- Created by Andrey Veprikov, last modified on Jan 26, 2022
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 10 Next »
Method Objective
The method allows importing order history or updating of orders previously imported or created by tracking, as well as changing order statuses.
Don't use this method to create new orders. The creation of new orders should be done by tracking user activity in a way that is appropriate for your platform. See REST API, JS SDK or Mobile SDKs.
Request
Endpoint | Request Type | Content-Type | Rate Limit | Max Data Size |
---|---|---|---|---|
https://api.personaclick.com/sync/orders | POST | application/json | 40 requests/minute | 32 MB/request |
Parameters
Name | Type | Requirement | Description |
---|---|---|---|
shop_id | string | required | Unique Store Key in PersonaClick. Located there: Account > Settings > Store Settings |
shop_secret | string | required | Store Secret Key in PersonaClick. Located there: Account > Settings > Store Settings |
orders | Array | required | Object array with orders. See the description below. |
Order Object
Name | Type | Requirement | Description |
---|---|---|---|
id | string | required | Order ID. If the Order ID and Order Number aren't the same, it's recommended to use the Order Number value. This will allow for easy comparison of orders on both sides. Also, note that the source of this property must be the same as the one used in the User Activity Tracking (Purchase Event). |
status | string | required | Order Status. The status matching must be set there in advance: Account > Settings > Order Statuses |
channel | string | required for new order | The name of the sales channel. Any string value, such as "website", "offline", "mobile_ios", "mobile_android", "infokiosk", "pos", "callcenter", etc. |
date | number | required for new order | Order date in UNIX timestamp format (in seconds). Milliseconds and microseconds aren't supported. |
value | Object | required for new order | Describes the parts from which the final cost of the order is calculated. See the description below. |
items | Array | required for new order | Describes the products of the order. See the description below. This property should be missing if the synchronization of the status of an existing order is performed. |
offline | boolean | optionally | Sets whether the order was created offline or not. Default: false. |
string | optionally | User's email. | |
phone | string | optionally | User's phone. |
loyalty_id | string | optionally | User's Loyalty ID. |
location_id | string | optionally | User's Location. Should match the value from the previously given list of locations (HTTP API, XML feed). |
promocode | string | optionally | The promo code that the user applied at checkout. |
delivery_type | string | optionally | Delivery Type, e.g. "courier", "self_pickup", "delivery", "pickup_point", etc. |
delivery_address | string | optionally | Shipping address. |
delivery_date | string | optionally | Date of delivery, planned or completed. Format: YYYY-MM-DD. |
delivery_time | string | optionally | Time of delivery, planned or completed. Format: hh:mm. |
payment_type | string | optionally | The method of payment, such as "cash", "card", "wire", etc. |
tax_free | boolean | optionally | It sets whether the order was placed with Tax-Free or not. |
Value Object
Name | Type | Requirement | Description |
---|---|---|---|
total | number | required | Order's total value. The "total" value should be equal to the "cash" plus the "bonuses" plus the "delivery" minus the "discount" values. |
cash | number | optionally | Describes how much of the order's value was paid by cash. |
bonuses | number | optionally | Describes how much of the order's value was paid by bonuses. |
delivery | number | optionally | Describes the cost of delivery of the order. |
discount | number | optionally | Describes the amount of discount (in money) applied to the order. |
Items Array
Name | Type | Requirement | Description |
---|---|---|---|
id | string | required | Product ID. |
price | number | required | Cost per unit of product. |
quantity | number | required | The product quantity in the order. |
API Response Code
HTTP status code | Description |
---|---|
200 OK | Authorization was successful. The import process is asynchronous and executes in the background. The system checks only if the value types are correct, but not if the values themselves are correct. First, make sure by importing one order that the data is correct, then import all necessary orders. |
400 Bad Request | Unsuccessful authorization. |
Request Example
curl 'https://api.personaclick.com/sync/orders' \ -X 'POST' \ -H 'content-type: application/json' \ --data-binary '@data.json' # data.json { "shop_id":"0d42fd8b713d0752776ca589cc0056", "shop_secret":"0123456789abcdef0123456789abcdef", "orders":[ { "id":"ORDER_ID_1", "status":"Delivered", "channel":"website", "date":1626344304, "offline":false, "email":"john.doe@examplemail.com", "phone":"4400114527199", "loyalty_id":"000001234567", "location_id":"NY", "promocode":"vxawxSi9Uy", "delivery_type":"courier", "delivery_address":"146, Somewhere Ave, NY", "delivery_date":"2021-08-21", "delivery_time":"00:01", "value":{ "total":212.13, "cash":190, "bonuses":27, "delivery":20, "discount":24.87 }, "items":[ { "id":"ITEM-ID-1", "price":205, "quantity":1 }, { "id":"ITEM-ID-2", "price":3, "quantity":4 } ] }, { "id":"ORDER_ID_2", "status":"Delivered", "channel":"website", "date":1626344414, "offline":false, "email":"peter.parker@examplemail.com", "phone":"4400145291711", "loyalty_id":"000000001", "location_id":"NY", "promocode":"vxawxSi9Uy", "delivery_type":"courier", "delivery_address":"Forest Hills, Queens", "delivery_date":"2021-07-20", "delivery_time":"10:01", "value":{ "total":211.13, "cash":190, "bonuses":27, "delivery":20, "discount":24.87 }, "items":[ { "id":"ITEM-ID-3", "price":204, "quantity":1 }, { "id":"ITEM-ID-4", "price":3, "quantity":4 } ] } ] }
Page Navigation
Related Pages
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
- No labels