API Documentation — различия между версиями

Материал из Меасофт
Перейти к: навигация, поиск
(Новая страница: «“Delivery Service 2008” system has an option of integration by means of XML API under HTTP POST protocol. The given API is designed for integrating customers…»)
 
(Response Examples)
 
(не показано 100 промежуточных версий 4 участников)
Строка 1: Строка 1:
“Delivery Service 2008” system has an option of integration by means of XML API under HTTP POST protocol.
+
MeaSoft has an option of integration by means of XML API through HTTP POST protocol.
The given API is designed for integrating customers (online shops and other companies ordering delivery) with delivery services working under the control of “Delivery Service 2008” system. If you are an aggregator transferring customer data, you will probably have to log in using different user accounts in case a delivery service has to keep separate accounts for reciprocal payments for each customer. If you are a “contractor”, the integration should be done in the opposite direction – orders will be transferred to you from a delivery service. For that purpose we have a platform for external integration but contractors can be added to it only on our side. Please, send us your quote, the description of your service and we will gladly consider them.
 
When writing the given documentation we`ve been assuming that a person reading it has the required level of expertise in programming sufficient for the understanding of the contents of this documentation, has a knowledge of XML and development environment which he is integrating. If you are not qualified as a programmer you will have to hire a professional programmer for the implementation of your project.
 
If you still have questions after reading the given documentation, feel free to ask them via e-mail [mailto:support@courierexe.ru support@courierexe.ru]. In your e-mail message you should introduce yourself, leave your contact information (your phone number, Skype login) and the name of the company that you want to integrate with.  
 
  
== Complete integrations ==
+
The API is designed for integrating customers (online shops and other companies ordering delivery) with courier services working under MeaSoft.
  
You can download integration modules to integrate with popular CMS
+
If you are an '''aggregator''' who transfers customer data and a courier service keeps separate accounts for settlements with each client, you will probably have to log in using different user accounts.
  
{| class="wikitable" align="center" style="width: 80%; margin: auto; color: black; boreder: 1px solid #999999;" cellpadding="10" cellspacing="0"
+
If you are a '''service partner''' and orders will be transferred to you from a delivery service, you can take the orders using <code>clients=AGENTS</code> in the [[#Order Status Query Example|statusreq]] query. For that purpose we have a platform for external integration but service partners can be added only on our side. Please, send us your commercial purpose, description of your service and we will gladly consider them.
!style="width: 35%;"| Content Management System (CMS)
+
 
!style="width: 15%;"|Module version
+
When writing the given documentation we assume that a person reading it has the level of expertise in coding sufficient for understanding the contents of this documentation, has a knowledge of XML and integration development environment. If you are not qualified as a developer you will have to hire a professional developer to implement your project.
!style="width: 15%;"|Link
+
 
!style="width: 35%;"|Note
+
If you still have questions after reading the given documentation, feel free to ask them via e-mail [mailto:support@courierexe.ru support@courierexe.ru]. In your email message, please introduce yourself, leave your contact information (your phone number, Skype login) and the name of the company you want to integrate with.
 +
 
 +
== CMS Integrations ==
 +
 
 +
You can download the modules presented in the table to integrate with popular CMS.
 +
 
 +
'''The given modules are shared for free without any guarantee on the part of the developer'''. The online store bears full responsibility for correct data transfer. They modules are not intended for complete automation of your interaction with the courier service. They help online shop developers build integration with courier services. However, we will appreciate if you inform us about your needs or discrepancies found in our modules – this allows us to consider your demands when developing new versions of our modules.
 +
 
 +
{| class="wikitable" align="center" style="width: 80%; margin: auto; background-color:#ffffff; border: 1px solid #999999;" cellpadding="10" cellspacing="0"
 +
!style="width: 35%;"|Content Management System (CMS)
 +
!style="width: 15%;"|Download
 +
!style="width: 35%;"|Comment
 
|-
 
|-
|[[File:bitrix.png|center|x44px]]
+
|[[Файл:bitrix.png|center|x44px]]
|style="text-align: center;"|1.5.8 от 13.11.2017
+
|style="text-align: center;"|[https://marketplace.1c-bitrix.ru/solutions/measoft.courier/ Install]
|style="text-align: center;"|[http://courierexe.ru/download/api/bitrix.zip Download Unicode]<br>[http://courierexe.ru/download/api/bitrix_ansi.zip Download ANSI]
+
|Supports version 14.5 and higher.
|Supports version 14.5 and newer ones
 
 
|-
 
|-
|[[File:prestashop.png|center|x44px]]
+
|[[Файл:prestashop.png|center|x60px]]
|style="text-align: center;"|1.4.2 dated from September 6, 2017
+
|style="text-align: center;"|[https://courierexe.ru/download/api/prestashop.zip Download]
|style="text-align: center;"|[http://courierexe.ru/download/api/prestashop.zip Download]
+
|Supports version 1.5.2.0 and higher (including 2.x)
|Supports version 1.5.2.0 and newer ones (including 2.x!)
 
 
|-
 
|-
|[[File:opencart.png|center|x44px]] [[Файл:ocstore.png|center|x30px]]
+
|[[Файл:OpencartOCStore.png|center|x60px]]
|style="text-align: center;"|1.7.2 от 06.09.2017
+
|style="text-align: center;"|[https://courierexe.ru/download/api/opencart.zip For version 1.5.5.1]<br>[https://courierexe.ru/download/api/measoft_oc2.ocmod.zip For version 2.0]<br>[https://courierexe.ru/download/api/measoft_oc2.3.ocmod.zip For version 2.3]<br>[https://courierexe.ru/download/api/measoft_ос3.ocmod.zip For version 3.0]
|style="text-align: center;"|[http://courierexe.ru/download/api/opencart.zip Download]
+
|Supports version 1.5.5.1 and higher.<br>Select a module for your OpenCart version.<br>[https://opencartforum.com/files/file/2906-avtomatizaciya-otpravki-i-otslezhivanie-dostavok-courierexe-dlya-opencart-15x/ Alternative third-party module]
| Supports versions from 1.5.5.1 till 2.2.<br>
 
[https://opencartforum.com/files/file/2906-avtomatizaciya-otpravki-i-otslezhivanie-dostavok-courierexe-dlya-opencart-15x/ Third-party alternative module]
 
 
|-
 
|-
|[[File:webasyst-shopscript.png|center|x44px]]
+
|[[Файл:webasyst-shopscript.png|center|x44px]]
|style="text-align: center;"|1.3.2 от 15.08.2017
+
|style="text-align: center;"|[http://www.webasyst.ru/store/plugin/shop/measoftcourier/ Install module]<br>[https://www.webasyst.ru/store/plugin/shipping/measoftcourier/ Install plugin]
|style="text-align: center;"|[http://www.webasyst.ru/store/plugin/shop/measoftcourier/ Install]
+
|The module is designed for sending orders to delivery service, while the plugin calculates delivery cost on creating an order.
|
 
 
|-
 
|-
|[[File:insales.png|center|x44px]]
+
<!--|[[Файл:advantshop.png|center|x44px]]
|style="text-align: center;"|1.2.1 от 06.09.2017
+
|style="text-align: center;"|[https://promo-z.ru/ PROMO company site]
|style="text-align: center;"|[http://www.insales.ru/collection/all/product/kurierskaya-sluzhba-2008  Install]
+
|The PROMO company has developed the module. Contact PROMO to set up integration between MeaSoft and ADVANTSHOP.
|[[Integration_with_other_systems#Insales|is set up]] in user area in the system
+
|- -->
 +
|[[Файл:insales.png|center|x80px]]
 +
|style="text-align: center;"|Configure using MeaSoft [[Личный кабинет клиента|client account]]
 +
|[[Интеграция с другими системами#InSales|Guide]]
 
|-
 
|-
|[[File:Leadvertex.png|center|x44px]]
+
|[[Файл:Leadvertex.png|center|x44px]]
|style="text-align: center;"|1.0 dated from November 15, 2016 
 
 
|style="text-align: center;"|[[Файл:Leadvertex-howto.png|center|x44px]]
 
|style="text-align: center;"|[[Файл:Leadvertex-howto.png|center|x44px]]
|[http://blog.leadvertex.ru/news/2110-integraciya-s-kurerkami-na-platforme-measoft/ is set up] in user area in the system [https://Leadvertex.ru Leadvertex]
+
|[http://blog.leadvertex.ru/news/2110-integraciya-s-kurerkami-na-platforme-measoft/ Configure] using [https://Leadvertex.ru Leadvertex] account
 
|-
 
|-
|[[File:Retailcrm.png|center|x44px]]
+
|[[Файл:Retailcrm.png|center|x30px]]
|style="text-align: center;"|1.0 dated from January 1, 2018
 
 
|style="text-align: center;"|[https://www.retailcrm.ru/ RetailCRM]
 
|style="text-align: center;"|[https://www.retailcrm.ru/ RetailCRM]
|[[Integration_with_other_systems#RetailCRM|is set up]] in user area in the system
+
|[http://wiki.courierexe.ru/index.php?title=Интеграция_с_другими_системами#RetailCRM Configure] using MeaSoft [[Личный кабинет клиента|client account]]
 +
|-
 +
|[[Файл:1C.jpg|center|x44px]]
 +
|style="text-align: center;"|-
 +
|[https://infostart.ru/public/692790/ Alternative third-party module]
 +
|-
 +
|[[Файл:Joomla2.jpg|center|x60px]]
 +
|style="text-align: center;"|[https://courierexe.ru/download/api/com_measoft.zip Download]
 +
|Integration with Virtuemart is available only.
 +
|-
 +
|[[Файл:Amocrm.png|center|x44px]]
 +
|style="text-align: center;"|[https://www.amocrm.ru/extensions/courier2008 Download]
 +
|
 +
|-
 +
|rowspan="2"|[[Файл:MoySclad.jpg|center|x30px]]
 +
|style="height:50px; text-align: center;"|[https://home.courierexe.ru/moysklad/step1 Integrate with MeaSoft]
 +
|
 +
|-
 +
|style="height:50px; text-align: center;"|[https://itmdev.ru/ms/shipping/ Alternative third-party module]
 +
|Alternative third-party module
 +
|-
 +
|[[Файл:wordpress.jpg|center|x80px]]
 +
|style="text-align: center;"|[https://courierexe.ru/download/api/wordpress.zip Download]
 +
|
 +
|-
 +
|[[Файл:Cscart.png|center|x60px]]
 +
|style="text-align: center;"|[https://marketplace.cs-cart.com/measoft-en.html Download]
 +
|Supports versions 4.10 and higher.
 +
|-
 +
|style="height:100px; text-align: center;"|'''Webhook'''
 +
|style="text-align: center;"|See [[Webhook|here]]
 +
|Transfer of status and order info to your system
 
|-
 
|-
 
|}
 
|}
  
The given modules are shared for free without any guarantee on the part of the developer. Their availability should be considered not as a means of complete automation of your interaction with the delivery service but more as an aid for online shop developers in building integration with delivery services. However, we will appreciate if you inform us about your needs and/or discrepancies found in our modules – this allows us to consider your demands when developing new versions of our modules.  
+
== Test Account ==
 +
 
 +
For debugging, you can access your test client account at
 +
https://home.courierexe.ru/8
 +
login login
 +
password pass
 +
 
 +
In the '''Integration''' > '''Debug''', you can execute API requests for debugging purposes and see sent requests. You will see all created orders on the '''Placed Orders''' tab.
 +
 
 +
To simplify the process of integration, you can download [https://courierexe.ru/download/api/php_sample.zip the example of addressing the service using PHP].
 +
 
 +
== Account for Integration ==
  
== Test account ==
+
You can access your client account at:
 +
 
 +
<source lang=xml>
 +
<auth extra="8" login="login" pass="pass"></auth>
 +
</source>
  
For debugging you can access your test personal account following the link: [https://home.courierexe.ru/8 https://home.courierexe.ru/8], your login will be: test, your password will be: testm. There you will be able to see all your requests with the “eyes” of our system by using “Automation” tab. You will also find a query execution interface there. You will see all created orders on “Tracking” tab.  
+
Description:
 +
* '''extra''' — extra code, a unique identifier of the courier service.  
 +
* '''login''' — user name for the client account and API.
 +
* '''pass''' — password for the client account and API.
  
In order to simplify the process of integration, you can download [http://courierexe.ru/download/api/php_sample.zip the example of addressing the service using PHP].
+
Request the credentials from the courier service you are integrating with.
  
== Work account for the connection to your customer`s platform ==
+
The courier service gives you a temporary password. For security purposes, change it using your client account.
  
It is necessary to have 3 parameters in order to connect to your customer`s platform:
+
== Courier Service Access ==
1. '''Parameter extra''' (this is a digital code, company`s unique identifier. Request this parameter from a company that you are integrating with.) You can look this code up in “Delivery Service 2008” software interface by using its main menu '''"Reference – Additional Options"'''. Digital value will be given at the second hyperlink (it is marked with an “asterisk” in the screenshot below):
 
  
[[File:extra1.png|750px]]
+
To access API with courier service credentials, use the following connection string:
  
2. '''Login''' is a user account parameter for customer`s member area and API that is entered in user card on '''"Miscellaneous"''' in '''"User Name"''' field. You will probably have to create a new user card (shown in the screenshot below) in “Delivery Service 2008” software.
+
<source lang=xml>
 +
<auth extra="8" login="login" pass="pass" clientcode="123"></auth>
 +
</source>
  
3. '''Password''' is a user account parameter for customer`s member area and API that is entered in user card on '''"Miscellaneous"''' in '''" Password"''' field (shown in the screenshot below).
+
Description:
[[File:33_client.png|500px]]
+
* '''extra''' — extra code, a unique identifier of the courier service.  
 +
* '''login''' — couerier service user name.
 +
* '''pass''' — couerier service password.
 +
* '''clientcode''' — internal client code (see the office application, the '''Clients''' tab, the "Internal code" column).
  
