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.
Building a full account area — email-code login, subscription changes, cancellation with retention offers, addresses, cards? See Customer Portal.

Get Customer Profile

By Email

Not available. No route finds a customer by email from a storefront: the only email search needs a secret API key of the whole account, which must never ship to a browser. From 1.18.0, getByEmail() rejects with a TagadaError of code not_supported without sending a request (before, it always returned null). For the logged-in customer, use portal.getMe() or getProfile(customerId).

Update Email

This is the checkout’s email step: only email is saved, other fields are ignored. To change the name and phone of a logged-in customer, use portal.updateProfile.

Orders

List Orders

Newest first. It needs a session of that same customer: the checkout session, or a portal login. Another customer’s id rejects with TagadaNotFoundError. The route sends every order at once: limit and offset slice them in the SDK, and total counts them all. Works from 1.18.0; earlier versions called a route that does not exist.

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

The 20 most recent subscriptions of the logged-in customer. It needs the customer’s portal login; for any other customer id it returns [].

Get Single Subscription

Looks the id up among those 20, and rejects with TagadaNotFoundError when it is not there. Both work from 1.18.0; earlier versions called routes that do not exist.

Manage a Subscription

Also resumeSubscription, rescheduleSubscription, updateSubscriptionQuantity, swapSubscriptionProduct and updateSubscriptionPaymentMethod. They act for the customer logged in with the emailed code, and each one can be turned off by the store. The full list, the permissions and the errors are on Customer Portal.

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