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

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

Settlements

Обновлено 13.01.2020
108 кб

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-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-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":"2016-04-01 00:00:00",
         "sum":380
      },
      "closing":{
         "date":"2016-04-30 23:59:59",
         "sum":0
      }
   },
   "document":[
      {
         "sum":1042.5,
         "doc":"Накладная 16-00031037176 от 1 апреля 2016 г.",
         "date":"2016-04-01 17:29:33",
         "docType":"Накладная",
         "docID":"16-00031037176",
         "description":"Накладная 16-00031037176 от 1 апреля 2016 г.",
         "begin":380,
         "end":1422.5,
         "debit":1042.5,
         "credit":0,
         "payment":true,
         "cashOrder":1,
         "freightName":"Мебель",
         "quantity":1,
         "weight":3,
         "volume":0.1,
         "overSizedQuantity":0,
         "overSizedWeight":0,
         "overSizedVolume":0,
         "maxLength":0.02,
         "maxWidth":3,
         "maxHeight":0.02,
         "docSQLuid":"0xac62ce6428515cce4086e2efa77c06dd",
         "giveOutDate":"2016-04-06 17:17:53"
      },
      {
         "sum":-1042.5,
         "doc":"Приходный кассовый ордер 03022000156 от 6 апреля 2016 г.",
         "date":"2016-04-06 17:19:13",
         "docType":"ПКО",
         "docID":"03022000156"
      },
      {
         "sum":-380,
         "doc":"Приходный кассовый ордер 03022000158 от 6 апреля 2016 г.",
         "date":"2016-04-06 17:25:00",
         "docType":"ПКО",
         "docID":"03022000158"
      }
   ]
}
<response>
   <balance>
      <opening>
         <date>2016-04-01 00:00:00</date>
         <sum>380</sum>
      </opening>
      <closing>
         <date>2016-04-30 23:59:59</date>
         <sum>0</sum>
      </closing>
   </balance>
   <document>
      <sum>1042.5</sum>
      <doc>Накладная 16-00031037176 от 1 апреля 2016 г.</doc>
      <date>2016-04-01 17:29:33</date>
      <docType>Накладная</docType>
      <docID>16-00031037176</docID>
      <description>Накладная 16-00031037176 от 1 апреля 2016 г.</description>
      <begin>380</begin>
      <end>1422.5</end>
      <debit>1042.5</debit>
      <credit>0</credit>
      <payment>true</payment>
      <cashOrder>1</cashOrder>
      <freightName>Мебель</freightName>
      <quantity>1</quantity>
      <weight>3</weight>
      <volume>0.1</volume>
      <overSizedQuantity>0</overSizedQuantity>
      <overSizedWeight>0</overSizedWeight>
      <overSizedVolume>0</overSizedVolume>
      <maxLength>0.02</maxLength>
      <maxWidth>3</maxWidth>
      <maxHeight>0.02</maxHeight>
      <docSQLuid>0xac62ce6428515cce4086e2efa77c06dd</docSQLuid>
      <giveOutDate>2016-04-06 17:17:53</giveOutDate>
   </document>
   <document>
      <sum>-1042.5</sum>
      <doc>Приходный кассовый ордер 03022000156 от 6 апреля 2016 г.</doc>
      <date>2016-04-06 17:19:13</date>
      <docType>ПКО</docType>
      <docID>03022000156</docID>
   </document>
   <document>
      <sum>-380</sum>
      <doc>Приходный кассовый ордер 03022000158 от 6 апреля 2016 г.</doc>
      <date>2016-04-06 17:25:00</date>
      <docType>ПКО</docType>
      <docID>03022000158</docID>
   </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.datestringPeriod start date
opening.sumfloatAmount at the beginning of the period, rubles
closingobjectClosing balance
closing.datestringPeriod end date
closing.sumfloatAmount at the end of the period, rubles

Response.Document
ParameterTypeDescription
sumfloatAmount on the document, rubles
docstringDocument name and details
datestringDocument creation date
docTypestringDocument type
docIDstringDocument number
descriptionstringFull document name*
beginfloatAmount at the period start date, rubles*
endfloatAmount at the period end date, rubles*
debitfloatAmount to be paid, rubles*
creditfloatDebt amount, rubles*
paymentbooleanPayment status*
cashOrderinteger

Information on cash register order*

Possible values:

1 - a cash register order was issued on the basis of the waybill;

0 - no cash register order was issued on the basis of the waybill

freightNamestringNature of the cargo*
quantityintegerNumber of cargo places*
weightfloatCargo weight, kg*
volumefloatCargo volume, m3*
overSizedQuantityfloatNumber of the oversize cargo places*
overSizedWeightfloatWeight of the overweight cargo places, kg*
overSizedVolumefloatVolume of the oversize cargo places, m3*
maxLengthfloatLength of the longest cargo place, m*
maxWidthfloatWidth of the widest cargo place, m*
maxHeightfloatHeight of the highest cargo place, m*
docSQLuidstringDocument UID*
giveOutDatestringDocument give out date*
* The parameter is present in the response only if docType is "Накладная" (Waybill)

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-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-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