Skip to main content

Shop Pay payment handler specification

The dev.shopify.shop_pay handler enables merchants to offer Shop Pay as an accelerated checkout option through UCP-compatible agents. Shop Pay is Shopify's native payment solution that provides a streamlined checkout experience by securely storing buyer payment and shipping information.

This handler enables a delegated payment flow where agents can securely generate a Shop Token for a buyer's selected payment instrument in Shop Pay. Merchants can then process these tokens, and agents can leverage the same Shop Pay integration across all participating merchants.


  • Accelerated checkout: Buyers with Shop Pay accounts can complete purchases faster using their saved payment and shipping details.
  • Delegated payments: Agents can orchestrate Shop Pay payments without directly handling sensitive payment credentials.
  • Standardized integration: A single Shop Pay integration works across all UCP-compatible merchants.

Anchor to Merchant integrationMerchant integration

Merchants enable Shop Pay through UCP by advertising the handler in their payment configuration and processing Shop Pay tokens when buyers complete checkout.

Requirements depend on whether you're a Shopify merchant or integrating as an external merchant:

If you're a Shopify merchant, Shopify automatically advertises all UCP payment handlers on your behalf, including Shop Pay.

If you're an external merchant, you must register for Shop Pay to obtain your shop_id before advertising Shop Pay through UCP.

Anchor to Handler configurationHandler configuration

Merchants advertise Shop Pay support by including the handler in their payment handlers array. The handler uses a minimal configuration containing only the merchant's Shop Pay identifier today.

Anchor to Configuration schemaConfiguration schema

FieldTypeDescription
shop_id
required
StringThe merchant's unique Shop Pay identifier.

The following example shows how merchants declare the Shop Pay handler in their payment configuration:

{
"payment": {
"handlers": [
{
"id": "shop_pay",
"name": "dev.shopify.shop_pay",
"version": "2026-01-11",
"spec": "https://shopify.dev/docs/agents/checkout/shop-pay-handler",
"config_schema": "https://shopify.dev/ucp/shop-pay-handler/2026-01-11/config.json",
"instrument_schemas": [
"https://shopify.dev/ucp/shop-pay-handler/2026-01-11/instrument.json"
],
"config": {
"shop_id": "shopify-559128571"
}
}
]
}
}

Anchor to Payment instrument supportPayment instrument support

By advertising the Shop Pay handler, merchants indicate they can accept and process Shop Pay payment instruments. Merchants must be able to handle payment objects conforming to the Shop Pay instrument schema.

Shop Pay instruments extend the base UCP payment instrument with Shop Pay-specific fields and credential types.

FieldTypeDescription
billing_address
required
ObjectThe billing address associated with the Shop Pay account.
credential
required
ObjectThe Shop Pay credential containing the token.
credential.token
required
StringThe Shop Token from the delegated payment flow.
credential.type
required
StringMust be shop_token.
handler_id
required
StringMust match the handler's id (for example, shop_pay).
id
required
StringThe unique identifier for this payment instrument.
type
required
StringMust be shop_pay.
emailStringThe buyer's email address associated with the Shop Pay account.

Merchants receive a payment object structured as follows when an agent submits a Shop Pay payment:

{} Response

{
"payment": {
"instruments": [
{
"id": "instr_shop_pay_1",
"handler_id": "shop_pay",
"type": "shop_pay",
"credential": {
"type": "shop_token",
"token": "shop_abc123xyz789..."
},
"email": "buyer@example.com",
"billing_address": {
"full_name": "Jane Doe",
"street_address": "123 Main St",
"address_locality": "San Francisco",
"address_region": "CA",
"postal_code": "94102",
"address_country": "US"
}
}
],
"selected_instrument_id": "instr_shop_pay_1"
}
}

Agents orchestrate Shop Pay payments on behalf of merchants through a delegated flow that collects payment authorization from buyers and returns a token for processing.

Before handling delegated Shop Pay payments, agents must register with Shop Pay to obtain a client_id that supports delegated experiences.

