Skip to Content
Docs

Customer portal

Let customers manage their plans, payment methods, invoices, refund requests, and withdrawal themselves.

Customers handle the everyday changes to their subscriptions themselves, so your support team doesn't have to. The portal is a Pay.com page, and it works the same whichever engine runs the subscription.

What customers can do

In the portal, customers can:

  • Change plans, with the proration shown before they confirm.
  • Cancel, online, at the end of the period.
  • Update payment methods.
  • See their invoices.
  • Ask for a refund.
  • Withdraw, where the law gives them that right.

See Trials, plan changes, and canceling for how each change works. A cancellation in the portal always takes effect at the end of the period. To cancel on another date, cancel from your server with cancel_at.

Send customers to the portal

Create a portal session on your server with POST /v1/portal_sessions and the customer's customer_reference_id, and send the customer to its url. return_url sets the portal's back link. To open the portal on one subscription, send subscription, and to open it on one action, add flow set to change_plan, cancel, update_payment_method, or withdraw. The URL is short-lived, so create a session each time the customer opens the portal.

curl https://api.sandbox.pay.com/v1/portal_sessions \
  -u ':sk-pay-com-sandbox-…' \
  -H "Content-Type: application/json" \
  -H "idempotency-key: $(uuidgen)" \
  -d '{
    "customer_reference_id": "cust-jane-doe-001",
    "return_url": "https://app.example.com/account",
    "subscription": "sub_684790996696828928",
    "flow": "change_plan"
  }'

See Create a customer portal session in the Commerce API reference.

When Pay.com sells

When Pay.com sells as the merchant of record, Pay.com handles first-line customer support and refund requests. You can still refund from the order yourself. See Orders and refunds.

Was this page helpful?