Skip to Content
Docs

Guests and Pay.com accounts

Let customers check out as guests, or with a Pay.com account that saves their payment methods across merchants.

Nobody has to sign up to pay you. Customers who want a faster checkout next time can use a Pay.com account, which keeps their payment methods across every merchant that uses Pay.com.

Guest checkout always works

Customers can always pay as guests. When a checkout session has no customer_reference_id, Pay.com creates a guest customer for it, so every purchase still has its customer record. A guest's reference_id is its cust_ ID until it's claimed.

Customers are shared with Payments, with one record for each customer_reference_id. Read and update them with the customers API, which Commerce leaves as it is. Commerce's orders, subscriptions, and entitlements name the customer by its customer_reference_id.

A Pay.com account, if customers want one

Customers can choose a Pay.com account, secured with a passkey. It saves their payment methods, so they can pay with them at any merchant that uses Pay.com. On their account's page, they can see their saved methods, remove one, or delete the account.

Claiming a guest purchase

A purchase made as a guest links to the customer's account with you in one of two ways. Either your server tells Pay.com it belongs to them, or the customer opens a single-use link that Pay.com emails to them. Pay.com never links purchases to an account by matching an email address.

Both ways use POST /v1/customer_claims with your customer_reference_id for the customer. From your server, send the guest's cust_ ID in guest_customer. Claim from your server only when your system can prove that the customer's account started the purchase. A session ID from a return URL alone isn't proof.

curl https://api.sandbox.pay.com/v1/customer_claims \
  -u ':sk-pay-com-sandbox-…' \
  -H "Content-Type: application/json" \
  -H "idempotency-key: $(uuidgen)" \
  -d '{
    "guest_customer": "cust_691204560741163008",
    "customer_reference_id": "cust-jane-doe-001"
  }'

With the emailed link, the customer opens your claim page with a token. After they sign in, your server sends that token in place of guest_customer, with your customer_reference_id. Either way, the guest's subscriptions, orders, and entitlements end up under your reference, nothing about the payments changes, and Pay.com sends customer_claim.created.

Was this page helpful?