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

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

Settlements

Обновлено 07.03.2024
114 кб

General information

This service allows getting information about the cash flow per waybills and paid bills.

To get data through this service it is necessary to have full access to the counterparty from the account (see Available counterparties method, response parameter "info.accessLevel").

Settlements

Method request

Request structure

Method address: https://api.dellin.ru/v2/mutual_calculations.json

{   
   "appkey":"00000000-0000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "cauid":"00000000-0000-0000-0000-000000000000",
   "month":1,
   "year":2020
}

Method address: https://api.dellin.ru/v2/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>1</month>
   <year>2020</year>
</request>

Description of parameters

Request
Request
ParameterRequiredTypeDescription
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 mutual settlements is required. It is necessary to have full access to the counterparty from the account (see Available counterparties method, response parameter "info.accessLevel").

If the parameter is not passed in the request, then information on the default counterparty will be passed in the response

monthYes
integerMonth for which information is required (1)
yearYes
integerYear for which information is required (1)

Notes:

(1) To get the list of periods for which information on mutual settlements is available, use "Mutual settlements periods" method

Method response

Response structure

{
   "metadata":{
      "status":200,
      "generated_at":"2015-06-18 12:37:28"
   },
   "data":{
      "balance":{
         "opening":{
            "date":"2016-04-01 00:00:00",
            "sum":380
         },
         "closing":{
            "date":"2016-04-30 23:59:59",
            "sum":0
         }
      },
      "documents":[
         {
            "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,
            "paymentInfo":{
               "payment":true,
               "paymentState":"paid",
               "dataForReceipt":{
                  "phoneNumber":"+79110000000",
                  "email":"meow@mail.ru"
               }
            },
            "cashOrder":1,
            "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>
   <metadata>
      <status>200</status>
      <generated_at>2015-06-18 12:37:28</generated_at>
   </metadata>
   <data>
      <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>
      <documents>
         <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>
         <paymentInfo>
            <payment>true</payment>
            <paymentState>paid</paymentState>
            <dataForReceipt>
               <phoneNumber>+79110000000</phoneNumber>
               <email>meow@mail.ru</email>
            </dataForReceipt>
         </paymentInfo>
         <cashOrder>1</cashOrder>
         <docSQLuid>0xac62ce6428515cce4086e2efa77c06dd</docSQLuid>
         <giveOutDate>2016-04-06 17:17:53</giveOutDate>
      </documents>
      <documents>
         <sum>1042.5</sum>
         <doc>Приходный кассовый ордер 03022000156 от 6 апреля 2016 г.</doc>
         <date>2016-04-06 17:19:13</date>
         <docType>ПКО</docType>
         <docID>03022000156</docID>
      </documents>
      <documents>
         <sum>380</sum>
         <doc>Приходный кассовый ордер 03022000158 от 6 апреля 2016 г.</doc>
         <date>2016-04-06 17:25:00</date>
         <docType>ПКО</docType>
         <docID>03022000158</docID>
      </documents>
   </data>
</response>

Description of parameters

Response
Response
ParameterTypeDescription
metadataobjectSystem information
metadata.statusintegerEmulated status http-code. If successful, code 200 is returned
metadata.generated_atstring

Server response date and time.

Format: YYYY-MM-DD HH:MM:SS

dataobjectMutual settlements data
data.balanceBalanceInformation about the cash flow
data.documentsarray of DocumentsInformation about the documents. The array is present in the response only if there was any cash flow during the specified period

Balance
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

Documents
Documents
ParameterTypeDescription
sumfloat

Amount on the document, rubles.

In case of payment voucher and waybill  ("data.documents.docType" response parameter value is "РКО" or "накладная") the parameter value is a negative number, in other cases - positive number
docstringDocument name and details
datestring

Document creation date

Format: YYYY-MM-DD HH:MM:SS

docTypestringDocument type
docIDstringDocument number
descriptionstringFull document name (1)
beginfloatAmount at the period start date, rubles (1)
endfloatAmount at the period end date, rubles (1)
debitfloatAmount to be paid, rubles (1)
creditfloatDebt amount, rubles (1)
paymentInfoobjectPayment information (1)
paymentInfo.paymentboolean

Information on cash receipt note (1)

Possible values:

  • "true" - a cash receipt note was issued on the basis of the waybill;
  • "false" - no cash receipt note was issued on the basis of the waybill
paymentInfo.paymentStatestring

Waybill payment status.

Possible values:

  • "paid";
  • "not_paid";
  • "in_process"
paymentInfo.dataForReceiptDataForReceipt

Contact data to send the payment receipt to the individual.

The parameter is present in the response only if the default counterparty / the counterparty whose UID was passed in the request (see "cauid" parameter description) is the payer on the waybill.

The data can be used to pre-fill the payment form

cashOrderinteger

Receipt (payment document) number (1)

docSQLuidstringDocument UID (1)
giveOutDatestring

Document give out date (1)

Format: YYYY-MM-DD HH:MM:SS

Notes:

  1. The parameter is present in the response only if docType is "Накладная" (waybill)
DataForReceipt

DataForReceipt

ParameterTypeDescription

phoneNumber

string

Phone number for sending the payment receipt.

The data is present in the response, if there is the information in the address book

email

string

Email address for sending the payment receipt.

The data is present in the response, if there is the information in the address book

Error handling

Except for common API errors the method response may contain the following errors:

Error numberhttp-codeError title
TitleTranslation

703001

403Доступ к контрагентам отсутствуетNo access to the counterparties