Order API
Order2
Represents a single customer order that Bubblehouse takes in.
Properties
id
stringrequiredID of the order in the ecommerce system
Example:
"123456789"
The time the order has been placed in the ecommerce system
This value is the primary timestamp of the order, used both for analytics (attributing revenues to a particular day) and for important user-visible purposes like determining which time-based point multiplier promos are applicable.
An ideal value is the time when the order has been submitted or confirmed by the customer. Depending on how your ecommerce is built, it might or might not match the creation time of an order object in your system..
Example:
"2022-05-01T11:22:33Z"
The last time the order information has been updated in any relevant way
This value is used for auxiliary purposes, like sorting order data by last update time. (Also, when doing pull-based order processing, Bubblehouse queries for new orders based on this field.)
Example:
"2022-05-02T20:10:00Z"
Whether the order has been paid, shipped, refunded, etc.
Example:
"confirmed"
Information about the customer placing the order
You can either pass a customer identity (i.e. an object with a single
id
oremail
property) to reference an existing customer, or a full customer object to create/update the customer as well.When referencing an existing customer,
id
is much preferred overemail
to avoid edge cases.Example:
{"id":"123456789"}
Information about the ordered products
Example:
[{"id":"xyz101","product":{"id":"P123","title":"Supershoe","collection_ids":["C42","C1"]},"quantity":2,"amount_full":"12.00","amount_spent":"8.00"},{"id":"xyz102","product":{"id":"P124","title":"Megashoe","collection_ids":["C42"]},"quantity":1,"amount_full":"20.00","amount_spent":"20.00"}]
discount_codes
array of stringoptionalA list of discount codes applied to this order
Bubblehouse uses discount codes found on orders to track redeeming of points, usage of benefits, and to track referrals.
It's okay to only provide discount codes that originate from Bubblehouse; we don't need to know about other codes. (But it's also okay to provide all discount codes; we'll ignore the ones we did not create.)
Example:
["AB12345CDEF","FRIEND-123456"]
store_location
stringoptionalA unique identifier of a particular store location where the order has been made
This is a niche field only relevant for enabling rewards based on specific store locations visited.
Full (undiscounted) amount of the order that should be attributed to this customer for analytics.
Example:
"300.00"
Amount actually spent by the customer (taking into account all possible costs, discounts and other price adjustments).
Example:
"250.00"
short
stringoptionalA short, human-readable identifier for the order
This is typically an order number like "#1234" or "ORD-5678" that customers see. If not provided, Bubblehouse will use the order ID as a fallback.
Example:
"R-789"
The subtotal of all items before discounts, taxes, and shipping
While optional, it's best to provide this along with
amount_spent
andamount_full
for optimal discount allocation and analytics.Example:
"280.00"
Total amount of discounts applied to the order
This helps with proper allocation of order-level discounts across line items.
Example:
"50.00"
Total amount refunded to the customer
Providing this separately helps with proper allocation of order-level discounts across line items.
Example:
"0.00"
Total tax amount on the order
Providing this separately helps with proper allocation of order-level discounts across line items, and allows to exclude taxes from loyalty point calculations.
Example:
"15.00"
Total shipping costs for the order
Providing this separately helps with proper allocation of order-level discounts across line items, and allows to exclude shipping from loyalty point calculations.
Example:
"5.00"
Dollar value of points redeemed directly at checkout
This field represents the monetary value of loyalty points that were redeemed directly during the checkout process, rather than through discount codes. This is used for direct redemption functionality where customers can apply points as payment.
Mutually exclusive with
pts_redeemed_at_checkout
. Provide either this field (and Bubblehouse will calculate the points) orpts_redeemed_at_checkout
(and Bubblehouse will calculate the amount), but never both. If both are provided,pts_redeemed_at_checkout
takes precedence.pts_redeemed_at_checkout
integeroptionalNumber of loyalty points redeemed directly at checkout
This field represents the exact number of loyalty points that were redeemed directly during the checkout process. This is used for direct redemption functionality where customers can apply points as payment.
Mutually exclusive with
amount_redeemed_at_checkout
. Provide either this field (and Bubblehouse will calculate the dollar value) oramount_redeemed_at_checkout
(and Bubblehouse will calculate the points), but never both. If both are provided, this field takes precedence.is_subscription
booleanoptionalWhether this order is part of a subscription
Subscription orders may have different point accrual rules or timing compared to regular orders.
The type of store where the order was placed
This helps with analytics and also allows for different point accrual rules based on where customers shop. Defaults to
online
if not specified.Example:
"online"
tags
array of stringoptionalArbitrary tags associated with the order
These can be used to pass additional metadata about the order that may be specific to your store's situation. Tags can be used in conditions for rewards and promotions.
extras
JSON object (string keys and arbitrary values)optionalAny additional data you want to associate with the order
Extras can be used to pass additional metadata about the order that may be specific to your store's situation. Similar to tags but for structured data. This allows passing custom information that may be needed for your specific integration or business logic.
Information about order fulfillments (shipments)
Providing fulfillment data allows Bubblehouse to optionally delay point accrual until items are fulfilled or delivered. This is essentially shipment tracking information.
If you provide this field, please also provide
fulfillment_status
.Example:
[{"id":"flf201","items":[{"id":"xyz101","qty":2}],"delivered":false}]
Overall fulfillment status of the order
You can provide no fulfillment information at all, or you can provide order-level
fulfillment_status
only, or bothfulfillment_status
andfulfillments
.Including
fulfillment_status
in addition tofulfillments
ensures Bubblehouse can tell when the entire order has been fulfilled, in case certain items do not require fulfillment.Example:
"partial"
deleted
booleanoptionalSet to true to delete this order in our system
Bubblehouse does not have deletion APIs for most objects; instead, pass
deleted: true
when updating an object. Note that we won't delete the data immediately, in case there are other objects referencing this one.Deleting an order is the same as setting its status to
deleted
, which is about the same ascanceled
.
Examples
Typical Order
{ "id": "123456789", "short": "R-789", "order_time": "2022-05-01T11:22:33Z", "update_time": "2022-05-02T20:10:00Z", "status": "confirmed", "customer": { "id": "123456789" }, "amount_full": "300.00", "amount_subtotal": "280.00", "amount_spent": "250.00", "amount_discounts": "50.00", "amount_refunded": "0.00", "amount_taxes": "15.00", "amount_shipping": "5.00", "store_type": "online", "items": [ { "id": "xyz101", "product": { "id": "P123", "title": "Supershoe", "collection_ids": [ "C42", "C1" ] }, "quantity": 2, "amount_full": "12.00", "amount_spent": "8.00" }, { "id": "xyz102", "product": { "id": "P124", "title": "Megashoe", "collection_ids": [ "C42" ] }, "quantity": 1, "amount_full": "20.00", "amount_spent": "20.00" } ], "fulfillments": [ { "id": "flf201", "items": [ { "id": "xyz101", "qty": 2 } ], "delivered": false } ], "fulfillment_status": "partial", "discount_codes": [ "AB12345CDEF", "FRIEND-123456" ] }
Minimal Order Allowing Accrual
{ "id": "123456789", "order_time": "2022-05-01T11:22:33Z", "customer": { "id": "123456789" }, "amount_full": "300.00", "amount_spent": "250.00" }
Minimal Order Without Accrual
{ "id": "123456789", "order_time": "2022-05-01T11:22:33Z", "customer": { "id": "123456789" } }