1. Home
  2. Docs
  3. Dynamic Integration
  4. Orders POST

Orders POST

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
    }
  ]
}

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
    }
  ]
}

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
    }
  ]
}

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
    }
  ]
}

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
    }
  ]
}

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

KeyTypeRequiredDescriptionExample
order_numberStringYesOrdernumber of the order, special field, needed to recognize an order number in a question asked by a customer"O1243"
email_addressStringYesEmail address of the customer, used to match the orders for a customer that is recognized based on the email address"email@address.com"
revenueFloatYesRevenue, used to store the revenue for the order, this will be used to calculate ROBIN's acquisition and retention widget reports113.34
old_revenueFloatNoOld revenue, used to calculate ROBIN's acquisition and retention widget reports when the revenue of the order has changed112.34
profitFloatNoProfit, 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 profit13.34
old_profitFloatNoOld profit, used to calculate ROBIN's acquisition and retention widget reports, when the profit of the order has changed12.34
order_dateStringYesder date, the creation date of the order"2018-04-05T12:34:56Z"
is_first_orderBooleanYesIs 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 falsetrue