Skip to main content

Customer

The customer module gives you access to customer profiles, order history, and subscriptions. Use it to build account dashboards, order tracking pages, and subscription management UIs.

Get Customer Profile

By Email


Update Profile


Orders

List Orders

Get Single Order

Get an Order on the Thank-You Page

Accepted post-purchase offers create separate child orders, not extra lines on the main order — and they land asynchronously. The first fetch right after an accept usually misses them. Pass waitForRelatedOrders: true and the SDK polls for you:
On timeout the latest snapshot is returned — it never throws. A customer who declined every offer simply gets an order with an empty relatedOrders after timeoutMs. In React, prefer the useOrder hook which renders the main order immediately and fills in the upsells in the background. Worked example: Basic post-purchase.

Subscriptions

List Subscriptions

Get Single Subscription


React Hook

Full Hook API


useOrder — Thank-You Pages

useCustomer is for account dashboards (you have a customerId). On a thank-you page you have an orderId from the URL — use useOrder. It loads the order, renders it immediately, and keeps watching in the background for the child orders created by accepted upsells:
No manual polling: with the default watchRelatedOrders: true, the hook refetches every 2s for up to 8s while relatedOrders is empty, then stops. Upsell blocks pop in as soon as the child orders exist.

useOrder API