1. Home
  2. Docs
  3. Dynamic Integration
  4. [Customer Lifetime] Customers POST

[Customer Lifetime] Customers POST

Resource

POST https://api.robinhq.com/dynamic/customers/

Success message: 201 Created

Error in JSON: 400 Bad Request

Wrong authentication: 401 Invalid authorisation data


POST

The “Customer Lifetime” endpoint shows the total amount of orders and the total amount of revenue per customer.

What is essential to know:

1. Customers POST works in combination with Endpoint 5 “Customer Lifetime”

The reason for this is because the endpoint only gets requested once a new conversation has opened, thus it will not be updated until the customer has opened a new conversation. For this, we have created the Customers POST to ensure that the data is up-to-date.

The Customers POST

You need to POST Customers when:

Situation 1: When a new order has been placed

Situation 2: When an order has been (partly) refunded

Situation 1: When a new order has been placed

Original Customer Lifetime from customer “email@address.com” was 11 orders and a total revenue of € 100,-

{  
   "customers":[  
      {  
         "email_address":"email@address.com",
         "customer_since":"2017-01-29T12:34:56Z",
         "order_count":11,
         "total_revenue":100.00,
         "currency":"€",
         "last_order_date":"2017-04-05T12:34:56Z"
      }
   ]
}

The customer “email@address.com” has placed an order, the customer now has 12 orders and a total revenue of 120,00-

{
  "customers": [
    {
      "email_address": "email@address.com",
      "customer_since": "2017-01-29T12:34:56Z",
      "order_count": 12,
      "total_revenue": 120.00,
      "currency": "€",
      "last_order_date": "2017-04-05T12:34:56Z"
    }
  ]
}

Situation 2: When an order has been (partly) refunded

Original Customer Lifetime from customer “customer@address.com” was 15 orders and a total revenue of € 200,-

{  
   "customers":[  
      {  
         "email_address":"customer@address.com",
         "customer_since":"2017-01-29T12:34:56Z",
         "order_count":15,
         "total_revenue":200.00,
         "currency":"€",
         "last_order_date":"2017-04-05T12:34:56Z"
      }
   ]
}

The customer has refunded his order, the customer now has 14 orders and a total revenue of 190,-

{  
   "customers":[  
      {  
         "email_address":"customer@address.com",
         "customer_since":"2017-01-29T12:34:56Z",
         "order_count":14,
         "total_revenue":190.00,
         "currency":"€",
         "last_order_date":"2017-04-05T12:34:56Z"
      }
   ]
}

After you’ve made Endpoint 5 and Customer POST you are done with the Customer Lifetime!

Customers POST Schema

KeyTypeRequiredDescriptionExample
email_addressStringYesEmail address of your customer"email@address.com"
customer_sinceStringYeswhen did your customer become a client"2017-01-29T12:34:56Z"
order_countIntegerYesNumber of orders of your customer12
total_revenueFloatYesHow much did your customer spend123.45
currencyStringYesCurrency for this customer. Use '€' or '$'"$"
last_order_dateStringYesThe date of the last order of the customer used to determine the segment of the customer. "2018-04-05T12:34:56Z"