Tracking API

API

Our API is a stable and fast way of delivery of return risks and insights. We maintain high availability and stability across regions and constantly working on improvements to provide you with best experience. More information about performance is available here.

The link to our API is https://api.easysize.me/v1/, followed by your unique app id. The app id will be provided by Easysize.

Note If you want to test the API before going live please ask us for a testing API key.

Authentication

In order to be authenticated you need to add a secret key (provided by Easysize) to request header: Secret-key: 44c62c6e9cde3bef188c7aa337a67bbfda621c65

Errors

Our API returns standard HTTP success or error status codes. For errors, we will also include extra information about what went wrong encoded in the response as JSON. The various HTTP status codes we might return are listed below.

HTTP Status codes

Code Title Description
200 OK The request was successful.
201 Created The resource was successfully created.
400 Bad request Bad request
401 Unauthorized Your Secret-key is invalid.
404 Not found The resource does not exist.
50X InternalServer Error An error occurred with our API.

Mobile Event tracking

POST /api/app_id/tracking/bundle

Request body should be a JSON object array, where object structure is as follows:

Parameter Type Description
id* String Unique identifier for the user session (UUID)
product_id* String Parent/Family product ID
user_id* String User ID
events* Array All items currently in a cart

event object

Parameter Type Description
timestamp* String Date time with following format 2018-01-01 12:00:00
type* String Event type (See list below for accepted types)
value* String Event value

Accepted event types

Type Description
product_view -
add_to_cart value is child product id of the product
checkout_complete value is child product id of the product

Example request

[
  {
    "id": "43bfde22-3775-4e38-a34d-01cbcf56768e",
    "product_id": "156897",
    "user_id": "999",
    "events": [
        {
            "timestamp": "2017-03-25 12:01:55",
            "type": "product_view",
            "value": ""
        },
        {
            "timestamp": "2017-03-25 12:03:15",
            "type": "add_to_cart",
            "value": "156897-a"
        }
    ]
  },
  {
    "id": "fdecce0b-ba23-49f8-bf19-55cc52be2c52",
    ..
  }
]

Example response

{
  "43bfde22-3775-4e38-a34d-01cbcf56768e": "SUCCESS",
  "fdecce0b-ba23-49f8-bf19-55cc52be2c52": "SUCCESS"
}

Checkout (order tracking)

Single product tracking

POST /api/app_id/tracking/order

Params

Parameter Type Description
product_id* String Child product id
session_id* String User’s current session ID (used together with tracking data)

Example request

{
  "session_id": "<session_id>",
  "product_id": "<child_product_id>"
}

Bundled product tracking

POST /api/app_id/tracking/orders

Parameter Type Description
product_id* String Child product id
session_id* String User’s current session ID (used together with tracking data)

Example request

[
  {
    "session_id": "<session_id>",
    "product_id": "<child_product_id>"
  },
  ...
]