Use
The private Orders API allows you to send us your customers orders.
-
Usage Quotas: unlimitedThis API is not subject to requests quota.
-
Authentication: yesKey authentication is required to access and send data.
-
E-mail sending delay : 10 daysFrom the date your orders are received via the API, your customers will be contacted 10 days later by e-mail.
Orders
The following parameters must be used to customize the query:
-
api_key string, mandatoryUnique private key for API access
-
orders json, mandatoryOrders array (JSON encoded)
-
id_order string, mandatoryUnique order identifier
-
order_date string, mandatoryOrder date and time in YYYY-MM-DD HH:MM:SS format
-
firstname string, mandatoryCustomer first name
-
lastname string, mandatoryCustomer last name
-
email string, mandatoryCustomer email address
-
reference stringUnique order reference
-
products arrayArray of ordered products
-
id integer, mandatoryUnique product identifier
-
name string, mandatoryProduct name
-
category_id stringProduct category identifier
-
category_name stringProduct category name
-
qty integerProduct quantity in order
-
unit_price floatUnit product price (tax included)
-
mpn stringProduct MPN code
-
ean13 stringProduct EAN13 code
-
sku stringProduct SKU code
-
upc stringProduct UPC code
-
url stringProduct URL
Endpoint
https://api.guaranteed-reviews.com/private/v3/orders
Request example (PHP cURL)
<?php
// Define API endpoint and API key
$apiEndPoint = "https://api.guaranteed-reviews.com/private/v3/orders";
$apiKey = "YOUR_PRIVATE_KEY";
// Prepare data
$post = array(
'api_key' => $apiKey,
'orders' => json_encode(
array(
array(
'id_order' => '1234',
'order_date' => '2019-01-01 12:00:00',
'firstname' => 'John',
'lastname' => 'Doe',
'email' => '[email protected]',
'reference' => '12345678',
'products' => array(
array(
'id' => '100',
'name' => 'My Product 100',
'category_id' => 'cat1',
'category_name' => 'Category 1',
'qty' => '1',
'unit_price' => '25.90',
'mpn' => 'MPN100',
'ean13' => '1234567890123',
'sku' => 'SKU100',
'upc' => 'UPCCODE',
'url' => 'https://www.mywebsite.com/myproduct/',
),
),
),
),
),
);
// Prepare CURL request
$ch = curl_init($apiEndPoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
// Execute CURL request
$response = curl_exec($ch);
// Close the connection, release resources used
curl_close($ch);
// Do anything you want with your response !
var_dump($response);
?>
Values returned by API
The API returns a response containing a 'success' object.
-
success integerReturns '1' if at least one order has been imported, or '0' if no order has been imported.
-
orders_count integerReturns the total number of commands sent in the call
-
orders_imported integerReturns the total number of orders actually been imported
WARNING: An order will not be re-imported if another order with the same order_id or reference has already been sent. -
message stringReturns a possible message containing more information about an error during import
Example of an API response to a successfully imported command :
JSON
{
"success": 1,
"orders_count": 1,
"orders_imported": 1,
"message": null
}
Example of an API response for orders that already been imported :
JSON
{
"success": 0,
"orders_count": 1,
"orders_imported": 0,
"message": "Some orders were not imported because they had already been sent (see documentation)"
}