Checking access…

Skip to main content
Audience: CCG Platform Engineers

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:

EnvironmentUser scope
Productionfinancial/commerce/checkout:user
Non-productionfinancial/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​

  1. The merchant backend creates a session (POST /v2/sessions, merchant scope) and embeds the CCG Widget, passing it the resulting checkoutSessionId.
  2. The Widget loads and exchanges the checkout session context for a short-lived, user-scoped access token tied to that specific session/customer.
  3. 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.

HeaderDescription
X-Checkout-IdThe active checkout session ID. Ties the request to the session the Widget is operating inside.
X-Customer-IdThe wallet customer ID the request acts on behalf of.
X-Widget-VersionThe version of the Widget making the request.
X-Upstream-EnvRequired 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​

OperationMethod & Path
createChildCheckoutSessionPOST /v2/checkout-sessions/{sessionId}/child-sessions
getCheckoutSessionGET /v2/checkout-sessions/{sessionId}
updateCheckoutSessionPATCH /v2/checkout-sessions/{sessionId}
cancelCheckoutSessionPATCH /v2/checkout-sessions/{sessionId}/cancel

Payments​

OperationMethod & Path
createUserPaymentPOST /v2/api-ccg/payments
getUserPaymentGET /v2/api-ccg/payments/{paymentId}

Customer payment methods and bank lookup​

OperationMethod & Path
getCustomerPaymentMethodsGET /v2/customers/{id}/payment-methods
searchCustomerPaymentMethodsGET /v2/customers/{id}/payment-methods/search
getCustomerPaymentMethodGET /v2/customers/{id}/payment-methods/{payment-method-id}
updateCustomerPaymentMethodPATCH /v2/customers/{id}/payment-methods/{payment-method-id}
deleteCustomerPaymentMethodDELETE /v2/customers/{id}/payment-methods/{payment-method-id}
createCustomerSetupPaymentMethodPOST /v2/customers/{id}/setup-payment-methods
getCustomerSetupPaymentMethodGET /v2/customers/{id}/setup-payment-methods/{setupPaymentMethodId}
getBankByRoutingNumberGET /v2/banks/routing/{routing-number}

Payment allocation​

OperationMethod & Path
confirmPaymentAllocationPATCH /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.

Agent Sessions

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.