Skip to main content

Environments

Payment Acceptance has separate Sandbox (testing) and Production (live) environments. Use the host and URLs for your target environment consistently — the REST API, the returned hosted checkout URL, and the embedded component are all environment-specific.
Keep the environment consistent across all three. For example, a Sandbox payment session will not render in the Production component.

Overview

Redirect flow

Redirect customers to a hosted checkout page.
1

Create a payment session

Call POST /v2/payment-sessions on the host for your environment (see Environments) with your payment details. Include a redirect object in the request body with successUrl and failureUrl to control where customers land after payment.
2

Extract the payment URL

From the response, get the top-level url field. This is the hosted payment page where customers complete the payment.
3

Redirect customers

Redirect customers to the url to complete the payment.
4

Handle the redirect

After payment completion, customers are automatically redirected to your redirect.successUrl or redirect.failureUrl.

Embedded UI

The payment UI can be embedded natively into your website using Coinbase’s <coinbase-payment> web component. This allows customers to complete payments without leaving your checkout page.

Setup

Load the web component from the URL for your target environment. Use the Sandbox URL for testing and switch to the Production URL when you go live.

Rendering

Call render() with the paymentSessionId from the POST /v2/payment-sessions response:
To re-render with updated payment data, call render() again. To navigate back to the wallet selection view, call back():

Attributes

Events

The component emits Custom Events for handling payment outcomes:
When the component is rendered inside an iframe, it cannot redirect the browser directly. You must handle the deeplink event to perform the redirect from the parent page:

iFrame permissions

If embedding the component inside an iframe, configure the following permissions to enable passkey and clipboard access:

Theming

Customize the component appearance using CSS custom properties: