Поиск по сайту

API
Главная / API - Settlements

Settlements

Обновлено 24.05.2018
94 кб

General information

This service allows you to get information about the cash flow in the context of waybills and paid bills.

Notice: getting information using this service is possible only if you have access to at least one counterparty in your personal account (about access see the section "Available counterparties").

Settlements calculator with detalization

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/mutual_calculations.json

{   
   "appkey":"00000000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "cauid":"00000000-0000-0000-0000-000000000000",
   "month":12,
   "year":2013
}

Method address: https://api.dellin.ru/v1/customers/mutual_calculations.xml

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <cauid>00000000-0000-0000-0000-000000000000</cauid>
   <month>12</month>
   <year>2013</year>
</request>

Description of parameters

Request
ParameterR*TypeDescription
appkeyYesstring

Application key. To get the key, register

sessionID

YesstringTo get the session ID, use the User Authorization method

cauid

Nostring

UID of counterparty on which information about the settlements is required. If parameter is not passed then information will be collected about the default counterparty (see the section "Available counterparties")

monthYes
integerMonth for which information is required
yearYes
integerYear for which information is required

Method response

Response example

{  
   "balance":{  
      "opening":{  
         "date":"2013-12-01 00:00:00",
         "sum":"0.0"
      },
      "closing":{  
         "date":"2013-12-31 23:59:59",
         "sum":"20.0"
      }
   },
   "document":[  
      {  
         "date":"2013-12-04 13:15:38",
         "doc":"Движение    банк 000000000000 from 04.12.2013 13:15:38",
         "sum":"100.0"
      },
      {  
         "date":"2013-12-12 15:16:13",
         "doc":"Накладная 13-00000000000 from 09.12.2013 18:16:22",
         "sum":"-100.0"
      },
      {  
         "date":"2013-12-21 15:09:06",
         "doc":"Приходный кассовый ордер    000000000000 from 21.12.2013 15:08:48",
         "sum":"220.0"
      },
      {  
         "date":"2013-12-26 17:48:29",
         "doc":"Накладная 13-00000000000 from 19.12.2013 23:56:02",
         "sum":"-200.0"
      }
   ]
}
<response>
   <balance>
      <opening>
         <date>2013-12-01 00:00:00</date>
         <sum>0.0</sum>
      </opening>
      <closing>
         <date>2013-12-31 23:59:59</date>
         <sum>20.0</sum>
      </closing>
   </balance>
   <document>
      <date>2013-12-04 13:15:38</date>
      <doc>Движение    банк 000000000000 from 04.12.2013 13:15:38</doc>
      <sum>100.0</sum>
   </document>
   <document>
      <date>2013-12-12 15:16:13</date>
      <doc>Накладная 13-00000000000 from 09.12.2013 18:16:22</doc>
      <sum>-100.0</sum>
   </document>
   <document>
      <date>2013-12-21 15:09:06</date>
      <doc>Приходный кассовый ордер    000000000000 from 21.12.2013 15:08:48</doc>
      <sum>220.0</sum>
   </document>
   <document>
      <date>2013-12-26 17:48:29</date>
      <doc>Накладная 13-00000000000 from 19.12.2013 23:56:02</doc>
      <sum>-200.0</sum>
   </document>
</response>

Description of parameters

Response
ParameterTypeDescription
balanceResponse.BalanceInformation about the cash flow
documentarray of Response.Document

Information about the documents. The array is present in the response only if there was any cash flow in specified period

Response.Balance
ParameterTypeDescription
openingobjectOpening balance
opening.datestringDate of opening the period
opening.sumstringAmount at the beginning of the period
closingobjectClosing balance
closing.datestringDate of closing the period
closing.sumstringAmount at the end of the period

Response.Document
ParameterTypeDescription
datestringDate of issue of the document
docstringName and requisites of the document
sumstringAmount in the document

Error handling

If you do not have access to the counterparties or the current counterparty is not chosen, you will get the following message. (Error description in example below: "The current counterparty is not chosen. Probably, you do not have access to the counterparties".)

Response example

{  
   "error":{  
      "code":"403",
      "description":"Не выбран текущий контрагент. Возможно у вас нет доступа к контрагентам."
   }
}
<response>
   <error>
      <code>403</code>
      <description>Не выбран текущий контрагент. Возможно у вас нет доступа к контрагентам.</description>
   </error>
</response>

Period of available settlements

This method allows you to get information about the period for which it is possible to get information about the settlements using the method "Settlements calculator with detalization".

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/mutual_period.json

{   
   "appkey":"00000000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "cauid":"00000000-0000-0000-0000-000000000000"
}

Method address: https://api.dellin.ru/v1/customers/mutual_period.xml

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <cauid>00000000-0000-0000-0000-000000000000</cauid>
</request>

Description of parameters

Request
ParameterR*TypeDescription
appkeyYesstring

Application key. To get the key, register

sessionID

YesstringTo get the session ID, use the User Authorization method

cauid

NostringUID of counterparty on which information about the settlements is required

Method response

Response example

{
   "years": {
      "2016": {
         "months": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
      },
      "2017": {
         "months": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
      }
   }
}
<response>
   <years>
      <2016>
         <months>1</months>
         <months>2</months>
         <months>3</months>
         <months>4</months>
         <months>5</months>
         <months>6</months>
         <months>7</months>
         <months>8</months>
         <months>9</months>
         <months>10</months>
         <months>11</months>
         <months>12</months>
      </2016>
      <2017>
         <months>1</months>
         <months>2</months>
         <months>3</months>
         <months>4</months>
         <months>5</months>
         <months>6</months>
         <months>7</months>
         <months>8</months>
         <months>9</months>
         <months>10</months>
         <months>11</months>
         <months>12</months>
      </2017>
   </years>
</response>

Description of parameters

Response
ParameterTypeDescription
yearsResponse.Years

List of years, for which information about the settlements is available

Response.Years
ParameterTypeDescription
[Year]object

Name of this object contains the number of the year instead of "[Year]" (for example, "2017").

This object contains the list of months within this year, for which information about the settlements is available

[Year].monthsarray of integer

List of months within the specified year ([Year]) for which information about the settlements is available