Skip to main content
If a buyer is already signed into your app, you usually don’t want them retyping (or fat-fingering) their email at checkout. A typo there means a stranded order, a duplicate customer record, and a reconciliation headache later. The fix: attach the checkout session to a customer you already know. When you do, Macropay treats the email as settled — it pre-fills the field and locks it so it can’t be changed.

What attaching a customer does

Pass customer_id or external_customer_id to checkouts.create and Macropay will:
  • Pre-fill the customer’s known details into the checkout form.
  • Lock the email field so the buyer can’t edit it.
  • Bind the resulting order to that exact customer record — no duplicates, clean reconciliation.
Because Macropay is the Merchant of Record, that locked customer record is also what we use to assess the right sales tax/VAT and to put the correct legal seller on the buyer’s statement. One trustworthy identity in, one clean tax-compliant order out.

Pick the right identifier

If you already manage users, hand us your internal ID as external_customer_id. Macropay looks for a customer with that external ID; if one exists it links to it and pre-fills their data, and either way the order ends up attributed to that ID.
1

Create the checkout with external_customer_id

Pass your application’s user ID. Here a logged-in user upgrades to the pro-annual plan:
2

Send the buyer to checkout

Redirect to the url in the response. The email arrives pre-filled and read-only, and the order comes back stamped with user_8f3a91.
If the customer already lives in Macropay and you have our UUID, link to it directly.
1

Grab the customer ID

Find it in your dashboard’s customer list or via the API. It’s a UUID, for example 992fae2a-2a17-4b7a-8d9e-e287cf90131b.
2

Create the checkout with customer_id

3

Send the buyer to checkout

Redirect to the returned url. The email field is pre-filled and locked, and the order links back to that customer.
Building agent or usage-based billing? The same trick keeps your records clean: bind every checkout to an external_customer_id and downstream usage events, meters, and agent value receipts all roll up under one stable customer — so per-customer revenue and margin stay accurate without any post-hoc stitching.