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

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

Counterparties

Обновлено 23.11.2018
149 кб

General information

Address book is a list of counterparties with details that can be used to process orders.

Address book and list of available counterparties are different concepts. Counterparties from the address book can be used for orders processing only, detailed informtaion about them is unavailable.

Counterparties list from address book

Method request

Request example

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

{
   "appkey": "00000000-0000-0000-000000000000",
   "sessionID": "00000000-0000-0000-0000-000000000000",
   "withAnonym": "true",
   "isAnonym": "true" 
}

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

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <withanonym>true</withanonym>
   <isanonym>true</isanonym>
</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
withAnonymNostring

Flag for getting the list of counterparties with/without anonymous receivers.

Available values:

  • "true" - the response must include anonymous receivers
  • "false" - the response must exclude anonymous receivers

Default value: "false".

isAnonymNoboolean

Flag for getting the list of counterparties including only anonymous receivers.

Default value: "false"

If the request contains parameters "withAnonym" = "false" and "isAnonym" = "true" then response contains the list of only anonymous receivers.

Method response

Response example

[  
   {  
      "counteragent": {  
         "id":"1",
         "is_anonym":"false",
         "form":"ООО",
         "formUID":"0x92EE03691F25A9FE4BE9910CD87CA9CA",
         "name":"Ромашка",
         "type":"juridical",
         "inn":"1234567890",
         "addresses":3,
         "lastUpdate":"2015-07-04 02:27:15",
         "country_uid":"0x8f51001438c4d49511dbd774581edb7a",
         "uid":"00000000-0000-0000-0000-000000000000"
      }
   },
   {  
      "counteragent": {  
         "id":"2",
         "is_anonym":"false",
         "form":"ООО",
         "formUID":"0x92EE03691F25A9FE4BE9910CD87CA9CA",
         "name":"Мечта",
         "type":"juridical",
         "inn":"1234567891",
         "addresses":1,
         "lastUpdate":"2015-07-04 02:27:15",
         "country_uid":"0x8f51001438c4d49511dbd774581edb7a",
         "uid":"00000000-0000-0000-0000-000000000000"
      }
   },
   {  
      "counteragent": {  
         "id":"3",
         "is_anonym":"false",
         "form":"Ч/Л",
         "formUID":"0x8F51001438C4D49511DBD774581EDB80",
         "name":"Иванов Иван Иванович",
         "type":"physical",
         "addresses":1,
         "document": {  
            "type":"passport",
            "serial":"0000",
            "number":"000000",
            "date":"2014-01-23"
         },
         "lastUpdate":"2015-07-04 02:27:15",
         "country_uid":"0x8f51001438c4d49511dbd774581edb7a",
         "uid":"00000000-0000-0000-0000-000000000000"
      }
   },
   {  
      "counteragent": {  
         "id":"4",
         "is_anonym":"true",
         "form":"Ч/Л",
         "formUID":"0xAB91FEEA04F6D4AD48DF42161B6C2E7A",
         "name":"Петрович",
         "phone":"+7 (900) 000-00-00",
         "Email":"petro@mail.com",
         "type":"physical",
         "addresses":1,
         "lastUpdate":"2015-07-04 02:27:15",
         "country_uid":"0x8f51001438c4d49511dbd774581edb7a",
         "uid":"00000000-0000-0000-0000-000000000000"
      }
   }
]
<response>
   <counteragent>
      <id>1</id>
      <is_anonym>false</is_anonym>
      <form>ООО</form>
      <formuid>0x92EE03691F25A9FE4BE9910CD87CA9CA</formuid>
      <name>Ромашка</name>
      <type>juridical</type>
      <inn>1234567890</inn>
      <addresses>3</addresses>
      <lastupdate>2015-07-04 02:27:15</lastupdate>
      <country_uid>0x8f51001438c4d49511dbd774581edb7a</country_uid>
      <uid>00000000-0000-0000-0000-000000000000</uid>
   </counteragent>
   <counteragent>
      <id>2</id>
      <is_anonym>false</is_anonym>
      <form>ООО</form>
      <formuid>0x92EE03691F25A9FE4BE9910CD87CA9CA</formuid>
      <name>Мечта</name>
      <type>juridical</type>
      <inn>1234567891</inn>
      <addresses>1</addresses>
      <lastupdate>2015-07-04 02:27:15</lastupdate>
      <country_uid>0x8f51001438c4d49511dbd774581edb7a</country_uid>
      <uid>00000000-0000-0000-0000-000000000000</uid>
   </counteragent>
   <counteragent>
      <id>3</id>
      <is_anonym>false</is_anonym>
      <form>Ч/Л</form>
      <formuid>0x8F51001438C4D49511DBD774581EDB80</formuid>
      <name>Иванов Иван Иванович</name>
      <type>physical</type>
      <addresses>1</addresses>
      <document>
         <type>passport</type>
         <serial>0000</serial>
         <number>000000</number>
         <date>2014-01-23</date>
      </document>
      <lastupdate>2015-07-04 02:27:15</lastupdate>
      <country_uid>0x8f51001438c4d49511dbd774581edb7a</country_uid>
      <uid>00000000-0000-0000-0000-000000000000</uid>
   </counteragent>
   <counteragent>
      <id>4</id>
      <is_anonym>true</is_anonym>
      <form>Ч/Л</form>
      <formuid>0xAB91FEEA04F6D4AD48DF42161B6C2E7A</formuid>
      <name>Петрович</name>
      <phone>+7 (900) 000-00-00</phone>
      <email>petro@mail.com</email>
      <type>physical</type>
      <addresses>1</addresses>
      <lastupdate>2015-07-04 02:27:15</lastupdate>
      <country_uid>0x8f51001438c4d49511dbd774581edb7a</country_uid>
      <uid>00000000-0000-0000-0000-000000000000</uid>
   </counteragent>
