Code Examples

Refer to the API and SDK references for complete documentation.

post
Purchase

https://api.zaius.com/v3/events
Request
Response
Body Parameters
type
required
string
action
required
string
identifiers
required
object
data
required
object
data.order
required
object
data.order.items
required
array
200: OK
{
"title": "Accepted",
"status": 202,
"timestamp": "2019-04-30T15:24:08.816Z"
}
{
"type": "order",
"action": "purchase",
"identifiers": {
"email": "bob@gmail.com"
},
"data": {
"ts": 123456789, // (optional) the time of the order purchase
"order": {
"order_id": "OR345",
"total": 109.65,
"discount": 5.00,
"subtotal": 103.00,
"tax": 5.15,
"shipping": 6.50,
"coupon_code": "5OFF",
"items": [
{
"product_id": "2045",
"price": 19.00,
"quantity": 5,
"discount": 0.00,
"subtotal": 95.00
},
{
"product_id": "2091",
"price": 10.00,
"quantity": 1,
"discount": 2.00,
"subtotal": 8.00
}
]
}
}
}

post
Return, Refund, Cancel

https://api.zaius.com/v3/events
Request
Response
Body Parameters
type
required
string
action
required
string
identifiers
required
object
data
required
object
data.order
required
object
data.order.items
required
array
200: OK
{
"title": "Accepted",
"status": 202,
"timestamp": "2019-04-30T15:24:08.816Z"
}
{
"type": "order",
"action": "return", // or refund or cancel
"identifiers": {
"email": "bob@gmail.com",
},
"data": {
"ts": 123456789, // (optional) the time of the order return | refund | cancel
"order": {
"order_id": "OR345",
"total": -100.00
"items": [
{
"product_id": "2045",
"price": -10.00,
"quantity": 10,
"subtotal": -100.00
}
]
}
}
}