Изменения

Перейти к: навигация, поиск

API Documentation

7596 байт добавлено, 23 апрель
Response Examples
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 [mailto:support@courierexe.ru support@courierexe.ru]. In your e-mail email message , please introduce yourself, leave your contact information (your phone number, Skype login) and the name of the company that you want to integrate with.
== CMS Integrations ==
|-
|[[Файл:bitrix.png|center|x44px]]
|style="text-align: center;"|[httphttps://marketplace.1c-bitrix.ru/solutions/measoft.courier/ Install]
|Supports version 14.5 and higher.
|-
|[[Файл:prestashop.png|center|x60px]]
|style="text-align: center;"|[httphttps://courierexe.ru/download/api/prestashop.zip Download]
|Supports version 1.5.2.0 and higher (including 2.x)
|-
|[[Файл:OpencartOCStore.png|center|x60px]]
|style="text-align: center;"|[httphttps://courierexe.ru/download/api/opencart.zip For version 1.5.5.1]<br>[httphttps://courierexe.ru/download/api/measoft_oc2.ocmod.zip For version 2.0]<br>[httphttps://courierexe.ru/download/api/measoft_oc2.3.ocmod.zip For version 2.3]<br>[httphttps://courierexe.ru/download/api/measoft_ос3.ocmod.zip For version 3.0]
|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]
|-
|The module is designed for sending orders to delivery service, while the plugin calculates delivery cost on creating an order.
|-
<!--|[[Файл:advantshop.png|center|x44px]]
|style="text-align: center;"|[https://promo-z.ru/ PROMO company site]
|The PROMO company has developed the module. Contact PROMO to set up integration between MeaSoft and ADVANTSHOP.
|--->
|[[Файл:insales.png|center|x80px]]
|style="text-align: center;"|Configure using MeaSoft [[Личный кабинет клиента|client account]]
|-
|[[Файл:Joomla2.jpg|center|x60px]]
|style="text-align: center;"|[httphttps://courierexe.ru/download/api/com_measoft.zip Download]
|Integration with Virtuemart is available only.
|-
|-
|[[Файл:wordpress.jpg|center|x80px]]
|style="text-align: center;"|[httphttps://courierexe.ru/download/api/wordpress.zip Download]
|
|-
|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
|-
|}
For debugging, you can access your test client account at
https://home.courierexe.ru/8
login testlogin password testmpass
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.
== Account for Integration ==
Use the following credentialsYou can access your client account at: <source lang=xml><auth extra="8" login="login" pass="pass"></auth></source> Description:* Extra client '''extra''' — extra code. This is , a digital code, company`s unique identifier. Request this parameter from of the courier service you are integrating with. You can see this code in MeaSoft desktop interface by using its main menu * '''Referencelogin''' > — user name for the client account and API.* '''Additional Optionspass'''— password for the client account and API. Extra code is given in  Request the credentials from the second hyperlink (it is marked courier service you are integrating with an asterisk on the screenshot below): [[File:extra1.png|750px|none]]* LoginThe courier service gives you a temporary password. It is a user name for For security purposes, change it using your client account and API.  == Courier Service Access == To access API with courier service creates credentials, use the following connection string: <source lang=xml><auth extra="8" login="login in the client card on the " pass="pass" clientcode="123"></auth></source> Description: * '''Otherextra''' tab in — extra code, a unique identifier of the courier service. * '''login'''User — couerier service user name.* '''pass' field. You will probably have to create a new client card (shown on the screenshot below) in MeaSoft software'' — couerier service password.* Password. It is a password for '''clientcode''' — internal client account and API. Courier service creates password in code (see the client card on office application, the '''OtherClients''' tab , the "Internal code" column). To see the extra code, login and password, in the office application go to the '''PasswordAdditional Features''' fieldreference. (shown on the screenshot below). For more information, see [[File:33_client.pngCourier_Service_Account#Registering Courier Service Account|500px|noneRegistering 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: testlogin password: testmpass
extra client code: 8
* 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.
* 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>.
<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>
<?xml version="1.0" encoding="UTF-8"?>
<neworder>
<auth extra="8" login="testlogin" pass="testmpass" />
<order>
<receiver>
</source>
</spoiler>
 
 
'''Fields Description'''
*'''neworder''' is a root container, required. :*'''''newfolder''''' is an 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''' is a 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''''' is an order number. It should be entered here 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''' 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 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">
<sender>
*'''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 <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.
*'''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.
*'''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.
:*'''''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].
:* '''''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:
:* '''''price''''' — purchase amount within the limit.
* '''advprices''' — a container describing additional 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 '''Additional Value-added services''' field for new order and pickup request.</span>
:* '''''code''''' — service code.
:* '''''value''''' — service value. If service type is Boolean, set the value to '''True'''.
If you want to apply additional 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;">
=== 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>errormsgruerrormsg</code> attribute returns. The <code>orderno</code> attribute contains order number, <code>barcode</code> — order barcode.
'''Success'''
<?xml version="1.0" encoding="UTF-8"?>
<neworder>
<createorder orderno="AB23541" barcode="67567#114" error="0" errormsg="successSuccess" orderprice="5000"></createorder> <createorder orderno="55_6542AB23542" barcode="67567#115" error="0" errormsg="successSuccess" orderprice="6000"></createorder> <createorder orderno="AB23542AB23543" barcode="67567#116" error="0" errormsg="successSuccess" orderprice="0"></createorder>
</neworder>
</source>
<?xml version="1.0" encoding="UTF-8"?>
<neworder>
<createorder orderno="AB23541" barcode="67567#114" error="1767" errormsg="Such number Order barcode already existsin the database."></createorder> <createorder orderno="AB23542" barcode="67567#115" error="1317" errormsg="empty companyOrder number already exists in the database."></createorder> <createorder orderno="AB23543" barcode="67567#116" error="1467" errormsg="empty personOrder barcode already exists in the database."></createorder>
</neworder>
</source>
<done>ONLY_NOT_DONE</done>
<changes>ONLY_LAST</changes>
<conditions>
<namecontains>1234</namecontains>
<namestarts>1234</namestarts>
</conditions>
</statusreq>
</source>
=== 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 — CLIENT — the default value.:* AGENT — 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 — ONLY_DONE — delivered only. Success stauses like '''Delivered''', '''Partially delivered'''.:* ONLY_NOT_DONE — ONLY_NOT_DONE — undelivered only. Statuses like '''Not delivered''', '''Lost'''.:* ONLY_NEW — ONLY_NEW — new only.:*ONLY_DELIVERY — 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|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.
<div style="color: #a94442; background-color: #f2dede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
# You can request statuses of orders created no earlier than 2 months before the '''to''' date (<code>datefrom</code> and <code>dateto</code> containers). # If no date is provided, <code>dateto</code> equals the current date. # Omitting <code>dateto</code> defaults to <code>datefrom</code> plus two months.
# Omitting <code>datefrom</code> defaults to <code>dateto</code> minus two months.
# You can search using '''conditions''' only by order numbers (external codes). 4 characters is the minimum search length.
</div>
<time_max>14:00</time_max>
<coords lat="55.680327" lon="37.604456"></coords>
<deliveryPIN>1234</deliveryPIN>
</receiver>
<pickup>NO</pickup>
<return_weight>5.1</return_weight>
<quantity>2</quantity>
<paytypecode="1">CASH</paytype>
<service>2</service>
<return_service>2</service>
<arrival>2021-05-02 23:21</arrival>
<outstrbarcode>EXT123456</outstrbarcode>
<partner>Western Branch</partner>
<return_message>Delivered undamaged</return_message>
<department>Accounting</department>
=== Response Fields ===
All responce response fields correspond to the [[#Example of New Order|order creating request]] structure, with the following additions:
* The '''order''' container attributes:
:* '''''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:
:* '''''delivery''''' — one-way trip cost.
:* '''''return''''' — return trip cost (if '''order''' > '''return=YES''').
The '''deliveryprice''' tag includes additional value-added services. The option is available for the Premium and Maximum courier service account plans::* '''''advprice''''' — additional value-added service name.:* '''''code''''' — additional value-added service code.:* '''''price''''' — additional value-added service amount.
* '''status''' — delivery status. See the list of statuses below. It has the following attributes:
* '''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.
<auth extra="8" login="login" pass="pass"></auth>
<changes>ONLY_LAST</changes>
<streamid>1234</streamid>
</statusreq>
</source>
<auth extra="8" login="login" pass="pass"></auth>
<client>CLIENT</client>
<streamid>1234</streamid>
</commitlaststatus>
</source>
* '''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.
# 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 ===
* 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 responce response structure]], except for:
*the <code>editorder</code> tag is returned instead of <code>neworder</code>.
* '''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.
*'''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.
<name>Moscow</name>
<fullname>Moscow city</fullname>
<country>1RU</country>
</conditions>
<limit>
*'''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 Item Movement ==
'''Request Example'''
:* '''number''' — order number.
:* '''date''' — order date.
:* '''orderno''' — external order code.
:* '''barcode''' — barcode.
:* '''company''' — company.
== 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'''
*'''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.
"tariffs": [
{
"towntofias": "7339e8340c5b2444-2cb470a0-47344932-a4c7980c-1fca2c66e562b4dc0d3f02b5", "towntocode": 1, "towntoname": "482Moscow city", "towntonamedistance": 0, "Ufa citypricedistance": 0,
"pricesnew": {
"before": [
"mass": "1"
},
{ "price": "200150", "every": "10", "mass": "25"
}
],
"after": [
{
"price": 0, "300every": 1, "everymass": 38.01 }, { "1price": 15, "massevery": 1, "3mass": 51.01
}
]
},
"prices": { "before": { "mass": "3", "price": "202.5" }, "after": { "mass": "3", "everydeliveryPeriodMin": "1", "price": "18.75" } }, "deliveryPeriodMin": 4, "deliveryPeriodMax": 52
}
]
:* '''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.
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].
 
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'''
<code>1234</code>
<client_code>7890</client_code>
<city>Sverdlovsk Oblast</city> <townregioncode="66" country="RU">Nizhniy Nizhny Tagil</town>
<parentcode>6</parentcode>
<acceptcash>YES</acceptcash>
*'''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'''.
<?xml version="1.0" encoding="UTF-8"?>
<receiptdata>
<auth extra="8" login="testlogin" pass="testmpass" />
<orders>
<order orderno="123456" />
</source>
== Additional Value-Added Services List ==
'''Request Example'''
'''advprices''' — root container. Required.
*'''visible''' — indicates whether only the additional value-added services available in client account are returned. Optional. Possible values: '''Yes''', '''No'''. The default value is '''No'''.
Параметры:
*'''code''' — internal service code.
*'''name''' — service name. If in the '''Additional Value-Added Services''' list the '''Name in client account''' column is not empty, the column value is returned.<!--*'''hine''' — additional value-added service hint for user.-->
*'''type''' — service type. Possible values:
:*'''bool''' — for services with the '''Check box''' input type.
<?xml version="1.0" encoding="UTF-8" ?>
<calculator>
<auth extra="8" login="login" pass="pass" /> <order> <calc pricetype=">CUSTOMER"</pricetype> <sender> townfrom=" <town>Moscow" </town> addressfrom=" <address>Lenin prospectstreet, 95</address> <coords lat="55.621048" zipcodelon="66400037.604456"></coords> </sender> townto <receiver> <zipcode>125480</zipcode> <town regioncode="380000030000078" addresstocountry="Pushkinskaya str., 10RU">Saint Petersburg</town> <address>Petrovka 38 office 35</address> <pvz>124</pvz> <coords lat="12355.680327" llon="1037.604456"></coords> </receiver> w <weight>5.1</weight> <service>2</service> <paytype>CASH</paytype> <price>387.5</price> <deliveryprice>150</deliveryprice> <inshprice>387.5</inshprice> <packages> <package mass="201" hquantity="305"></package> <package mass="32.75" servicelength="110" pricewidth="120020" inshpriceheight="120030"></package> </packages> <userid>user123</userid> <groupid>customer</groupid> paytype="CASH" </order>
</calculator>
</source>
Parameters are the same as described in [[#Creating Order|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.
*'''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.
<service name="Express">1</service>
<zone>2</zone>
<price>11631113</price>
<mindeliverydays>1</mindeliverydays>
<maxdeliverydays>3</maxdeliverydays>
<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>
*'''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 ==
<?xml version="1.0" encoding="UTF-8" ?>
<client>
<auth extra="8" login="testlogin" pass="testmpass" />
</client>
</source>
*'''code''' — record code.
*'''ordercode''' — external order code.
*'''orderno''' — order cipher.
*'''orderdate''' — order date.
98
правок

Навигация