</response>

Description of parameters

Response
ParameterTypeDescription
counteragentResponse.CounteragentInformation about the counterparties from the address book

Response.Counteragent
ParameterTypeDescription
idstringCounterparty ID
is_anonymstring

Anonymous receiver indicator. It is present in the response only if the request included parameter "WithAnonym" = "true".

Possible values:

  • "true" – anonymous receiver
  • "false" – not anonymous receiver
formstringCounterparty legal form of organization
formUIDstringUID of legal form of organization. Value from the "Legal forms of organization" directory
namestringCounterparty name. Full name for anonymous receiver
phonestringPhone number of anonymous receiver. Parameter is returned if counterparty is an anonymous receiver
EmailstringE-mail of anonymous receiver. Parameter is returned if counterparty is an anonymous receiver
typestringCounterparty type: juridical party or physical party
innstringCounterparty TIN. Parameter is returned if counterparty is a juridical party
adressesintegerQuantity of delivery addresses of the counterparty
documentobjectInformation about the physical party. Parameter is returned if counterparty is a physical party
document.typestring

Document type.

Possible values:

  • passport
  • drivingLicence
  • foreignPassport
document.serialstringDocument series
document.numberstringDocument number
document.datestringDate of issue of the document
lastUpdatestring

Date of the last update of information about the current counterparty

country_uidstringCountry UID from the "Countries" directory
uidstring

Counterparty UID. Parameter is returned if this counterparty from the address book has corresponding counterparty from the list of available counterparties. Otherwise, the value is "null"

Counterparties adding and editing

This method allows you to add new counterparties to the address book and edit information about them. Method request depends on type of the counterparty (juridical or physical party).

Juridical party adding

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/book/counteragents/update.json

{
   "appkey": "00000000-0000-0000-000000000000",
   "sessionID": "00000000-0000-0000-0000-000000000000",
   "form": "0x8F51001438C4D49511DBD774581EDB80",
   "customForm": {
      "formName": "ОБРУГ",
      "countryUID": "0x00000000000000000000000000000000",
      "juridical": true
   },
   "name": "Ромашка",
   "inn": "1234567890",
   "juridicalAddress": {
      "street": "7800000000004380000000000",
      "customStreet": {
         "code": "7800000000000000000000000",
         "street": "Восточная"
      },
      "house": "4",
      "building": "2",
      "structure": "3А",
      "flat": "Б-234"
   }
}

Method address: https://api.dellin.ru/v1/customers/book/counteragents/update.xml

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <form>0x8F51001438C4D49511DBD774581EDB80</form>
   <customform>
      <formname>ОБРУГ</formname>
      <countryuid>0x00000000000000000000000000000000</countryuid>
      <juridical>true</juridical>
   </customform>
   <name>Ромашка</name>
   <inn>1234567890</inn>
   <juridicaladdress>
      <street>7800000000004380000000000</street>
      <customStreet>
         <code>7800000000000000000000000</code>
         <street>Восточная</street>
      </customStreet>
      <house>4</house>
      <building>2</building>
      <structure>3А</structure>
      <flat>Б-234</flat>
   </juridicaladdress>
</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
formYes*string

UID of legal form of organization. Value from the "Legal forms of organization" directory.

*only if parameter "customForm" is absent. Otherwise, parameter must be absent

customFormYes*object

Information about the legal form of organization. Applicable if there is no needed form in the "Legal forms of organization" directory.

*only if parameter "form" is absent. Otherwise, parameter must be absent

customForm.formNameYesstringName of the legal form of organization
customForm.countryUIDYesstringCountry UID from the "Countries" directory
customForm.juridicalYesboolean

Flag of juridical party.

Available values:

  • "true" - juridical party
  • "false" - physical party
nameYes
stringName of the juridical party
innYes
stringTIN of the juridical party
juridicalAddressYesRequest.JuridicalAddressJuridical address

Request.JuridicalAddress
ParameterR*TypeDescription
streetYes*string

CLADR** code of the street. Value from the "Streets" directory.

*only if parameter "Request.JuridicalAddress.CustomStreet" is absent. Otherwise, parameter must be absent

**CLADR - Classifier of Addresses of Russian Federation

customStreetYes*object

Information about the street. Applicable if there is no needed street in the "Streets" directory.

*only if parameter "Request.JuridicalAddress.Street" is absent. Otherwise, parameter must be absent

customStreet.codeYesstring