Anchor to Delegated payment protocolDelegated payment protocol

Agents must follow this flow to process a dev.shopify.shop_pay handler:

Anchor to Step 1: Discover handlerStep 1: Discover handler

Identify dev.shopify.shop_pay in the merchant's payment handlers array from the checkout response or merchant profile.

{
"id": "shop_pay",
"name": "dev.shopify.shop_pay",
"version": "2026-01-11",
"spec": "https://shopify.dev/docs/agents/checkout/shop-pay-handler",
"config_schema": "https://shopify.dev/ucp/shop-pay-handler/2026-01-11/config.json",
"instrument_schemas": [
"https://shopify.dev/ucp/shop-pay-handler/2026-01-11/instrument.json"
],
"config": {
"shop_id": "shopify-559128571"
}
}

Anchor to Step 2: Build payment requestStep 2: Build payment request

Build a Shop Pay payment request by:

  1. Initializing the delegated payment context:

    • Provide the merchant's shop_id from the handler configuration.
    • Provide your agent's client_id obtained during registration.
    • This establishes that you're orchestrating a Shop Pay payment on behalf of the merchant.
  2. Constructing the payment request with standardized UCP checkout data:

    • Totals: Subtotal, shipping, tax, and grand total amounts.
    • Fulfillment options: Available shipping methods or pickup locations.
    • Line items: Product details, quantities, and pricing.
    • Currency and locale: For proper formatting and display.

Present this payment request to the buyer through the Shop Pay interface, where they can authenticate and select their preferred payment method.

Anchor to Step 3: Complete checkoutStep 3: Complete checkout

After the buyer confirms, Shop Pay returns a Shop Token. Wrap this token in a UCP payment instrument conforming to the Shop Pay instrument schema and submit the complete checkout request to the merchant:

POST /checkout-sessions/{checkout_id}/complete
Content-Type: application/json
UCP-Agent: profile="https://agent.example/profile"

{
"payment_data": {
"id": "instr_shop_pay_1",
"handler_id": "shop_pay",
"type": "shop_pay",
"credential": {
"type": "shop_token",
"token": "shop_abc123xyz789..."
},
"email": "buyer@example.com",
"billing_address": {
"full_name": "Jane Doe",
"street_address": "123 Main St",
"address_locality": "San Francisco",
"address_region": "CA",
"postal_code": "94102",
"address_country": "US"
}
}
}

Upon successful processing, the merchant returns the completed checkout state with an order_id confirming the purchase.


Upon receiving a shop_pay payment instrument, merchants must:

  1. Validate handler: Confirm handler_id matches a configured Shop Pay handler.

  2. Extract token: Retrieve the token from credential.token.

  3. Process payment: Use the Shop Token to complete the payment through Shop Pay's payment processing API.

  4. Return response: Respond with the finalized checkout state including order confirmation details.


Anchor to Security considerationsSecurity considerations

The Shop Pay handler implements multiple security measures to protect payment data and ensure proper authorization throughout the delegated payment flow.

  • Single-use tokens: Shop Tokens are designed to be single-use and can't be reused across transactions.
  • Time-limited: Tokens have a limited validity period and should be used promptly after generation.
  • Checkout-scoped: Tokens have context about the checkout and merchant, preventing usage outside of the verified checkout.
  • Secure transmission: All token exchanges must occur over TLS 1.2+.

  • Agents must register with Shop Pay to obtain a valid client_id before processing delegated payments.
  • The client_id identifies the agent to Shop Pay and enables proper authorization tracking.

The following JSON schemas define the structure and validation rules for Shop Pay handler configuration and payment data:

  • Handler config schema: Defines the required shop_id configuration field that merchants include when advertising the Shop Pay handler.
  • Instrument schema: Specifies the structure of Shop Pay payment instruments that agents submit and merchants process, including credential and billing address requirements.
  • Credential schema: Details the Shop Token credential format used to authorize payments through the delegated flow.

Was this page helpful?