This section helps you import an existing order history to improve personalization.
TIPS
Sending a request with an empty array will trigger an error notification email
Incorrectly formatted data will trigger an error notification email
Do not send more than 1000 orders per request to ensure quick processing
TIP for Sync Status of Orders:
Perform the import at least every 24 hours. Ideally - every hour via a scheduled cron event
To import your Order History on PersonaClick:
Send an HTTP POST request to the following URL: NOTE: Order History requests are processsed asynchronously. When a request is succesfully processed, you will see "200 OK" in the response.
http://api.personaclick.com/import/orders
While sending, use the following HTTP header:
Content-Type: application/json
Insert your order history into the body of the request in the form of a JSON-string. NOTE: Use the following structure for it:
{
shop_id - Store Key
shop_secret - Secret Key
orders [ - Orders (in an array)
{
id - Order ID
user_id - Customer ID
user_email - Customer amail
date - Order date in UNIX timestamp format (an integer)
offline - Offline order marker (type: boolean, values: true - offline order, false - online order as default)
loyalty_card - (string) Identifier (number) of the customer's loyalty card
location_id - (string/number) Identifier of a store/city location used in a product feed (XML) or HTTP import of products
phone_number - (string) Customer's phone number
items [ - Items in the order (in an array)
{
id - Product ID
price - Product price
categories []- Category IDs for the products (optional; in an array)
is_available - Product availability status (a boolean: 1/true - in stock, 0/false - out of stock)
amount - Amount of certain product in the order
}[...]
]
}[...]
]
}
To clarify, consider the following example of JSON-code: