Orders in Zaius are treated as an entity whose attributes can change over time as tracking actions against the order happen (e.g., purchase today, return tomorrow), or as you explicitly update fields on the order outside of customer activity (e.g., you update the ship_address of an order two days after it was placed). Refer to Special Events for details on order semantics in Zaius.

To update an order entity, first an order must have been created in Zaius via an event as in ZAIUS Javascript Integration. You can then update fields on the order either during subsequent order events, or via an explicit request to update the entity. In the latter case, no event is produced for the customer who placed the order.

zaius.entity("order", 
            {order_id: "7278913",
             ship_address: "123 Main St. Boston, MA 02110"});
POST /v2/entities
Host: api.zaius.com
Content-Type: application/json
Zaius-Tracker-Id: <YOUR TRACKER ID>

{"type": "order",
"data": {"order_id": "7278913",
         "ship_address": "123 Main St. Boston, MA 02110"}
}
curl -H 'Content-Type: application/json' -H 'Zaius-Tracker-Id: <YOUR TRACKER ID>' -d '{
"type": "order",
"data": {"order_id": "7278913",
         "ship_address": "123 Main St. Boston, MA 02110"}
}' https://api.zaius.com/v2/entities

Order Entities use a different HTTP endpoint than order events

Order Entities have a different format than order events. Ensure order events are sent to the order event endpoint, and order entities are sent to the entities endpoint.

Order Fields

Zaius has a number of pre-defined fields for orders. You can add new fields to order entities via Custom Fields.

Field
Description

order_id
string, required

Unique identifier for the order. This identifier is used to link events with orders.

ts
timestamp

Time of the order. Timestamps must be formatted as ISO 8601 format or unix epoch (seconds since January 1, 1970). Examples: 1438315200, 2015-07-31T00:00:00-00:00, 2015-07-31T12:30:00-07:00. Note: If time and time zone are not provided the time is assumed be 12am UTC.
ts will be inferred if absent, as time sent (via JS/app SDK) or time received (via API/batch).

total
number

Total for the order, i.e., what the customer paid.

subtotal
number

Order subtotal. Zaius recommends excluding tax and shipping from this amount.

Revenue in Zaius is calculated from this field.

discount
number

Discount amount applied to order.

shipping
number

Shipping cost of the order.

tax
number

Order tax.

coupon_code
string

Coupon code applied to the order.

ship_address
string

Order shipping address.

bill_address
string

Billing address of the customer who placed the order.

email
string

Customer email address associated with the order.

phone
string

Customer phone number associated with the order.

name
string

Customer full name associated with the order.

first_name
string

Customer first name associated with the order.

last_name
string

Customer last name associated with the order.

Orders


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.