CLADR code of the city from the "Places" directory

customStreet.streetYesstring

Street name

houseYesstringHouse
buildingNostringBuilding
structureNostringStructure
flatNostringApartmetn/office

Method response

Response example
{
   "success": {
      "counteragentId": "1"
   }
}
<response>
   <success>
      <counteragentid>1</counteragentid>
   </success>
</response>

Description of parameters
Response
ParameterTypeDescription
successobjectSuccessful operation of adding the counterparty
success.counteragentIdstringAdded counterparty ID

Error handling

In case of errors, response will contain the names of parameters that caused errors with errors description. Error description in example below: "the legal form of organization is not specified".

Response example
{
   "errors": {
      "form":"не задана правовая форма"
   }
}
<response>
   <errorrs><form>не задана правовая форма</form>
   </errorrs>
</response>

Physical party adding

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/book/counteragents/update.json 

{
   "appkey":"00000000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "form":"0xAB91FEEA04F6D4AD48DF42161B6C2E7A",
   "name":"Петров А.А."
   "document": {
      "type":"passport", 
      "serial":"XXXX", 
      "number":"XXXX", 
      "date":"YYYY-MM-DD"
   }
}

Method address: https://api.dellin.ru/v1/customers/book/counteragents/update.xml  

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <form>0xAB91FEEA04F6D4AD48DF42161B6C2E7A</form>
   <name>Петров А.А.</name>
   <document>
      <type>passport</type>
      <serial>XXXX</serial>
      <number>XXXX</number>
      <date>YYYY-MM-DD</date>
   </document>
</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
formYesstringUID of legal form of organization. Value from the "Legal forms of organization" directory
nameYesstringCounterparty name
documentYesobjectInformation about the document of the physical party
document.typeYesstring

Document type.

Available values:

  • passport
  • drivingLicence
  • foreignPassport
document.serialYes
stringDocument series

document.number

Yes
stringDocument number
document.dateNostringDate of issue of the document (Format: "YYYY-MM-DD")

If it is required to add an anonymous receiver to the address book, then request should be the following:

Request example

Method address: https://api.dellin.ru/v1/customers/book/counteragents/update.json 

{
   "appkey":"00000000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "is_anonym":"true",
   "form":"0xAB91FEEA04F6D4AD48DF42161B6C2E7A", 
   "name":"Петрович",
   "phone":"+7 (900) 000-00-00",
   "Email":"petro@mail.com"
}

Method address: https://api.dellin.ru/v1/customers/book/counteragents/update.xml  

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <is_anonym>true</is_anonym>
   <form>0xAB91FEEA04F6D4AD48DF42161B6C2E7A</form>
   <name>Петрович</name>
   <phone>+7 (900) 000-00-00</phone>
   <email>petro@mail.com</email>
</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
is_anonymNostring

Flag of anonymous receiver.

Available value:

  • "true" – counterparty is an anonymous receiver
  • "false" – counterparty is not anonymous receiver

Default value: "false"

formYesstring

UID of legal form of organization. Value from the "Legal forms of organization" directory.

If parameter "is_anonym" = "true", then parameter "form" must be absent or be equal "0xAB91FEEA04F6D4AD48DF42161B6C2E7A" (private person, Russia)

nameYesstringAnonymous receiver's name
phoneYesstring

Anonymous receiver's phone number

Number format: 11 digits starting with "8" (additional symbols are permitted: parentheses, dashes, spaces)

EmailNostringAnonymous receiver's e-mail
Responses of method when adding juridical and physical parties are similar. See the section "Juridical party adding".

Counterparty editing

To edit information about the counterparty that is not an anonymous receiver, you need to pass its ID and new values for parameters that are need to be edited.

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/book/counteragents/update.json 

{
   "appkey":"00000000-0000-0000-000000000000",
   "sessionID": "00000000-0000-0000-0000-000000000000",
   "counteragentID":"1",
   "form":"0x8F51001438C4D49511DBD774581EDB80" 
}

Method address:  https://api.dellin.ru/v1/customers/book/counteragents/update.xml  

<response>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <counteragentid>1</counteragentid>
   <form>0x8F51001438C4D49511DBD774581EDB80</form>
</response>
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
counteragentIdYesstringID of counterparty that needs to be edited
formYesstringUID of new legal form of organization. Value from the "Legal forms of organization" directory
Responses of method when adding and editing counterparties are similar. See the section "Juridical party adding".

Error handling

In case of errors, response will contain the names of parameters that caused errors with errors description. In example below four required parameters of the object "document" were not passed.

Response example
{
   "errors": {
      "document": {
         "type": "не задан тип документа",
         "serial": "не указана серия документа",
         "number": "не указан номер документа",
         "date": "не задана дата выдачи документа"
      }
   }
}
<response>
   <errors>
      <document>
         <type>не задан тип документа</type>
         <serial>не указана серия документа</serial>
         <number>не указан номер документа</number>
         <date>не задана дата выдачи документа</date>
      </document>
   </errors>
</response>
Parameters of the object "document" are described in detail in section "Physical party adding".
Notice: it is impossible to edit information about the existing anonymous receiver.