Page tree
Skip to end of metadata
Go to start of metadata

This topic helps you import your Order History.

This page covers the following:

Import Your Order History

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
  • Perform the import at least every 24 hours. Ideally - every hour via a scheduled cron event


To import your Order History on REES46:

  • 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.rees46.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)
  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:

{
	"shop_id" : "o81762iujygkshdgi6tda",
	"shop_secret" : "o87y1tkuyfglksdhjfkjsdhgjsgf",
	"orders" : 
     [
		{
			"id" : 1,
			"user_id" : 31,
			"email" : "sam@example.com",
			"date" : 1470863042,
			"items" : 
            [
				{"id" : 1, "price": 300, "categories" : ["1", "2"], "is_available" : 1, "amount" : 1},
				{"id" : "2", "price" : 400, "is_available" : 1, "amount" : 2}
			]
		 },
		 {
		 	"id" : 2,
			"user_id" : 13,
			"email" : "john@example.com",
			"date" : 1470863042,
			"items" : 
            [
				{"id" : 2, "price" : 400, "is_available" : 1, "amount" : 1}
			]
		 }
	 ]
}

         Also, consider the following PHP-script example.

Return to the top of the page Proceed to the next page

Table of Contents

  • No labels