Zaius Orders API
The Orders API from Zaius — 1 operation(s) for orders.
The Orders API from Zaius — 1 operation(s) for orders.
openapi: 3.0.1
info:
title: Advanced Compliance Orders API
description: Advanced
version: v3
servers:
- url: https://api.us1.odp.optimizely.com/v3
description: United States
- url: https://api.eu1.odp.optimizely.com/v3
description: Europe
- url: https://api.au1.odp.optimizely.com/v3
description: Asia-Pacific
security:
- x-api-key: []
tags:
- name: Orders
paths:
/events:
post:
tags:
- Orders
summary: Order Purchase/Return/Refund/Cancellation
description: Upload an order purchase/return/refund/cancellation event to Optimizely Data Platform (ODP).
operationId: order-returnrefund
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Event'
examples:
Order Purchase Example Payload:
description: Order Purchase Example Payload
value:
- type: order
action: purchase
identifiers:
email: bob@gmail.com
data:
ts: 123456789
order:
order_id: OR345
total: 109.65
discount: 5
subtotal: 103
tax: 5.15
shipping: 6.5
coupon_code: 5OFF
items:
- product_id: '2045'
price: 19
quantity: 5
discount: 0
subtotal: 95
- product_id: '2091'
price: 10
quantity: 1
discount: 2
subtotal: 8
Order Return/Refund Example Payload:
description: Order Return/Refund Example Payload
value:
- type: order
action: return
identifiers:
email: bob@gmail.com
data:
ts: 123456789
order:
order_id: OR345
total: -100
subtotal: -90
tax: 0
shipping: 0
items:
- product_id: '2045'
price: -9
quantity: 10
subtotal: -90
Order Cancellation Example Payload:
description: Order Cancellation Example Payload
value:
- type: order
action: cancel
identifiers:
email: bob@gmail.com
data:
ts: 123456789
order:
order_id: OR345
total: -100
items:
- product_id: '2045'
price: -10
quantity: 10
subtotal: -100
Partial Refund Example Payload:
description: Partial Refund Example Payload
value:
- identifiers:
email: bob@thebuyer.com
type: order
action: refund
data:
order:
order_id: ABC
total: 10
subtotal: 10
required: true
responses:
'202':
description: Accepted
content:
application/json:
schema:
$ref: '#/components/schemas/GenericUpdateResponse'
'400':
description: Bad Request
content:
application/json:
schema:
example: '{"title":"Bad Request","status":400,"timestamp":"2018-09-10T21:07:10-05:00","detail":{"invalids":[{"field":"delimiter","reason":"Unrecognized delimiter, valid options are comma, tab or pipe"}]}}'
'403':
description: Forbidden
content:
application/json:
schema:
example: '{ "message": "Forbidden"}'
'404':
description: Not Found
content:
application/json:
schema:
example: '{"title":"Bad Request","status":404,"timestamp":"2018-09-10T21:07:10-05:00","detail":{"message":"Not found description"}}'
components:
schemas:
Event:
required:
- action
- identifiers
- type
type: object
properties:
type:
type: string
description: the event type
default: order
example: order
action:
type: string
description: 'the event action associated with the type. Acceptable actions include: `purchase`, `return`, `refund`, and `cancel`'
example: purchase
identifiers:
type: object
additionalProperties:
type: string
description: any known identifiers associated with the customer that performed the event
description: any known identifiers associated with the customer that performed the event
data:
type: object
properties:
ts:
type: number
description: specify the time of the order action
order:
$ref: '#/components/schemas/Order'
additionalProperties:
type: string
description: any additional fields you want to include on the event (for example, product_id)
description: the data with the order and any additional fields
Order:
required:
- order_id
type: object
properties:
order_id:
type: string
description: the unique identifier related to this order
total:
type: number
description: total should include the final amount charged to the customer after all goods, discounts, tax, and shipping are calculated. See below for more information
subtotal:
type: number
description: subtotal may be taken either before or after discounting, but generally should be before shipping or tax
tax:
type: number
shipping:
type: number
items:
type: array
items:
$ref: '#/components/schemas/LineItem'
LineItem:
required:
- product_id
type: object
properties:
product_id:
type: string
description: the unique identifier for the order line item
price:
type: number
description: the price for an order line item
quantity:
type: number
description: the number of items purchased
discount:
type: number
description: the discount (if any) for the given line item
subtotal:
type: number
description: the calculated subtotal for the given product and quantity, typically calculated after any discounts
GenericUpdateResponse:
type: object
properties:
title:
type: string
status:
type: integer
format: int32
timestamp:
type: string
securitySchemes:
x-api-key:
type: apiKey
name: x-api-key
in: header
x-readme:
explorer-enabled: true
proxy-enabled: true