== General terms ==
+
To see the extra code, login and password, in the office application go to the '''Additional Features''' reference. For more information, see [[Courier_Service_Account#Registering Courier Service Account|Registering Courier Service Account]].
  
There is a web service on the side of the delivery service located at the following URL: https://home.courierexe.ru/api/. Test authorization data are: user login: test, user password: testm, “extra” parameter value: 8. Please, note that the test platform is common for everyone. You shouldn`t pass on orders containing confidential data through it as they might be seen by other users of the service.
+
== General Terms ==
Ask the company that you are integrating with for user “login”, “password” and “extra” parameter value in order to use the integration in the work mode.
 
You can send test queries to our service in the member area using “Automation” tab. You can also check the history of all queries sent by you in the member area. 
 
  
A customer is sending queries to the service by using HTTP POST, the service is processing these queries and sending the execution result back. All queries and responses are transferred in XML format.
+
Courier service provides access to a web service at https://home.courierexe.ru/api/. "/" (slash) on the end of the link is required. Use the following credentials for test access:
The encoding used is UTF-8. Dot sign is used as a decimal symbol. Dates are presented in YYYY-MM-DD format and time is presented in HH:MM format.
+
login: login
Due to [https://ru.wikipedia.org/wiki/XML#.D0.A0.D0.B5.D1.88.D0.B5.D0.BD.D0.B8.D0.B5_.D0.BF.D1.80.D0.BE.D0.B1.D0.BB.D0.B5.D0.BC.D1.8B_.D0.BD.D0.B5.D0.BE.D0.B4.D0.BD.D0.BE.D0.B7.D0.BD.D0.B0.D1.87.D0.BD.D0.BE.D1.81.D1.82.D0.B8_.D1.80.D0.B0.D0.B7.D0.BC.D0.B5.D1.82.D0.BA.D0.B8 the peculiarities of XML extensible markup language], some symbols in the text should be replaced: & from &amp;amp; < to &amp;lt; > from &amp;gt; " to &amp;quot;
+
password: pass
 +
  extra client code: 8
  
== Limitations ==
+
Note that the test platform is open for everyone. Do not submit orders containing confidential information as any authorized user can see them.
With the aim of protecting service from its improper use query limitation equal to 1500 queries from one IP-address for 20-minute period has been introduced since May 29, 2017. In case the above-mentioned limit is reached, the IP-address will be blocked; unblocking of the IP-address is possible by addressing the technical support service with the subsequent discussion of your algorithms and their correction.  
 
  
The best option for checking your orders` status is using "statusreq" queries with changes=ONLY_LAST parameter. You shouldn`t try to “attack” our API with queries containing numbers of all your orders, especially, with "tracking" queries – they are not intended to be used for this (see their description).  
+
To set up a working integration, request [[#Account for Integration|credentials]] from the courier service you are integrating with.  
  
== Ordering ==
+
In the client account, use the '''Integration''' menu item for debugging purposes and see sent requests. 
=== Example of ordering ===
+
 
 +
A client sends requests to the service by using HTTP POST, the service processes these requests and sends the execution result back. All requests and responses are submitted in the XML format. The encoding used is UTF-8. Dot sign is used as a decimal symbol. Dates are formatted as YYYY-MM-DD, and time is formatted as HH:MM.
 +
 +
Due to [https://en.wikipedia.org/wiki/XML#Escaping some XML features], the following characters in the text should be replaced:
 +
* <code>&amp;lt;</code> represents "&lt;"
 +
* <code>&amp;gt;</code> represents "&gt;"
 +
* <code>&amp;amp;</code> represents "&amp;"
 +
* <code>&amp;quot;</code> represents ".
 +
 
 +
Our API uses only HTTPS because it is a secure way to send sensible data.
 +
 
 +
However, in some systems it may lead to a failure. If your system cannot process encryption correctly, we recommend that you deploy a local HTTP server and set up [https://courierexe.ru/download/api/proxy.zip a PHP proxy]. <spoiler text="How to use">To test the feature, run it on the server using command
 +
php -S <IP>:8080 proxy.php
 +
where<br>
 +
<IP> — your server IP address.<br>
 +
8080 — request receiving port.<br><br>
 +
To exchange data with our API use <IP>:8080. </spoiler>
 +
The features described below are available according to your [[Courier Service Account#Personal Account Functions|personal account plan]].
 +
 
 +
== Fair Usage Policy ==
 +
 
 +
To protect our service from improper use and DDoS attacks, we have defined fair usage levels:
 +
 
 +
* 30 tracking queries from a single IP address per 1 minute (use <code>statusreq</code>).
 +
* 150 queries from a single IP address per 1 minute.
 +
* 1500 queries from a single IP address per 20 minutes.
 +
* 3000 queries from a single account per 1 hour.
 +
* 200 MB text data downloaded per 3 hours.
 +
* Number of non-existing order status queries must not exceed the number of queries of existing order statuses.
 +
 
 +
If a limit is exceeded, the IP address is blocked for up to 3 hours.
 +
 
 +
Actions that result in blocking your IP address or account:
 +
 
 +
* Attacking our API with status queries with numbers of all you orders. Mind that the <code>tracking</code> queries are not intended for that, see [[API documentation#Order tracking by number|description]]. These queries are especially bad at the top of the hour.
 +
* Sending queries like "Show statuses of all orders for the last 3 months" every 5 minutes.
 +
* Sending a large amount of order numbers trying to guess which one is valid.
 +
 
 +
Correct actions:
 +
 
 +
* Queries are created for existing orders only.
 +
* To check order statuses, use <code>statusreq</code> queries with parameter <code>changes=ONLY_LAST</code>.
 +
* When requesting for changed statuses, you must confirm that the statuses were sucessfully received by query <code>commitlaststatus</code>.
 +
 
 +
== Creating Order ==
 +
=== Example of New Order ===
  
 
<source lang=xml>
 
<source lang=xml>
Строка 101: Строка 201:
 
     <phone>123-45-67</phone>
 
     <phone>123-45-67</phone>
 
     <town>Saint-Petersburg</town>
 
     <town>Saint-Petersburg</town>
     <address>Room 35, 38 Petrovka Str.</address>
+
     <address>Petrovka Str., 38, room 35</address>
     <date>March 22, 2014</date>
+
     <date>2021-03-22</date>
 
     <time_min>09:00</time_min>
 
     <time_min>09:00</time_min>
 
     <time_max>14:00</time_max>
 
     <time_max>14:00</time_max>
Строка 108: Строка 208:
 
   <receiver>
 
   <receiver>
 
     <company>Ministry of Internal Affairs</company>
 
     <company>Ministry of Internal Affairs</company>
     <person>Cheap &amp; Dale</person>
+
     <person>Tom Wale</person>
 
     <phone>123-45-67</phone>
 
     <phone>123-45-67</phone>
 
     <zipcode>125480</zipcode>
 
     <zipcode>125480</zipcode>
     <town>Saint-Petersburg</town>
+
     <town regioncode="78" country="RU">Saint-Petersburg</town>
     <address>Room 35, 38 Petrovka Str.</address>
+
     <address>Petrovka Str., 38, room 35</address>
     <date>2014-03-22</date>
+
    <pvz>124</pvz>
 +
    <inn>1112223335</inn>
 +
     <date>2021-03-22</date>
 
     <time_min>09:00</time_min>
 
     <time_min>09:00</time_min>
 
     <time_max>14:00</time_max>
 
     <time_max>14:00</time_max>
 +
    <deliveryPIN>1234</deliveryPIN>
 +
    <coords lat="55.680327" lon="37.604456"></coords>
 
   </receiver>
 
   </receiver>
 
   <return>NO</return>
 
   <return>NO</return>
  <return_service>1</return_service>
 
 
   <weight>5.1</weight>
 
   <weight>5.1</weight>
 +
  <return_weight>5.1</return_weight>
 
   <quantity>2</quantity>
 
   <quantity>2</quantity>
 
   <paytype>CASH</paytype>
 
   <paytype>CASH</paytype>
 
   <service>2</service>
 
   <service>2</service>
 +
  <return_service>1</return_service>
 
   <type>3</type>
 
   <type>3</type>
 +
  <return_type>3</return_type>
 +
  <courier>22</courier>
 
   <price>387.5</price>
 
   <price>387.5</price>
   <deliveryprice>150</deliveryprice>
+
   <deliveryprice VATrate="20">150</deliveryprice>
   <discount>0</discount>
+
   <inshprice>387.5</inshprice>
   <inshprice>387.5</inshprice>  
+
  <receiverpays>NO</receiverpays>
   <enclosure>Children`s toys</enclosure>
+
   <discount>120</discount>
   <instruction>Check in the presence of the buyer, sign acceptance act</instruction>
+
   <enclosure>Kids toys</enclosure>
  <pvz>124</pvz>
+
   <instruction>Check in the presence of the buyer, sign acceptance certificate</instruction>
   <department>Department</department>
+
   <department>Accounting</department>
 
   <pickup>NO</pickup>
 
   <pickup>NO</pickup>
 +
  <acceptpartially>NO</acceptpartially>
 +
  <costcode>cc12345</costcode>
 
   <items>
 
   <items>
       <item extcode="abc123" quantity="1" mass="0.2" retprice="37.5" VATrate="0" barcode="2345625213125" article="1">Ball</item>
+
       <item extcode="abc123" quantity="1" mass="0.2" retprice="37.5" VATrate="0" barcode="2345625213125" textArticle="1" article="1" volume="3" origincountry="AUT" GTD="321546654" excise="15.20" suppcompany="LLC &quot;Miller and Partners&quot;" suppphone="79161234567" suppINN="1112223334" governmentCode="11223311">Race car</item>
       <item extcode="abc124" quantity="2" mass="2" retprice="100" VATrate="10" barcode="4645625213138" article="2">Hula hoop</item>
+
       <item extcode="abc124" quantity="2" mass="2" retprice="100" inshprice="100" VATrate="10" barcode="4645625213138" article="2" length="10" width="20" height="30" origincountry="004">Princess castle</item>
       <item extcode="abc125" quantity="3" mass="0.3" retprice="50" barcode="2345625213126" article="3">Yellow rattle</item>
+
       <item extcode="abc125" quantity="3" mass="0.3" retprice="50" inshprice="50" barcode="2345625213126" itemcode="44123" article="3" type="1">Clay mass</item>
 
   </items>
 
   </items>
 +
  <packages>
 +
      <package strbarcode="ORD0000001" mass="1" message="" quantity="3"></package>
 +
      <package strbarcode="ORD0000002" mass="2.5" message="" length="10" width="20" height="30"></package>
 +
  </packages>
 +
  <deliveryset above_price="100" return_price="1000" VATrate="10">
 +
      <below below_sum="500" price="500" />
 +
      <below below_sum="2000" price="300" />
 +
  </deliveryset>
 +
  <advprices>
 +
    <advprice>
 +
      <code>1</code>
 +
      <value>123</value>
 +
    </advprice>
 +
    <advprice>
 +
      <code>2</code>
 +
      <value>10.5</value>
 +
    </advprice>
 +
    <advprice>
 +
      <code>3</code>
 +
      <value>true</value>
 +
    </advprice>
 +
  </advprices>
 +
  <overall_volume>81</overall_volume>
 +
  <userid>user123</userid>
 +
  <groupid>customer</groupid>
 
  </order>
 
  </order>
 
</neworder>
 
</neworder>
 
</source>
 
</source>
  
=== Order elements description ===
+
=== Order Elements ===
 +
'''Required Elements'''
  
*'''neworder''' is a root container, the mandatory element.
+
For MeaSoft, only three fields are required:
:* '''''newfolder''''' is an attribute of a new order – YES/NO. If there is YES, then a new order will be created for the given correspondence in the delivery service system. It is an optional element.  
+
* either receiver->company or receiver->person
 +
* receiver->address
 +
* receiver->phone.
  
*'''order''' is a container used for the description of one order, the mandatory element. There may be a number of '''order''' containers in one '''neworder''' container for the creation of several orders by using one query.
+
Courier service company can add required fields in the system settings. If you do not specify the required field values, an error message returns.
  
:* '''''orderno''''' is an order number. It should be entered here if it is assigned by the customer. In case it is not assigned, this field can be left empty; the system will generate its own number and send it back in the response. The system checks the presence of orders with the entered number within the current calendar year and in case they already exist in the system, the order won`t be created and error 17    "Such number exists" will be send back in the response.  
+
<spoiler text="Example of order with minimum data">
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<neworder>
 +
<auth extra="8" login="login" pass="pass" />
 +
<order>
 +
  <receiver>
 +
    <company>Company</company>
 +
    <phone>(495)123-45-67</phone>
 +
    <address>Petrovka, 38</address>
 +
  </receiver>
 +
</order>
 +
</neworder>
 +
</source>
 +
</spoiler>
 +
'''Fields Description'''
 +
*'''neworder''' — root container, required.
 +
:*'''''newfolder''''' — attribute of a new order, possible values: '''YES''', '''NO'''. If '''YES''', a new order is created for the specified shipment in the courier service system. It is an optional element.  
  
*'''barcode''' is an order barcode. In case the customer uses barcodes for his dispatches and the barcode is different from the order number, the barcode is entered into this field. In case there are several pieces packages present that are individually marked, masks in the form of underscore characters indicating barcode items, varying for different pieces packages within one order can be used. <br />
+
*'''order''' — container used for description of one order, required. A single '''neworder''' container can have a number of '''order''' containers to create several orders by using one query.
''For example'': There are 20 product units in order no. 123 packed in 3 pieces packages. The customer has to prepare 3 barcodes for each piece: CLNT0012301, CLNT0012302, CLNT0012303, where CLNT – is a customer`s prefix, 00123 is an order number, 01-03 is the number for each piece package in the order. CLNT00123__ should be entered into the “barcode” field (the system will understand that there may be any last 2 symbols in the field and will display barcodes for the same order).
+
:*'''''orderno''''' order number. Specify it if it is assigned by the client. In case it is not assigned, this field can be left empty. The system will generate its own number and send it back in the response. The system checks whether the specified number has been used within the current calendar year. If it already exists in the system, the order is not created, error 17 "Such number exists" returns.  
  
*'''sender''' presents the information about order sender. It is an optional container.  
+
*'''barcode''' — order barcode. In case the customer uses barcodes for his dispatches and the barcode is different from the order number, the barcode is entered into this field. In case there are several packages and they are individually marked, underscore character can be used as a mask to indicate barcoded item number varying for different packages within one order.
 +
 
 +
''For example'': There are 20 items in order No. 123 packed in 3 packages. The client generates 3 barcodes for each package: CLNT0012301, CLNT0012302, CLNT0012303, where CLNT is a client prefix, 00123 is an order number, 01-03 is the number for each package in the order. In this case CLNT00123__ should be entered into the '''barcode''' field. Thus, MeaSoft knows the last 2 characters can be any values and will display barcodes for the same order. If it is not you who will print packing slips with the specified barcode, the barcode must not exceed 25 characters, otherwise it cannot be fully seen on the standard printing forms.
 +
 
 +
*'''sender''' presents the information about order sender. It is an optional container.  
 
<source lang="xml">
 
<source lang="xml">
 
   <sender>
 
   <sender>
     <company>Name of the sender company</company>
+
     <company>Name of sender company</company>
 
     <person>Sender company contact person</person>
 
     <person>Sender company contact person</person>
     <phone>Sender`s phone number, E-mail</phone>
+
     <phone>Sender phone number, email</phone>
     <town>Sender`s location in “Moscow city” format</town>
+
     <town>Sender location in the "[name] city" format</town>
     <address>Sender`s address</address>
+
     <address>Sender address</address>
     <date>Pick-up date in "YYYY-MM-DD" format</date>
+
     <date>Pickup date in the "YYYY-MM-DD" format</date>
     <time_min>Desired pick-up time in "HH:MM" format</time_min>
+
     <time_min>Desired pickup time in the "HH:MM" format</time_min>
     <time_max>Desired pick-up time in "HH:MM" format</time_max>
+
     <time_max>Desired pickup time in the "HH:MM" format</time_max>
 
   </sender>
 
   </sender>
 
</source>
 
</source>
  
*'''receiver''' is the information about the receiver. It is a mandatory container.  
+
* '''receiver''' is the information about the recipient. Required.
 
<source lang="xml">
 
<source lang="xml">
 
   <receiver>
 
   <receiver>
     <company>Name of the receiving company</company>
+
     <company>Name of the recipient company</company>
     <person>Receiving company contact person</person>
+
     <person>Recipient company contact person</person>
     <phone>Receiver`s phone number, E-mail</phone>
+
     <phone>Recipient phone number, email</phone>
     <town>Receiver`s location in “Moscow city” format</town>
+
     <town regioncode="Region code"> Recipient location in the "[name] city" format</town>
     <address>Receiver`s address</address>
+
     <address>Recipient address</address>
     <date>Delivery date in "YYYY-MM-DD" format</date>
+
     <date>Delivery date in the "YYYY-MM-DD" format</date>
     <time_min>Desired delivery time in "HH:MM" format</time_min>
+
     <time_min>Desired delivery time in the "HH:MM" format</time_min>
     <time_max>Desired delivery time in "HH:MM" format</time_max>
+
     <time_max>Desired delivery time in the "HH:MM" format</time_max>
 
   </receiver>
 
   </receiver>
 
</source>
 
</source>
  
*'''company''' is a receiving company.  
+
*'''company''' is a recipient company.  
*'''person''' is a contact person. ''At least one field should be filled in – either company or person!''
+
*'''person''' is a contact person's name. ''At least one field should be filled in – either company or person.''
*'''phone''' is a phone number. Several phone numbers and emails can be entered into this field.  
+
*'''phone''' is a phone number. You can specify several phone numbers and emails.  
 
*'''town''' is the name of the town.
 
*'''town''' is the name of the town.
 +
*'''pvz''' is the pickup point code from the '''Branches''' reference. Besides, you can specify the pickup point in the <code>address</code> parameter by one of the following:
 +
** Pickup point code in our system.
 +
** Pickup point code in service partner's system.
 +
 +
For the '''town''' tag, you can speify the value from the '''Regions''' reference in the '''regioncode''' attribute. The town is searched for in the specified region.
 +
 +
In the '''country''' attribute, you can specify the recipient country according to the [https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes ISO 3166-1] standard. For example: "AT", "AUT" or "040" for Austria.
 +
 +
Besides, the '''zipcode''' attribute value is considered when searching for a town.
  
''Town''' field of '''sender''' and '''receiver''' containers can be filled in by using:   
+
You can use one of the following ways to  fill in the '''Town''' field of the '''sender''' and '''receiver''' containers:   
:* locality dialing code [[#Dialing codes guide|dialing codes guide]]
+
:* [[#Dialing codes guide|location code]]
 
:* 13-digit code from All-Russian Classifier of Addresses (Address Classifier used in Russia)   
 
:* 13-digit code from All-Russian Classifier of Addresses (Address Classifier used in Russia)   
 
:* 36-digit code from the address system <rspoiler text="Federal Information Address System">Federal Information Address System (Address system used in Russia)</rspoiler> (AOID)
 
:* 36-digit code from the address system <rspoiler text="Federal Information Address System">Federal Information Address System (Address system used in Russia)</rspoiler> (AOID)
:* the name of the town (not recommended!)  
+
:* the name of the town (not recommended)  
  
 +
* '''coords''' — recipient coordinates. If not specified, they are determined automatically.
 +
*'''paytype''' is a type of order payment. Possible values:
 +
:* CASH — cash on delivery (by default).
 +
:* CARD — by card on delivery.
 +
:* NO — no payment expected, the order is already paid. API adds an advance payment item with negative price value to the list of items, so that the order total is 0. The order receipt lists all items, their prices and the advance payment amount accourding to the Federal Law.
 +
:* OTHER means other types of payment. It is designed for making payments directly to the delivery service by using other types of payment: Webmoney, Yandex Money, online payment by card, other payment systems.
 +
:* OPTION — recepient selects the payment type. This type of payment is not transferred in the order. It is set automatically client settings.
  
*'''paytype''' is a type of payment used for checking out the order by the receiver. It can take on the following values:
+
*'''zipcode''' — postal code. 
:* CASH is paying with cash on delivery (by default)
+
*'''weight''' — total order weight in kilograms.
:* CARD is paying with a credit card on delivery
+
*'''return_weight''' — total order return weight in kilograms.
:* NO which means that there won`t be any payment. “Price” field value will be ignored. (This type of payment is transferred in case the order has already been paid for and doesn`t require cash collection; API will add goods from the order with a null price to the system. If it is necessary to transfer order total cost, it can be done by using <inshprice> field, indicating order items` declared value)
+
*'''quantity''' — number of packages.
:* OTHER means other types of payment (It is designated for making payments directly to the delivery service by using other types of payment as: “Webmoney”, “Yandex Money”, online payment with a credit card other payment systems, etc.
+
*'''service''' — delivery mode (service type). It is transferred as a code from the '''Urgency Kinds''' reference. 
:* OPTION means choosing type of payment by the receiver. This type of payment can’t be transferred with the order. It is automatically set depending on customer`s data setup.  
+
*'''type''' – shipment type. It is transferred as a code from the '''Shipment Types''' reference.
 +
*'''return_type''' - return shipment type. It is transferred as a code from the '''Shipment Types''' reference.
 +
*'''price''' — order amount. If the '''items''' container is present, this parameter is ignored and calculated automatically.
 +
*'''deliveryprice'''— delivery fee. If the '''items''' container is present, the "Delivery" item is added to it.
 +
:*'''VATrate''' — value-added tax rate, integer.
 +
*'''return''' — indicates whether return trip is required.  
 +
*'''return_service''' — return mode (type of service). It is transferred as a code from the '''Urgency Kinds''' reference.
 +
*'''discount''' — order discount amount. The discount amount distributes between the order item prices, the cash on delivery amount decreases by the the discount amount. The "Discount" item is not created. Note that using this tag might lead to discrepancies in order total due to rounding errors. Avoid using this tag, specify the item prices already decreased by the discount amount.
 +
*'''enclosure''' — task description.
 +
*'''inshprice''' — declared value. If not specified explicitly, the value is calcuated automatically as order items prices total.
 +
*'''instruction''' — instruction text for courier.
 +
*'''courier''' — planned courier. It is transferred as a MeaSoft courier code.
 +
*'''receiverpays''' — indicates whether recipient pays the delivery fee. If '''YES''', the recipient pays, if '''NO''', the sender pays.
 +
*'''department''' — the order creator's department.
 +
*'''pickup''' — indicates whether it is a pickup order. If '''YES''', the entire order is considered to be the assignment for pickup, not for delivery. It is used for calling a courier to the sender's place to pick up shipments. '''Note'''. If warehouse goods are added to the order, their type must be '''[7]Goods pickup'''. Any other type is automatically changed to type 7 on submitting the order.
 +
* '''acceptpartially''' — indicates whether the recepient can partially accept order items.
 +
*'''items''' — a container describing order items. It is an optional container. It has the following attributes: 
 +
:* '''''item''''' — item name.
 +
:* '''''quantity''''' — number of articles. 
 +
:* '''''mass''''' — item weight in kg.
 +
:* '''''volume''''' — dimensional weight of an item in kilograms. If specified, the value substitutes the '''mass''' value.
 +
:* '''''length''''' — item length in cm.
 +
:* '''''width''''' — item width in cm.
 +
:* '''''retprice''''' — price of an article. Rounds to the hundredths. It must include all markups and discounts. It cannot be negative for item types 1, 2, 3.
 +
:*'''''inshprice''''' — declareed value of an article. Rounds to the hundredths. If not specified, considered equal to '''retprice'''.
 +
:* '''''VATrate''''' — VAT rate which is specified as integer percentage. If a value is not indicated, then “18” value is entered. 
 +
:* '''''barcode''''' — item barcode.
 +
:* '''''article''''' — supplier SKU ID. ''Attention!'' Supplier SKU ID is required only for the items stored at the courier service warehouse and if cross-docking is required for them. In this case the system tries to associate the item with a corresponding item in [[API#Nomenclature list|nomenclature list]]. If the item is not found in the nomenclature list, the error message is displayed. If several items are found with the same supplier SKU ID, one of the IDs is selected randomly. It might result in incorrect cross-docking.
 +
:*'''''itemcode''''' — internal SKU ID/ You can use instead of supplier SKU ID. ''Attention!'' SKU ID is required only for the items stored at the courier service warehouse and if cross-docking is required for them. The system uses SKU ID to associate the item with a corresponding item in [[API#Nomenclature list|nomenclature list]]. If the item is not found, the error message is displayed.
 +
:*'''''type''''' — item type. Possible values:
 +
::1 — Goods. The default value.
 +
::2 — Delivery. The item is added automatically if '''order''' > '''deliveryprice''' is specified.
 +
::3 — Service
 +
::4 — Advance payment. The amount is specified. '''quantity''' is ignored, always "1". The amount in the order is displayed with the negative sign irrespective of the sign in the request. The item is added automatically if '''order''' > '''paytype=NO''' is specified.
 +
::6 - Credit payment. The amount is specified. '''quantity''' is ignored, always "1". The amount in the order is displayed with the negative sign irrespective of the sign in the request.
 +
::7 - Pickup. Use it if you have to pick up the items from the recipient. The amount in the order is displayed with the negative sign irrespective of the sign in the request.
 +
:* '''''extcode''''' — external line code. It is used to identify the order lines when obtaining statuses. It is an optional field.
 +
:* '''''origincountry''''' - origin country code according to [https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes ISO 3166-1].
 +
:* '''''GTD''''' — GTD number.
 +
:* '''''excise''''' — excise tax amount.
 +
:* '''''suppcompany''''' — supplier name if it is different from the sender.
 +
:* '''''suppphone''''' — supplier phone number if it is different from the sender.
 +
:* '''''suppINN''''' — supplier taxpayer ID if supplier is not the sender.
 +
:* '''''governmentCode''''' — [https://chestnyznak.ru/en/ Chestnyi ZNAK code]. It is used to digitally mark goods. Specify all characters of the QR code excepting ASCII 29 character. If the code is unknown, specify "?". The courier will scan it when giving the item to recepient. Some processes may require using "!". In this case, the courier scans the item  serial number, but it is not considered to be the digital mark code. If the field is filled in, '''quantity''' must be "1", otherwise an error returns.  
  
*'''zipcode''' is a zip code.
+
*'''packages''' — a container describing order packages. It is an optional container. It has the following attributes:
*'''weight''' is a total weight of the order in kilograms.
+
:* '''''package''''' — package name.
*'''quantity''' is the number of pieces packages.  
+
:* '''''code''''' — internal line code.
*'''service''' - delivery mode (service type) is transferred in the form of a code from “Delivery priority types” guide. 
+
:* '''''strbarcode''''' — package barcode.
*'''type''' – correspondence (dispatch) type is transferred in the form of a code from “Types of correspondence” guide.
+
:* '''''mass''''' — package weight in kg.
*'''price''' is an order amount. In case “items” container is present, the value of the given parameter will be ignored and calculated automatically.  
+
:* '''''message''''' — message line.
*'''deliveryprice''' is the cost of delivery. In case “items” container is present, “Delivery” enclosure will be added to it.  
+
:* '''''length''''' — package length in cm.
*'''discount''' is a discount for the order amount. As a result the order amount will be decreased by the discount amount. 
+
:* '''''width''''' — package width in cm.
*'''return''' is an attribute indicating the necessity of return.
+
:* '''''height''''' — package height in cm.
*'''return_service''' is a return mode (type of service) which is transferred in the form of a code from “Delivery priority types” guide.  
+
:* '''''quantity''''' — number of packages with the specified dimensions and mass. Total number of packages in the order cannot be more than 1000.
*'''enclosure''' is an enclosure.
 
*'''inshprice''' is a declared value.
 
*'''instruction''' is an instruction – a note. 
 
*'''pvz''' is a pick-up point code. You can find out pick-up point codes on request or in user`s member area  on “pvz” tab.  
 
*'''department''' is the name of the department which the order is raised in.
 
*'''pickup''' is YES/NO attribute of pickup arrangement. If there is YES, then the entire order will be considered to be the assignment for cargo pickup but not for cargo delivery! It is applied for calling a courier to the receiver for the pickup of other packaging units.  
 
  
*'''items''' is a container used for the description of goods enclosed. It is an optional container. It has the following attributes:
+
* '''deliveryset''' — custom delivery rate setup. It has the following attributes:
:* '''''item''''' is the name of a product.
+
:* '''''above_price''''' — delivery fee if all order items are accepted by the recipient. It is "amount from" for the limit set in the '''below_sum''' tag.
:* '''''quantity''''' is the amount of product units. 
+
:* '''''return_price''''' delivery fee if the order is returned.
:* '''''mass''''' is the weight of a product unit in kilograms.
+
:* '''''VATrate''''' — value-added tax rate, integer.
:* '''''retprice''''' is the price of a product unit.
 
:* '''''VATrate''''' is a VAT rate which is specified as integer percentage. If a value is not indicated, then “18” value is entered. 
 
:* '''''barcode''''' is a product unit barcode. [[File:Article.png|thumb|100px|right]]
 
:* '''''article''''' is product unit article number. ''Attention!'' Product unit article is displayed only in case when a product unit is stored at the delivery service in safe custody and order batching is required. In this case the system will try to assign a product unit to a corresponding item in [[API#Nomenclature list|nomenclature list]]. If the product unit is not found in the nomenclature list, the appropriate error message will be displayed by the system. If there are several product units found within one article number, the system will randomly select one of them what can result in incorrect order batching! If a product unit is NOT in safe custody – you DON`T have to specify its article number. Product item will be entered into the system by a plain text.  
 
:* '''''extcode''''' is an external code of a string. It is used for the identification of strings of orders when obtaining statuses. It is an optional field. IT IS NOT SUPPORTED YET.  
 
  
In case it is necessary to specify them besides product units, additional services (for example, DELIVERY, order batching, lifting the order up to the floor, etc.) – they should be specified in the same “items” container as product units but without article numbers.  
+
* '''below''' — amount limit of the settings.
 +
:* '''''below_sum''''' — purchase amount limit.
 +
:* '''''price''''' — purchase amount within the limit.
  
=== Examples of responses ===
+
* '''advprices''' — a container describing value-added services. It is an optional container. It has the following attributes: <span style="color: red;>To use it in the API, in the [[Courier Service Account#Setting Up Client Account|client account settings]], enable the '''Value-added services''' field for new order and pickup request.</span>
'''The example of a successful response'''
+
:* '''''code''''' — service code.
 +
:* '''''value''''' — service value. If service type is Boolean, set the value to '''True'''.
 +
 
 +
If you want to apply value-added services (for example, delivery, cross-docking, lifting upstairs, etc.), specify them in the same '''items''' container as items without a SKU ID.
 +
 
 +
*'''costcode''' — employee cost code.
 +
 
 +
*'''overall_volume''' — total volume, m3. An optional virtual field. It is used to calculate the package dimensions. The calculation works only if every package contains zero values of length, heigth, or width.
 +
 
 +
*'''userid''' — user ID, either string or integer type. Virual field, optional. The field is used in the custom delivery rate settings. It defines the rule priority. You can use the field for CMS and CRM to set delivery fee for each customer individually.
 +
 
 +
*'''groupid''' — user group ID, either string or integer type. Virual field, optional. The field is used in the custom delivery rate settings. It defines the rule priority. You can use the field for CMS and CRM to set delivery fee for each customer group individually.
 +
 
 +
<div style="color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
 +
When submitting orders with scheduled delivery or pickup date earlier than the nearest possible date, the delivery or pickup date changes automatically to the [[Courier Service Account#Calculating the Nearest Possible Delivery Date|nearest possible date]].</div>
 +
 
 +
=== Response Examples ===
 +
 
 +
If a request is executed successfully and an order is created, the order amount in the <code>orderprice</code> attribute and the 0 error returns. Otherwise, an error number and its description in the <code>errormsg</code> attribute returns. The <code>orderno</code> attribute contains order number, <code>barcode</code> — order barcode.
 +
 
 +
'''Success'''
  
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<neworder>
 
<neworder>
   <createorder orderno="AB23541" error="0" errormsg="success"></createorder>
+
   <createorder orderno="AB23541" barcode="67567#114" error="0" errormsg="Success" orderprice="5000" />
   <createorder orderno="55_6542" error="0" errormsg="success"></createorder>
+
   <createorder orderno="AB23542" barcode="67567#115" error="0" errormsg="Success" orderprice="6000" />
   <createorder orderno="AB23542" error="0" errormsg="success"></createorder>
+
   <createorder orderno="AB23543" barcode="67567#116" error="0" errormsg="Success" orderprice="0" />
 
</neworder>   
 
</neworder>   
 
</source>
 
</source>
  
'''The example of a response with an error'''
+
'''Error'''
  
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<neworder>
 
<neworder>
   <createorder orderno="AB23541" error="17" errormsg="Such number exists"></createorder>
+
   <createorder orderno="AB23541" barcode="67567#114" error="67" errormsg="Order barcode already exists in the database." />
   <createorder orderno="AB23542" error="13" errormsg="empty company"></createorder>
+
   <createorder orderno="AB23542" barcode="67567#115" error="17" errormsg="Order number already exists in the database." />
   <createorder orderno="AB23543" error="14" errormsg="empty person"></createorder>
+
   <createorder orderno="AB23543" barcode="67567#116" error="67" errormsg="Order barcode already exists in the database." />
 
</neworder>  
 
</neworder>  
 
</source>
 
</source>
  
'''The example of a response in case of the authorization error'''
+
'''Authorization Error'''
  
 
<source lang="xml">
 
<source lang="xml">
Строка 262: Строка 490:
 
</source>
 
</source>
  
'''The example of a response in case of a syntax error''''''  
+
'''Syntax Error'''  
  
 
<source lang="xml">
 
<source lang="xml">
Строка 271: Строка 499:
 
</source>
 
</source>
  
=== Error codes in case of ordering ===
+
== Order Status ==
 
 
0 – No errors.
 
 
 
1 - Authorization error. (<auth login="" pass=""></auth> tags are missing, incorrect login or password). 
 
 
 
2 - Empty response is sent (<neworder></neworder> container is missing in a XML document).
 
 
 
3 - Order amount is set incorrectly.
 
 
 
4 - Order weight is set incorrectly.
 
 
 
5 - Receiver`s town is not found.
 
 
 
6 - Sender`s town is not found.
 
 
 
7 - Receiver`s address is not filled in.
 
 
 
8 - Receiver`s phone number is not filled in. 
 
 
 
9 - Receiver`s contact name is not filled in. 
 
 
 
10 - Receiver`s company name is not filled in. 
 
 
 
11 - The amount of declared value is incorrect.
 
 
 
12 - Article number is not found.
 
 
 
13 - Sender`s company name is not filled in.
 
 
 
14 - Sender`s contact name is not filled in. 
 
 
 
15 - Sender`s phone number is not filled in. 
 
 
 
16 - Sender`s address is not filled in.
 
 
 
17 - Order with this number already exists.
 
  
== Order status query ==
+
=== Request Example ===
 
 
 
 
=== The example of order status query ===
 
  
 
<source lang="xml">
 
<source lang="xml">
Строка 320: Строка 509:
 
   <client>CLIENT</client>
 
   <client>CLIENT</client>
 
   <orderno>1234</orderno>
 
   <orderno>1234</orderno>
 +
  <orderno2>5678</orderno2>
 
   <ordercode>34234</ordercode>
 
   <ordercode>34234</ordercode>
 
   <givencode>234534</givencode>
 
   <givencode>234534</givencode>
   <datefrom>2016-07-21</datefrom>
+
   <datefrom>2021-06-21</datefrom>
   <dateto>2016-07-21</dateto>
+
   <dateto>2021-06-21</dateto>
   <target>Car-making factory</target>
+
   <target>Company</target>
 
   <done>ONLY_NOT_DONE</done>
 
   <done>ONLY_NOT_DONE</done>
 
   <changes>ONLY_LAST</changes>
 
   <changes>ONLY_LAST</changes>
   <quickstatus>NO</quickstatus>
+
   <conditions>
 +
    <namecontains>1234</namecontains>
 +
    <namestarts>1234</namestarts>
 +
  </conditions>
 
</statusreq>
 
</statusreq>
 
</source>
 
</source>
  
=== The description of status query fields ===
+
=== Fields Description ===
 
+
'''statusreq''' is a root container. Required.
'''statusreq''' is a root container. It is a mandatory element.  
+
* '''auth''' — authorization. Required.
*'''auth''' is authorization. It is a mandatory element.  
+
* '''client''' — indicates whether it is a client or a delivery service partner. It is an optional element. Possible values:
*'''client''' is an attribute of a customer or an agent. It is an optional element.  
+
:* CLIENT — the default value.
:* CLIENT is an attribute of a customer, the default value  
+
:* AGENT — delivery service partner. Response contains information on the orders tendered for delivery.
:* AGENT is an attribute of an agent. In response the information on orders passed on to the agent for their delivery is returned
+
* '''orderno''' — order number. It is an optional element.
*'''orderno''' is an order number. It is an optional element.  
+
* '''ordercode''' — internal order code. It is an optional element.
*'''orderno2''' is an order number from the list of urgent orders. It is an optional element.  
+
* '''orderno2''' — urgent order number. It is an optional element.
*'''datefrom''' is a date “from”. It is a mandatory element.  
+
* '''datefrom''' — order creation date "from". It is an optional element.
*'''dateto''' is a date “to”. It is a mandatory element.
+
* '''dateto''' — order creation date 'to". It is an optional element.
*'''target''' is a find string. It allows indicating the text that company name or receiver`s address contains.
+
* '''target''' — a search text. You can specify a part of recipient company name or recipient address.
*'''done''' can have the following values:  
+
* '''done''' — possible values:
:* ONLY_NOT_DONE - for undelivered only  
+
:* ONLY_DONE — delivered only. Success stauses like '''Delivered''', '''Partially delivered'''.
:* ONLY_DONE - for delivered only  
+
:* ONLY_NOT_DONE — undelivered only. Statuses like '''Not delivered''', '''Lost'''.
:* ONLY_NEW - for new only
+
:* ONLY_NEW — new only.
:* ''Empty'' - for all correspondence
+
:* ONLY_DELIVERY — orders in process only. These are orders in any status except for final statuses '''Delivered''', '''Not delivered''', '''Canceled''' and the like.
 
+
:* ''Empty'' — for all shipments.
*'''changes''' can have only one value - ONLY_LAST. If this parameter is set, all other parameters, except quickstatus, will be ignored. The description of this mode is given here: [[#Newly changed statuses transfer|Newly changed statuses transfer]]  
+
* '''changes''' — can take only ONLY_LAST value. If this parameter is specified, all other parameters are ignored. For more information, see [[#Get Latest Changed Statuses|Get Latest Changed Statuses]].
 
+
* '''conditions''' — specify search conditions. The nested elements are joined by the logical AND operator.
*'''quickstatus''' indicates the “depth” of transferred statuses: "YES" value (by default) - statuses are transferred starting from the information provided by a courier. Such statuses are quick (as a rule, they are provided by a courier immediately after delivery) but not always accurate. "NO" value prohibits status transfer according to oral information provided by the courier and provides only those statuses that have been entered by an operator manually, as a rule. It takes more time however the level of accuracy is much higher in this case. It is not recommended to combine (interleave) these two types of status transfer in case of newly changed statuses demand as in this case the system will consider that statuses of dispatches are changing.  
+
:* '''namecontains''' — search order numbers (external codes) that contain the specified text.
 
+
:* '''namestarts''' — search order numbers (external codes) that start with the specified text.
  
 
<div style="color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
 
<div style="color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
'''Please, note!'''
+
# You can request statuses of orders created no earlier than 2 months before the '''to''' date (<code>datefrom</code> and <code>dateto</code> containers).
# Period of status query ('''datefrom''' and '''dateto''' containers) is limited to two months &mdash; two months to the date '''"to"'''.  
+
# If no date is provided, <code>dateto</code> equals the current date.
# In case both dates are not specified &mdash; '''dateto''' is accepted equal to the current date.  
+
# Omitting <code>dateto</code> defaults to <code>datefrom</code> plus two months.
# In case '''dateto''' date is not specified &mdash; it is accepted equal to '''datefrom''' plus two months.  
+
# Omitting <code>datefrom</code> defaults to <code>dateto</code> minus two months.
# In case '''datefrom''' date is not specified &mdash; it is accepted equal to '''dateto''' minus two months.
+
# You can search using '''conditions''' only by order numbers (external codes). 4 characters is the minimum search length.
 
</div>
 
</div>
<br />
 
  
=== Examples of responses ===  
+
=== Response Examples ===  
  
'''The example of a successful response'''
+
'''Success'''
  
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<statusreq count="23">
 
<statusreq count="23">
  <order orderno="111111" orderno2="123123" ordercode="34534234" givencode="2345334">
+
  <order orderno="111111" awb="qwerty" orderno2="123123" ordercode="34534234" givencode="2345334">
 
   <barcode>111111</barcode>
 
   <barcode>111111</barcode>
 
   <sender>
 
   <sender>
 
     <company>Ministry of Internal Affairs</company>
 
     <company>Ministry of Internal Affairs</company>
     <person>I. I. Ivanov</person>
+
     <person>Sam Goe</person>
 
     <phone>123-45-67</phone>
 
     <phone>123-45-67</phone>
 
     <contacts>
 
     <contacts>
 
       <phone>+74951234567</phone>
 
       <phone>+74951234567</phone>
 
     </contacts>
 
     </contacts>
     <town code="23432">Saint-Petersburg</town>
+
     <town code="23432">Saint-Petersburg city</town>
     <address>Room 35, 38 Petrovka Str.</address>
+
     <address>Petrovka Str., 38, Room 35</address>
     <date>2014-03-22</date>
+
     <date>2021-03-22</date>
 
     <time_min>09:00</time_min>
 
     <time_min>09:00</time_min>
 
     <time_max>14:00</time_max>
 
     <time_max>14:00</time_max>
Строка 387: Строка 579:
 
   <receiver>
 
   <receiver>
 
     <company>Ministry of Internal Affairs</company>
 
     <company>Ministry of Internal Affairs</company>
     <person>I. I. Ivanov</person>
+
     <person>Tom Well</person>
     <phone>123-45-67 - Ivan, (916)234.45.21 Pyotr, mvd@mail.ru</phone>
+
     <phone>123-45-67 - Tom, (916)234.45.21 Sam, mia@gmail.com</phone>
 
     <contacts>
 
     <contacts>
 
       <phone>+74951234567</phone>
 
       <phone>+74951234567</phone>
 
       <phone>+79162344521</phone>
 
       <phone>+79162344521</phone>
       <email>mvd@mail.ru</email>
+
       <email>mia@gmail.com</email>
 
     </contacts>
 
     </contacts>
 +
    <inn>1112223335</inn>
 
     <zipcode>125480</zipcode>
 
     <zipcode>125480</zipcode>
     <town code="23432">Saint-Petersburg</town>
+
     <town code="153361" regioncode="78" regionname="Saint-Petersburg city">Saint-Petersburg city</town>
     <address>Room 35, 38 Petrovka Str.</address>
+
     <address>Petrovka Str., 38, Room 35</address>
     <date>2014-03-22</date>
+
    <pvz>
 +
      <code>126</code>
 +
      <clientcode>QWERTY</clientcode>
 +
    </pvz>
 +
     <date>2021-03-22</date>
 
     <time_min>09:00</time_min>
 
     <time_min>09:00</time_min>
 
     <time_max>14:00</time_max>
 
     <time_max>14:00</time_max>
 
     <coords lat="55.680327" lon="37.604456"></coords>
 
     <coords lat="55.680327" lon="37.604456"></coords>
 +
    <deliveryPIN>1234</deliveryPIN>
 
   </receiver>
 
   </receiver>
 +
  <pickup>NO</pickup>
 
   <weight>5.1</weight>
 
   <weight>5.1</weight>
 +
  <return_weight>5.1</return_weight>
 
   <quantity>2</quantity>
 
   <quantity>2</quantity>
   <paytype>CASH</paytype>
+
   <paytype code="1">CASH</paytype>
 
   <service>2</service>
 
   <service>2</service>
 +
  <return_service>2</service>
 +
  <type>3</type>
 +
  <return_type>3</return_type>
 +
  <waittime>12</waittime>
 
   <price>387.5</price>
 
   <price>387.5</price>
 
   <print_check>YES</print_check>
 
   <print_check>YES</print_check>
 
   <inshprice>387.5</inshprice>
 
   <inshprice>387.5</inshprice>
   <enclosure>Children`s toys</enclosure>
+
   <enclosure>Kids toys</enclosure>
   <instruction>Check in the presence of the buyer, sign acceptance act</instruction>
+
   <instruction>Check in the buyer's presence, sign acceptance certificate</instruction>
   <currcoords lat="55.680327" lon="37.604456" accuracy="50" RequestDateTime="2014-04-21 18:07:45"></currcoords>
+
   <currcoords lat="55.680327" lon="37.604456" accuracy="50" RequestDateTime="2021-04-21 18:07:45"></currcoords>
 
   <courier>
 
   <courier>
 
<code>26</code>
 
<code>26</code>
<name>Vladimir Petrovich Ivanov</name>
+
<name>Katie Summerhill</name>
 
<phone>+79161234567</phone>
 
<phone>+79161234567</phone>
 
   </courier>
 
   </courier>
   <deliveryprice total="158.6">
+
   <deliveryprice total="158.6" delivery="100.00" return="58.6">
       <>..</> (price details are not yet supported)
+
       <advprice code="1" price="150">Base</advprice>
       ..
+
      <advprice code="2" price="0">% of declared value</advprice>
 +
       <advprice code="3" price="8.6">Fuel surcharge</advprice>
 +
      <advprice code="4" price="0">Rounding</advprice>
 
   </deliveryprice>
 
   </deliveryprice>
 
   <receiverpays>NO</receiverpays>
 
   <receiverpays>NO</receiverpays>
   <status eventstore="Saint-Petersburg branch" eventtime="2016-06-02 17:22:00" createtimegmt="2016-06-03 16:14:44" message="" title="Delivered">COMPLETE</status>
+
  <acceptpartially>NO</acceptpartially>
 +
   <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="" title="Delivered">COMPLETE</status>
 
   <statushistory>
 
   <statushistory>
     <status eventstore="Moscow branch" eventtime="2016-05-30 10:20:00" createtimegmt="2016-06-03 16:14:44" message="" title="New">NEW</status>
+
     <status eventstore="Moscow office" eventtime="2021-05-30 10:20:00" createtimegmt="2021-06-03 16:14:44" message="" title="New">NEW</status
     <status eventstore="Moscow branch" eventtime="2016-06-01 17:38:00" createtimegmt="2016-06-03 16:14:44" message="Saint-Petersburg branch" title="Dispatch is planned">DEPARTURING</status>
+
     <status eventstore="Moscow office" eventtime="2021-06-01 17:38:00" createtimegmt="2021-06-03 16:14:44" message="Branch office" title="Shipment planned">DEPARTURING</status>
     <status eventstore="Moscow branch" eventtime="2016-06-01 19:53:00" createtimegmt="2016-06-03 16:14:44" message="Saint-Petersburg branch" title="Dispatched from the warehouse">DEPARTURE</status>
+
     <status eventstore="Moscow office" eventtime="2021-06-01 19:53:00" createtimegmt="2021-06-03 16:14:44" message="Branch office" title="Shipped">DEPARTURE</status>
     <status eventstore="Saint-Petersburg branch" eventtime="2016-06-02 07:41:00" createtimegmt="2016-06-03 16:14:44" message="" title="Received by the warehouse">ACCEPTED</status>
+
     <status eventstore="Branch office" eventtime="2021-06-02 07:41:00" createtimegmt="2021-06-03 16:14:44" message="" title="Received by warehouse">ACCEPTED</status>
     <status eventstore="Saint-Petersburg branch" eventtime="2016-06-02 09:17:00" createtimegmt="2016-06-03 16:14:44" message="" title="Given to the courier to be delivered ">DELIVERY</status>
+
     <status eventstore="Branch office" eventtime="2021-06-02 09:17:00" createtimegmt="2021-06-03 16:14:44" message="" title="Out for delivery">DELIVERY</status>
     <status eventstore="Saint-Petersburg branch" eventtime="2016-06-02 17:22:00" createtimegmt="2016-06-03 16:14:44" message="" title="Delivered (to be confirmed)">COURIERDELIVERED</status>
+
     <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="" title="Delivered as reported by courier">COURIERDELIVERED</status>
     <status eventstore="Saint-Petersburg branch" eventtime="2016-06-02 17:22:00" createtimegmt="2016-06-03 16:14:44" message="" title="Delivered">COMPLETE</status>
+
     <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="" title="Delivered">COMPLETE</status>
 
   </statushistory>
 
   </statushistory>
 
   <customstatecode>2<customstatecode>
 
   <customstatecode>2<customstatecode>
   <deliveredto>Ivanova, sec.</deliveredto>
+
  <clientstatecode></clientstatecode>
   <delivereddate>2016-06-02</delivereddate>
+
  <costcode>cc12345</costcode>
 +
    <receipt fdNum="124555" fnSn="9289000100295555" kktNum="0001611984048555" inn="7722756555" fdValue="2899551555" summ="387.5" ofdUrl="gate.ofd.ru">https://ofd.ru/rec/7722756555/0001611984048555/9289000100295555/124555/2899551555</receipt>
 +
   <deliveredto>Mary Smith, secretary</deliveredto>
 +
   <delivereddate>2021-06-02</delivereddate>
 
   <deliveredtime>17:22</deliveredtime>
 
   <deliveredtime>17:22</deliveredtime>
 +
  <arrival>2021-05-02 23:21</arrival>
 
   <outstrbarcode>EXT123456</outstrbarcode>
 
   <outstrbarcode>EXT123456</outstrbarcode>
 +
  <partner>Western Branch</partner>
 +
  <return_message>Delivered undamaged</return_message>
 +
  <department>Accounting</department>
 
   <items>
 
   <items>
       <item code="34533" extcode="abc123" quantity="1" mass="0.2" retprice="37.5" VATrate="0" barcode="2345625213125" article="1" returns="0">Ball</item>
+
       <item code="34533" extcode="abc123" quantity="1" mass="0.2" retprice="37.5" VATrate="0" barcode="2345625213125" article="1" returns="0" origincountry="040" GTD="" excise="0.00" governmentCode="11223311" suppcompany="Miller and Company" suppINN="1112223334" suppphone="79161234567">Princess house</item>
       <item code="34456" extcode="abc124" quantity="2" mass="2" retprice="100" VATrate="10" barcode="4645625213138" article="2" returns="0">Hula hoop</item>
+
       <item code="34456" extcode="abc124" quantity="2" mass="2" retprice="100" VATrate="10" barcode="4645625213138" article="2" returns="0" governmentCode="">Sword</item>
       <item code="34421" extcode="abc125" quantity="3" mass="0.3" retprice="50" VATrate="18" barcode="2345625213126" article="3" returns="0">Yellow rattler</item>
+
       <item code="34421" extcode="abc125" quantity="3" mass="0.3" retprice="50" VATrate="18" barcode="2345625213126" itemcode="44123" article="3" returns="0" governmentCode="">Jedi lightsaber</item>
 
   </items>
 
   </items>
 +
  <packages>
 +
      <package code="33331" strbarcode="ORD0000001" mass="1" message="" got="YES"></package>
 +
      <package code="33332" strbarcode="ORD0000002" mass="2.5" message="" got="NO"></package>
 +
  </packages>
 
  </order>
 
  </order>
</statusreq>  
+
</statusreq>
 
</source>
 
</source>
  
'''A response example in the absence of orders'''
+
'''No Orders'''
  
 
<source lang="xml">
 
<source lang="xml">
Строка 454: Строка 672:
 
</source>
 
</source>
  
'''A response example in case of the authorization error'''
+
'''Authorization Error'''
  
 
<source lang="xml">
 
<source lang="xml">
Строка 463: Строка 681:
 
</source>
 
</source>
  
'''A response example in case of the syntax error'''  
+
'''Syntax Error'''  
  
 
<source lang="xml">
 
<source lang="xml">
Строка 472: Строка 690:
 
</source>
 
</source>
  
=== Status response fields description ===
+
=== Response Fields ===
All the fields of response correspond with order structure when creating an order, with some additions:  
+
 
 +
All response fields correspond to the [[#Example of New Order|order creating request]] structure, with the following additions:
 +
 
 +
* The '''order''' container attributes:
 +
:* '''''awb''''' — number of the courier company packing slip.
 +
:* '''''orderno2''''' — number of the packing slip in the courier service urgent delivery subsystem.
 +
:* '''''ordercode''''' — order internal code, for internal use.
 +
:* '''''givencode''''' — order internal code, for internal use.
 +
 
 +
* The '''''code''''' attribute of the '''item''' container — internal order line code, for interal use.
 +
:* '''''returns''''' is the amount of the article rejected by the recipient. It is not 0 only in case of partial refusal.
 +
* The '''''got''''' attribute of the '''package''' container — indicates whether a package is accepted. Possible values: YES, NO.
 +
:* '''''returns''''' is the amount of the article rejected by the recipient. It is not 0 only in case of partial refusal.
 +
* '''''coords''''' in '''receiver''' container — recipient location coordinates.
 +
* '''''deliveryPIN''''' in '''receiver''' container — PIN.
 +
* '''pickup''' —  indicates whether it is a pickup order. Possible values: '''YES''', '''NO'''. If '''YES''', the entire order is considered to be the assignment for pickup, not for delivery.
 +
* '''currcoords''' — current order location cordinates. Its attributes are:
 +
:* '''''lat''''' — latitude
 +
:* '''''lon''''' — longitude
 +
:* '''''accuracy''''' — location accuracy in meters
 +
:* '''''RequestDateTime''''' — date and time of the latest location update.
 +
* '''courier''' — information on the courier who carries the order. If the order is not out for delivery, plan courier data is shown.
 +
* '''waittime''' — courier waiting time.
 +
* '''deliveryprice''' — cost of delivery denominated in the customer`s currency. It has the following attributes:
 +
:* '''''total''''' — total delivery cost.
 +
:* '''''delivery''''' — one-way trip cost.
 +
:* '''''return''''' — return trip cost (if '''order''' > '''return=YES''').
 +
The '''deliveryprice''' tag includes  value-added services. The option is available for the Premium and Maximum courier service account plans:
 +
:* '''''advprice''''' — value-added service name.
 +
:* '''''code''''' — value-added service code.
 +
:* '''''price''''' — value-added service amount.
 +
 
 +
* '''status''' — delivery status. See the list of statuses below. It has the following attributes:
 +
:* '''''eventstore''''' — courier service branch which set the current status.
 +
:* '''''eventtime''''' — time of latest status change as in the current branch timezone.
 +
:* '''''createtimegmt''''' — status change entry created in the datatbase, GMT. Used to arrange the entries in chronological order.
 +
:* '''''message''''' — name of a recipient branch. Used in case of order transfer between branches.
 +
:* '''''title''''' — name of the status in Russian.
  
* ''order'' container attributes:
+
* '''statushistory''' — history of delivery statuses. It contains the list of '''status''' containers. It is filled in only for Premium and Maximum plans.
:* '''''ordercode''''' is an internal code of the order in the system which is applied for some internal operations.
+
* '''customstatecode''' — internal status code of a courier service. Please, check with the courier service for its values. They are assigned by the courier service in '''References''' > '''Statuses''' > '''15 Shipment statuses'''. The reference is not transferred to the client via API due to possible presence of delivery service internal statuses in it.
:* '''''givencode''''' is an internal code of the order in the system which is applied for some internal operations.
+
* '''clientstatecode''' — client status code. It is used if client submits their own codes of delivery statuses and reasons for non-delivery.
:* '''''returns''''' is the amount of a certain product unit which a receiver has refused. It will have a non-zero value only in case of a partial refusal.  
+
* '''deliveredto''' — actual information on delivery or a reason for non-delivery.
 +
* '''delivereddate''' — actual delivery date.
 +
* '''deliveredtime''' — actual delivery date. It can be empty in case of non-delivery.
 +
* '''arrival''' — scheduled delivery date formatted as YYYY-MM-DD HH:MM:SS.
 +
* '''outstrbarcode''' — service partner system code (in an external system). It is used for integration with external systems.
 +
* '''partner''' — current branch or service partner.
 +
* '''return_message''' — return information.
 +
* '''department''' —  the order creator's department.
  
* '''''code''''' attribute of '''item''' container is an internal code of order string in the system which is applied for some internal operations.
+
The '''status''' container can have the following values:
* '''''coords''''' in '''receiver''' container indicates receiver position.  
+
: AWAITING_SYNC — Awaiting for sync. Order is not in the courier company database yet.
* '''currcoords''' indicates current order position. Its attributes are:
+
: '''NEW''' — Created, submitted to the courier company.
:* '''''lat''''' is latitude
+
: NEWPICKUP — Pickup created.
:* '''''lon''''' is longitude
+
: PICKUP — Picked up from sender.
:* '''''accuracy''''' indicates the degree of accuracy in meters
+
: WMSASSEMBLED — Order is picked at the fulfillment center.
:* '''''RequestDateTime''''' is date/time of the latest position update.  
+
: WMSDISASSEMBLED — Order is unpicked at the fulfillment center.
* '''deliveryprice''' is the price of delivery in the customer`s settlement currency.  
+
: '''ACCEPTED''' — Received by warehouse.
* '''status''' is a delivery status (see the list of statuses below). It has the following attributes (they are filled in starting from version 2008.0.0.670 of the system):
+
: CUSTOMSPROCESS — Customs clearance.
:* '''''eventstore''''' is a branch which the following status is related to
+
: CUSTOMSFINISHED — Customs clearance complete.
:* '''''eventtime''''' is the time of status change (time of status change depends on the location of a branch)
+
: CONFIRM — Delivery is scheduled.
:* '''''createtimegmt''''' is the time of the actual status change (GMT)
+
: UNCONFIRM — Failed to arrange for delivery time.
:* '''''message''''' is the name of a receiving branch in case of a transfer between branches 
+
: DEPARTURING — Warehouse transfer planned.
:* '''''title''''' is the name of a status in Russian
+
: DEPARTURE — Warehouse transfer shipped.
 +
: INVENTORY — Inventory. Made sure the shipment is in the warehouse.
 +
: PICKUPREADY — Available for pickup at the pickup point.
 +
: '''DELIVERY''' — Out for delivery.
 +
: COURIERDELIVERED — Delivered (as reported by courier). Confirmation by manager is expected to change status to COMPLETE.
 +
: COURIERPARTIALLY — Partially delivered (as reported by courier). Confirmation by manager is expected to change status to PARTIALLY.
 +
: COURIERCANCELED — Refused (as reported by courier). Confirmation by manager is expected to change status to COURIERRETURN.
 +
: COURIERRETURN — Returned to warehouse by courier. The courier failed to deliver the order to recepient and returned it to the warehouse. This is an intermediate status, the manager is to check whether the order is to be delivered again (DATECHANGE/DELIVERY) or this is a final non-delivery (CANCELED).
 +
: DATECHANGE — Rescheduled.
 +
: '''COMPLETE''' — Delivered.
 +
: '''PARTIALLY''' — Partially delivered.
 +
: '''CANCELED''' — Not delivered (Returned/Canceled). The order must be returned to sender.
  
* '''statushistory''' is the history of delivery statuses. It contains the list of '''status''' containers. It is filled in only for “Premium” plan starting from version 2008.0.0.670 of the system.  
+
: RETURNING — Return to sender planned (after CANCELED).
* '''customstatecode''' is an internal status code of a delivery service. Please, check with the delivery service for its values. They are assigned by the delivery service in “Guides” - “Statuses” - “15 Correspondence statuses” section. The guide is not transferred to the client via API due to a possible presence of delivery service technological statuses in it.  
+
: RETURNED — Returned to sender.
* '''clientstatecode''' is a customer`s status code.  It is used in case a customer is transferring his codes of delivery/reasons for non-delivery statuses.
+
: LOST — Lost.
* '''deliveredto''' is the information on delivery or a reason for non-delivery. 
 
* '''delivereddate''' is the date of delivery.
 
* '''deliveredtime''' is the time of delivery. It can be left empty in case of non-delivery.
 
* '''outstrbarcode''' is a contractor`s code (the order code within an external system). It is used in integrations with external systems.  
 
  
'''status''' container can have the following values:
+
''Note:'' The set of currently used statuses may be expanded and changed in the future.
: NEW - New 
 
: ACCEPTED - Received by the warehouse
 
: INVENTORY - Inventory
 
: DEPARTURING - Dispatch is planned
 
: DEPARTURE - Dispatched from the warehouse
 
: DELIVERY - Given to the courier to be delivered
 
: COURIERDELIVERED - Delivered (to be confirmed)
 
: COMPLETE - Delivered
 
: PARTIALLY - Partially delivered
 
: COURIERRETURN - Returned by the courier. The courier couldn`t deliver the order to the receiver and returned it back to the warehouse. This is an intermediate status after which the manager is checking whether the courier has to make another attempt to deliver the order or this is a final non-delivery.
 
: CANCELED - Not delivered (Return/Cancellation)
 
: RETURNING - Return is planned
 
: RETURNED - Returned
 
: CONFIRM - Dispatch is confirmed
 
: DATECHANGE - Postponement 
 
: NEWPICKUP - Pickup is created
 
: UNCONFIRM - Dispatch has not been confirmed
 
: PICKUPREADY - Ready for pickup
 
  
''Note:'' The set of currently used statuses may be expanded and charged in the future. 
 
 
<div style="color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
 
<div style="color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
 +
# '''statushistory''' and '''deliveryprice''' are filled in for [[Courier Service Account#Personal Account Functions|Premium and Maximum]] courier service account plans only.
 +
# The sequence of statuses is not fixed. For example, you can get the COMPLETE status and then NEW because an operator marked the order completed by mistake and then corrected it.
 +
</div>
  
'''Please, note!'''
+
=== Get Latest Changed Statuses ===
  
# '''status''' container attributes should be specified for system version '''2008.0.0.670''' and newer ones.
+
To see only latest changed statuses, once in a while send the request (see the example below). API returns all the orders with recently changed statuses and some other attributes. You save the status information for each order in your system and confirm the receipt by sending the <code>commitlaststatus</code> request. MeaSoft marks these statuses as received by you and does not return them again. Thus, no matter how many orders is in process, you can get their actual statuses by using only 2 requests.
# '''statushistory''' is filled in for tariff. "[[Member_area #.D0.9F.D0.BE.D0.B4.D0.BA.D0.BB.D1.8E.D1.87.D0.B5.D0.BD.D0.B8.D0.B5|Premium]]" as well as for system version '''2008.0.0.670''' and newer ones.
 
</div>
 
<br />
 
  
=== Newly changed statuses transfer ===
+
Getting latest changed statuses  
Send a query for getting newly changed statuses  
 
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
Строка 540: Строка 789:
 
   <auth extra="8" login="login" pass="pass"></auth>
 
   <auth extra="8" login="login" pass="pass"></auth>
 
   <changes>ONLY_LAST</changes>
 
   <changes>ONLY_LAST</changes>
   <quickstatus>NO</quickstatus>
+
   <streamid>1234</streamid>
</statusreq>
+
</statusreq>
 
</source>
 
</source>
  
 
The system will display all orders that have at least one of the fields changed since the time of the last query in this mode:
 
The system will display all orders that have at least one of the fields changed since the time of the last query in this mode:
 +
Returns all the orders with at least one of the following fields changed since the last status request sent in this mode:
 
  orderno
 
  orderno
 
  status
 
  status
Строка 554: Строка 804:
 
  price
 
  price
  
After successful response processing it is necessary to mark received statuses as successfully received ones sending the following query
+
If the response is processed successfully, use the following request to mark the returned statuses as successfully received ones:
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<commitlaststatus>
 
<commitlaststatus>
 
   <auth extra="8" login="login" pass="pass"></auth>
 
   <auth extra="8" login="login" pass="pass"></auth>
 +
  <client>CLIENT</client>
 +
  <streamid>1234</streamid>
 
</commitlaststatus>
 
</commitlaststatus>
 
</source>
 
</source>
  
If successful you will get the following response
+
'''Query Fields'''
 +
 
 +
* '''auth''' — Authorization. Required.
 +
* '''streamid''' - stream ID. If you get order statuses for multiple integrations, pass this parameter to divide getting statuses and sending confirmation. The value must be from 100 up to 10000. It is an optional element.
 +
*'''client''' —  indicates whether it is a client or a delivery service partner. It is an optional element. Possible values:
 +
:*'''CLIENT''' — the default value.
 +
:*'''AGENT''' — delivery service partner. Response contains information on the orders tendered for delivery.
 +
 
 +
If successful you will get the following response:
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
<commitlaststatus>
+
<commitlaststatus error="0">OK</commitlaststatus>
  <error error="0" errormsg="OK"></error>
 
</commitlaststatus>
 
 
</source>
 
</source>
  
This way of status transfer ensures a complete and correct status transfer even in case the status has changed in the time period between statuses` query and confirmation of their receipt. If the system hasn`t received the confirmation of a successful status transfer, it will consider this information to be not delivered and will display it in case of a requery.  
+
This way ensures a complete and correct status transfer even if the status has changed in the time period between the request and receipt confirmation.
 +
 
 +
If you do not confirm successful status receipt, the information will be returned again on the next request.  
  
 
<div style="color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
 
<div style="color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
'''Please, note!'''
+
# When this way of data transfer is used (<changes>ONLY_LAST</changes>), the system reviews the orders created for the last 3 months. No information on the orders created earlier returns.
 +
# The system always returns the current status. It means you can get the NEW status returned for the first request, and the COMPLETE status for your second request. A shipment could have gone through several intermediate statuses in between the request.
 +
# The sequence of statuses is not fixed. For example, you can get the COMPLETE status and then NEW because an operator marked the order completed by mistake and then corrected it.
 +
</div>
  
# When this way of data transfer is used (<changes>ONLY_LAST</changes>), the system is reviewing those orders that have been checked out for the last 3 months. In case there is an order that has been checked out before this period, then status change for this order won`t get into the list of results of this query execution.
+
== Tracking Order by Number ==
# The system always returns a current status, i. e., you can get "NEW" status for your first query and "COMPLETE" status - for your second query. A dispatch could have gone through several intermediate statuses in between queries.
+
 
# The system can never guarantee the order going through a set of statuses successively, i. e., you can get "COMPLETE" status after your first query and "NEW" status after your second query - such things can happen in case when, for example, the operator has mistakenly marked an order as a completed one and then corrected his mistake.  
+
Request for tracking order by number is intended to provide minimal anonymized information about a certain order to a non-authorized user.
</div>
 
<br />
 
  
== Order tracking by its number ==
+
MeaSoft allows unauthorized access to tracking at htttp://home.courierexe.ru/{client extra code}/tracking. This interface is designed to show information to a human user.
  
Query for order tracking by number is intended to provide minimal anonymized information about a certain order to a non-authorized user.  Our system has its own interface for this which is available at the following URL: "home.courierexe.ru/{extra code}/tracking". You can either create a link to such page at your web-site or put as an iframe there or create your own page and use our API. This interface is specially designed to issue information to a human web-site user. You need to use "statusreq" query, desirably with changes=ONLY_LAST parameter in order to obtain statuses of orders into your information system!
+
You can create a link to such page at your web site, or place an iFrame, or create your own page and use our API. To receive order statuses in your information system, use <code>statusreq</code> request, the <code>changes=ONLY_LAST</code> parameter is recommended.
  
'''A query example:'''
+
'''Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 594: Строка 855:
 
</source>
 
</source>
  
'''A response example:'''
+
'''Response Example:'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 600: Строка 861:
 
   <order orderno="1234">
 
   <order orderno="1234">
 
     <sender>
 
     <sender>
       <town code="1">Moscow city</town>
+
       <town code="1" country="RU">Moscow city</town>
       <date></date>
+
       <date>2021-03-22</date>
 +
      <time_min>09:00</time_min>
 +
      <time_max>14:00</time_max>
 
     </sender>
 
     </sender>
 
     <receiver>
 
     <receiver>
       <town code="1">Moscow city</town>
+
       <town code="1" country="RU">Moscow city</town>
      <date>2015-04-18</date>
+
    <zipcode>125480</zipcode>
 +
    <date>2021-03-22</date>
 +
    <time_min>09:00</time_min>
 +
    <time_max>14:00</time_max>
 
     </receiver>
 
     </receiver>
     <weight>0</weight>
+
    <price>387.5</price>
     <quantity>1</quantity>
+
    <inshprice>387.5</inshprice>
     <currcoords lat="" lon="" accuracy="" RequestDateTime="" />
+
    <paytype>CASH</paytype>
    <status eventstore="Saint-Petersburg branch" eventtime="2016-06-02 17:22:00" createtimegmt="2016-06-03 16:14:44" message="" title="Delivered">COMPLETE</status>
+
     <weight>5.1</weight>
    <statushistory>
+
     <quantity>2</quantity>
      <status eventstore="Moscow office" eventtime="2016-05-30 10:20:00" createtimegmt="2016-06-03 16:14:44" message="" title="New">NEW</status>
+
     <service>2</service>
      <status eventstore="Moscow office" eventtime="2016-06-01 17:38:00" createtimegmt="2016-06-03 16:14:44" message="Saint-Petersburg branch" title="Dispatch is planned">DEPARTURING</status>
+
    <type>3</type>
      <status eventstore="Moscow office" eventtime="2016-06-01 19:53:00" createtimegmt="2016-06-03 16:14:44" message="Saint-Petersburg branch" title="Dispatched from the warehouse">DEPARTURE</status>
+
    <return>NO</return>
      <status eventstore="Saint-Petersburg branch" eventtime="2016-06-02 07:41:00" createtimegmt="2016-06-03 16:14:44" message="" title="Received by the warehouse">ACCEPTED</status>
+
    <return_service>2</service>
      <status eventstore="Saint-Petersburg branch" eventtime="2016-06-02 09:17:00" createtimegmt="2016-06-03 16:14:44" message="" title="Given to the courier to be delivered">DELIVERY</status>
+
    <return_date></return_date>
      <status eventstore="Saint-Petersburg branch" eventtime="2016-06-02 17:22:00" createtimegmt="2016-06-03 16:14:44" message="" title="Delivered (to be confirmed)">COURIERDELIVERED</status>
+
    <return_time></return_time>
      <status eventstore="Saint-Petersburg branch" eventtime="2016-06-02 17:22:00" createtimegmt="2016-06-03 16:14:44" message="" title="Delivered">COMPLETE</status>
+
    <return_message></return_message>
    </statushistory>
+
    <waittime>12</waittime>
 +
    <enclosure>Kids toys</enclosure>
 +
    <instruction>Check in the presence of the buyer, sign acceptance certificate</instruction>
 +
    <deliveryprice total="158.6" delivery="100.00" return="58.6" />
 +
    <courier>
 +
    <code>26</code>
 +
    <name>Katie Summerhill</name>
 +
    <phone>+79161234567</phone>
 +
    </courier>
 +
  <currcoords lat="55.680327" lon="37.604456" accuracy="50" RequestDateTime="2021-04-21 18:07:45" />
 +
  <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="">COMPLETE</status>
 +
  <statushistory>
 +
    <status eventstore="Moscow office" eventtime="2021-05-30 10:20:00" createtimegmt="2021-06-03 16:14:44" message="">NEW</status
 +
    <status eventstore="Moscow office" eventtime="2021-06-01 17:38:00" createtimegmt="2021-06-03 16:14:44" message="Branch office">DEPARTURING</status>
 +
    <status eventstore="Moscow office" eventtime="2021-06-01 19:53:00" createtimegmt="2021-06-03 16:14:44" message="Branch office">DEPARTURE</status>
 +
    <status eventstore="Branch office" eventtime="2021-06-02 07:41:00" createtimegmt="2021-06-03 16:14:44" message="">ACCEPTED</status>
 +
    <status eventstore="Branch office" eventtime="2021-06-02 09:17:00" createtimegmt="2021-06-03 16:14:44" message="">DELIVERY</status>
 +
    <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="">COURIERDELIVERED</status>
 +
    <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="">COMPLETE</status>
 +
  </statushistory>
 +
  <deliveredto>Mary Smith, secretary</deliveredto>
 +
  <delivereddate>2021-06-02</delivereddate>
 +
  <deliveredtime>17:22</deliveredtime>
 +
  <outstrbarcode>EXT123456</outstrbarcode>
 +
  <items>
 +
      <item code="34533" extcode="abc123" quantity="1" mass="0.2" retprice="37.5" VATrate="0" barcode="2345625213125" article="1" returns="0" origincountry="040" GTD="" excise="0.00" governmentCode="11223311" suppcompany="Miller and Company" suppINN="1112223334" suppphone="79161234567">Princess house</item>
 +
      <item code="34456" extcode="abc124" quantity="2" mass="2" retprice="100" VATrate="10" barcode="4645625213138" article="2" returns="0" governmentCode="">Sword</item>
 +
      <item code="34421" extcode="abc125" quantity="3" mass="0.3" retprice="50" VATrate="18" barcode="2345625213126" article="3" returns="0" governmentCode="">Jedi lightsaber</item>
 +
  </items>
 
   </order>
 
   </order>
 
</tracking>
 
</tracking>
 
</source>
 
</source>
  
The function is searching for the last order among the orders of all customers by its number. It provides anonymized information on a current state of the order. <br />
+
'''Get Info in 17 TRACK Format'''
The description of response containers is similar to the description of [[API#.D0.97.D0.B0.D0.BF.D1.80.D0.BE.D1.81_.D1.81.D1.82.D0.B0.D1.82.D1.83.D1.81.D0.B0_.D0.B7.D0.B0.D0.BA.D0.B0.D0.B7.D0.BE.D0.B2|Order status query]].
 
  
 +
'''Request Example'''
  
== Status change by agent ==
+
<?xml version="1.0" encoding="UTF-8"?>
 +
<tracking17>
 +
  <extra>8</extra>
 +
  <orderno>1234</orderno>
 +
</tracking17>
  
Order change status query allows finding out the final status of the order - "Delivered" or "Not delivered (Return/Cancellation)."
+
'''Request Example'''
  
Besides that, date and time (in necessary) of status change as well as a type of message in "Information on delivery" field are set.  
+
{
 +
"number":"ExtNumber",
 +
"oriNumber":"1234",
 +
"oriCountry":"RU",
 +
"destCountry":"RU",
 +
"status":"Complete",
 +
"events":[
 +
{
 +
"time":"2021-06-02 17:22:00",
 +
"location":"RU",
 +
"content":"Complete"
 +
},
 +
{
 +
"time":"2021-06-02 17:22:00",
 +
"location":"RU",
 +
"content":"Courierdelivered"
 +
},
 +
{
 +
"time":"2021-06-02 09:17:00",
 +
"location":"RU",
 +
"content":"Delivery"
 +
},
 +
{
 +
"time":"2021-06-02 07:41:00",
 +
"location":"RU",
 +
"content":"Accepted"
 +
},
 +
{
 +
"time":"2021-06-01 19:53:00",
 +
"location":"RU",
 +
"content":"Departure"
 +
},
 +
{
 +
"time":"2021-06-01 17:38:00",
 +
"location":"RU",
 +
"content":"Departuring"
 +
},
 +
{
 +
"time":"2021-05-30 10:20:00",
 +
"location":"RU",
 +
"content":"New"
 +
}
 +
]
 +
  }
  
If necessary, images can be attached to the order information.  
+
The function searches for the latest order among the orders of all clients by its number. It provides anonymized information on the current state of the order.
 +
 
 +
Response containers are similar to the [[#Order Status|Order Status Request]].
 +
 
 +
== Changing Order ==
 +
The request is intended to edit the orders that are not in process yet — there was no changes of shipment or delivery status or delivery time, etc.
 +
 
 +
You can only edit orders if the courier service uses the Premium or Maximum [[Courier Service Account#Personal Account Functions|personal account plan]]. To enable order editing, in the courier service account go to '''Settings''' > '''Parameters''' > '''Advanced''' and select the '''Allow canceling and editing orders''' check box.
 +
 
 +
<div style="color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
 +
# The edit request must contain all order data as if the order is being created for the first time.
 +
# If the edit request is missing an item, the item is not removed from the order, but its quantity becomes 0.
 +
# If an order is being edited via API and in MeaSoft desktop application at the same time, only the changes made in the desktop applications are applied.
 +
</div>
 +
 
 +
Planned courier might be canceled utomatically once an order is edited. It depends on the value set in '''References''' > '''Variables''' > '''Shipments''' > '''Automatically assign courier by area''':
 +
* '''No''' — courier is not changed on editing orders via API.
 +
* '''Area''' — courier is canceled on changing delivery address.
 +
* '''Area or delivery date''' — courier is canceled on changing delivery address or delivery date.
 +
 
 +
=== Edit Request Fields ===
 +
All request fields correspond to the [[#Creating Order|order creating request structure]], except for:
 +
* specify the <code>editorder</code> instead of the <code>neworder</code> root tag.
 +
* do not specify the <code>barcode</code> tag as it is assigned when creating an order.
 +
* for <code>item</code> items, specify the item internal code in the <code>code</code> attribute. To receive the internal code, use the [[#Order Status|order status]] request.
 +
 
 +
You cannot change the '''orderno''' value using this method.
 +
 
 +
=== Edit Response Fields ===
 +
All response fields correspond to the [[#Creating Order|order creating response structure]], except for:
 +
*the <code>editorder</code> tag is returned instead of <code>neworder</code>.
 +
 
 +
== Canceling Order ==
 +
 
 +
The request is intended to cancel the orders that are not in process yet — there was no changes of shipment or delivery status or delivery time, etc.
 +
 
 +
You can only cancel orders if the courier service uses the Premium or Maximum [[Courier Service Account#Personal Account Functions|personal account plan]]. To enable order canceling, in the courier service account go to '''Settings''' > '''Parameters''' > '''Advanced''' and select the '''Allow canceling and editing orders''' check box.
 +
 
 +
Once an order is canceled, the '''Delivery info''' field is filled in with '''Canceled by client''', the '''Delivery date''' is filed in with the current date, the '''Delivered by''' is filled in with system entry CANCEL.
 +
 
 +
'''Order Cancelation Example'''
  
'''The example of a status change response:'''
 
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
<setorderinfo>
+
<cancelorder>
 +
  <auth extra="8" login="login" pass="pass" />
 +
  <order orderno="" ordercode="123456" />
 +
  <order orderno="123aaa" ordercode="" />
 +
</cancelorder>
 +
</source>
 +
 
 +
'''Order Cancelation Fields'''
 +
 
 +
'''cancelorder''' — root container. Required.
 +
* '''auth''' — authorization. Required.
 +
* '''order''' — container of the order being canceled. Required. The request can contain more than one '''order'''. It has the following attributes:
 +
:* '''''orderno''''' — external order code.
 +
:* '''''ordercode''''' — internal order code.
 +
Either '''''orderno''''' or '''''ordercode''''' is required.
 +
 
 +
'''Response Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<cancelorder>
 +
  <order orderno="123test" ordercode="123456" error="0" errormsg="OK" />
 +
  <order orderno="123aaa" ordercode="" error="52" errormsg="order not found" />
 +
</cancelorder>
 +
</source>
 +
 
 +
== Adding Files to Order ==
 +
 
 +
'''Request Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<addattachments>
 
   <auth extra="8" login="login" pass="pass" />
 
   <auth extra="8" login="login" pass="pass" />
   <order ordercode="123456" date="2018-03-01" time="10:00" message="The customer has refused from the purchase"/>
+
   <orderno>1234567</orderno>
   <order ordercode="234567" date="2018-03-01" time="10:00" message="">
+
   <attachments>
     <image filename="filename1.jpg">/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAA0JCgsKCA0LCgsODg0PEyAVExISEy
+
    <item name="photo1.jpg">JVBERi0xLjMN1wb25lbnQgMQ
     ccHhcgLikxMC4pLSwzOko+MzZGNywtQFdBRkxOUlNSMj5aYVpQYEpRUk//2wBDAQ4ODhMREyYVFSZPNS01T09PT09PT09P
+
    JUBQREYwMTIzNDU2Nzg5IDI NMyAwIG9iag08PA0vVHlwZSA
     T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0//wAARCAYACAADASIA</image>
+
    U3VidHlwZSAvSW1hZ2UNL1d pZHRoIDE4MDgNL0hlaWdodCA
   </order>
+
    ggNCAwIFINL0JpdHNQZXJDb 21wb25lbnQgMQ0vRGVjb2RlU
</setorderinfo>
+
    ENL0NvbHVtbnMgMTgwOA0+P g0vSW1hZ2VNYXNrIHRydWUNL
 +
    XhEZWNvZGUNPj4Nc3RyZWFt DQ</item>
 +
     <item name="photo2.jpg">VBERi0xLjMNAwIG9iag0HRoJ
 +
    JUBQREYwMTIzNDU2Nzg5IDI NMyAwIG9iag08PA0vVHlwZSA
 +
    vWE9iamVjdA0vU3VidHlwZS AvSW1hZ2UNL1dpZHRoIDEzNj
 +
    gNL0hlaWdodCAxMzMzDS9MZ W5ndGggNCAwIFINL0JpdHNQZ
 +
     XJDb21wb25lbnQgMQ0vRGVj b2RlUGFybXMgPDwNL0sgLTEN
 +
     L0NvbHVtbnMgMTM2OA0+Pg0 vSW</item>
 +
   </attachments>
 +
</addattachments>
 
</source>
 
</source>
  
  
'''The description of status response fields:'''
+
'''Fields Description'''
  
'''setorderinfo''' is a root container. It is a mandatory element.
+
'''addattachments''' root container. Required.
*'''auth''' is authorization. It is a mandatory element.  
+
*'''auth''' authorization. Required.
*'''order''' is order container. It is a mandatory element. A query may contain more than one '''order''' container. It has the following attributes:
+
*'''orderno''' order number. Required. You can use tag <code>ordercode</code> to specify order internal code.
:* '''''ordercode''''' is an internal code of an order.
+
*'''attachments''' — file data. Required.
:* '''''date''''' is status change date.  
+
**'''item''' — base64 encoded binary file data. Required.
:* '''''time''''' is status change time. 
+
***'''name''' — an '''item''' attribute that contains the file name. Required.
:* '''''message''''' is message text.  
 
  
*'''image''' is an attached image container. It contains image file text coded according to ''base64'' standard. '''order''' container may contain more than one '''image''' container. It has the following attribute:
+
 
:* '''''filename''''' is a file name.
+
'''Response Example'''
'''The example of a response:'''
 
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<setorderinfo>
+
<addattachments>
   <order ordercode="123456" error="0" errormsg="OK" errormsgru="Successfully" />
+
   <attachments>
  <order ordercode="234567" error="59" errormsg="value [date_put] is already set" errormsgru="The value [Date of delivery] is already set" />
+
    <item name="photo1.jpg" error="0" errormsg="OK" />
</setorderinfo>
+
    <item name="photo2.jpg" error="0" errormsg="OK" />
 +
  </attachments>
 +
</addattachments>
 
</source>
 
</source>
  
 +
== Getting Order Files ==
  
 +
'''Request Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<attachments>
 +
  <auth extra="8" login="login" pass="pass" />
 +
  <orderno>1234567</orderno>
 +
</attachments>
 +
</source>
  
== Cancellation of order ==
+
'''Fileds Description'''
  
Cancel request is intended to be used for cancellation of those orders about which no changes have been made - like delivery status, correspondence status and delivery time - in other words, those orders which are not being processed.
+
'''attachments''' — Root container. Required.
 +
*'''auth''' — authorization. Required.
 +
*'''orderno''' — order number or code. Required.
  
In case of order cancellation “Delivery information” field gets the value “Cancelled by the customer” and “Delivery date” field gets a current date.
 
  
 +
'''Response Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<attachments>
 +
  <item name="doc1.docx" size="35654">JVBERi0xLjMN
 +
  JUBQREYwMTIzNDU2Nzg5IDI NMyAwIG9iag08PA0vVHlwZSA
 +
  U3VidHlwZSAvSW1hZ2UNL1d pZHRoIDE4MDgNL0hlaWdodCA
 +
  ggNCAwIFINL0JpdHNQZXJDb 21wb25lbnQgMQ0vRGVjb2RlU
 +
  ENL0NvbHVtbnMgMTgwOA0+P g0vSW1hZ2VNYXNrIHRydWUNL
 +
  XhEZWNvZGUNPj4Nc3RyZWFt DQ</item>
 +
  <item name="photo2.jpg" size="74861">VBERi0xLjMN
 +
  JUBQREYwMTIzNDU2Nzg5IDI NMyAwIG9iag08PA0vVHlwZSA
 +
  vWE9iamVjdA0vU3VidHlwZS AvSW1hZ2UNL1dpZHRoIDEzNj
 +
  gNL0hlaWdodCAxMzMzDS9MZ W5ndGggNCAwIFINL0JpdHNQZ
 +
  XJDb21wb25lbnQgMQ0vRGVj b2RlUGFybXMgPDwNL0sgLTEN
 +
  L0NvbHVtbnMgMTM2OA0+Pg0 vSW</item>
 +
</attachments>
 +
</source>
  
'''The example of a query for order cancellation:'''
+
The <code>item</code> tag contains base 64 encoded binary data (files).
 +
 
 +
== Changing Status by Service Partner ==
 +
 
 +
Order status change request allows to get the final status of the order — either '''Delivered''' or '''Not delivered (Returned/Canceled)'''.
 +
 
 +
Besides, the request gets date and time of status change, if necessary, and the '''Delivery info''' field message. 
 +
 
 +
You can attach images to the order.
 +
 
 +
'''Request Example:'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
<cancelorder>
+
<setorderinfo>
 
   <auth extra="8" login="login" pass="pass" />
 
   <auth extra="8" login="login" pass="pass" />
   <order orderno="" ordercode="123456" />
+
   <order ordercode="123456">
  <order orderno="123aaa" ordercode="" />
+
    <message>Accepted by Tailor</message>
</cancelorder>
+
    <outstrbarcode>7654312</outstrbarcode>
 +
  </order>
 +
  <order ordercode="234567">
 +
    <status>PICKUPREADY</status>
 +
    <eventtime>2021-05-30 10:20:00</eventtime>
 +
    <message>Client refused the order</message>
 +
    <paytype>CASH</paytype>
 +
    <items>
 +
      <item code="34533" quantity="1" reason="0" />
 +
      <item code="34456" quantity="0" reason="0" />
 +
      <item code="34421" quantity="2" reason="0" />
 +
    </items>
 +
    <image filename="filename1.jpg"> /9j/4AAQSkZJRgA
 +
    BAQAAAQABAAD/2wBDAA0JCg sKCA0LCgsODg0PEyAVExISEy
 +
    ccHhcgLikxMC4pLSwzOko+M zZGNywtQFdBRkxOUlNSMj5aY
 +
    VpQYEpRUk//2wBDAQ4ODhMR EyYVFSZPNS01T09PT09PT09P
 +
    T09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09
 +
    PT09PT0//wAARCAYACAADAS IA</image>
 +
  </order>
 +
</setorderinfo>
 
</source>
 
</source>
  
  
'''The description of status query fields:'''
+
'''Fields Description'''
  
'''cancelorder''' is a root container. It is a mandatory element.   
+
'''setorderinfo''' root container. Required.   
*'''auth''' is authorization. It is a mandatory element.
+
*'''auth''' authorization. Required.  
*'''order''' is a cancelled order container. It is a mandatory element. A query may contain more than one '''order''' container. It has the following attributes:
+
*'''order''' order container. Required. A request can contain more than one '''order''' container. It has the following attribute:  
:* '''''orderno''''' is order`s cipher.  
+
:* '''''ordercode''''' — an internal order code.
:* '''''ordercode''''' is an internal code of the order.
+
*'''status''' — new order status. It can be any [[#Response Fields|status]] excepting AWAITING_SYNC and NEW.
Please, note that at least one of ''orderno'' or ''ordercode'' attributes should be specified!
+
*'''eventtime''' — status change date and time. Required if status is specified. 
 +
*'''message''' — delivery info text.
 +
*'''outstrbarcode''' — code in service partner system (order code in external system). It is used in integrations with external systems.
 +
*'''paytype''' — order payment type. Possible values are '''CASH''' and '''CARD'''.
 +
*'''items''' — container that describes order items. It has the following attributes:
 +
:* '''''code''''' — item code.
 +
:* '''''quantity''''' — quantity of delivered articles.
 +
:* '''''reason''''' — reason for non-delivery. It is selected from the status list.
 +
*'''image''' — container for the image being attached. It contains base 64 encoded image file text. The '''order''' container can contain more than one '''image''' container. It has the following attribute:
 +
:* '''''filename''''' — file name.
  
 +
'''Response Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<setorderinfo>
 +
  <order ordercode="123456" error="0" errormsg="OK" />
 +
  <order ordercode="234567" error="59" errormsg="value [date_put] is already set" />
 +
</setorderinfo>
 +
</source>
  
'''The example of a response:'''
+
== Getting Documents for Printing ==
 +
 
 +
'''Get Print Forms Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
<cancelorder>
+
<waybill>
   <order orderno="123test" ordercode="123456" error="0" errormsg="OK" errormsgru="Successfully" />
+
   <auth extra="8" login="login" pass="pass" />
  <order orderno="123aaa" ordercode="" error="52" errormsg="order not found" errormsgru="The order is not found" />
+
  <orders>
</cancelorder>
+
    <order orderno="1234567" ordercode="33331" />
 +
    <order orderno="1234568" ordercode="33332" />
 +
  </orders>
 +
  <form>1</form>
 +
</waybill>
 +
</source>
 +
 
 +
'''Fields Description'''
 +
 
 +
'''waybill''' — is a root container. Required.
 +
*'''auth''' — is authorization. Required.
 +
*'''orders''' — list of orders to get print forms for. It contains tags '''order''' with the following attributes:
 +
** '''''orderno''''' — external order code.
 +
** '''''ordercode''''' — internal order code.
 +
*: Specify either of the attributes for all the orders. The '''''ordercode''''' attribute is recommended.
 +
*'''form''' — packing slip format. Optional. Possible values:
 +
:* '''1''' — detailed packing slip. Default value.
 +
:* '''2''' — Zebra label.
 +
:* '''3''' — A4 size label.
 +
:* '''4''' — delivery and acceptance certificate.
 +
 
 +
 
 +
'''Response Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<waybill>
 +
  <content>EODIcaI8KSBlwQ 4MnEOR7Px8U8EBAyGICBnwpw
 +
  IZhQgz0ZxuPs8EBM/GcbjzB AwhBl8hwQYIO00GmEwg1CeEG
 +
  mqYTChNU0wqf8l8nz4zgc+K fCno+zwU5GjOZmzXGcbEQYIM
 +
  4zkegRE40zWzONyoNNMIOIa cWnp6aDCGEGE9NQmoQd2mg00
 +
  79U4f3hPTwnfp6Sdrafeqpa JDpFw/1aYT077VNNNdO00G3q
 +
  mqqvp9p2E7T0/wiFemv8uG6 OM</content>
 +
</waybill>
 
</source>
 
</source>
  
== City names list ==
+
Note that print forms are not created for pickups.
  
'''The example of the city names list query:'''
+
The '''''content''''' tag contains base64 encoded binary data (PDF file).
 +
 
 +
== City Names List ==
 +
 
 +
'''City List Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 729: Строка 1260:
 
     <name>Moscow</name>
 
     <name>Moscow</name>
 
     <fullname>Moscow city</fullname>
 
     <fullname>Moscow city</fullname>
     <country>1</country>
+
     <country>RU</country>
 
   </conditions>
 
   </conditions>
 
   <limit>
 
   <limit>
Строка 739: Строка 1270:
 
</source>
 
</source>
  
All elements inside townlist container can either be absent or combine. The search is not case-sensitive.  
+
The <code>townlist</code> container can either be empty or combine elements. The search is case insensitive.
*'''codesearch''' is a search by codes. In case when it is used, conditions and limit containers will be ignored.  
+
*'''auth''' — authorisation, optional. Use it if the courier service set and enabled some location restrictions.
:* '''zipcode''' is a search by zip codes. Please, note that one zip code can be applicable to several localities. In this case the system will return several records.
+
*'''codesearch''' search by codes. When it is used, the <code>conditions</code> and <code>limit</code> containers are ignored.  
:* '''kladrcode''' is a search by 13-digit codes of All-Russian Classifier of Addresses.
+
:* '''zipcode''' search by postal codes. Note that one postal code can be applicable to more than one localities. In this case MeaSoft returns several records.
:* '''fiascode''' is a search by codes of Federal Information Address System (Address system used in Russia) (AOID).
+
:* '''kladrcode''' search by 13-digit code of All-Russian Classifier of Addresses.
:* '''code''' is a search by codes of the system.  
+
:* '''fiascode''' search by the code of Federal Information Address System (address system used in Russia) (AOGUID).
 +
:* '''code''' search by the system code.  
  
*'''conditions''' specifies search criteria. All enclose elements simultaneously impose “AND” condition.  
+
*'''conditions''' specifies search criteria. All nested elements simultaneously impose the AND condition.  
:* '''city''' is a search by all the localities of a region.  
+
:* '''city''' search for all the localities of a region.  
:* '''namecontains''' is a search of the localities which names contain a specified text.  
+
:* '''namecontains''' search for the localities with names including the search text.  
:* '''namestarts''' is a search of the localities which names start from a specified text.
+
:* '''namestarts''' search for the localities with names starting with the search text.
:* '''name''' is a search of the localities which names match a specified text.
+
:* '''name''' search for the localities with names matching the search text.
:* '''fullname''' is a search of the localities which names and type match a specified text.  
+
:* '''fullname''' search for the localities with names and type matching the search text.  
:* '''country''' is a search of the country with a specified zip code.  
+
:* '''country''' search in the country with the specified code only.  
  
*'''limit''' limits result output.  
+
*'''limit'''limits result output.  
:* '''limitfrom''' specifies the record number of a search result starting with which a response should be given. It equals 0 by default.  
+
:* '''limitfrom''' — defines the search result record number to start output with. The default value is '''0'''.  
:* '''limitcount''' specifies the number of search result records which should be returned. It equals 10000 by default.
+
:* '''limitcount''' — defines the quantity of search result records to show. The default value is '''10000'''.
:* '''countall''' - YES indicates the necessity of counting the amount of matches found. It may slow down the process of query execution. In case it is disabled, totalcount and totalpages values won`t be indicated in the response.  
+
:* '''countall''' — if '''YES''', the total quantity of found matches is counted. It might slow down the request execution. If disabled, <code>totalcount</code> and <code>totalpages</code> are missing in the response.  
  
'''The example of a response:'''
+
'''Response Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 767: Строка 1299:
 
     <city>
 
     <city>
 
       <code>23</code>
 
       <code>23</code>
       <name>Krasnodar Territory</name>
+
       <name>Krasnodar Krai</name>
 
     </city>
 
     </city>
 
     <name>Sochi city</name>
 
     <name>Sochi city</name>
    <shortname>Sochi</shortname>  (not yet supported)
+
    <fiascode>79da737a-603b-4c19-9b54-9114c96fb912</fiascode>
    <typename>city</typename>  (not yet supported)
+
    <kladrcode>2300000700000</kladrcode>
 +
    <shortname />  (not yet supported)
 +
    <typename />  (not yet supported)
 +
    <coords lat="43.5855" lon="39.7231" />
 
   </town>
 
   </town>
 
   <town>
 
   <town>
Строка 777: Строка 1312:
 
     <city>
 
     <city>
 
       <code>32</code>
 
       <code>32</code>
       <name>Bryanskaya oblast</name>
+
       <name>Bryansk District</name>
 
     </city>
 
     </city>
     <name>Sochilov farmstead</name>
+
     <name>Sochilov khutor</name>
     <shortname>Sochilov</shortname>
+
     <fiascode>c9c96c67-2cc9-4f10-afde-fd32417ea216</fiascode>
     <typename>farmstead</typename>
+
    <kladrcode>3201900011100</kladrcode>
 +
    <shortname />
 +
     <typename />
 +
    <coords lat="52.6407" lon="33.1724" />
 
   </town>
 
   </town>
 
   <town>
 
   <town>
Строка 787: Строка 1325:
 
     <city>
 
     <city>
 
       <code>60</code>
 
       <code>60</code>
       <name>Pskov oblast</name>
+
       <name>Pskov District</name>
 
     </city>
 
     </city>
 
     <name>Sochikhino village</name>
 
     <name>Sochikhino village</name>
     <shortname>Sochikhino</shortname>
+
     <fiascode>10df7588-19c1-49d1-a387-9de1cf3eb26f</fiascode>
     <typename>village</typename>
+
    <kladrcode>6001900015400</kladrcode>
 +
    <shortname />
 +
     <typename />
 +
    <coords lat="56.6003" lon="29.3542" />
 
   </town>
 
   </town>
 
</townlist>
 
</townlist>
 
</source>
 
</source>
  
In a response cities and towns are sorted by their popularity, importance (district centers, etc.) and only after that - alphabetically.  
+
In the response, the cities and towns are arranged by their popularity, importance (district centers, etc.) and then by alphabet.
  
== Region names list ==
+
== Region Names List ==
  
'''The example of the region names list query:'''
+
'''Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 808: Строка 1349:
 
   </codesearch>
 
   </codesearch>
 
   <conditions>
 
   <conditions>
     <namecontains>Territory</namecontains>
+
     <namecontains>Krai</namecontains>
 
     <namestarts>Mosc</namestarts>
 
     <namestarts>Mosc</namestarts>
     <fullname>Moscow region</fullname>
+
     <fullname>Moscow Oblast</fullname>
 
     <country>1</country>
 
     <country>1</country>
 
   </conditions>
 
   </conditions>
Строка 816: Строка 1357:
 
</source>
 
</source>
  
'''The example of a response:'''
+
'''Response Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 829: Строка 1370:
 
       <ShortName2>RUS</ShortName2>
 
       <ShortName2>RUS</ShortName2>
 
     </country>
 
     </country>
     <name>Agin-Buryat Autonomous Area</name>
+
     <name>Agin-Buryat Autonomous Okrug</name>
 
   </city>
 
   </city>
 
   <city>
 
   <city>
Строка 845: Строка 1386:
 
</source>
 
</source>
  
== Street names guide ==
+
== Street Names List ==
  
'''The example of the city names list query:'''
+
'''Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<streetlist>
 
<streetlist>
 
   <conditions>
 
   <conditions>
     <town>Moscow city</town>  // MANDATORY FIELD!
+
     <town>Moscow city</town>  // REQUIRED FIELD
 
     <namecontains>Khokhlo</namecontains>
 
     <namecontains>Khokhlo</namecontains>
 
     <namestarts>Academician K</namestarts>
 
     <namestarts>Academician K</namestarts>
Строка 866: Строка 1407:
 
</source>
 
</source>
  
*'''conditions''' specifies search criteria. All enclose elements simultaneously impose “AND” condition.
+
*'''conditions''' search criteria. All nested elements simultaneously impose the AND condition.
:* '''town''' is a mandatory field. It`s the name or the code of a locality.
+
:* '''town''' — required field. It is the name or the code of a locality.
:* '''namecontains''' is a search of the localities which names contain a specified text.
+
:* '''namecontains''' search for the streets with names including the search text.
:* '''namestarts''' is a search of the localities which names start from a specified text.
+
:* '''namestarts''' search for the streets with names starting with the search text.
:* '''name''' is a search of the localities which names match a specified text.
+
:* '''name''' search for the streets with names matching the search text.
:* '''fullname''' is a search of the localities which names and type match a specified text.
+
:* '''fullname''' search for the streets with names and type matching the search text.
  
 
*'''limit''' limits result output.  
 
*'''limit''' limits result output.  
:* '''limitfrom''' specifies the record number of a search result starting with which a response should be given. It equals 0 by default.  
+
:* '''limitfrom''' — defines the search result record number to start output with. The default value is '''0'''.  
:* '''limitcount''' specifies the number of search result records which should be returned. It equals 10000 by default.
+
:* '''limitcount''' — defines the quantity of search result records to show. The default value is '''10000'''.
:* '''countall''' - YES indicates the necessity of counting the amount of matches found. It may slow down the process of query execution. In case it is disabled, totalcount and totalpages values won`t be indicated in the response.  
+
:* '''countall''' — if '''YES''', the total quantity of found matches is counted. It might slow down the request execution. If disabled, <code>totalcount</code> and <code>totalpages</code> are missing in the response.  
  
'''The example of a response:'''
+
'''Response Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 890: Строка 1431:
 
</source>
 
</source>
  
In a response names of the streets are sorted in alphabetical order.  
+
In the response, the street names are arranged alphabetically.
  
== Nomenclature list ==
+
== List of Goods ==
  
'''The example of the nomenclature list query:'''
+
'''Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
Строка 907: Строка 1448:
 
       <namecontains>TV set</namecontains>
 
       <namecontains>TV set</namecontains>
 
       <namestarts>sony</namestarts>
 
       <namestarts>sony</namestarts>
       <name>Sony KDL-55W905 LCD television</name>
+
       <name>Sony KDL-55W905 LCD TV</name>
 
       <quantity>EXISTING_ONLY</quantity>
 
       <quantity>EXISTING_ONLY</quantity>
 
     </conditions>
 
     </conditions>
 +
    <except>
 +
      <code>123478</code>
 +
    </except>
 
     <limit>
 
     <limit>
 
       <limitfrom>30</limitfrom>
 
       <limitfrom>30</limitfrom>
Строка 918: Строка 1462:
 
</source>
 
</source>
  
All elements inside itemlist container can either be absent or combine. The search is not case-sensitive.  
+
The <code>townlist</code> container can either be empty or combine elements. The search is case insensitive.
*'''codesearch''' is a search by codes. In case when it is used, conditions and limit containers will be ignored.
+
*'''codesearch''' search by codes. When it is used, the <code>conditions</code> and <code>limit</code> containers are ignored.
:* '''code''' is a search by codes of the system.
+
:* '''code''' —  search by internal system code.
:* '''article''' is a search by article numbers.  
+
:* '''article''' search by SKU ID.  
:* '''barcode''' is a search by barcodes.  
+
:* '''barcode''' —  search by barcode.
 +
 
 +
*'''conditions''' — specifies search criteria. All nested elements simultaneously impose the AND condition.
 +
:* '''namecontains''' — search for the goods with names containing the search text.
 +
:* '''namestarts''' — search for the goods with names starting from the search text.
 +
:* '''name''' — search for the goods with names matching the search text.
 +
:* '''quantity''' — availability of goods in the warehouse. Sometimes, the field may be unavailable. Possible values:
 +
*** '''EXISTING_ONLY''' — only in stock.
 +
*** '''NOT_EXISTING_ONLY''' — only out of stock.
 +
*** '''ALL''' — all.
 +
:* '''store''' — search by the specified warehouse.
  
*'''conditions''' specifies search criteria. All enclose elements simultaneously impose “AND” condition.
+
*'''except''' — exception description for correct counting of reserved items.
:* '''namecontains''' is a search of the goods which names contain a specified text.
+
*'''code''' — order code.
:* '''namestarts''' is a search of the goods which names start from a specified text.
 
:* '''name''' is a search of the goods which names match a specified text.
 
:* '''quantity''' is the availability of goods at the warehouse. It can have the following values: EXISTING_ONLY - only in stock, NOT_EXISTING_ONLY - only stock out, ALL - all. ''In some setups this field may be unavailable.''
 
  
*'''limit''' limits result output.
+
*'''limit''' limits result output.
:* '''limitfrom''' specifies the record number of a search result starting with which a response should be given.
+
:* '''limitfrom''' — defines the search result record number to start output with.
:* '''limitcount''' specifies the number of search result records which should be returned.  
+
:* '''limitcount''' — defines the quantity of search result records to show.  
  
'''The example of a response:'''
+
'''Response Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 942: Строка 1493:
 
     <article>FD343</article>
 
     <article>FD343</article>
 
     <barcode>2345625213125</barcode>
 
     <barcode>2345625213125</barcode>
     <name>Sony KDL-55W905 LCD television</name>
+
     <name>Sony KDL-55W905 LCD TV</name>
 
     <retprice>65000</retprice>
 
     <retprice>65000</retprice>
 +
    <purchprice>50000</purchprice>
 
     <weight>5.1</weight>
 
     <weight>5.1</weight>
 
     <length>50</length>
 
     <length>50</length>
 
     <width>30</width>
 
     <width>30</width>
 
     <height>40</height>
 
     <height>40</height>
 +
    <VATrate>20</VATrate>
 
     <CountInPallet>30</CountInPallet>
 
     <CountInPallet>30</CountInPallet>
 
     <HasSerials>1</HasSerials>
 
     <HasSerials>1</HasSerials>
 
     <CountryOfOrigin>Malaysia</CountryOfOrigin> (not yet supported)
 
     <CountryOfOrigin>Malaysia</CountryOfOrigin> (not yet supported)
     <Message>A good TV set</Message>
+
     <Message>A good TV</Message>
     <Message2>Another good TV set</Message2>
+
     <Message2>Another good TV</Message2>
 
     <quantity>12</quantity>
 
     <quantity>12</quantity>
 
     <reserved>3</reserved>
 
     <reserved>3</reserved>
Строка 960: Строка 1513:
 
</source>
 
</source>
  
'''The description of fields:'''
+
'''Fields Description'''
*'''code''' is an internal identifier assigned by the system.  
+
*'''code''' internal identifier assigned by the system.  
*'''article''' is an article assigned by a customer (a supplier).   
+
*'''article''' — supplier SKU ID. 
*'''barcode''' is a manufacturer`s barcode.  
+
*'''barcode''' — manufacturer barcode.
 +
*'''name''' — item name.
 +
*'''retprice''' — default retail price. When creating the order, the price specified in the order is used.
 +
*'''purchprice''' — purchase price.
 +
*'''weight''' — weight in kilograms.
 +
*'''length''' — length in centimeters. 
 +
*'''width''' — width in centimeters.   
 +
*'''height''' — height in centimeters.
 +
*'''VATrate''' — value-added tax rate, integer.
 +
*'''CountInPallet''' — number of pieces in a pallet. 
 +
*'''HasSerials''' — indicates whether serial numbers tracking is used. Possible values: '''1''' — Yes, '''0''' — No.
 +
*'''CountryOfOrigin''' — name of the country of origin.
 +
*'''Message''' — comment.
 +
*'''Message2''' — additional comment.
 +
*'''quantity''' — quantity in stock. Goods picked up for orders are not included in this number, they are considered to be shipped. ''This field may be unavailable in some setups.''
 +
*'''reserved''' — quantity of goods reserved. It may outnumber the stock balance if customers are waiting for the next delivery. ''This field may be unavailable in some setups.''
 +
 
 +
== Goods Movement ==
 +
 
 +
'''Request Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<itemmovements>
 +
<auth extra="8" login="login" pass="pass"></auth>
 +
<code>4259</code>
 +
<datefrom>2020-10-01</datefrom>
 +
<dateto>2020-10-02</dateto>
 +
</itemmovements>
 +
</source>
 +
 
 +
*'''code''' — internal item code in the list of goods.
 +
*'''datefrom''' — period start date.
 +
*'''dateto''' — period end date.
 +
You can specify either code or period, or both code and period.
 +
 
 +
 
 +
'''Response Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<itemmovements count="16">
 +
  <itemmovement>
 +
    <code>151500</code>
 +
    <date>2020-10-01</date>
 +
    <retprice>0</retprice>
 +
    <quantity>1</quantity>
 +
    <delivered>0</delivered>
 +
    <item>
 +
      <code>4259</code>
 +
      <name>Jenga Classic Game</name>
 +
    </item>
 +
    <status>
 +
      <code>5</code>
 +
      <name>Return from customer</name>
 +
    </status>
 +
    <store>
 +
      <code>1</code>
 +
      <name>Moscow office</name>
 +
    </store>
 +
    <order>
 +
      <ordercode>3374830</ordercode>
 +
      <number>123660-0</number>
 +
      <date>2020-10-01</date>
 +
      <orderno>14123</orderno>
 +
      <barcode>0000000670</barcode>
 +
      <company>All Games</company>
 +
      <address>Thompson str., 88</address>
 +
      <delivereddate>2020-05-29</delivereddate>
 +
      <deliveredtime>12:00:00</deliveredtime>
 +
      <deliveredto />
 +
    </order>
 +
    <document>
 +
      <code>21991</code>
 +
      <number>318</number>
 +
      <date>2020-05-26</date>
 +
      <message></message>
 +
    </document>
 +
  </itemmovements>
 +
</itemlist>
 +
</source>
 +
 
 +
'''Fields Description'''
 +
*'''code''' — goods movement internal transaction code.
 +
*'''date''' — transaction date.
 +
*'''retprice''' — item price.
 +
*'''quantity''' — item quantity in the movement transaction.
 +
*'''delivered''' — quantity of delivered items.
 +
 
 +
*'''item''' — goods item container.
 +
:* '''code''' — item internal code.
 +
:* '''name''' — item name.
 +
 
 +
*'''status''' — transaction status container.
 +
:* '''code''' — status code.
 +
:* '''name''' — name.
 +
 
 +
*'''store''' — container for the branch that performs the transaction.
 +
:* '''code''' — branch code.
 +
:* '''name''' — branch name.
 +
 
 +
*'''order''' — shipment container.
 +
:* '''ordercode''' — internal order code.
 +
:* '''number''' — order number.
 +
:* '''date''' — order date.
 +
:* '''orderno''' — external order code.
 +
:* '''barcode''' — barcode.
 +
:* '''company''' — company.
 +
:* '''address''' — address.
 +
:* '''delivereddate''' — date delivered.
 +
:* '''deliveredtime''' — time delivered.
 +
:* '''deliveredto''' — delivery info or reason for non-delivery.
 +
 
 +
*'''document''' — transaction document container.
 +
:* '''code''' — internal document code.
 +
:* '''number''' — document number.
 +
:* '''extnumber''' — external document number.
 +
:* '''date''' — document date.
 +
:* '''message''' — comment.
 +
 
 +
== Getting Shipping Rates for Towns and Cities ==
 +
 
 +
<div style="color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
 +
If the <code>nofederal</code> parameter is missing in the request, Moscow is processed in the following way: the response contains Moscow and Moscow region towns and distance markup.
 +
</div>
 +
 
 +
'''Request Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<tariffs>
 +
<auth extra="8" login="login" pass="pass" />
 +
<townfrom>Moscow</townfrom>
 +
<service>1</service>
 +
<mainonly>1</mainonly>   
 +
</tariffs>
 +
</source>
 +
 
 +
*'''auth''' — the '''extra''' attribute is required, it is used to determine the courier service company.
 +
*'''townfrom''' — sender town or city. If it is not passed, the default value is '''Moscow'''.
 +
*'''service''' — delivery mode. Required.
 +
*'''mainonly''' — optional. If passed, the response contains data from the '''Inter-city''' > '''Zones''' table only.
 +
* '''nofederal''' — optional. If passed, a city of federal importance is processed as an ordinary city.
 +
 
 +
 
 +
'''Response Example'''
 +
<source lang="json">
 +
{
 +
    "townfrom": "0c5b2444-70a0-4932-980c-b4dc0d3f02b5",
 +
    "service": 1,
 +
    "tariffs": [
 +
        {
 +
            "towntofias": "0c5b2444-70a0-4932-980c-b4dc0d3f02b5",
 +
            "towntocode": 1,
 +
            "towntoname": "Moscow city",
 +
            "distance": 0,
 +
            "pricedistance": 0,
 +
            "pricesnew": {
 +
                "before": [
 +
                    {
 +
                        "price": "100",
 +
                        "every": "0",
 +
                        "mass": "1"
 +
                    },
 +
    {
 +
                        "price": "150",
 +
                        "every": "0",
 +
                        "mass": "5"
 +
                    }
 +
                ],
 +
                "after": [
 +
                    {
 +
                        "price": 0,
 +
                        "every": 1,
 +
                        "mass": 38.01
 +
                    },
 +
                    {
 +
                        "price": 15,
 +
                        "every": 1,
 +
                        "mass": 51.01
 +
                    }
 +
                ]
 +
            },
 +
            "deliveryPeriodMin": 1,
 +
            "deliveryPeriodMax": 2
 +
        }     
 +
    ]
 +
}
 +
</source>
 +
 
 +
'''Fields Description'''
 +
* '''townfrom''' — sender locality [[#City Names List|AOGUID]] (Federal Information Address System) code.
 +
* '''service''' — delivery mode.
 +
*'''tariffs''' — shipping rates list for the locality.
 +
:* '''towntofias''' — recipient locality AOGUID code.
 +
:* '''towntocode''' — recipient locality internal code.
 +
:* '''towntoname''' — recipient locality name.
 +
:* '''distance''' — distance in km from Moscow to Moscow Ring Road if <code>townfrom</code> is Moscow.
 +
:* '''pricedistance''' — Moscow to Moscow Ring Road distance markup if <code>townfrom</code> is Moscow..
 +
:* '''pricesnew''' — your shipping rates from the '''Inter-city''' > '''Rates by Zones''' table.
 +
::* '''before/after — containers.
 +
:::* '''price''' — price. If the response is for the <code>before</code> container, <code>pricedistance</code> is also added to the amount.
 +
:::* '''every''' — for every specified number of pieces.
 +
:::* '''mass''' — weight.
 +
:* '''prices''' — obsolete, do not use.
 +
:* '''deliveryPeriodMin''' — minimum number of days in transit.
 +
:* '''deliveryPeriodMax''' — maximum  number of days in transit.
 +
 
 +
== Receipt Items ==
 +
 
 +
'''Request Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<itemdoc>
 +
  <auth extra="8" login="login" pass="pass"></auth>
 +
<code>21991</code>
 +
</itemdoc>
 +
</source>
 +
 
 +
*'''code''' — internal receipt document code.
  
*'''name''' is an item name.
 
  
*'''retprice''' is a retail price value by default. When ordering the price which is mentioned in the order is used.
+
'''Response Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<itemdoc>
 +
  <code>21991</code>
 +
  <number>318</number>
 +
  <date>2021-05-26</date>
 +
  <message></message>
 +
  <items>
 +
    <item code="4259" quantity="1" barcode="200300" article="123555">Jenga Classic Game</item>
 +
  </items>
 +
</itemdoc>
 +
</source>
  
*'''weight''' is weight in kilograms.  
+
'''Fields Description'''
*'''length''' is length in centimeters.
+
* '''code''' — internal receipt code.
 +
* '''number''' — document number.
 +
* '''date''' — document date.
 +
* '''message''' — comment.
  
*'''width''' is width in centimeters.  
+
*'''item''' — goods item container.
 +
:* '''code''' — internal item code.
 +
:* '''barcode''' — item barcode.
 +
:* '''article''' — item SKU ID.
 +
:* '''quantity''' — quantity of received items.
  
*'''height''' is height in centimeters.
+
== Branches List ==
  
*'''CountInPallet''' is the number of pieces in a pallet.   
+
'''Request Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<storelist>
 +
  <auth extra="8"></auth>
 +
<json>YES</json>
 +
<client_code>7890</client_code>
 +
</storelist>
 +
</source>
  
*'''HasSerials''' requires serial numbers accounting. It takes on the following values: 1 - yes, 0 - no.  
+
*'''auth''' — the '''extra''' attribute is required, it is used to determine the courier service company.
 +
*'''json''' — indicates whether response is in JSON format. Possible values are '''YES''', '''NO'''.
 +
*'''client_code''' — courier service client code.
  
*'''CountryOfOrigin''' is the name of a country of origin in Russian.
+
'''Response Example'''
*'''Message''' is a commentary.
+
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<storelist count="2">
 +
  <store>
 +
    <code>123</code>   
 +
    <name>ABC</name>
 +
  </store>
 +
  <store>
 +
    <code>456</code> 
 +
    <name>Branch 2</name>
 +
  </store>
 +
</storelist>
 +
</source>
  
*'''Message2''' is an additional commentary.  
+
*'''code''' — branch code.
 +
*'''name''' — branch name.
  
*'''quantity''' is the number of goods in stock. Those goods that have already been batched into orders are not included in this number and considered to depart the depository for goods. ''This field may be unavailable in some setups.''
+
== Pickup Points List ==
  
*'''reserved''' is the number of goods reserved. It may outnumber stock balance if customers are waiting for the next delivery. ''This field may be unavailable in some setups.''
+
To show pickup points on the map, use the [https://home.courierexe.ru/js/measoft_map.js JavaScript module]. See help info in the file. See example [https://home.courierexe.ru/pvz_test.html here].
  
== The list of pick-up points ==
+
Unique pickup point requests are cached on the client account side and retained till 7 AM GMT+3 of the next day. For example, if a unique request with a mass of 2 kg was submitted today at 10 AM, tommorow at 7 AM it will be deleted. If you submit a mass of 2 kg in the same request today at 6 PM, you will get the same list of pickup points. If you submit a mass of 3 kg in the same request, you will probably get another list.
  
'''The example of a pick-points query:'''
+
'''Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<pvzlist>
 
<pvzlist>
 
  <auth extra="8" login="login" pass="pass"></auth>
 
  <auth extra="8" login="login" pass="pass"></auth>
  <town>Nizhniy Tagil</town>
+
<code>1234</code>
 +
<client_code>7890</client_code>
 +
<city>Sverdlovsk Oblast</city>
 +
  <town regioncode="66" country="RU">Nizhny Tagil</town>
 +
<parentcode>6</parentcode>
 +
<acceptcash>YES</acceptcash>
 +
<acceptcard>YES</acceptcard>
 +
<acceptfitting>YES</acceptfitting>
 +
<maxweight>30</maxweight>
 +
<acceptindividuals>YES</acceptindividuals>
 +
<lt>57.924737</lt>
 +
<lg>59.940019</lg>
 +
<rt>57.905682</rt>
 +
<rg>59.984669</rg>
 +
<json>YES</json>
 +
<limit>
 +
    <limitfrom>30</limitfrom>
 +
    <limitcount>2</limitcount>
 +
    <countall>YES</countall>
 +
</limit>
 
</pvzlist>
 
</pvzlist>
 
</source>
 
</source>
  
*'''town''' is a receiver`s residence.  
+
*'''auth''' — the '''extra''' attribute is required, it is used to determine the courier service company. '''login''' and '''pass''' allow to sign in as a client to apply the pickup points availability restrictions if they are set up for the client.
 +
*'''code''' — internal code.
 +
*'''client_code''' — courier service client code.
 +
*'''city''' - recipint region. You can specify a region code or a full region name from the '''Regions''' reference.
 +
*'''town''' — recipient location.
 +
:For the <code>town</code> tag, you can speify the value from the '''Regions''' reference in the <code>regioncode</code> attribute. The specified region is searched for the town.
 +
:In the <code>country</code> attribute, you can specify the recipient country according to the ISO 3166-1 standard. For example: "AT", "AUT" or "040" for Austria.
 +
*'''parentcode''' — parent [[#Branches List|branch]].
 +
*'''acceptcash''' — indicates whether cash on delivery is accepted. Possible values: '''YES''', '''NO'''.
 +
*'''acceptcard''' — indicates whether bank cards are accepted. Possible values: '''YES''', '''NO'''.
 +
*'''acceptfitting''' — indicates whether try-on is allowed. Possible values: '''YES''', '''NO'''.
 +
*'''maxweight''' — maximum weight allowed for the pickup point.
 +
*'''acceptindividuals''' — indicates whether pickup point is available for individuals. Possible values: '''YES''', '''NO'''.
 +
*'''lt''' — upper left corner latitude.
 +
*'''lg''' — upper left corner longitude.
 +
*'''rt''' — lower right corner latitude.
 +
*'''rg''' — lower right corner longitude.
 +
*'''json''' — indicates whether response is in JSON format. Possible values: '''YES''', '''NO'''.
 +
*'''limit''' — limits result output.
 +
:* '''limitfrom''' — defines the search result record number to start output with. The default value is '''0'''.
 +
:* '''limitcount''' — defines the quantity of search result records to show. The default value is '''100'''.
 +
:* '''countall''' — if '''YES''', the total quantity of found matches is counted. It might slow down the request execution. If disabled, <code>totalcount</code> is missing in the response.
  
  
'''The example of a response from the list of pick-up points:'''
+
'''Response Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
<pvzlist count="2">
+
<pvzlist count="2" totalcount="40465">
 
   <pvz>
 
   <pvz>
 
     <code>126</code>
 
     <code>126</code>
 
     <clientcode>3</clientcode>
 
     <clientcode>3</clientcode>
 
     <name>Nizhniy Tagil</name>
 
     <name>Nizhniy Tagil</name>
 +
    <parentcode>6</parentcode>
 +
    <parentname>Integration</parentname>
 +
    <town code="124267" regioncode="66" regionname="Sverdlovsk Oblast">Nizhniy Tagil city</town>
 
     <address>622036, 17 Tsiolkovsky Str., Nizhniy Tagil city</address>
 
     <address>622036, 17 Tsiolkovsky Str., Nizhniy Tagil city</address>
 
     <phone>+73435417709, +73435254989</phone>
 
     <phone>+73435417709, +73435254989</phone>
     <comment>5-storeyed apartment building with its end wall beside the highway, the second building from Parkhomenko-Tsiolkovsky street intersection.</comment>
+
     <comment>New pickup point</comment>
 +
    <worktime>Sun 10:00-16:00, Sat 10:00-16:00, Mon-Fri 10:00-20:00</worktime>
 +
    <traveldescription>5-storey apartment building, the second building from Parkhomenko-Tsiolkovsky street intersection.</traveldescription>
 +
    <maxweight>10</maxweight>
 +
    <acceptcash>YES</acceptcash>
 +
    <acceptcard>YES</acceptcard>
 +
    <acceptfitting>YES</acceptfitting>
 +
    <acceptindividuals>YES</acceptindividuals>
 +
    <latitude>57.93457</latitude>
 +
    <longitude>59.95131</longitude>
 +
    <uid>40606d00-9c51-11eb-b2c9-cfd6c1111392</uid>
 
   </pvz>
 
   </pvz>
 
   <pvz>
 
   <pvz>
 
     <code>245</code>
 
     <code>245</code>
 
     <clientcode>NTG1</clientcode>
 
     <clientcode>NTG1</clientcode>
     <name>At Krasnoarmeyskaya Street</name>
+
     <name>On Krasnoarmeiskaya</name>
     <address>79 KRASNOARMEYSKAYA STR.</address>
+
    <parentcode>6</parentcode>
 +
    <parentname>Integration</parentname>
 +
    <town code="124267" regioncode="66" regionname="Sverdlovsk Oblast">>Nizhniy Tagil city</town>
 +
     <address>Krasnoarmeiskaya, 79</address>
 
     <phone>+7(3435)379-044</phone>
 
     <phone>+7(3435)379-044</phone>
     <comment>Working hours: from Monday through Friday, from 9 a. m. till 6 p. m., on Saturday - from 10 a. m. till 2 p. m.</comment>
+
     <comment>Try-on is not allowed</comment>
 +
    <worktime>Sun 10:00-16:00, Sat 10:00-16:00, Mon-Fri 10:00-20:00</worktime>
 +
    <traveldescription>Next to McDonalds</traveldescription>
 +
    <maxweight>20</maxweight>
 +
    <acceptcash>YES</acceptcash>
 +
    <acceptcard>YES</acceptcard>
 +
    <acceptfitting>NO</acceptfitting>
 +
    <acceptindividuals>YES</acceptindividuals>
 +
    <latitude>57.93468</latitude>
 +
    <longitude>60.55476</longitude>
 +
    <uid>41116853-9c51-11eb-b2c9-cfd6c1451392</uid>
 
   </pvz>
 
   </pvz>
 
</pvzlist>
 
</pvzlist>
 
</source>
 
</source>
  
*'''code''' is a code of a pick-up point in the system. It is used in an [[API#Ordering|ordering]] query.
+
*'''code''' — pickup point code in MeaSoft. It is used in [[#Creating Order|creating order request]].
*'''clientcode''' is a code of a pick-up point used by a contracting company.  
+
*'''clientcode''' — pickup point code in service partner system.
*'''name''' is a name of a pick-up point.  
+
*'''name''' — pickup point name.
*'''address''' is a pick-up point`s address.  
+
*'''parentcode''' — pickup point parent code.
*'''phone''' are pick-up point phone numbers.  
+
*'''parentname''' — pickup point parent name.
*'''comment''' is additional information.  
+
*'''town''' — locality with code from [[#City Names List|City Names List]] and region code and name.
 +
*'''address''' — pickup point address.
 +
*'''phone''' — pickup point phone number.
 +
*'''comment''' — additional info.
 +
*'''worktime''' — pickup point working hours.
 +
*'''traveldescription''' — pickup point location description.
 +
*'''maxweight''' — maximum weight allowed for the pickup point.
 +
*'''acceptcash''' — indicates whether cash on delivery is accepted. Possible values: '''YES''', '''NO'''.
 +
*'''acceptcard''' — indicates whether bank cards are accepted. Possible values: '''YES''', '''NO'''.
 +
*'''acceptfitting''' — indicates whether try-on is allowed. Possible values: '''YES''', '''NO'''.
 +
*'''latitude''' — location latitude.
 +
*'''longitude''' — location longitude.
 +
*'''uid''' — pickup point unique ID in MeaSoft.
 +
*'''count''' — number of response records.
 +
*'''totalcount''' — total number of relevant records.
 +
 
 +
== Getting Order Fiscal Data ==
 +
 
 +
'''Request Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<receiptdata>
 +
  <auth extra="8" login="login" pass="pass" />
 +
  <orders>
 +
      <order orderno="123456" />
 +
      <order orderno="890111C" />
 +
  </orders>
 +
</receiptdata>
 +
</source>
 +
 
 +
'''Response Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<receipts count="1">
 +
  <receipt>
 +
      <orderno>123456</orderno>
 +
      <fdDatetime>2020-06-07 12:14:00</fdDatetime>
 +
      <fdValue>123</fdValue>
 +
      <fdNum>456</fdNum>
 +
      <fnSn>789</fnSn>
 +
      <kktNum>100</kktNum>
 +
      <inn>222</inn>
 +
      <ofdUrl>gate.ofd.ru</ofdUrl>
 +
      <fullUrl>https://check.ofd.ru/123</fullUrl>
 +
      <price>12345</price>
 +
      <lines count="1">
 +
        <line>
 +
            <item>1111764</item>
 +
            <name>Boots</name>
 +
            <qty>1</qty>
 +
            <price>1000</price>
 +
            <vatRate>20</vatRate>
 +
            <governmentCode>Z16513LK2</governmentCode>
 +
            <itemType>1</itemType>
 +
        </line>
 +
      </lines>
 +
  </receipt>
 +
</receipts>
 +
</source>
 +
 
 +
 
 +
'''Fields Description'''
 +
*'''orderno''' — order number.
 +
*'''fdDatetime''' — fiscal receipt issued date and time.
 +
*'''fdValue''' — fiscal document tag.
 +
*'''fdNum''' — fiscal document (receipt fiscal number).
 +
*'''fnSn''' — fiscal memory device number.
 +
*'''kktNum''' — cash registers number.
 +
*'''inn''' — TIN (taxpayer individual number).
 +
*'''ofdUrl''' — fiscal data operator URL address (domain name).
 +
*'''price''' — receipt amount.
 +
*'''fullUrl''' — receipt URL for online access.
 +
*'''lines''' — receipt items.
 +
:*'''item''' — item code.
 +
:*'''name''' — item name.
 +
:*'''qty''' — item quantity.
 +
:*'''price''' — item price.
 +
:*'''governmentCode''' — CHESTNYI Znak code sequence. It is processed by the 1162 tag algorithm.
 +
:*'''vatRate''' — item VAT rate.
 +
:*'''itemType''' — item type (goods, delivery, etc.)
  
== The list of types of priority ==
+
== Urgency Kinds List ==
  
'''The example of a type of priority query:'''
+
'''Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
Строка 1043: Строка 1998:
 
</source>
 
</source>
  
'''The example of a response from the list of types of priority:'''
+
'''Response Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
Строка 1053: Строка 2008:
 
   <service>
 
   <service>
 
     <code>2</code>
 
     <code>2</code>
     <name>Urgently</name>
+
     <name>Urgent</name>
 
   </service>
 
   </service>
 
</services>
 
</services>
 
</source>
 
</source>
  
== Delivery cost calculation ==
+
== Value-Added Services List ==
  
'''The example of a delivery cost query:'''
+
'''Request Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<advprices>
 +
  <auth extra="8" login="login" pass="pass" />
 +
  <visible>NO</visible>
 +
</advprices>
 +
</source>
 +
 
 +
'''advprices''' — root container. Required.
 +
*'''visible''' — indicates whether only the value-added services available in client account are returned. Optional. Possible values: '''Yes''', '''No'''. The default value is '''No'''.
 +
 
 +
 
 +
'''Response Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<advprices>
 +
  <advprice>
 +
      <code>1</code>
 +
      <name>Number of floors in the building</name>
 +
      <type>int</type>
 +
  </advprice>
 +
  <advprice>
 +
      <code>2</code>
 +
      <name>Markup coefficient </name>
 +
      <type>float</type>
 +
  </advprice>
 +
  <advprice>
 +
      <code>3</code>
 +
      <name>Heavy lift</name>
 +
      <type>bool</type>
 +
  </advprice>
 +
</advprices>
 +
</source>
 +
 
 +
Параметры:
 +
*'''code''' — internal service code.
 +
*'''name''' — service name. If in the '''Value-Added Services''' list the '''Name in client account''' column is not empty, the column value is returned.
 +
<!--*'''hine''' — value-added service hint for user.-->
 +
*'''type''' — service type. Possible values:
 +
:*'''bool''' — for services with the '''Check box''' input type.
 +
:*'''float''' — for services with the '''Float''' input type.
 +
:*'''int''' — for services with the '''Integer''' input type.
 +
 
 +
== Delivery Fee Calculation ==
 +
 
 +
'''Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<calculator>
 
<calculator>
  <auth extra="8" login="login" pass="pass" />
+
<auth extra="8" login="login" pass="pass" />
   <calc townfrom="Moscow" townto="3800000300000" mass="3.7" service="1" />
+
<order>
 +
  <pricetype>CUSTOMER</pricetype>
 +
   <sender>
 +
    <town>Moscow</town>
 +
    <address>Lenin street, 95</address>
 +
    <coords lat="55.621048" lon="37.604456"></coords>
 +
  </sender>
 +
  <receiver>
 +
    <zipcode>125480</zipcode>
 +
    <town regioncode="78" country="RU">Saint Petersburg</town>
 +
    <address>Petrovka 38 office 35</address>
 +
    <pvz>124</pvz>
 +
    <coords lat="55.680327" lon="37.604456"></coords>
 +
  </receiver>
 +
  <weight>5.1</weight>
 +
  <service>2</service>
 +
  <paytype>CASH</paytype>
 +
  <price>387.5</price>
 +
  <deliveryprice>150</deliveryprice>
 +
  <inshprice>387.5</inshprice>
 +
  <packages>
 +
      <package mass="1" quantity="5"></package>
 +
      <package mass="2.5" length="10" width="20" height="30"></package>
 +
  </packages>
 +
  <userid>user123</userid>
 +
  <groupid>customer</groupid>
 +
</order>
 
</calculator>
 
</calculator>
 
</source>
 
</source>
  
Parameters:
+
Parameters are the same as described in [[#Creating Order|Creating Order]].
*'''townfrom''' is a sending town. 
 
*'''townto''' is a receiving town.
 
*'''mass''' is weight in kilograms.
 
*'''service''' is a delivery mode - a number indicating the entry in the list of [The list of types of priority|types of priority]
 
  
In authorization login and pass parameters can be omitted, then calculation will be made according to a standard tariff rate of a delivery service with no account of possible differences for a certain customer. <br>
+
'''Fields Description'''
The name of a town (not recommended!), or its code from our list, or its 13-digit code of All-Russian Classifier of Addresses (Address Classifier used in Russia), or its 36-digit code of the Federal Information Address System (AOID) can be entered into the fields for a sending town and a receiving town. 
 
  
 +
*'''pricetype''' — price type. Possible values:
 +
** '''CUSTOMER''' — delivery price for end customer. The default value.
 +
** '''CLIENT''' — courier service price for client.
 +
*'''townfrom''' - sender location.
 +
*'''addressfrom''' — sender address.
 +
*'''zipcode''' — recipient postal code.
 +
*'''townto''' — recipient location.
 +
*'''addressto''' — recipient address.
 +
*'''pvz''' — pickup point code in MeaSoft.
 +
*'''l''' — length in cm. Optional.
 +
*'''w''' — width in cm. Optional.
 +
*'''h''' — height in cm. Optional.
 +
*'''mass''' — weight in kg.
 +
*'''service''' — delivery mode which is an integer specifying an '''Urgency Kinds''' list record. If the parameter is not specified, all available urgency kinds are calculated, with a lot of the <calc> containers in response.
 +
*'''price''' — cash on delivery amount.
 +
*'''inshprice''' — declared value amount.
 +
*'''paytype''' — payment type.
 +
*'''userid''' — user ID, either string or integer type. Virual field, optional. The field is used in the custom delivery rate settings. It defines the rule priority. You can use the field for CMS and CRM to set delivery fee for each customer individually.
 +
*'''groupid''' — user group ID, either string or integer type. Virual field, optional. The field is used in the custom delivery rate settings. It defines the rule priority. You can use the field for CMS and CRM to set delivery fee for each customer group individually.
  
 +
Cash on delivery amount, declared value amount, and CARD payment type are used in service percent calculations set up in the delivery rate card, on the '''Other''' tab.
  
'''The example of a cost of delivery response:'''
+
In authorization, you can omit the '''login''' and '''pass'''. In this case, the fee is calculated using courier service standard delivery rate, without taking into account possible differences for a certain client.
 +
 
 +
Dimensional weight is calculated only if all the dimensions are provided: length, width, heigth.
 +
 
 +
Sender and recipient location possible values:
 +
* location name (not recommended).
 +
* a code from the '''City Names''' list.
 +
* a 13-digit code of All-Russian Classifier of Addresses (Address Classifier used in Russia).
 +
* a 36-digit code of the Federal Information Address System (AOGUID). 
 +
 
 +
 
 +
'''Response Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 1088: Строка 2141:
 
     <townto code="56603">Irkutsk city</townto>
 
     <townto code="56603">Irkutsk city</townto>
 
     <mass>3.7</mass>
 
     <mass>3.7</mass>
     <service>1</service>
+
     <service name="Express">1</service>
 
     <zone>2</zone>
 
     <zone>2</zone>
     <price>1163</price>
+
     <price>1113</price>
 +
    <mindeliverydays>1</mindeliverydays>
 
     <maxdeliverydays>3</maxdeliverydays>
 
     <maxdeliverydays>3</maxdeliverydays>
 +
    <mindeliverydate>2020-05-13</mindeliverydate>
 +
    <deliveryprice>
 +
    <advprice code="1" price="1000">Base</advprice>
 +
    <advprice code="4" price="100">Amount percent</advprice>
 +
    <advprice code="5" price="63">Declared value percent</advprice>
 +
    <advprice code="6" price="-50">Discount on delivery</advprice>
 +
    </deliveryprice>
 
   </calc>
 
   </calc>
 
</calculator>
 
</calculator>
Строка 1097: Строка 2158:
  
 
Parameters:  
 
Parameters:  
*'''townfrom''' is a sending town name which has been recognized and assigned to the list of towns by the system. '''code''' attribute is a code from the list of towns in the system.
+
*'''townfrom''' — sender location as recognized and assigned to the list of cities by the system.  
*'''townto''' is a receiving town name which has been recognized and assigned to the list of towns by the system. '''code''' attribute is a code from the list of towns in the system.
+
**'''code''' —  a code from the '''City Names''' list.
*'''mass''' is weight in kilograms.  
+
*'''townto''' — recipient location as recognized and assigned to the list of cities by the system.  
*'''service''' is a delivery mode - a number indicating the entry in the list of [The list of types of priority|types of priority]
+
**'''code''' —  a code from the '''City Names''' list.
*'''service''' is a delivery mode - the number indicating a certain entry in the list of types of priority (See the description on this page).  
+
*'''mass''' weight in kilograms.  
*'''zone''' is the number of a tariff zone according to which the price has been calculated. The tariff schedule is selected depending on the tariff zone. Multiplying or decreasing coefficients can be applied to the price of delivery in case of order delivery not from/to a regional center.  
+
*'''service''' delivery mode which is an integer specifying an '''Urgency Kinds''' list record. If the parameter is not specified, all available urgency kinds are calculated, with a lot of the <calc> containers in response.
*'''price''' is a calculated delivery price in the currency of a delivery service`s price-list. It is recommended to be used rather than its homonymous attribute of the parent container.  
+
*'''zone''' number of the rate zone used in the calculation. The shipping rate schedule is selected depending on the zone. Coefficients can be applied to the shipping cost if the order is not delivered from or to a regional center.  
*'''maxdeliverydays''' is the maximum delivery period in business days.
+
*'''price''' — shipping cost in the currency of the courier service. We recommend that you use this parameter.  
 +
*'''maxdeliverydays''' maximum number of busines days in transit.
 +
*'''mindeliverydate''' — closest delivery date considering holidays.
 +
*'''deliveryprice''' — contains shipping cost details.
 +
 
 +
'''Note''': the actual server response contains the <code>price</code> attribute in the <code>calc</code> tag. It is retained for backward compatibility, use nested <code>price</code> tag instead.
 +
 
 +
== Getting Client Info ==
 +
 
 +
'''Request Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<client>
 +
  <auth extra="8" login="login" pass="pass" />
 +
</client>
 +
</source>
  
== The list of money transference certificates ==
+
'''client''' — root container. Required.
 +
*'''auth''' — authorization. Required.
  
'''The example of the query for the list of money transference certificates:'''
+
'''Response Example'''
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<client>
 +
  <code>1082</code>
 +
</client>
 +
</source>
 +
 
 +
*'''code''' — client code.
 +
 
 +
== List of Сash Transfer Certificates ==
 +
 
 +
'''Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<smalist>
 
<smalist>
 
   <auth extra="8" login="login" pass="pass" />
 
   <auth extra="8" login="login" pass="pass" />
   <datefrom>2016-02-10</datefrom>
+
   <datefrom>2021-02-10</datefrom>
   <dateto>2016-03-10</dateto>
+
   <dateto>2021-03-10</dateto>
 
</smalist>
 
</smalist>
 
</source>
 
</source>
  
'''smalist''' is a root container. It is a mandatory element.  
+
'''smalist''' root container. Required.  
*'''auth''' is authorization. It is a mandatory element.   
+
*'''auth''' authorization. Required.   
*'''datefrom''' is a date “from”. It is an optional element.  
+
*'''datefrom''' date from. Optional.  
*'''dateto''' is a date “to”. It is an optional element.  
+
*'''dateto''' date to. Optional.  
  
If the date range is not specified, then money transference certificates for the last month are returned.  
+
If the date range is not specified, cash transfer certificates for the last month are returned.  
  
'''The example of a response to the query for the list of money transference certificates:'''
+
'''Response Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 1132: Строка 2221:
 
     <code>6278</code>
 
     <code>6278</code>
 
     <number>3992</number>
 
     <number>3992</number>
     <actdate>2016-02-12</actdate>
+
     <actdate>2020-02-12</actdate>
 
     <datepay></datepay>
 
     <datepay></datepay>
 +
    <dateto>2020-02-12</dateto>
 +
    <promiseddatepay></promiseddatepay>
 
     <price>637.00</price>
 
     <price>637.00</price>
 +
    <pricecorr>113.00</pricecorr>
 
     <rur>13430.00</rur>
 
     <rur>13430.00</rur>
 
     <pricekur>570.00</pricekur>
 
     <pricekur>570.00</pricekur>
Строка 1140: Строка 2232:
 
     <payno>42423</payno>
 
     <payno>42423</payno>
 
     <paytype>1</paytype>
 
     <paytype>1</paytype>
 +
    <paytypename></paytypename> /not supported yet
 +
    <signedcopyreceived>NO</signedcopyreceived>
 
   </sma>
 
   </sma>
 
</smalist>
 
</smalist>
 
</source>
 
</source>
  
*'''code''' is a code of a money transference certificate.
+
*'''code''' — cash transfer certificate code.
*'''number''' is the number of a money transference certificate in the system.  
+
*'''number''' — cash transfer certificate number in MeaSoft.  
*'''actdate''' is a date of a money transference certificate.
+
*'''actdate''' date cash transfer certificate created.
*'''datepay''' is a date of payment on a money transference certificate.  
+
*'''datepay''' — date cash transfer certificate paid.
*'''price''' is a price of services.
+
*'''dateto''' — cash transfer certificate period end date.
*'''rur''' is a price of an order.  
+
*'''promiseddatepay''' — planned payment date.
*'''pricekur''' is a price of courier delivery.  
+
*'''price''' — cost of courier services.
*'''priceag''' is agent`s commission.  
+
*'''pricecorr''' — adjustment amount.
*'''payno''' is a number of a payment order.  
+
*'''rur''' order amount.  
*'''paytype''' is a type of payment: 1- non-cash payment, 2 - paying a courier in cash, 3 - paying cash at the office, 4 - wire transfer.  
+
*'''pricekur''' courier delivery cost.  
 +
*'''priceag''' — service partner fee.  
 +
*'''payno''' payment order number.  
 +
*'''paytype''' type of payment: 1 non-cash payment, 2 paying a courier in cash, 3 paying cash at the office, 4 — payment to bank card.
 +
*'''paytypename''' — payment type as string.
 +
*'''signedcopyreceived''' — indicates whether cash transfer certificate is returned. Possible values: '''YES''', '''NO'''.
  
== Detailing of money transference certificates ==
+
== Cash Transfer Certificate Breakdown ==
  
'''The examples of the query for money transference certificates detailing:'''
+
'''Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
Строка 1166: Строка 2265:
 
</source>
 
</source>
  
'''smadetail''' is a root container. It is a mandatory element.  
+
'''smadetail''' root container. Required.  
*'''auth''' is authorization. It is a mandatory element.
+
*'''auth''' authorization. Required.
*'''code''' is a code of a money transference certificate (See the query of the list of money transference certificates). It is a mandatory element.  
+
*'''code''' — cash transfer certificate [[#List of Сash Transfer Certificates|code]]. Required.  
  
'''The example of a response to the query of money transference certificates:'''
+
'''Response Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<smadetail count="1">
+
<smadetail count="2">
 
   <specialsma>
 
   <specialsma>
 
     <code>42494</code>
 
     <code>42494</code>
     <addresscode>14424</addresscode>
+
     <ordercode>14424</ordercode>
 +
    <orderno>11111</orderno>
 +
    <orderdate>2021-01-01</orderdate>
 +
    <delivereddate>2021-10-01</delivereddate>
 +
    <company>Company</company>
 
     <price>314.00</price>
 
     <price>314.00</price>
 
     <rur>8800.00</rur>
 
     <rur>8800.00</rur>
 +
    <inshprice>314.00</inshprice>
 
     <pricekur>270.00</pricekur>
 
     <pricekur>270.00</pricekur>
 
     <priceag>44.00</priceag>
 
     <priceag>44.00</priceag>
 
     <pricecalc>8486.00</pricecalc>
 
     <pricecalc>8486.00</pricecalc>
     <paytype>Cash on delivery</paytype>
+
     <paytype>2</paytype>
     <status>Delivered</status>
+
     <paytypename>paying a courier in cash</paytypename>
  </specialsma>
+
     <weight>0.400</weight>
  <specialsma>
+
     <distance>0.0</distance>
    <code>42495</code>
 
    <addresscode>14415</addresscode>
 
    <price>323.00</price>
 
    <rur>4630.00</rur>
 
     <pricekur>300.00</pricekur>
 
     <priceag>23.00</priceag>
 
    <pricecalc>4306.00</pricecalc>
 
    <paytype>Cash on delivery</paytype>
 
 
     <status>Delivered</status>
 
     <status>Delivered</status>
 
   </specialsma>
 
   </specialsma>
Строка 1199: Строка 2295:
 
</source>
 
</source>
  
*'''code''' is a code of the record.
+
*'''code''' — record code.
*'''addresscode''' is a code of the order.  
+
*'''ordercode''' — external order code.
*'''price''' is a price of service
+
*'''orderno''' — order cipher.
*'''rur''' is the amount of the order.  
+
*'''orderdate''' — order date.
*'''pricekur''' is a price of courier delivery.  
+
*'''delivereddate''' — delivery date.
*'''priceag''' is agent`s commission.  
+
*'''company''' — recipient.
*'''pricecalc''' is the amount to be transferred to the agent.  
+
*'''price''' — cost of courier services.
*'''paytype''' is a type of payment: 1- non-cash payment, 2 - paying a courier in cash, 3 - paying cash at the office, 4 - wire transfer.  
+
*'''rur''' — order amount.
*'''status''' is a status of the order.  
+
*'''inshprice''' — order cost.
 +
*'''pricekur''' courier delivery cost.
 +
*'''priceag''' — service partner fee.
 +
*'''pricecalc''' amount to pay to service partner.
 +
*'''paytype''' type of payment: 1 non-cash payment, 2 paying a courier in cash, 3 paying cash at the office, 4 — payment to bank card.
 +
*'''paytypename''' — payment type as string.
 +
*'''weight''' — order weight.
 +
*'''distance''' — order distance.
 +
*'''status''' — order status.
  
== Generation of short links ==
+
== URL Shortener ==
  
In some cases, for instance, when using them in SMS, the use of short links to member area may be required.  
+
Sometimes, you might want to use short links to client account. For instance, when sending an SMS to recipient.  
  
For doing that it is necessary to send a query containing a full link to which a response containing a hash code for a short link will be sent.  
+
To get a short URL, send a request with a full URL. Hash value for a short link is returned.  
  
'''The example of a query for short links generation:'''
+
'''Request Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8" ?>
 
<?xml version="1.0" encoding="UTF-8" ?>
Строка 1223: Строка 2327:
 
</source>
 
</source>
  
'''shortlink''' is a root container. It is a mandatory element.
+
'''shortlink''' root container. Required.
*'''link''' is a full link for generation of which a code should be obtained. It is a mandatory element. If '''short''' attribute equals 1, then a response won`t contain XML but only a hash code.  
+
*'''link''' — long link to shorten. Required. If '''short''' value is '''1''', the return contains only hash code, no XML.  
  
'''The example of a response to the query for short links generation:'''
+
'''Response Example'''
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Строка 1234: Строка 2338:
 
</source>
 
</source>
  
*'''hash''' is a hash code of a short link.
+
*'''hash''' — URL hash code.
 +
 
 +
Use it as client account URL:
 +
 
 +
<nowiki>https://home.courierexe.ru/35AF350C or curie.ru/35AF350C</nowiki>
 +
 
 +
'''Note'''. URL shortener is only for MeaSoft company sites.
 +
 
 +
== Recipient Rating Check ==
 +
 
 +
The check is available only for the Maximum personal account plan.
 +
 
 +
'''Request Example'''
 +
 
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<mcheck>
 +
  <auth extra="8" login="login" pass="pass" />
 +
  <phones>
 +
    <phone>89161147992</phone>
 +
  </phones>
 +
</mcheck>
 +
</source>
  
Further on the following link to member area can be used:
+
'''Response Example'''
  
<nowiki>https://home.courierexe.ru/35AF350C</nowiki>
+
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8" ?>
 +
<mcheck>
 +
  <phones>
 +
    <phone rate="90">89161147992</phone>
 +
  </phones>
 +
</mcheck>
 +
</source>

Текущая версия на 14:14, 23 апреля 2024

MeaSoft has an option of integration by means of XML API through HTTP POST protocol.

The API is designed for integrating customers (online shops and other companies ordering delivery) with courier services working under MeaSoft.

If you are an aggregator who transfers customer data and a courier service keeps separate accounts for settlements with each client, you will probably have to log in using different user accounts.

If you are a service partner and orders will be transferred to you from a delivery service, you can take the orders using clients=AGENTS in the statusreq query. For that purpose we have a platform for external integration but service partners can be added only on our side. Please, send us your commercial purpose, description of your service and we will gladly consider them.

When writing the given documentation we assume that a person reading it has the level of expertise in coding sufficient for understanding the contents of this documentation, has a knowledge of XML and integration development environment. If you are not qualified as a developer you will have to hire a professional developer to implement your project.

If you still have questions after reading the given documentation, feel free to ask them via e-mail support@courierexe.ru. In your email message, please introduce yourself, leave your contact information (your phone number, Skype login) and the name of the company you want to integrate with.

CMS Integrations

You can download the modules presented in the table to integrate with popular CMS.

The given modules are shared for free without any guarantee on the part of the developer. The online store bears full responsibility for correct data transfer. They modules are not intended for complete automation of your interaction with the courier service. They help online shop developers build integration with courier services. However, we will appreciate if you inform us about your needs or discrepancies found in our modules – this allows us to consider your demands when developing new versions of our modules.

Content Management System (CMS) Download Comment
Bitrix.png
Install Supports version 14.5 and higher.
Prestashop.png
Download Supports version 1.5.2.0 and higher (including 2.x)
OpencartOCStore.png
For version 1.5.5.1
For version 2.0
For version 2.3
For version 3.0
Supports version 1.5.5.1 and higher.
Select a module for your OpenCart version.
Alternative third-party module
Webasyst-shopscript.png
Install module
Install plugin
The module is designed for sending orders to delivery service, while the plugin calculates delivery cost on creating an order.
Insales.png
Configure using MeaSoft client account Guide
Leadvertex.png
Leadvertex-howto.png
Configure using Leadvertex account
Retailcrm.png
RetailCRM Configure using MeaSoft client account
1C.jpg
- Alternative third-party module
Joomla2.jpg
Download Integration with Virtuemart is available only.
Amocrm.png
Download
MoySclad.jpg
Integrate with MeaSoft
Alternative third-party module Alternative third-party module
Wordpress.jpg
Download
Cscart.png
Download Supports versions 4.10 and higher.
Webhook See here Transfer of status and order info to your system

Test Account

For debugging, you can access your test client account at

https://home.courierexe.ru/8
login login
password pass

In the Integration > Debug, you can execute API requests for debugging purposes and see sent requests. You will see all created orders on the Placed Orders tab.

To simplify the process of integration, you can download the example of addressing the service using PHP.

Account for Integration

You can access your client account at:

<auth extra="8" login="login" pass="pass"></auth>

Description:

  • extra — extra code, a unique identifier of the courier service.
  • login — user name for the client account and API.
  • pass — password for the client account and API.

Request the credentials from the courier service you are integrating with.

The courier service gives you a temporary password. For security purposes, change it using your client account.

Courier Service Access

To access API with courier service credentials, use the following connection string:

<auth extra="8" login="login" pass="pass" clientcode="123"></auth>

Description:

  • extra — extra code, a unique identifier of the courier service.
  • login — couerier service user name.
  • pass — couerier service password.
  • clientcode — internal client code (see the office application, the Clients tab, the "Internal code" column).

To see the extra code, login and password, in the office application go to the Additional Features reference. For more information, see Registering Courier Service Account.

General Terms

Courier service provides access to a web service at https://home.courierexe.ru/api/. "/" (slash) on the end of the link is required. Use the following credentials for test access:

login: login
password: pass
extra client code: 8

Note that the test platform is open for everyone. Do not submit orders containing confidential information as any authorized user can see them.

To set up a working integration, request credentials from the courier service you are integrating with.

In the client account, use the Integration menu item for debugging purposes and see sent requests.

A client sends requests to the service by using HTTP POST, the service processes these requests and sends the execution result back. All requests and responses are submitted in the XML format. The encoding used is UTF-8. Dot sign is used as a decimal symbol. Dates are formatted as YYYY-MM-DD, and time is formatted as HH:MM.

Due to some XML features, the following characters in the text should be replaced:

  • &lt; represents "<"
  • &gt; represents ">"
  • &amp; represents "&"
  • &quot; represents ".

Our API uses only HTTPS because it is a secure way to send sensible data.

However, in some systems it may lead to a failure. If your system cannot process encryption correctly, we recommend that you deploy a local HTTP server and set up a PHP proxy. How to use

The features described below are available according to your personal account plan.

Fair Usage Policy

To protect our service from improper use and DDoS attacks, we have defined fair usage levels:

  • 30 tracking queries from a single IP address per 1 minute (use statusreq).
  • 150 queries from a single IP address per 1 minute.
  • 1500 queries from a single IP address per 20 minutes.
  • 3000 queries from a single account per 1 hour.
  • 200 MB text data downloaded per 3 hours.
  • Number of non-existing order status queries must not exceed the number of queries of existing order statuses.

If a limit is exceeded, the IP address is blocked for up to 3 hours.

Actions that result in blocking your IP address or account:

  • Attacking our API with status queries with numbers of all you orders. Mind that the tracking queries are not intended for that, see description. These queries are especially bad at the top of the hour.
  • Sending queries like "Show statuses of all orders for the last 3 months" every 5 minutes.
  • Sending a large amount of order numbers trying to guess which one is valid.

Correct actions:

  • Queries are created for existing orders only.
  • To check order statuses, use statusreq queries with parameter changes=ONLY_LAST.
  • When requesting for changed statuses, you must confirm that the statuses were sucessfully received by query commitlaststatus.

Creating Order

Example of New Order

<?xml version="1.0" encoding="UTF-8"?>
<neworder newfolder="NO">
 <auth extra="8" login="login" pass="pass"></auth>
 <order orderno="111111">
   <barcode>111111</barcode>
   <sender>
     <company>Ministry of Internal Affairs</company>
     <person>I. I. Ivanov</person>
     <phone>123-45-67</phone>
     <town>Saint-Petersburg</town>
     <address>Petrovka Str., 38, room 35</address>
     <date>2021-03-22</date>
     <time_min>09:00</time_min>
     <time_max>14:00</time_max>
   </sender>
   <receiver>
     <company>Ministry of Internal Affairs</company>
     <person>Tom Wale</person>
     <phone>123-45-67</phone>
     <zipcode>125480</zipcode>
     <town regioncode="78" country="RU">Saint-Petersburg</town>
     <address>Petrovka Str., 38, room 35</address>
     <pvz>124</pvz>
     <inn>1112223335</inn>
     <date>2021-03-22</date>
     <time_min>09:00</time_min>
     <time_max>14:00</time_max>
     <deliveryPIN>1234</deliveryPIN>
     <coords lat="55.680327" lon="37.604456"></coords>
   </receiver>
   <return>NO</return>
   <weight>5.1</weight>
   <return_weight>5.1</return_weight>
   <quantity>2</quantity>
   <paytype>CASH</paytype>
   <service>2</service>
   <return_service>1</return_service>
   <type>3</type>
   <return_type>3</return_type>
   <courier>22</courier>
   <price>387.5</price>
   <deliveryprice VATrate="20">150</deliveryprice>
   <inshprice>387.5</inshprice>
   <receiverpays>NO</receiverpays>
   <discount>120</discount>
   <enclosure>Kids toys</enclosure>
   <instruction>Check in the presence of the buyer, sign acceptance certificate</instruction>
   <department>Accounting</department>
   <pickup>NO</pickup>
   <acceptpartially>NO</acceptpartially>
   <costcode>cc12345</costcode>
   <items>
      <item extcode="abc123" quantity="1" mass="0.2" retprice="37.5" VATrate="0" barcode="2345625213125" textArticle="1" article="1" volume="3" origincountry="AUT" GTD="321546654" excise="15.20" suppcompany="LLC &quot;Miller and Partners&quot;" suppphone="79161234567" suppINN="1112223334" governmentCode="11223311">Race car</item>
      <item extcode="abc124" quantity="2" mass="2" retprice="100" inshprice="100" VATrate="10" barcode="4645625213138" article="2" length="10" width="20" height="30" origincountry="004">Princess castle</item>
      <item extcode="abc125" quantity="3" mass="0.3" retprice="50" inshprice="50" barcode="2345625213126" itemcode="44123" article="3" type="1">Clay mass</item>
   </items>
   <packages>
      <package strbarcode="ORD0000001" mass="1" message="" quantity="3"></package>
      <package strbarcode="ORD0000002" mass="2.5" message="" length="10" width="20" height="30"></package>
   </packages>
   <deliveryset above_price="100" return_price="1000" VATrate="10">
      <below below_sum="500" price="500" />
      <below below_sum="2000" price="300" />
   </deliveryset>
   <advprices>
    <advprice>
       <code>1</code>
       <value>123</value>
    </advprice>
    <advprice>
       <code>2</code>
       <value>10.5</value>
    </advprice>
    <advprice>
       <code>3</code>
       <value>true</value>
    </advprice>
  </advprices>
  <overall_volume>81</overall_volume>
  <userid>user123</userid>
  <groupid>customer</groupid>
 </order>
</neworder>

Order Elements

Required Elements

For MeaSoft, only three fields are required:

  • either receiver->company or receiver->person
  • receiver->address
  • receiver->phone.

Courier service company can add required fields in the system settings. If you do not specify the required field values, an error message returns.

Example of order with minimum data

Fields Description

  • neworder — root container, required.
  • newfolder — attribute of a new order, possible values: YES, NO. If YES, a new order is created for the specified shipment in the courier service system. It is an optional element.
  • order — container used for description of one order, required. A single neworder container can have a number of order containers to create several orders by using one query.
  • orderno — order number. Specify it if it is assigned by the client. In case it is not assigned, this field can be left empty. The system will generate its own number and send it back in the response. The system checks whether the specified number has been used within the current calendar year. If it already exists in the system, the order is not created, error 17 "Such number exists" returns.
  • barcode — order barcode. In case the customer uses barcodes for his dispatches and the barcode is different from the order number, the barcode is entered into this field. In case there are several packages and they are individually marked, underscore character can be used as a mask to indicate barcoded item number varying for different packages within one order.

For example: There are 20 items in order No. 123 packed in 3 packages. The client generates 3 barcodes for each package: CLNT0012301, CLNT0012302, CLNT0012303, where CLNT is a client prefix, 00123 is an order number, 01-03 is the number for each package in the order. In this case CLNT00123__ should be entered into the barcode field. Thus, MeaSoft knows the last 2 characters can be any values and will display barcodes for the same order. If it is not you who will print packing slips with the specified barcode, the barcode must not exceed 25 characters, otherwise it cannot be fully seen on the standard printing forms.

  • sender — presents the information about order sender. It is an optional container.
   <sender>
     <company>Name of sender company</company>
     <person>Sender company contact person</person>
     <phone>Sender phone number, email</phone>
     <town>Sender location in the "[name] city" format</town>
     <address>Sender address</address>
     <date>Pickup date in the "YYYY-MM-DD" format</date>
     <time_min>Desired pickup time in the "HH:MM" format</time_min>
     <time_max>Desired pickup time in the "HH:MM" format</time_max>
   </sender>
  • receiver is the information about the recipient. Required.
   <receiver>
     <company>Name of the recipient company</company>
     <person>Recipient company contact person</person>
     <phone>Recipient phone number, email</phone>
     <town regioncode="Region code"> Recipient location in the "[name] city" format</town>
     <address>Recipient address</address>
     <date>Delivery date in the "YYYY-MM-DD" format</date>
     <time_min>Desired delivery time in the "HH:MM" format</time_min>
     <time_max>Desired delivery time in the "HH:MM" format</time_max>
   </receiver>
  • company is a recipient company.
  • person is a contact person's name. At least one field should be filled in – either company or person.
  • phone is a phone number. You can specify several phone numbers and emails.
  • town is the name of the town.
  • pvz is the pickup point code from the Branches reference. Besides, you can specify the pickup point in the address parameter by one of the following:
    • Pickup point code in our system.
    • Pickup point code in service partner's system.

For the town tag, you can speify the value from the Regions reference in the regioncode attribute. The town is searched for in the specified region.

In the country attribute, you can specify the recipient country according to the ISO 3166-1 standard. For example: "AT", "AUT" or "040" for Austria.

Besides, the zipcode attribute value is considered when searching for a town.

You can use one of the following ways to fill in the Town field of the sender and receiver containers:

  • location code
  • 13-digit code from All-Russian Classifier of Addresses (Address Classifier used in Russia)
  • 36-digit code from the address system Federal Information Address System
    (AOID)
  • the name of the town (not recommended)
  • coords — recipient coordinates. If not specified, they are determined automatically.
  • paytype is a type of order payment. Possible values:
  • CASH — cash on delivery (by default).
  • CARD — by card on delivery.
  • NO — no payment expected, the order is already paid. API adds an advance payment item with negative price value to the list of items, so that the order total is 0. The order receipt lists all items, their prices and the advance payment amount accourding to the Federal Law.
  • OTHER means other types of payment. It is designed for making payments directly to the delivery service by using other types of payment: Webmoney, Yandex Money, online payment by card, other payment systems.
  • OPTION — recepient selects the payment type. This type of payment is not transferred in the order. It is set automatically client settings.
  • zipcode — postal code.
  • weight — total order weight in kilograms.
  • return_weight — total order return weight in kilograms.
  • quantity — number of packages.
  • service — delivery mode (service type). It is transferred as a code from the Urgency Kinds reference.
  • type – shipment type. It is transferred as a code from the Shipment Types reference.
  • return_type - return shipment type. It is transferred as a code from the Shipment Types reference.
  • price — order amount. If the items container is present, this parameter is ignored and calculated automatically.
  • deliveryprice— delivery fee. If the items container is present, the "Delivery" item is added to it.
  • VATrate — value-added tax rate, integer.
  • return — indicates whether return trip is required.
  • return_service — return mode (type of service). It is transferred as a code from the Urgency Kinds reference.
  • discount — order discount amount. The discount amount distributes between the order item prices, the cash on delivery amount decreases by the the discount amount. The "Discount" item is not created. Note that using this tag might lead to discrepancies in order total due to rounding errors. Avoid using this tag, specify the item prices already decreased by the discount amount.
  • enclosure — task description.
  • inshprice — declared value. If not specified explicitly, the value is calcuated automatically as order items prices total.
  • instruction — instruction text for courier.
  • courier — planned courier. It is transferred as a MeaSoft courier code.
  • receiverpays — indicates whether recipient pays the delivery fee. If YES, the recipient pays, if NO, the sender pays.
  • department — the order creator's department.
  • pickup — indicates whether it is a pickup order. If YES, the entire order is considered to be the assignment for pickup, not for delivery. It is used for calling a courier to the sender's place to pick up shipments. Note. If warehouse goods are added to the order, their type must be [7]Goods pickup. Any other type is automatically changed to type 7 on submitting the order.
  • acceptpartially — indicates whether the recepient can partially accept order items.
  • items — a container describing order items. It is an optional container. It has the following attributes:
  • item — item name.
  • quantity — number of articles.
  • mass — item weight in kg.
  • volume — dimensional weight of an item in kilograms. If specified, the value substitutes the mass value.
  • length — item length in cm.
  • width — item width in cm.
  • retprice — price of an article. Rounds to the hundredths. It must include all markups and discounts. It cannot be negative for item types 1, 2, 3.
  • inshprice — declareed value of an article. Rounds to the hundredths. If not specified, considered equal to retprice.
  • VATrate — VAT rate which is specified as integer percentage. If a value is not indicated, then “18” value is entered.
  • barcode — item barcode.
  • article — supplier SKU ID. Attention! Supplier SKU ID is required only for the items stored at the courier service warehouse and if cross-docking is required for them. In this case the system tries to associate the item with a corresponding item in nomenclature list. If the item is not found in the nomenclature list, the error message is displayed. If several items are found with the same supplier SKU ID, one of the IDs is selected randomly. It might result in incorrect cross-docking.
  • itemcode — internal SKU ID/ You can use instead of supplier SKU ID. Attention! SKU ID is required only for the items stored at the courier service warehouse and if cross-docking is required for them. The system uses SKU ID to associate the item with a corresponding item in nomenclature list. If the item is not found, the error message is displayed.
  • type — item type. Possible values:
1 — Goods. The default value.
2 — Delivery. The item is added automatically if order > deliveryprice is specified.
3 — Service
4 — Advance payment. The amount is specified. quantity is ignored, always "1". The amount in the order is displayed with the negative sign irrespective of the sign in the request. The item is added automatically if order > paytype=NO is specified.
6 - Credit payment. The amount is specified. quantity is ignored, always "1". The amount in the order is displayed with the negative sign irrespective of the sign in the request.
7 - Pickup. Use it if you have to pick up the items from the recipient. The amount in the order is displayed with the negative sign irrespective of the sign in the request.
  • extcode — external line code. It is used to identify the order lines when obtaining statuses. It is an optional field.
  • origincountry - origin country code according to ISO 3166-1.
  • GTD — GTD number.
  • excise — excise tax amount.
  • suppcompany — supplier name if it is different from the sender.
  • suppphone — supplier phone number if it is different from the sender.
  • suppINN — supplier taxpayer ID if supplier is not the sender.
  • governmentCodeChestnyi ZNAK code. It is used to digitally mark goods. Specify all characters of the QR code excepting ASCII 29 character. If the code is unknown, specify "?". The courier will scan it when giving the item to recepient. Some processes may require using "!". In this case, the courier scans the item serial number, but it is not considered to be the digital mark code. If the field is filled in, quantity must be "1", otherwise an error returns.
  • packages — a container describing order packages. It is an optional container. It has the following attributes:
  • package — package name.
  • code — internal line code.
  • strbarcode — package barcode.
  • mass — package weight in kg.
  • message — message line.
  • length — package length in cm.
  • width — package width in cm.
  • height — package height in cm.
  • quantity — number of packages with the specified dimensions and mass. Total number of packages in the order cannot be more than 1000.
  • deliveryset — custom delivery rate setup. It has the following attributes:
  • above_price — delivery fee if all order items are accepted by the recipient. It is "amount from" for the limit set in the below_sum tag.
  • return_price — delivery fee if the order is returned.
  • VATrate — value-added tax rate, integer.
  • below — amount limit of the settings.
  • below_sum — purchase amount limit.
  • price — purchase amount within the limit.
  • advprices — a container describing value-added services. It is an optional container. It has the following attributes: To use it in the API, in the client account settings, enable the Value-added services field for new order and pickup request.
  • code — service code.
  • value — service value. If service type is Boolean, set the value to True.

If you want to apply value-added services (for example, delivery, cross-docking, lifting upstairs, etc.), specify them in the same items container as items without a SKU ID.

  • costcode — employee cost code.
  • overall_volume — total volume, m3. An optional virtual field. It is used to calculate the package dimensions. The calculation works only if every package contains zero values of length, heigth, or width.
  • userid — user ID, either string or integer type. Virual field, optional. The field is used in the custom delivery rate settings. It defines the rule priority. You can use the field for CMS and CRM to set delivery fee for each customer individually.
  • groupid — user group ID, either string or integer type. Virual field, optional. The field is used in the custom delivery rate settings. It defines the rule priority. You can use the field for CMS and CRM to set delivery fee for each customer group individually.
When submitting orders with scheduled delivery or pickup date earlier than the nearest possible date, the delivery or pickup date changes automatically to the nearest possible date.

Response Examples

If a request is executed successfully and an order is created, the order amount in the orderprice attribute and the 0 error returns. Otherwise, an error number and its description in the errormsg attribute returns. The orderno attribute contains order number, barcode — order barcode.

Success

<?xml version="1.0" encoding="UTF-8"?>
<neworder>
   <createorder orderno="AB23541" barcode="67567#114" error="0" errormsg="Success" orderprice="5000" />
   <createorder orderno="AB23542" barcode="67567#115" error="0" errormsg="Success" orderprice="6000" />
   <createorder orderno="AB23543" barcode="67567#116" error="0" errormsg="Success" orderprice="0" />
</neworder>

Error

<?xml version="1.0" encoding="UTF-8"?>
<neworder>
   <createorder orderno="AB23541" barcode="67567#114" error="67" errormsg="Order barcode already exists in the database." />
   <createorder orderno="AB23542" barcode="67567#115" error="17" errormsg="Order number already exists in the database." />
   <createorder orderno="AB23543" barcode="67567#116" error="67" errormsg="Order barcode already exists in the database." />
</neworder>

Authorization Error

<?xml version="1.0" encoding="utf-8"?>
<request>
<error error="1" errormsg="authorization error"></error>
</request>

Syntax Error

<?xml version="1.0" encoding="UTF-8"?>
<request>
   <error>column:1 line:11 message:expected '>'</error>
</request>

Order Status

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<statusreq>
  <auth extra="8" login="login" pass="pass"></auth>
  <client>CLIENT</client>
  <orderno>1234</orderno>
  <orderno2>5678</orderno2>
  <ordercode>34234</ordercode>
  <givencode>234534</givencode>
  <datefrom>2021-06-21</datefrom>
  <dateto>2021-06-21</dateto>
  <target>Company</target>
  <done>ONLY_NOT_DONE</done>
  <changes>ONLY_LAST</changes>
  <conditions>
    <namecontains>1234</namecontains>
    <namestarts>1234</namestarts>
  </conditions>
</statusreq>

Fields Description

statusreq is a root container. Required.

  • auth — authorization. Required.
  • client — indicates whether it is a client or a delivery service partner. It is an optional element. Possible values:
  • CLIENT — the default value.
  • AGENT — delivery service partner. Response contains information on the orders tendered for delivery.
  • orderno — order number. It is an optional element.
  • ordercode — internal order code. It is an optional element.
  • orderno2 — urgent order number. It is an optional element.
  • datefrom — order creation date "from". It is an optional element.
  • dateto — order creation date 'to". It is an optional element.
  • target — a search text. You can specify a part of recipient company name or recipient address.
  • done — possible values:
  • ONLY_DONE — delivered only. Success stauses like Delivered, Partially delivered.
  • ONLY_NOT_DONE — undelivered only. Statuses like Not delivered, Lost.
  • ONLY_NEW — new only.
  • ONLY_DELIVERY — orders in process only. These are orders in any status except for final statuses Delivered, Not delivered, Canceled and the like.
  • Empty — for all shipments.
  • changes — can take only ONLY_LAST value. If this parameter is specified, all other parameters are ignored. For more information, see Get Latest Changed Statuses.
  • conditions — specify search conditions. The nested elements are joined by the logical AND operator.
  • namecontains — search order numbers (external codes) that contain the specified text.
  • namestarts — search order numbers (external codes) that start with the specified text.
  1. You can request statuses of orders created no earlier than 2 months before the to date (datefrom and dateto containers).
  2. If no date is provided, dateto equals the current date.
  3. Omitting dateto defaults to datefrom plus two months.
  4. Omitting datefrom defaults to dateto minus two months.
  5. You can search using conditions only by order numbers (external codes). 4 characters is the minimum search length.

Response Examples

Success

<?xml version="1.0" encoding="UTF-8"?>
<statusreq count="23">
 <order orderno="111111" awb="qwerty" orderno2="123123" ordercode="34534234" givencode="2345334">
   <barcode>111111</barcode>
   <sender>
     <company>Ministry of Internal Affairs</company>
     <person>Sam Goe</person>
     <phone>123-45-67</phone>
     <contacts>
       <phone>+74951234567</phone>
     </contacts>
     <town code="23432">Saint-Petersburg city</town>
     <address>Petrovka Str., 38, Room 35</address>
     <date>2021-03-22</date>
     <time_min>09:00</time_min>
     <time_max>14:00</time_max>
   </sender>
   <receiver>
     <company>Ministry of Internal Affairs</company>
     <person>Tom Well</person>
     <phone>123-45-67 - Tom, (916)234.45.21 Sam, mia@gmail.com</phone>
     <contacts>
       <phone>+74951234567</phone>
       <phone>+79162344521</phone>
       <email>mia@gmail.com</email>
     </contacts>
     <inn>1112223335</inn>
     <zipcode>125480</zipcode>
     <town code="153361" regioncode="78" regionname="Saint-Petersburg city">Saint-Petersburg city</town>
     <address>Petrovka Str., 38, Room 35</address>
     <pvz>
       <code>126</code>
       <clientcode>QWERTY</clientcode>
     </pvz>
     <date>2021-03-22</date>
     <time_min>09:00</time_min>
     <time_max>14:00</time_max>
     <coords lat="55.680327" lon="37.604456"></coords>
     <deliveryPIN>1234</deliveryPIN>
   </receiver>
  <pickup>NO</pickup>
   <weight>5.1</weight>
   <return_weight>5.1</return_weight>
   <quantity>2</quantity>
   <paytype code="1">CASH</paytype>
   <service>2</service>
   <return_service>2</service>
   <type>3</type>
   <return_type>3</return_type>
   <waittime>12</waittime>
   <price>387.5</price>
   <print_check>YES</print_check>
   <inshprice>387.5</inshprice>
   <enclosure>Kids toys</enclosure>
   <instruction>Check in the buyer's presence, sign acceptance certificate</instruction>
   <currcoords lat="55.680327" lon="37.604456" accuracy="50" RequestDateTime="2021-04-21 18:07:45"></currcoords>
   <courier>
	<code>26</code>
	<name>Katie Summerhill</name>
	<phone>+79161234567</phone>
   </courier>
   <deliveryprice total="158.6" delivery="100.00" return="58.6">
      <advprice code="1" price="150">Base</advprice>
      <advprice code="2" price="0">% of declared value</advprice>
      <advprice code="3" price="8.6">Fuel surcharge</advprice>
      <advprice code="4" price="0">Rounding</advprice>
   </deliveryprice>
   <receiverpays>NO</receiverpays>
   <acceptpartially>NO</acceptpartially>
   <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="" title="Delivered">COMPLETE</status>
   <statushistory>
     <status eventstore="Moscow office" eventtime="2021-05-30 10:20:00" createtimegmt="2021-06-03 16:14:44" message="" title="New">NEW</status
     <status eventstore="Moscow office" eventtime="2021-06-01 17:38:00" createtimegmt="2021-06-03 16:14:44" message="Branch office" title="Shipment planned">DEPARTURING</status>
     <status eventstore="Moscow office" eventtime="2021-06-01 19:53:00" createtimegmt="2021-06-03 16:14:44" message="Branch office" title="Shipped">DEPARTURE</status>
     <status eventstore="Branch office" eventtime="2021-06-02 07:41:00" createtimegmt="2021-06-03 16:14:44" message="" title="Received by warehouse">ACCEPTED</status>
     <status eventstore="Branch office" eventtime="2021-06-02 09:17:00" createtimegmt="2021-06-03 16:14:44" message="" title="Out for delivery">DELIVERY</status>
     <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="" title="Delivered as reported by courier">COURIERDELIVERED</status>
     <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="" title="Delivered">COMPLETE</status>
   </statushistory>
   <customstatecode>2<customstatecode>
   <clientstatecode></clientstatecode>
   <costcode>cc12345</costcode>
    <receipt fdNum="124555" fnSn="9289000100295555" kktNum="0001611984048555" inn="7722756555" fdValue="2899551555" summ="387.5" ofdUrl="gate.ofd.ru">https://ofd.ru/rec/7722756555/0001611984048555/9289000100295555/124555/2899551555</receipt>
   <deliveredto>Mary Smith, secretary</deliveredto>
   <delivereddate>2021-06-02</delivereddate>
   <deliveredtime>17:22</deliveredtime>
   <arrival>2021-05-02 23:21</arrival>
   <outstrbarcode>EXT123456</outstrbarcode>
   <partner>Western Branch</partner>
   <return_message>Delivered undamaged</return_message>
   <department>Accounting</department>
   <items>
      <item code="34533" extcode="abc123" quantity="1" mass="0.2" retprice="37.5" VATrate="0" barcode="2345625213125" article="1" returns="0" origincountry="040" GTD="" excise="0.00" governmentCode="11223311" suppcompany="Miller and Company" suppINN="1112223334" suppphone="79161234567">Princess house</item>
      <item code="34456" extcode="abc124" quantity="2" mass="2" retprice="100" VATrate="10" barcode="4645625213138" article="2" returns="0" governmentCode="">Sword</item>
      <item code="34421" extcode="abc125" quantity="3" mass="0.3" retprice="50" VATrate="18" barcode="2345625213126" itemcode="44123" article="3" returns="0" governmentCode="">Jedi lightsaber</item>
   </items>
   <packages>
      <package code="33331" strbarcode="ORD0000001" mass="1" message="" got="YES"></package>
      <package code="33332" strbarcode="ORD0000002" mass="2.5" message="" got="NO"></package>
   </packages>
 </order>
</statusreq>

No Orders

<?xml version="1.0" encoding="utf-8"?>
<statusreq count="0">
</statusreq>

Authorization Error

<?xml version="1.0" encoding="utf-8"?>
<request>
<error error="1" errormsg="authorization error"></error>
</request>

Syntax Error

<?xml version="1.0" encoding="UTF-8"?>
<request>
   <error>column:1 line:11 message:expected '>'</error>
</request>

Response Fields

All response fields correspond to the order creating request structure, with the following additions:

  • The order container attributes:
  • awb — number of the courier company packing slip.
  • orderno2 — number of the packing slip in the courier service urgent delivery subsystem.
  • ordercode — order internal code, for internal use.
  • givencode — order internal code, for internal use.
  • The code attribute of the item container — internal order line code, for interal use.
  • returns is the amount of the article rejected by the recipient. It is not 0 only in case of partial refusal.
  • The got attribute of the package container — indicates whether a package is accepted. Possible values: YES, NO.
  • returns is the amount of the article rejected by the recipient. It is not 0 only in case of partial refusal.
  • coords in receiver container — recipient location coordinates.
  • deliveryPIN in receiver container — PIN.
  • pickup — indicates whether it is a pickup order. Possible values: YES, NO. If YES, the entire order is considered to be the assignment for pickup, not for delivery.
  • currcoords — current order location cordinates. Its attributes are:
  • lat — latitude
  • lon — longitude
  • accuracy — location accuracy in meters
  • RequestDateTime — date and time of the latest location update.
  • courier — information on the courier who carries the order. If the order is not out for delivery, plan courier data is shown.
  • waittime — courier waiting time.
  • deliveryprice — cost of delivery denominated in the customer`s currency. It has the following attributes:
  • total — total delivery cost.
  • delivery — one-way trip cost.
  • return — return trip cost (if order > return=YES).

The deliveryprice tag includes value-added services. The option is available for the Premium and Maximum courier service account plans:

  • advprice — value-added service name.
  • code — value-added service code.
  • price — value-added service amount.
  • status — delivery status. See the list of statuses below. It has the following attributes:
  • eventstore — courier service branch which set the current status.
  • eventtime — time of latest status change as in the current branch timezone.
  • createtimegmt — status change entry created in the datatbase, GMT. Used to arrange the entries in chronological order.
  • message — name of a recipient branch. Used in case of order transfer between branches.
  • title — name of the status in Russian.
  • statushistory — history of delivery statuses. It contains the list of status containers. It is filled in only for Premium and Maximum plans.
  • customstatecode — internal status code of a courier service. Please, check with the courier service for its values. They are assigned by the courier service in References > Statuses > 15 Shipment statuses. The reference is not transferred to the client via API due to possible presence of delivery service internal statuses in it.
  • clientstatecode — client status code. It is used if client submits their own codes of delivery statuses and reasons for non-delivery.
  • deliveredto — actual information on delivery or a reason for non-delivery.
  • delivereddate — actual delivery date.
  • deliveredtime — actual delivery date. It can be empty in case of non-delivery.
  • arrival — scheduled delivery date formatted as YYYY-MM-DD HH:MM:SS.
  • outstrbarcode — service partner system code (in an external system). It is used for integration with external systems.
  • partner — current branch or service partner.
  • return_message — return information.
  • department — the order creator's department.

The status container can have the following values:

AWAITING_SYNC — Awaiting for sync. Order is not in the courier company database yet.
NEW — Created, submitted to the courier company.
NEWPICKUP — Pickup created.
PICKUP — Picked up from sender.
WMSASSEMBLED — Order is picked at the fulfillment center.
WMSDISASSEMBLED — Order is unpicked at the fulfillment center.
ACCEPTED — Received by warehouse.
CUSTOMSPROCESS — Customs clearance.
CUSTOMSFINISHED — Customs clearance complete.
CONFIRM — Delivery is scheduled.
UNCONFIRM — Failed to arrange for delivery time.
DEPARTURING — Warehouse transfer planned.
DEPARTURE — Warehouse transfer shipped.
INVENTORY — Inventory. Made sure the shipment is in the warehouse.
PICKUPREADY — Available for pickup at the pickup point.
DELIVERY — Out for delivery.
COURIERDELIVERED — Delivered (as reported by courier). Confirmation by manager is expected to change status to COMPLETE.
COURIERPARTIALLY — Partially delivered (as reported by courier). Confirmation by manager is expected to change status to PARTIALLY.
COURIERCANCELED — Refused (as reported by courier). Confirmation by manager is expected to change status to COURIERRETURN.
COURIERRETURN — Returned to warehouse by courier. The courier failed to deliver the order to recepient and returned it to the warehouse. This is an intermediate status, the manager is to check whether the order is to be delivered again (DATECHANGE/DELIVERY) or this is a final non-delivery (CANCELED).
DATECHANGE — Rescheduled.
COMPLETE — Delivered.
PARTIALLY — Partially delivered.
CANCELED — Not delivered (Returned/Canceled). The order must be returned to sender.
RETURNING — Return to sender planned (after CANCELED).
RETURNED — Returned to sender.
LOST — Lost.

Note: The set of currently used statuses may be expanded and changed in the future.

  1. statushistory and deliveryprice are filled in for Premium and Maximum courier service account plans only.
  2. The sequence of statuses is not fixed. For example, you can get the COMPLETE status and then NEW because an operator marked the order completed by mistake and then corrected it.

Get Latest Changed Statuses

To see only latest changed statuses, once in a while send the request (see the example below). API returns all the orders with recently changed statuses and some other attributes. You save the status information for each order in your system and confirm the receipt by sending the commitlaststatus request. MeaSoft marks these statuses as received by you and does not return them again. Thus, no matter how many orders is in process, you can get their actual statuses by using only 2 requests.

Getting latest changed statuses

<?xml version="1.0" encoding="UTF-8" ?>
<statusreq>
  <auth extra="8" login="login" pass="pass"></auth>
  <changes>ONLY_LAST</changes>
  <streamid>1234</streamid>
 </statusreq>

The system will display all orders that have at least one of the fields changed since the time of the last query in this mode: Returns all the orders with at least one of the following fields changed since the last status request sent in this mode:

orderno
status
delivereddate
deliveredtime
deliveredto
receiver->date
receiver->address
price

If the response is processed successfully, use the following request to mark the returned statuses as successfully received ones:

<?xml version="1.0" encoding="UTF-8" ?>
<commitlaststatus>
  <auth extra="8" login="login" pass="pass"></auth>
  <client>CLIENT</client>
  <streamid>1234</streamid>
</commitlaststatus>

Query Fields

  • auth — Authorization. Required.
  • streamid - stream ID. If you get order statuses for multiple integrations, pass this parameter to divide getting statuses and sending confirmation. The value must be from 100 up to 10000. It is an optional element.
  • client — indicates whether it is a client or a delivery service partner. It is an optional element. Possible values:
  • CLIENT — the default value.
  • AGENT — delivery service partner. Response contains information on the orders tendered for delivery.

If successful you will get the following response:

<?xml version="1.0" encoding="UTF-8" ?>
<commitlaststatus error="0">OK</commitlaststatus>

This way ensures a complete and correct status transfer even if the status has changed in the time period between the request and receipt confirmation.

If you do not confirm successful status receipt, the information will be returned again on the next request.

  1. When this way of data transfer is used (<changes>ONLY_LAST</changes>), the system reviews the orders created for the last 3 months. No information on the orders created earlier returns.
  2. The system always returns the current status. It means you can get the NEW status returned for the first request, and the COMPLETE status for your second request. A shipment could have gone through several intermediate statuses in between the request.
  3. The sequence of statuses is not fixed. For example, you can get the COMPLETE status and then NEW because an operator marked the order completed by mistake and then corrected it.

Tracking Order by Number

Request for tracking order by number is intended to provide minimal anonymized information about a certain order to a non-authorized user.

MeaSoft allows unauthorized access to tracking at htttp://home.courierexe.ru/{client extra code}/tracking. This interface is designed to show information to a human user.

You can create a link to such page at your web site, or place an iFrame, or create your own page and use our API. To receive order statuses in your information system, use statusreq request, the changes=ONLY_LAST parameter is recommended.

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<tracking>
  <extra>8</extra>
  <orderno>1234</orderno>
</tracking>

Response Example:

<?xml version="1.0" encoding="UTF-8"?>
<tracking>
  <order orderno="1234">
    <sender>
      <town code="1" country="RU">Moscow city</town>
      <date>2021-03-22</date>
      <time_min>09:00</time_min>
      <time_max>14:00</time_max>
    </sender>
    <receiver>
      <town code="1" country="RU">Moscow city</town>
     <zipcode>125480</zipcode>
     <date>2021-03-22</date>
     <time_min>09:00</time_min>
     <time_max>14:00</time_max>
    </receiver>
    <price>387.5</price>
    <inshprice>387.5</inshprice>
    <paytype>CASH</paytype>
    <weight>5.1</weight>
    <quantity>2</quantity>
    <service>2</service>
    <type>3</type>
    <return>NO</return>
    <return_service>2</service>
    <return_date></return_date>
    <return_time></return_time>
    <return_message></return_message>
    <waittime>12</waittime>
    <enclosure>Kids toys</enclosure>
    <instruction>Check in the presence of the buyer, sign acceptance certificate</instruction>
    <deliveryprice total="158.6" delivery="100.00" return="58.6" />
    <courier>
     <code>26</code>
     <name>Katie Summerhill</name>
     <phone>+79161234567</phone>
    </courier>
   <currcoords lat="55.680327" lon="37.604456" accuracy="50" RequestDateTime="2021-04-21 18:07:45" />
   <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="">COMPLETE</status>
   <statushistory>
     <status eventstore="Moscow office" eventtime="2021-05-30 10:20:00" createtimegmt="2021-06-03 16:14:44" message="">NEW</status
     <status eventstore="Moscow office" eventtime="2021-06-01 17:38:00" createtimegmt="2021-06-03 16:14:44" message="Branch office">DEPARTURING</status>
     <status eventstore="Moscow office" eventtime="2021-06-01 19:53:00" createtimegmt="2021-06-03 16:14:44" message="Branch office">DEPARTURE</status>
     <status eventstore="Branch office" eventtime="2021-06-02 07:41:00" createtimegmt="2021-06-03 16:14:44" message="">ACCEPTED</status>
     <status eventstore="Branch office" eventtime="2021-06-02 09:17:00" createtimegmt="2021-06-03 16:14:44" message="">DELIVERY</status>
     <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="">COURIERDELIVERED</status>
     <status eventstore="Branch office" eventtime="2021-06-02 17:22:00" createtimegmt="2021-06-03 16:14:44" message="">COMPLETE</status>
   </statushistory>
   <deliveredto>Mary Smith, secretary</deliveredto>
   <delivereddate>2021-06-02</delivereddate>
   <deliveredtime>17:22</deliveredtime>
   <outstrbarcode>EXT123456</outstrbarcode>
   <items>
      <item code="34533" extcode="abc123" quantity="1" mass="0.2" retprice="37.5" VATrate="0" barcode="2345625213125" article="1" returns="0" origincountry="040" GTD="" excise="0.00" governmentCode="11223311" suppcompany="Miller and Company" suppINN="1112223334" suppphone="79161234567">Princess house</item>
      <item code="34456" extcode="abc124" quantity="2" mass="2" retprice="100" VATrate="10" barcode="4645625213138" article="2" returns="0" governmentCode="">Sword</item>
      <item code="34421" extcode="abc125" quantity="3" mass="0.3" retprice="50" VATrate="18" barcode="2345625213126" article="3" returns="0" governmentCode="">Jedi lightsaber</item>
   </items>
  </order>
</tracking>

Get Info in 17 TRACK Format

Request Example

<?xml version="1.0" encoding="UTF-8"?> <tracking17>

 <extra>8</extra>
 <orderno>1234</orderno>

</tracking17>

Request Example

{
	"number":"ExtNumber",
	"oriNumber":"1234",
	"oriCountry":"RU",
	"destCountry":"RU",
	"status":"Complete",
	"events":[
		{
			"time":"2021-06-02 17:22:00",
			"location":"RU",
			"content":"Complete"
		},
		{
			"time":"2021-06-02 17:22:00",
			"location":"RU",
			"content":"Courierdelivered"
		},
		{
			"time":"2021-06-02 09:17:00",
			"location":"RU",
			"content":"Delivery"
		},
		{
			"time":"2021-06-02 07:41:00",
			"location":"RU",
			"content":"Accepted"
		},
		{
			"time":"2021-06-01 19:53:00",
			"location":"RU",
			"content":"Departure"
		},
		{
			"time":"2021-06-01 17:38:00",
			"location":"RU",
			"content":"Departuring"
		},
		{
			"time":"2021-05-30 10:20:00",
			"location":"RU",
			"content":"New"
		}
	]
}

The function searches for the latest order among the orders of all clients by its number. It provides anonymized information on the current state of the order.

Response containers are similar to the Order Status Request.

Changing Order

The request is intended to edit the orders that are not in process yet — there was no changes of shipment or delivery status or delivery time, etc.

You can only edit orders if the courier service uses the Premium or Maximum personal account plan. To enable order editing, in the courier service account go to Settings > Parameters > Advanced and select the Allow canceling and editing orders check box.

  1. The edit request must contain all order data as if the order is being created for the first time.
  2. If the edit request is missing an item, the item is not removed from the order, but its quantity becomes 0.
  3. If an order is being edited via API and in MeaSoft desktop application at the same time, only the changes made in the desktop applications are applied.

Planned courier might be canceled utomatically once an order is edited. It depends on the value set in References > Variables > Shipments > Automatically assign courier by area:

  • No — courier is not changed on editing orders via API.
  • Area — courier is canceled on changing delivery address.
  • Area or delivery date — courier is canceled on changing delivery address or delivery date.

Edit Request Fields

All request fields correspond to the order creating request structure, except for:

  • specify the editorder instead of the neworder root tag.
  • do not specify the barcode tag as it is assigned when creating an order.
  • for item items, specify the item internal code in the code attribute. To receive the internal code, use the order status request.

You cannot change the orderno value using this method.

Edit Response Fields

All response fields correspond to the order creating response structure, except for:

  • the editorder tag is returned instead of neworder.

Canceling Order

The request is intended to cancel the orders that are not in process yet — there was no changes of shipment or delivery status or delivery time, etc.

You can only cancel orders if the courier service uses the Premium or Maximum personal account plan. To enable order canceling, in the courier service account go to Settings > Parameters > Advanced and select the Allow canceling and editing orders check box.

Once an order is canceled, the Delivery info field is filled in with Canceled by client, the Delivery date is filed in with the current date, the Delivered by is filled in with system entry CANCEL.

Order Cancelation Example

<?xml version="1.0" encoding="UTF-8" ?>
<cancelorder>
  <auth extra="8" login="login" pass="pass" />
  <order orderno="" ordercode="123456" />
  <order orderno="123aaa" ordercode="" />
</cancelorder>

Order Cancelation Fields

cancelorder — root container. Required.

  • auth — authorization. Required.
  • order — container of the order being canceled. Required. The request can contain more than one order. It has the following attributes:
  • orderno — external order code.
  • ordercode — internal order code.

Either orderno or ordercode is required.

Response Example

<?xml version="1.0" encoding="UTF-8" ?>
<cancelorder>
  <order orderno="123test" ordercode="123456" error="0" errormsg="OK" />
  <order orderno="123aaa" ordercode="" error="52" errormsg="order not found" />
</cancelorder>

Adding Files to Order

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<addattachments>
  <auth extra="8" login="login" pass="pass" />
  <orderno>1234567</orderno>
  <attachments>
    <item name="photo1.jpg">JVBERi0xLjMN1wb25lbnQgMQ
    JUBQREYwMTIzNDU2Nzg5IDI NMyAwIG9iag08PA0vVHlwZSA
    U3VidHlwZSAvSW1hZ2UNL1d pZHRoIDE4MDgNL0hlaWdodCA
    ggNCAwIFINL0JpdHNQZXJDb 21wb25lbnQgMQ0vRGVjb2RlU
    ENL0NvbHVtbnMgMTgwOA0+P g0vSW1hZ2VNYXNrIHRydWUNL
    XhEZWNvZGUNPj4Nc3RyZWFt DQ</item>
    <item name="photo2.jpg">VBERi0xLjMNAwIG9iag0HRoJ
    JUBQREYwMTIzNDU2Nzg5IDI NMyAwIG9iag08PA0vVHlwZSA
    vWE9iamVjdA0vU3VidHlwZS AvSW1hZ2UNL1dpZHRoIDEzNj 
    gNL0hlaWdodCAxMzMzDS9MZ W5ndGggNCAwIFINL0JpdHNQZ 
    XJDb21wb25lbnQgMQ0vRGVj b2RlUGFybXMgPDwNL0sgLTEN 
    L0NvbHVtbnMgMTM2OA0+Pg0 vSW</item>
  </attachments>
</addattachments>


Fields Description

addattachments — root container. Required.

  • auth — authorization. Required.
  • orderno — order number. Required. You can use tag ordercode to specify order internal code.
  • attachments — file data. Required.
    • item — base64 encoded binary file data. Required.
      • name — an item attribute that contains the file name. Required.


Response Example

<?xml version="1.0" encoding="UTF-8"?>
<addattachments>
  <attachments>
    <item name="photo1.jpg" error="0" errormsg="OK" />
    <item name="photo2.jpg" error="0" errormsg="OK" />
  </attachments>
</addattachments>

Getting Order Files

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<attachments>
  <auth extra="8" login="login" pass="pass" />
  <orderno>1234567</orderno>
</attachments>

Fileds Description

attachments — Root container. Required.

  • auth — authorization. Required.
  • orderno — order number or code. Required.


Response Example

<?xml version="1.0" encoding="UTF-8"?>
<attachments>
  <item name="doc1.docx" size="35654">JVBERi0xLjMN
  JUBQREYwMTIzNDU2Nzg5IDI NMyAwIG9iag08PA0vVHlwZSA
  U3VidHlwZSAvSW1hZ2UNL1d pZHRoIDE4MDgNL0hlaWdodCA
  ggNCAwIFINL0JpdHNQZXJDb 21wb25lbnQgMQ0vRGVjb2RlU
  ENL0NvbHVtbnMgMTgwOA0+P g0vSW1hZ2VNYXNrIHRydWUNL
  XhEZWNvZGUNPj4Nc3RyZWFt DQ</item>
  <item name="photo2.jpg" size="74861">VBERi0xLjMN 
  JUBQREYwMTIzNDU2Nzg5IDI NMyAwIG9iag08PA0vVHlwZSA
  vWE9iamVjdA0vU3VidHlwZS AvSW1hZ2UNL1dpZHRoIDEzNj 
  gNL0hlaWdodCAxMzMzDS9MZ W5ndGggNCAwIFINL0JpdHNQZ 
  XJDb21wb25lbnQgMQ0vRGVj b2RlUGFybXMgPDwNL0sgLTEN 
  L0NvbHVtbnMgMTM2OA0+Pg0 vSW</item>
</attachments>

The item tag contains base 64 encoded binary data (files).

Changing Status by Service Partner

Order status change request allows to get the final status of the order — either Delivered or Not delivered (Returned/Canceled).

Besides, the request gets date and time of status change, if necessary, and the Delivery info field message.

You can attach images to the order.

Request Example:

<?xml version="1.0" encoding="UTF-8" ?>
<setorderinfo>
  <auth extra="8" login="login" pass="pass" />
  <order ordercode="123456">
    <message>Accepted by Tailor</message>
    <outstrbarcode>7654312</outstrbarcode>
  </order>
  <order ordercode="234567">
    <status>PICKUPREADY</status>
    <eventtime>2021-05-30 10:20:00</eventtime>
    <message>Client refused the order</message>
    <paytype>CASH</paytype>
    <items>
       <item code="34533" quantity="1" reason="0" />
       <item code="34456" quantity="0" reason="0" />
       <item code="34421" quantity="2" reason="0" />
    </items>
    <image filename="filename1.jpg"> /9j/4AAQSkZJRgA
    BAQAAAQABAAD/2wBDAA0JCg sKCA0LCgsODg0PEyAVExISEy
    ccHhcgLikxMC4pLSwzOko+M zZGNywtQFdBRkxOUlNSMj5aY
    VpQYEpRUk//2wBDAQ4ODhMR EyYVFSZPNS01T09PT09PT09P
    T09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09
    PT09PT0//wAARCAYACAADAS IA</image>
  </order>
</setorderinfo>


Fields Description

setorderinfo — root container. Required.

  • auth — authorization. Required.
  • order — order container. Required. A request can contain more than one order container. It has the following attribute:
  • ordercode — an internal order code.
  • status — new order status. It can be any status excepting AWAITING_SYNC and NEW.
  • eventtime — status change date and time. Required if status is specified.
  • message — delivery info text.
  • outstrbarcode — code in service partner system (order code in external system). It is used in integrations with external systems.
  • paytype — order payment type. Possible values are CASH and CARD.
  • items — container that describes order items. It has the following attributes:
  • code — item code.
  • quantity — quantity of delivered articles.
  • reason — reason for non-delivery. It is selected from the status list.
  • image — container for the image being attached. It contains base 64 encoded image file text. The order container can contain more than one image container. It has the following attribute:
  • filename — file name.

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<setorderinfo>
  <order ordercode="123456" error="0" errormsg="OK" />
  <order ordercode="234567" error="59" errormsg="value [date_put] is already set" />
</setorderinfo>

Getting Documents for Printing

Get Print Forms Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<waybill>
  <auth extra="8" login="login" pass="pass" />
  <orders>
    <order orderno="1234567" ordercode="33331" />
    <order orderno="1234568" ordercode="33332" />
  </orders>
  <form>1</form>
</waybill>

Fields Description

waybill — is a root container. Required.

  • auth — is authorization. Required.
  • orders — list of orders to get print forms for. It contains tags order with the following attributes:
    • orderno — external order code.
    • ordercode — internal order code.
    Specify either of the attributes for all the orders. The ordercode attribute is recommended.
  • form — packing slip format. Optional. Possible values:
  • 1 — detailed packing slip. Default value.
  • 2 — Zebra label.
  • 3 — A4 size label.
  • 4 — delivery and acceptance certificate.


Response Example

<?xml version="1.0" encoding="UTF-8"?>
<waybill>
  <content>EODIcaI8KSBlwQ 4MnEOR7Px8U8EBAyGICBnwpw 
  IZhQgz0ZxuPs8EBM/GcbjzB AwhBl8hwQYIO00GmEwg1CeEG 
  mqYTChNU0wqf8l8nz4zgc+K fCno+zwU5GjOZmzXGcbEQYIM 
  4zkegRE40zWzONyoNNMIOIa cWnp6aDCGEGE9NQmoQd2mg00 
  79U4f3hPTwnfp6Sdrafeqpa JDpFw/1aYT077VNNNdO00G3q 
  mqqvp9p2E7T0/wiFemv8uG6 OM</content>
</waybill>

Note that print forms are not created for pickups.

The content tag contains base64 encoded binary data (PDF file).

City Names List

City List Request Example

<?xml version="1.0" encoding="UTF-8"?>
<townlist>
  <codesearch>
    <zipcode>110000</zipcode>
    <kladrcode>0100000100800</kladrcode>
    <fiascode>bd21979d-46f8-49d0-9105-e8d65172a983</fiascode>
    <code>123</code>
  </codesearch>
  <conditions>
    <city>Krasnodar Territory</city>
    <namecontains>Novgorod</namecontains>
    <namestarts>Mosc</namestarts>
    <name>Moscow</name>
    <fullname>Moscow city</fullname>
    <country>RU</country>
  </conditions>
  <limit>
    <limitfrom>30</limitfrom>
    <limitcount>10</limitcount>
    <countall>YES</countall>
  </limit>
</townlist>

The townlist container can either be empty or combine elements. The search is case insensitive.

  • auth — authorisation, optional. Use it if the courier service set and enabled some location restrictions.
  • codesearch — search by codes. When it is used, the conditions and limit containers are ignored.
  • zipcode — search by postal codes. Note that one postal code can be applicable to more than one localities. In this case MeaSoft returns several records.
  • kladrcode — search by 13-digit code of All-Russian Classifier of Addresses.
  • fiascode — search by the code of Federal Information Address System (address system used in Russia) (AOGUID).
  • code — search by the system code.
  • conditions — specifies search criteria. All nested elements simultaneously impose the AND condition.
  • city — search for all the localities of a region.
  • namecontains — search for the localities with names including the search text.
  • namestarts — search for the localities with names starting with the search text.
  • name — search for the localities with names matching the search text.
  • fullname — search for the localities with names and type matching the search text.
  • country — search in the country with the specified code only.
  • limit— limits result output.
  • limitfrom — defines the search result record number to start output with. The default value is 0.
  • limitcount — defines the quantity of search result records to show. The default value is 10000.
  • countall — if YES, the total quantity of found matches is counted. It might slow down the request execution. If disabled, totalcount and totalpages are missing in the response.

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<townlist count="3" page="1" totalcount="3" totalpages="1">
  <town>
     <code>26379</code>
     <city>
       <code>23</code>
       <name>Krasnodar Krai</name>
     </city>
     <name>Sochi city</name>
    <fiascode>79da737a-603b-4c19-9b54-9114c96fb912</fiascode>
    <kladrcode>2300000700000</kladrcode>
    <shortname />  (not yet supported)
    <typename />  (not yet supported)
    <coords lat="43.5855" lon="39.7231" />
  </town>
  <town>
     <code>40331</code>
     <city>
       <code>32</code>
       <name>Bryansk District</name>
     </city>
     <name>Sochilov khutor</name>
     <fiascode>c9c96c67-2cc9-4f10-afde-fd32417ea216</fiascode>
     <kladrcode>3201900011100</kladrcode>
     <shortname />
     <typename />
     <coords lat="52.6407" lon="33.1724" />
  </town>
  <town>
     <code>114016</code>
     <city>
       <code>60</code>
       <name>Pskov District</name>
     </city>
     <name>Sochikhino village</name>
     <fiascode>10df7588-19c1-49d1-a387-9de1cf3eb26f</fiascode>
     <kladrcode>6001900015400</kladrcode>
     <shortname />
     <typename />
     <coords lat="56.6003" lon="29.3542" />
  </town>
</townlist>

In the response, the cities and towns are arranged by their popularity, importance (district centers, etc.) and then by alphabet.

Region Names List

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<regionlist>
  <codesearch>
    <code>77</code>
  </codesearch>
  <conditions>
    <namecontains>Krai</namecontains>
    <namestarts>Mosc</namestarts>
    <fullname>Moscow Oblast</fullname>
    <country>1</country>
  </conditions>
</regionlist>

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<regionlist count="2">
  <city>
    <code>80</code>
    <country>
      <code>1</code>
      <name>Russia</name>
      <id>643</id>
      <ShortName1>RU</ShortName1>
      <ShortName2>RUS</ShortName2>
    </country>
    <name>Agin-Buryat Autonomous Okrug</name>
  </city>
  <city>
    <code>1</code>
    <country>
      <code>1</code>
      <name>Russia</name>
      <id>643</id>
      <ShortName1>RU</ShortName1>
      <ShortName2>RUS</ShortName2>
    </country>
    <name>Republic of Adygea</name>
  </city>
</regionlist>

Street Names List

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<streetlist>
  <conditions>
    <town>Moscow city</town>   // REQUIRED FIELD
    <namecontains>Khokhlo</namecontains>
    <namestarts>Academician K</namestarts>
    <name>Academician Khokhlov</name>
    <fullname>Academician Khokhlov Str.</fullname>
  </conditions>
  <limit>
    <limitfrom>30</limitfrom>
    <limitcount>10</limitcount>
    <countall>YES</countall>
  </limit>
</streetlist >
  • conditions — search criteria. All nested elements simultaneously impose the AND condition.
  • town — required field. It is the name or the code of a locality.
  • namecontains — search for the streets with names including the search text.
  • namestarts — search for the streets with names starting with the search text.
  • name — search for the streets with names matching the search text.
  • fullname — search for the streets with names and type matching the search text.
  • limit limits result output.
  • limitfrom — defines the search result record number to start output with. The default value is 0.
  • limitcount — defines the quantity of search result records to show. The default value is 10000.
  • countall — if YES, the total quantity of found matches is counted. It might slow down the request execution. If disabled, totalcount and totalpages are missing in the response.

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<streetlist count="1" page="1" totalcount="3" totalpages="1">
  <street>
     <name>Academician Khokhlov Str.</name>
     <shortname>Academician Khokhlov</shortname>
     <typename>Str.</typename>
  </street>
</streetlist>

In the response, the street names are arranged alphabetically.

List of Goods

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<itemlist>
  <auth extra="8" login="login" pass="pass"></auth>
    <codesearch>
      <code>123456</code>
      <article>FD343</article>
      <barcode>2345625213125</barcode>
    </codesearch>
    <conditions>
      <namecontains>TV set</namecontains>
      <namestarts>sony</namestarts>
      <name>Sony KDL-55W905 LCD TV</name>
      <quantity>EXISTING_ONLY</quantity>
    </conditions>
    <except>
      <code>123478</code>
    </except>
    <limit>
      <limitfrom>30</limitfrom>
      <limitcount>10</limitcount>
      <countall>YES</countall>
    </limit>
</itemlist>

The townlist container can either be empty or combine elements. The search is case insensitive.

  • codesearch — search by codes. When it is used, the conditions and limit containers are ignored.
  • code — search by internal system code.
  • article — search by SKU ID.
  • barcode — search by barcode.
  • conditions — specifies search criteria. All nested elements simultaneously impose the AND condition.
  • namecontains — search for the goods with names containing the search text.
  • namestarts — search for the goods with names starting from the search text.
  • name — search for the goods with names matching the search text.
  • quantity — availability of goods in the warehouse. Sometimes, the field may be unavailable. Possible values:
      • EXISTING_ONLY — only in stock.
      • NOT_EXISTING_ONLY — only out of stock.
      • ALL — all.
  • store — search by the specified warehouse.
  • except — exception description for correct counting of reserved items.
  • code — order code.
  • limit — limits result output.
  • limitfrom — defines the search result record number to start output with.
  • limitcount — defines the quantity of search result records to show.

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<itemlist count="3" totalcount="3" page="1" totalpages="1">
  <item>
    <code>123456</code>
    <article>FD343</article>
    <barcode>2345625213125</barcode>
    <name>Sony KDL-55W905 LCD TV</name>
    <retprice>65000</retprice>
    <purchprice>50000</purchprice>
    <weight>5.1</weight>
    <length>50</length>
    <width>30</width>
    <height>40</height>
    <VATrate>20</VATrate>
    <CountInPallet>30</CountInPallet>
    <HasSerials>1</HasSerials>
    <CountryOfOrigin>Malaysia</CountryOfOrigin> (not yet supported)
    <Message>A good TV</Message>
    <Message2>Another good TV</Message2>
    <quantity>12</quantity>
    <reserved>3</reserved>
  <item>
  ...
</itemlist>

Fields Description

  • code — internal identifier assigned by the system.
  • article — supplier SKU ID.
  • barcode — manufacturer barcode.
  • name — item name.
  • retprice — default retail price. When creating the order, the price specified in the order is used.
  • purchprice — purchase price.
  • weight — weight in kilograms.
  • length — length in centimeters.
  • width — width in centimeters.
  • height — height in centimeters.
  • VATrate — value-added tax rate, integer.
  • CountInPallet — number of pieces in a pallet.
  • HasSerials — indicates whether serial numbers tracking is used. Possible values: 1 — Yes, 0 — No.
  • CountryOfOrigin — name of the country of origin.
  • Message — comment.
  • Message2 — additional comment.
  • quantity — quantity in stock. Goods picked up for orders are not included in this number, they are considered to be shipped. This field may be unavailable in some setups.
  • reserved — quantity of goods reserved. It may outnumber the stock balance if customers are waiting for the next delivery. This field may be unavailable in some setups.

Goods Movement

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<itemmovements>
 <auth extra="8" login="login" pass="pass"></auth>
 <code>4259</code>
 <datefrom>2020-10-01</datefrom>
 <dateto>2020-10-02</dateto>
</itemmovements>
  • code — internal item code in the list of goods.
  • datefrom — period start date.
  • dateto — period end date.

You can specify either code or period, or both code and period.


Response Example

<?xml version="1.0" encoding="UTF-8" ?>
<itemmovements count="16">
  <itemmovement>
    <code>151500</code>
    <date>2020-10-01</date>
    <retprice>0</retprice>
    <quantity>1</quantity>
    <delivered>0</delivered>
    <item>
      <code>4259</code>
      <name>Jenga Classic Game</name>
    </item>
    <status>
      <code>5</code>
      <name>Return from customer</name>
    </status>
    <store>
      <code>1</code>
      <name>Moscow office</name>
    </store>
    <order>
      <ordercode>3374830</ordercode>
      <number>123660-0</number>
      <date>2020-10-01</date>
      <orderno>14123</orderno>
      <barcode>0000000670</barcode>
      <company>All Games</company>
      <address>Thompson str., 88</address>
      <delivereddate>2020-05-29</delivereddate>
      <deliveredtime>12:00:00</deliveredtime>
      <deliveredto />
    </order>
    <document>
      <code>21991</code>
      <number>318</number>
      <date>2020-05-26</date>
      <message></message>
    </document>
  </itemmovements>
</itemlist>

Fields Description

  • code — goods movement internal transaction code.
  • date — transaction date.
  • retprice — item price.
  • quantity — item quantity in the movement transaction.
  • delivered — quantity of delivered items.
  • item — goods item container.
  • code — item internal code.
  • name — item name.
  • status — transaction status container.
  • code — status code.
  • name — name.
  • store — container for the branch that performs the transaction.
  • code — branch code.
  • name — branch name.
  • order — shipment container.
  • ordercode — internal order code.
  • number — order number.
  • date — order date.
  • orderno — external order code.
  • barcode — barcode.
  • company — company.
  • address — address.
  • delivereddate — date delivered.
  • deliveredtime — time delivered.
  • deliveredto — delivery info or reason for non-delivery.
  • document — transaction document container.
  • code — internal document code.
  • number — document number.
  • extnumber — external document number.
  • date — document date.
  • message — comment.

Getting Shipping Rates for Towns and Cities

If the nofederal parameter is missing in the request, Moscow is processed in the following way: the response contains Moscow and Moscow region towns and distance markup.

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<tariffs>
 <auth extra="8" login="login" pass="pass" />
 <townfrom>Moscow</townfrom>
 <service>1</service>
 <mainonly>1</mainonly>    
</tariffs>
  • auth — the extra attribute is required, it is used to determine the courier service company.
  • townfrom — sender town or city. If it is not passed, the default value is Moscow.
  • service — delivery mode. Required.
  • mainonly — optional. If passed, the response contains data from the Inter-city > Zones table only.
  • nofederal — optional. If passed, a city of federal importance is processed as an ordinary city.


Response Example

{
    "townfrom": "0c5b2444-70a0-4932-980c-b4dc0d3f02b5",
    "service": 1,
    "tariffs": [
        {
            "towntofias": "0c5b2444-70a0-4932-980c-b4dc0d3f02b5",
            "towntocode": 1,
            "towntoname": "Moscow city",
            "distance": 0,
            "pricedistance": 0,
            "pricesnew": {
                "before": [
                    {
                        "price": "100",
                        "every": "0",
                        "mass": "1"
                    },
		    {
                        "price": "150",
                        "every": "0",
                        "mass": "5"
                    }
                ],
                "after": [
                    {
                         "price": 0,
                        "every": 1,
                        "mass": 38.01
                    },
                    {
                        "price": 15,
                        "every": 1,
                        "mass": 51.01
                    }
                ]
            },
            "deliveryPeriodMin": 1,
            "deliveryPeriodMax": 2
        }       
    ]
}

Fields Description

  • townfrom — sender locality AOGUID (Federal Information Address System) code.
  • service — delivery mode.
  • tariffs — shipping rates list for the locality.
  • towntofias — recipient locality AOGUID code.
  • towntocode — recipient locality internal code.
  • towntoname — recipient locality name.
  • distance — distance in km from Moscow to Moscow Ring Road if townfrom is Moscow.
  • pricedistance — Moscow to Moscow Ring Road distance markup if townfrom is Moscow..
  • pricesnew — your shipping rates from the Inter-city > Rates by Zones table.
  • before/after — containers.
  • price — price. If the response is for the before container, pricedistance is also added to the amount.
  • every — for every specified number of pieces.
  • mass — weight.
  • prices — obsolete, do not use.
  • deliveryPeriodMin — minimum number of days in transit.
  • deliveryPeriodMax — maximum number of days in transit.

Receipt Items

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<itemdoc>
 <auth extra="8" login="login" pass="pass"></auth>
 <code>21991</code>
</itemdoc>
  • code — internal receipt document code.


Response Example

<?xml version="1.0" encoding="UTF-8" ?>
<itemdoc>
  <code>21991</code>
  <number>318</number>
  <date>2021-05-26</date>
  <message></message>
  <items>
    <item code="4259" quantity="1" barcode="200300" article="123555">Jenga Classic Game</item>
  </items>
</itemdoc>

Fields Description

  • code — internal receipt code.
  • number — document number.
  • date — document date.
  • message — comment.
  • item — goods item container.
  • code — internal item code.
  • barcode — item barcode.
  • article — item SKU ID.
  • quantity — quantity of received items.

Branches List

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<storelist>
 <auth extra="8"></auth>
 <json>YES</json>
 <client_code>7890</client_code>
</storelist>
  • auth — the extra attribute is required, it is used to determine the courier service company.
  • json — indicates whether response is in JSON format. Possible values are YES, NO.
  • client_code — courier service client code.

Response Example

<?xml version="1.0" encoding="UTF-8" ?>
<storelist count="2">
  <store>
    <code>123</code>    
    <name>ABC</name> 
  </store>
  <store>
    <code>456</code>   
    <name>Branch 2</name> 
  </store>
</storelist>
  • code — branch code.
  • name — branch name.

Pickup Points List

To show pickup points on the map, use the JavaScript module. See help info in the file. See example here.

Unique pickup point requests are cached on the client account side and retained till 7 AM GMT+3 of the next day. For example, if a unique request with a mass of 2 kg was submitted today at 10 AM, tommorow at 7 AM it will be deleted. If you submit a mass of 2 kg in the same request today at 6 PM, you will get the same list of pickup points. If you submit a mass of 3 kg in the same request, you will probably get another list.

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<pvzlist>
 <auth extra="8" login="login" pass="pass"></auth>
 <code>1234</code>
 <client_code>7890</client_code>
 <city>Sverdlovsk Oblast</city>
 <town regioncode="66" country="RU">Nizhny Tagil</town>
 <parentcode>6</parentcode>
 <acceptcash>YES</acceptcash>
 <acceptcard>YES</acceptcard>
 <acceptfitting>YES</acceptfitting>
 <maxweight>30</maxweight>
 <acceptindividuals>YES</acceptindividuals>
 <lt>57.924737</lt>
 <lg>59.940019</lg>
 <rt>57.905682</rt>
 <rg>59.984669</rg>
 <json>YES</json>
 <limit>
    <limitfrom>30</limitfrom>
    <limitcount>2</limitcount>
    <countall>YES</countall>
 </limit>
</pvzlist>
  • auth — the extra attribute is required, it is used to determine the courier service company. login and pass allow to sign in as a client to apply the pickup points availability restrictions if they are set up for the client.
  • code — internal code.
  • client_code — courier service client code.
  • city - recipint region. You can specify a region code or a full region name from the Regions reference.
  • town — recipient location.
For the town tag, you can speify the value from the Regions reference in the regioncode attribute. The specified region is searched for the town.
In the country attribute, you can specify the recipient country according to the ISO 3166-1 standard. For example: "AT", "AUT" or "040" for Austria.
  • parentcode — parent branch.
  • acceptcash — indicates whether cash on delivery is accepted. Possible values: YES, NO.
  • acceptcard — indicates whether bank cards are accepted. Possible values: YES, NO.
  • acceptfitting — indicates whether try-on is allowed. Possible values: YES, NO.
  • maxweight — maximum weight allowed for the pickup point.
  • acceptindividuals — indicates whether pickup point is available for individuals. Possible values: YES, NO.
  • lt — upper left corner latitude.
  • lg — upper left corner longitude.
  • rt — lower right corner latitude.
  • rg — lower right corner longitude.
  • json — indicates whether response is in JSON format. Possible values: YES, NO.
  • limit — limits result output.
  • limitfrom — defines the search result record number to start output with. The default value is 0.
  • limitcount — defines the quantity of search result records to show. The default value is 100.
  • countall — if YES, the total quantity of found matches is counted. It might slow down the request execution. If disabled, totalcount is missing in the response.


Response Example

<?xml version="1.0" encoding="UTF-8" ?>
<pvzlist count="2" totalcount="40465">
  <pvz>
    <code>126</code>
    <clientcode>3</clientcode>
    <name>Nizhniy Tagil</name>
    <parentcode>6</parentcode>
    <parentname>Integration</parentname>
    <town code="124267" regioncode="66" regionname="Sverdlovsk Oblast">Nizhniy Tagil city</town>
    <address>622036, 17 Tsiolkovsky Str., Nizhniy Tagil city</address>
    <phone>+73435417709, +73435254989</phone>
    <comment>New pickup point</comment>
    <worktime>Sun 10:00-16:00, Sat 10:00-16:00, Mon-Fri 10:00-20:00</worktime>
    <traveldescription>5-storey apartment building, the second building from Parkhomenko-Tsiolkovsky street intersection.</traveldescription>
    <maxweight>10</maxweight>
    <acceptcash>YES</acceptcash>
    <acceptcard>YES</acceptcard>
    <acceptfitting>YES</acceptfitting>
    <acceptindividuals>YES</acceptindividuals>
    <latitude>57.93457</latitude>
    <longitude>59.95131</longitude>
    <uid>40606d00-9c51-11eb-b2c9-cfd6c1111392</uid>
  </pvz>
  <pvz>
    <code>245</code>
    <clientcode>NTG1</clientcode>
    <name>On Krasnoarmeiskaya</name>
    <parentcode>6</parentcode>
    <parentname>Integration</parentname>
    <town code="124267" regioncode="66" regionname="Sverdlovsk Oblast">>Nizhniy Tagil city</town>
    <address>Krasnoarmeiskaya, 79</address>
    <phone>+7(3435)379-044</phone>
    <comment>Try-on is not allowed</comment>
    <worktime>Sun 10:00-16:00, Sat 10:00-16:00, Mon-Fri 10:00-20:00</worktime>
    <traveldescription>Next to McDonalds</traveldescription>
    <maxweight>20</maxweight>
    <acceptcash>YES</acceptcash>
    <acceptcard>YES</acceptcard>
    <acceptfitting>NO</acceptfitting>
    <acceptindividuals>YES</acceptindividuals>
    <latitude>57.93468</latitude>
    <longitude>60.55476</longitude>
    <uid>41116853-9c51-11eb-b2c9-cfd6c1451392</uid>
  </pvz>
</pvzlist>
  • code — pickup point code in MeaSoft. It is used in creating order request.
  • clientcode — pickup point code in service partner system.
  • name — pickup point name.
  • parentcode — pickup point parent code.
  • parentname — pickup point parent name.
  • town — locality with code from City Names List and region code and name.
  • address — pickup point address.
  • phone — pickup point phone number.
  • comment — additional info.
  • worktime — pickup point working hours.
  • traveldescription — pickup point location description.
  • maxweight — maximum weight allowed for the pickup point.
  • acceptcash — indicates whether cash on delivery is accepted. Possible values: YES, NO.
  • acceptcard — indicates whether bank cards are accepted. Possible values: YES, NO.
  • acceptfitting — indicates whether try-on is allowed. Possible values: YES, NO.
  • latitude — location latitude.
  • longitude — location longitude.
  • uid — pickup point unique ID in MeaSoft.
  • count — number of response records.
  • totalcount — total number of relevant records.

Getting Order Fiscal Data

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<receiptdata>
   <auth extra="8" login="login" pass="pass" />
   <orders>
      <order orderno="123456" />
      <order orderno="890111C" />
   </orders>
</receiptdata>

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<receipts count="1">
   <receipt>
      <orderno>123456</orderno>
      <fdDatetime>2020-06-07 12:14:00</fdDatetime>
      <fdValue>123</fdValue>
      <fdNum>456</fdNum>
      <fnSn>789</fnSn>
      <kktNum>100</kktNum>
      <inn>222</inn>
      <ofdUrl>gate.ofd.ru</ofdUrl>
      <fullUrl>https://check.ofd.ru/123</fullUrl>
      <price>12345</price>
      <lines count="1">
         <line>
            <item>1111764</item>
            <name>Boots</name>
            <qty>1</qty>
            <price>1000</price>
            <vatRate>20</vatRate>
            <governmentCode>Z16513LK2</governmentCode>
            <itemType>1</itemType>
         </line>
      </lines>
   </receipt>
</receipts>


Fields Description

  • orderno — order number.
  • fdDatetime — fiscal receipt issued date and time.
  • fdValue — fiscal document tag.
  • fdNum — fiscal document (receipt fiscal number).
  • fnSn — fiscal memory device number.
  • kktNum — cash registers number.
  • inn — TIN (taxpayer individual number).
  • ofdUrl — fiscal data operator URL address (domain name).
  • price — receipt amount.
  • fullUrl — receipt URL for online access.
  • lines — receipt items.
  • item — item code.
  • name — item name.
  • qty — item quantity.
  • price — item price.
  • governmentCode — CHESTNYI Znak code sequence. It is processed by the 1162 tag algorithm.
  • vatRate — item VAT rate.
  • itemType — item type (goods, delivery, etc.)

Urgency Kinds List

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<services>
<auth extra="8"/>
</services>

Response Example

<?xml version="1.0" encoding="UTF-8" ?>
<services count="2">
  <service>
     <code>1</code>
     <name>Economy</name>
  </service>
  <service>
     <code>2</code>
     <name>Urgent</name>
  </service>
</services>

Value-Added Services List

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<advprices>
   <auth extra="8" login="login" pass="pass" />
   <visible>NO</visible>
</advprices>

advprices — root container. Required.

  • visible — indicates whether only the value-added services available in client account are returned. Optional. Possible values: Yes, No. The default value is No.


Response Example

<?xml version="1.0" encoding="UTF-8" ?>
<advprices>
   <advprice>
       <code>1</code>
       <name>Number of floors in the building</name>
       <type>int</type>
   </advprice>
   <advprice>
       <code>2</code>
       <name>Markup coefficient </name>
       <type>float</type>
   </advprice>
   <advprice>
       <code>3</code>
       <name>Heavy lift</name>
       <type>bool</type>
   </advprice>
</advprices>

Параметры:

  • code — internal service code.
  • name — service name. If in the Value-Added Services list the Name in client account column is not empty, the column value is returned.
  • type — service type. Possible values:
  • bool — for services with the Check box input type.
  • float — for services with the Float input type.
  • int — for services with the Integer input type.

Delivery Fee Calculation

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<calculator>
 <auth extra="8" login="login" pass="pass" />
 <order>
  <pricetype>CUSTOMER</pricetype>
  <sender>
     <town>Moscow</town>
     <address>Lenin street, 95</address>
     <coords lat="55.621048" lon="37.604456"></coords>
   </sender>
   <receiver>
     <zipcode>125480</zipcode>
     <town regioncode="78" country="RU">Saint Petersburg</town>
     <address>Petrovka 38 office 35</address>
     <pvz>124</pvz>
     <coords lat="55.680327" lon="37.604456"></coords>
   </receiver>
   <weight>5.1</weight>
   <service>2</service>
   <paytype>CASH</paytype>
   <price>387.5</price>
   <deliveryprice>150</deliveryprice>
   <inshprice>387.5</inshprice>
   <packages>
      <package mass="1" quantity="5"></package>
      <package mass="2.5" length="10" width="20" height="30"></package>
   </packages>
   <userid>user123</userid>
   <groupid>customer</groupid>
 </order>
</calculator>

Parameters are the same as described in Creating Order.

Fields Description

  • pricetype — price type. Possible values:
    • CUSTOMER — delivery price for end customer. The default value.
    • CLIENT — courier service price for client.
  • townfrom - sender location.
  • addressfrom — sender address.
  • zipcode — recipient postal code.
  • townto — recipient location.
  • addressto — recipient address.
  • pvz — pickup point code in MeaSoft.
  • l — length in cm. Optional.
  • w — width in cm. Optional.
  • h — height in cm. Optional.
  • mass — weight in kg.
  • service — delivery mode which is an integer specifying an Urgency Kinds list record. If the parameter is not specified, all available urgency kinds are calculated, with a lot of the <calc> containers in response.
  • price — cash on delivery amount.
  • inshprice — declared value amount.
  • paytype — payment type.
  • userid — user ID, either string or integer type. Virual field, optional. The field is used in the custom delivery rate settings. It defines the rule priority. You can use the field for CMS and CRM to set delivery fee for each customer individually.
  • groupid — user group ID, either string or integer type. Virual field, optional. The field is used in the custom delivery rate settings. It defines the rule priority. You can use the field for CMS and CRM to set delivery fee for each customer group individually.

Cash on delivery amount, declared value amount, and CARD payment type are used in service percent calculations set up in the delivery rate card, on the Other tab.

In authorization, you can omit the login and pass. In this case, the fee is calculated using courier service standard delivery rate, without taking into account possible differences for a certain client.

Dimensional weight is calculated only if all the dimensions are provided: length, width, heigth.

Sender and recipient location possible values:

  • location name (not recommended).
  • a code from the City Names list.
  • a 13-digit code of All-Russian Classifier of Addresses (Address Classifier used in Russia).
  • a 36-digit code of the Federal Information Address System (AOGUID).


Response Example

<?xml version="1.0" encoding="UTF-8"?>
<calculator>
  <calc>
    <townfrom code="1">Moscow city</townfrom>
    <townto code="56603">Irkutsk city</townto>
    <mass>3.7</mass>
    <service name="Express">1</service>
    <zone>2</zone>
    <price>1113</price>
    <mindeliverydays>1</mindeliverydays>
    <maxdeliverydays>3</maxdeliverydays>
    <mindeliverydate>2020-05-13</mindeliverydate>
    <deliveryprice>
     <advprice code="1" price="1000">Base</advprice>
     <advprice code="4" price="100">Amount percent</advprice>
     <advprice code="5" price="63">Declared value percent</advprice>
     <advprice code="6" price="-50">Discount on delivery</advprice>
    </deliveryprice>
  </calc>
</calculator>

Parameters:

  • townfrom — sender location as recognized and assigned to the list of cities by the system.
    • code — a code from the City Names list.
  • townto — recipient location as recognized and assigned to the list of cities by the system.
    • code — a code from the City Names list.
  • mass — weight in kilograms.
  • service — delivery mode which is an integer specifying an Urgency Kinds list record. If the parameter is not specified, all available urgency kinds are calculated, with a lot of the <calc> containers in response.
  • zone — number of the rate zone used in the calculation. The shipping rate schedule is selected depending on the zone. Coefficients can be applied to the shipping cost if the order is not delivered from or to a regional center.
  • price — shipping cost in the currency of the courier service. We recommend that you use this parameter.
  • maxdeliverydays — maximum number of busines days in transit.
  • mindeliverydate — closest delivery date considering holidays.
  • deliveryprice — contains shipping cost details.

Note: the actual server response contains the price attribute in the calc tag. It is retained for backward compatibility, use nested price tag instead.

Getting Client Info

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<client>
  <auth extra="8" login="login" pass="pass" /> 
</client>

client — root container. Required.

  • auth — authorization. Required.

Response Example

<?xml version="1.0" encoding="UTF-8" ?>
<client>
  <code>1082</code>
</client>
  • code — client code.

List of Сash Transfer Certificates

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<smalist>
  <auth extra="8" login="login" pass="pass" />
  <datefrom>2021-02-10</datefrom>
  <dateto>2021-03-10</dateto>
</smalist>

smalist — root container. Required.

  • auth — authorization. Required.
  • datefrom — date from. Optional.
  • dateto — date to. Optional.

If the date range is not specified, cash transfer certificates for the last month are returned.

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<smalist count="1">
  <sma>
    <code>6278</code>
    <number>3992</number>
    <actdate>2020-02-12</actdate>
    <datepay></datepay>
    <dateto>2020-02-12</dateto>
    <promiseddatepay></promiseddatepay>
    <price>637.00</price>
    <pricecorr>113.00</pricecorr>
    <rur>13430.00</rur>
    <pricekur>570.00</pricekur>
    <priceag>67.00</priceag>
    <payno>42423</payno>
    <paytype>1</paytype>
    <paytypename></paytypename> /not supported yet
    <signedcopyreceived>NO</signedcopyreceived>
  </sma>
</smalist>
  • code — cash transfer certificate code.
  • number — cash transfer certificate number in MeaSoft.
  • actdate — date cash transfer certificate created.
  • datepay — date cash transfer certificate paid.
  • dateto — cash transfer certificate period end date.
  • promiseddatepay — planned payment date.
  • price — cost of courier services.
  • pricecorr — adjustment amount.
  • rur — order amount.
  • pricekur — courier delivery cost.
  • priceag — service partner fee.
  • payno — payment order number.
  • paytype — type of payment: 1 — non-cash payment, 2 — paying a courier in cash, 3 — paying cash at the office, 4 — payment to bank card.
  • paytypename — payment type as string.
  • signedcopyreceived — indicates whether cash transfer certificate is returned. Possible values: YES, NO.

Cash Transfer Certificate Breakdown

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<smadetail>
  <auth extra="8" login="login" pass="pass" />
  <code>6278</code>
</smadetail>

smadetail — root container. Required.

  • auth — authorization. Required.
  • code — cash transfer certificate code. Required.

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<smadetail count="2">
  <specialsma>
    <code>42494</code>
    <ordercode>14424</ordercode>
    <orderno>11111</orderno>
    <orderdate>2021-01-01</orderdate>
    <delivereddate>2021-10-01</delivereddate>
    <company>Company</company>
    <price>314.00</price>
    <rur>8800.00</rur>
    <inshprice>314.00</inshprice>
    <pricekur>270.00</pricekur>
    <priceag>44.00</priceag>
    <pricecalc>8486.00</pricecalc>
    <paytype>2</paytype>
    <paytypename>paying a courier in cash</paytypename>
    <weight>0.400</weight>
    <distance>0.0</distance>
    <status>Delivered</status>
  </specialsma>
</smadetail>
  • code — record code.
  • ordercode — external order code.
  • orderno — order cipher.
  • orderdate — order date.
  • delivereddate — delivery date.
  • company — recipient.
  • price — cost of courier services.
  • rur — order amount.
  • inshprice — order cost.
  • pricekur — courier delivery cost.
  • priceag — service partner fee.
  • pricecalc — amount to pay to service partner.
  • paytype — type of payment: 1 — non-cash payment, 2 — paying a courier in cash, 3 — paying cash at the office, 4 — payment to bank card.
  • paytypename — payment type as string.
  • weight — order weight.
  • distance — order distance.
  • status — order status.

URL Shortener

Sometimes, you might want to use short links to client account. For instance, when sending an SMS to recipient.

To get a short URL, send a request with a full URL. Hash value for a short link is returned.

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<shortlink>
  <link short="0">https://home.courierexe.ru/8/site/orders</link>
</shortlink>

shortlink — root container. Required.

  • link — long link to shorten. Required. If short value is 1, the return contains only hash code, no XML.

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<shortlink>
  <hash>35AF350C</hash>
</shortlink>
  • hash — URL hash code.

Use it as client account URL:

https://home.courierexe.ru/35AF350C or curie.ru/35AF350C

Note. URL shortener is only for MeaSoft company sites.

Recipient Rating Check

The check is available only for the Maximum personal account plan.

Request Example

<?xml version="1.0" encoding="UTF-8" ?>
<mcheck>
  <auth extra="8" login="login" pass="pass" />
  <phones>
    <phone>89161147992</phone>
  </phones>
</mcheck>

Response Example

<?xml version="1.0" encoding="UTF-8" ?>
<mcheck>
  <phones>
    <phone rate="90">89161147992</phone>
  </phones>
</mcheck>