Widget User-Scoped API Requests
Scope and callerβ
The CCG Widget uses an OAuth2 user scope to call the API directly from the customer's browser/app, on behalf of a customer inside an active checkout session:
| Environment | User scope |
|---|---|
| Production | financial/commerce/checkout:user |
| Non-production | financial/commerce/nonprodcheckout:user |
These scopes are distinct from merchant, merchant-wallet-management, and merchant-pci scopes, which are issued to merchant backends.
A merchant integration never requests or holds a user-scoped token β the Widget obtains and uses it internally. This is why user-scope detail doesn't belong in the Developers docs: there's no integration-contract value for an external caller who can never legally make these calls.
How the Widget gets the tokenβ
- The merchant backend creates a session (
POST /v2/sessions,merchantscope) and embeds the CCG Widget, passing it the resultingcheckoutSessionId. - The Widget loads and exchanges the checkout session context for a short-lived, user-scoped access token tied to that specific session/customer.
- All subsequent widget-initiated calls use that user-scoped token and the common headers listed below.
See Sessions β Processing for the full session creation sequence.
Headers on user-scoped requestsβ
Every user-scoped request sends Authorization, X-Merchant-Id, X-Checkout-Id, X-Customer-Id, and X-Widget-Version.
| Header | Description |
|---|---|
X-Checkout-Id | The active checkout session ID. Ties the request to the session the Widget is operating inside. |
X-Customer-Id | The wallet customer ID the request acts on behalf of. |
X-Widget-Version | The version of the Widget making the request. |
X-Upstream-Env | Required in non-production, same as merchant-scoped calls. |
User-scoped operationsβ
All operations below are tagged User in the OpenAPI spec and are callable only with a user-scoped token β never by a merchant backend.
Checkout sessionsβ
| Operation | Method & Path |
|---|---|
createChildCheckoutSession | POST /v2/checkout-sessions/{sessionId}/child-sessions |
getCheckoutSession | GET /v2/checkout-sessions/{sessionId} |
updateCheckoutSession | PATCH /v2/checkout-sessions/{sessionId} |
cancelCheckoutSession | PATCH /v2/checkout-sessions/{sessionId}/cancel |
Paymentsβ
| Operation | Method & Path |
|---|---|
createUserPayment | POST /v2/api-ccg/payments |
getUserPayment | GET /v2/api-ccg/payments/{paymentId} |
Customer payment methods and bank lookupβ
| Operation | Method & Path |
|---|---|
getCustomerPaymentMethods | GET /v2/customers/{id}/payment-methods |
searchCustomerPaymentMethods | GET /v2/customers/{id}/payment-methods/search |
getCustomerPaymentMethod | GET /v2/customers/{id}/payment-methods/{payment-method-id} |
updateCustomerPaymentMethod | PATCH /v2/customers/{id}/payment-methods/{payment-method-id} |
deleteCustomerPaymentMethod | DELETE /v2/customers/{id}/payment-methods/{payment-method-id} |
createCustomerSetupPaymentMethod | POST /v2/customers/{id}/setup-payment-methods |
getCustomerSetupPaymentMethod | GET /v2/customers/{id}/setup-payment-methods/{setupPaymentMethodId} |
getBankByRoutingNumber | GET /v2/banks/routing/{routing-number} |
Payment allocationβ
| Operation | Method & Path |
|---|---|
confirmPaymentAllocation | PATCH /v2/payments/{paymentId}/allocations/{allocationId}/confirm |
For operations with a customer {id} path segment, that ID appears in the URL as well as in X-Customer-Id. The checkout session is still validated at the gateway/auth-service layer for any call made with a user-scoped token.
Request validation flowβ
When a user-scoped request arrives, the receiving service validates the checkout session before processing:
This exact pattern is documented end-to-end for one operation in Confirm Allocation (3DS) β Processing β the same checkout-session validation step applies to every user-scoped operation, not just that one.
Checkout session validation rejects agent-initiated sessions for operations that require a live customer-present action (e.g. 3DS confirmation) β agents cannot complete those steps on the customer's behalf.
Related Documentationβ
- Sessions β Processing
- Confirm Allocation (3DS) β Processing
- Dependency Map β scope-to-endpoint-prefix overview
- Internal API Reference