Resource
POST https://api.robinhq.com/dynamic/orders
Succes message: 201 Created
Error in JSON: 400 Bad Request
Wrong authentication: 401 Invalid authorisation data
POST
The Orders POST lets ROBIN know that the customer has purchased an order or has updated it.
What is important to know
1. The Orders POST shows a WIN message
2. The Orders POST is needed for the performance data inside ROBIN
3. The Orders POST is needed for our KPI Contribution and Prevention
The Orders POST
You need to POST Orders when:
Situation 1: A customer places his first order
Situation 2: A customer places another order
Situation 3: A customer returns a part of his order
Situation 4: A customer does an upsell on his order
Situation 1: A customer places his first order
Customer A places his first order of € 10,-
{
"orders": [
{
"order_number": "O1234",
"email_address": "email@address.com",
"revenue": 10,
"order_date": "2017-04-05T12:34:56Z",
"is_first_order": true,
"webstore_url":"https://www.webstore.com"
}
]
}
Note: Is_first_order needs to be true only when it’s the first order of the customer.
Situation 2: A customer places another order
Customer A places another order of € 10,- (order number: 01235)
{
"orders": [
{
"order_number": "O1235",
"email_address": "email@address.com",
"revenue": 10,
"order_date": "2017-04-08T14:32:56Z",
"is_first_order": false,
"webstore_url":"https://www.webstore.com"
}
]
}
Note: Is_first_order is false because the customer has already bought before at the store.
Situation 3: A customer returns a part of his order
Customer A returns a part (€ 5,-) from his first order of € 10,- (order number: 01234 as shown in situation 1)
{
"orders": [
{
"order_number": "O1234",
"email_address": "email@address.com",
"revenue": 5,
"old_revenue": 10,
"order_date": "2017-04-05T12:34:56Z",
"is_first_order": true,
"webstore_url":"https://www.webstore.com"
}
]
}
Note: Revenue is the new price; old_revenue is the price the order was.
Situation 4: A customer does an upsell on his order
Original order from Customer C was € 20,-
{
"orders": [
{
"order_number": "O4321",
"email_address": "address@email.com",
"revenue": 20,
"order_date": "2017-04-06T12:34:56Z",
"is_first_order": false,
"webstore_url":"https://www.webstore.com"
}
]
}
Customer C does an upsell of €10 on the original price. That means that the revenue increases from €20,- to €30,-.
{
"orders": [
{
"order_number": "O4321",
"email_address": "address@email.com",
"revenue": 30,
"old_revenue": 20,
"order_date": "2017-04-07T13:44:56Z",
"is_first_order": false,
"webstore_url":"https://www.webstore.com"
}
]
}
Note: Revenue is the new price; old_revenue is the price the order was.
Have you added all these four situations?
You’ve completed the Orders POST when you’ve added all four scenario’s
Orders POST Schema
Key | Type | Required | Description | Example |
---|---|---|---|---|
order_number | String | Yes | Ordernumber of the order, special field, needed to recognize an order number in a question asked by a customer | "O1243" |
email_address | String | Yes | Email address of the customer, used to match the orders for a customer that is recognized based on the email address | "email@address.com" |
revenue | Float | Yes | Revenue, used to store the revenue for the order, this will be used to calculate ROBIN's acquisition and retention widget reports | 113.34 |
old_revenue | Float | No | Old revenue, used to calculate ROBIN's acquisition and retention widget reports when the revenue of the order has changed | 112.34 |
profit | Float | No | Profit, used to store the profit for the order, this will be used to calculate ROBIN's acquisition and retention widget reports, but only for the profit | 13.34 |
old_profit | Float | No | Old profit, used to calculate ROBIN's acquisition and retention widget reports, when the profit of the order has changed | 12.34 |
order_date | String | Yes | Order date, the creation date of the order | "2018-04-05T12:34:56Z" |
is_first_order | Boolean | Yes | Is first order, a boolean whether or not this order is the first order of the customer. When it is the first order, this order will count as acquisition, else it is a retention order Default set to false | true |
webstore_url | String | No | The URL of the WebStore this Order belongs to. Without a WebStore URL the KPI for orders cannot be filtered by WebStore. | "http://webstore1.winkel.nl" |