Trimpo Public Application program interface (API) is a set of routines, protocols, and tools for building software application. API makes it easier to develop a program by providing all the building blocks.
Basic URL: api_base_url = https://api.trimpo.org/api
Providing information on order sending
You should put these fields in each request header:
Content-Type:application/json
X-MP30-Version: version
X-MP30-Date: date
X-MP30-Token: token
X-MP30-Application-Id: applicationId
- date – date of request sending which used to generate a token;
- applicationId – ID generated via personal account;
- applicationSecret – secret key generated via personal account;
- token – hash_hmac( ‘sha1′, method+’:’ + date +’:’+resource + ‘:’ + contentMD5Hash, applicationSecret)
- method – GET or POST;
- resource – url of the requested resource;
- contentHash – MD5 hash of the content sent through POST method;
- version – api version – number 1 or higher.
Example:
Token creation with POST
token=hash_hmac( 'sha1', 'POST:Tue, 21 Aug 2012 18:45:59 +0400:/api/public/version:44e7a186db2c24f55e9bf22e427df2ad', '626cca7587b25ae758ec3d80b8e624a2')
POST header type
Content-Type:application/json
X-MP30-Version:1
X-MP30-Date:Tue, 21 Aug 2012 18:45:59 +0400
X-MP30-Token:b3eb6907c7a58f5639a9400df69319d961490924
X-MP30-Application-Id:549e2498-c97a-4766-bcac-ef496ec3bfa2
Token creation with GET
token=hash_hmac( 'sha1', 'GET:Tue, 21 Aug 2012 18:45:59 +0400:/api/public/version', '626cca7587b25ae758ec3d80b8e624a2')
GET header type
Content-Type:application/json
X-MP30-Version:1
X-MP30-Date:Tue, 21 Aug 2012 18:45:59 +0400
X-MP30-Token:902fb0aa5051065cb984b7310c6516722f360bac
X-MP30-Application-Id:549e2498-c97a-4766-bcac-ef496ec3bfa2
Here is a couple of methods to work with orders:
Request must contain authentication.
GET http://api_base_url/public/order/list
Request parameters
"source": <Name of the system, from which we want to receive orders - ebay>, - mandatory field//line
"order_id": <Order ID in sourse system, for example ebay>, - optional field//line
"merchant_id": <Shop ID in trimpo>, - optional field//number
"ebay_profile_id": <Profile ID in trimpo>, - optional field//number
"created_date_from": <date and time of order creation in source system - yyyy-MM-dd HH:mm:ss>, - optional field//date
"created_date_to": <date and time of order creation in source system - yyyy-MM-dd HH:mm:ss>, - optional field//date
"start_number": <number of lines that have to be skipped - by default - 0>, - optional field//number
"count_items": <number of lines in answer - by default - 10>, - optional field//number
"sort_by": <field for sort - order_id|merchant_id|ebay_profile_id|created_date>, - optional field//line
"sort_order": <ASC|DESC> - optional field//line
JSON answer syntax
{
"arrays" : [
{
"source": <Name of the system from which we want to receive orders - ebay>,//line
"order_id": <Order ID in source system, for example in ebay>,//line
"status_order": <Order status from source system>,//line
"status_paid": <Payment status from source system>,//line
"tracking_number": <Mailing number>,//line
"shipping_service": <Post service chosen by user>,//строка
"shipping_cost": <Delivery price>,//number
"shipping_carrier_used": <Post service which sent an order>,//line
"seller_id": <Seller ID in source system>,//line
"merchant_id": <Shop ID in trimpo>,//number
"buyer_id": <Customer's ID in source system>,//line
"buyer_email": <Customer's E-mail>,//line
"buyer_phone": <Customer's phone>,//line
"sub_total": <Price without delivery>,//number
"total": <Price with delivery>,//nember
"created_time":<Order creation date in source system>,//date
"paid_time":<Order payment date in source system>,//date
"address":{//delivery address
"name": <Recipient name>,//line
"street1": <address first line>,//line
"street2": <address second line>,//line
"city_name": <City>,//line
"state_or_province": <State>,//line
"country_name": <Country>,//line
"postal_code": <Index, ZIP-code>//line
},
"items":[//goods in order
{
"item_id": <Good ID in source system>,//number
"item_name": <Good name in source system>,//line
"offer_id": <ID in shop system>,//line
"transaction_id": <Transaction number>,//line
"sku": <Good ID in shop>,//line
"currency": <Currency>,//line
"price": <Price>,//number
"quantity": <Quantity>,//number
},
...
]
}
],
"amount": <number of lines fell under condition select>
"error_code": <error code>, //number, 0 - no errors
"error_message": "<human understandable message>" //text
}
Providing information on order sending
Request should contain authentication
POST http://api_base_url/public/order/shipping
Request syntax
{
"source": <Name of the system from which we want to receive orders - ebay>, - mandatory field//line
"order_id": <Request ID in source system, for example in ebay>, - mandatory field//line
"tracking_number": <Mailing ID>,//line
"shipped_time": <Sending date and time - yyyy-MM-dd'T'HH:mm:ssZ>,//line
"shipping_carrier_used": <Post service>//line
}
The following values are acceptable for Russia
russianpost
ruexpeditedmoscowonly
ems
shopdeliveryservice
JSON answer syntax
{
"error_code": <error code>, //number, 0 - no errors
"error_message": "<human understandable message>" //text
}
Request example
{
"order_id":"121895241034-1601033651002",
"source":"ebay",
"tracking_number":"RU2186322343FG",
"shipped_time":"2016-04-14T12:11:52+0300",
"shipping_carrier_used":"russianpost"
}
Request should contain authetication
POST http://api_base_url/public/order/paid
Request syntax
{
"source": <Name of the system from which we want to receive orders - ebay>, - mandatory field//line
"order_id": <Order ID in source system, for example in ebay>, - mandatory field//line
"paid": <TRUE|FALSE>
}
JSON answer syntax
{
"error_code": <error code>, //number, 0 - no errors
"error_message": "<human understandable message>" //text
}