Model Data Schemas

This is a sample order schema that can be sent to the server via the JS API.
sample_order_schema.json
{
"order_id": "12345", // Required - Integer, String: A unique identifier that your platform can identify the order by.
"number": "order-5", // Optional - Integer, String: A user-friendly order identifier that appears on the order frontend.
"test": false, // Optional - Boolean: If true, the order will be skipped in certain calculations.
"canceled": false, // Optional - Boolean If true, the order will be ignored from certain calculations.
"total": 10.0, // Required - Float
"total_usd": 10.0, // Required - Float
"created_at": "2019-03-18T21:01:10+00:00", // (Optional) String (ISO 8601 format DateTime)
"modified_at": "2019-03-18T21:01:10+00:00", // (Optional) String (ISO 8601 format DateTime)
"source_name": "web", // (Optional) String
"line_items": [LineItem], // Required - Array<LineItem>
"customer": Customer // Optional - Customer: Information about the customer that placed the order,
}

LineItem

This is how a item looks sent within the order schema.

line_item.json
{
"name": "Subscription to Product 123", // Required - String
"quantity": 1, // Required - Integer
"total": 10.0, // Required - Float
"total_usd": 10.0, // Required - Float
"variant_id": "variation1", // (Optional) String: If a variation was particularly selected, then specify it here
"product_id": "123", // Optional - String: Either this field or the "product" field most be specified.
"product": ProductDataObject // Optional - ProductDataObject: Either this field or the "product_id" field most be specified.
}