Payment Handler Specification Guide

Introduction

This guide defines the standard structure and vocabulary for specifying UCP payment handlers to ensure consistency, completeness, and clarity.

Purpose

Payment handlers enable “N-to-N” interoperability between platforms, businesses, and payment providers. A well-specified handler must answer:

  • Who participates? What participants are involved and their roles
  • What are the prerequisites? What onboarding or setup is required
  • How is it configured? What configuration is advertised or consumed
  • How is it executed? What protocol is followed

Core Elements

Participants

The distinct actors that participate in the payment handler’s lifecycle:

ParticipantRole
BusinessAdvertises handler configuration, processes payment instruments
PlatformDiscovers handlers, acquires payment instruments, submits checkout
Tokenizer (Optional)Stores raw credentials and issues token credentials
PSP (Optional)Processes payments on behalf of business

Prerequisites

The onboarding, setup, or configuration a participant must complete before participating:

Signature:

PREREQUISITES(participant, onboarding_input) → prerequisites_output

Output includes:

  • Identity (access_token in PaymentIdentity format)
  • Additional configuration, credentials, or settings

Handler Declaration

The configuration a business advertises to indicate support for this handler:

{
  "id": "handler_instance_id",
  "name": "com.example.handler",
  "version": "2026-01-11",
  "spec": "https://example.com/ucp/handler",
  "config_schema": "https://example.com/ucp/handler/config.json",
  "instrument_schemas": [
    "https://example.com/ucp/handler/instruments/card.json"
  ],
  "config": {
    // Handler-specific configuration
  }
}

Instrument Acquisition

The protocol a platform follows to acquire a payment instrument:

Signature:

INSTRUMENT_ACQUISITION(
  platform_prerequisites_output,
  handler_declaration,
  binding,
  buyer_input
) → checkout_instrument

Processing

The steps a participant takes to process a received payment instrument:

Signature:

PROCESSING(
  identity,
  checkout_instrument,
  binding,
  transaction_context
) → processing_result

Best Practices

Schema Design

PracticeDescription
Extend, don’t reinventUse allOf to compose base schemas
Use const for discriminatorsDefine credential.type as const
Validate earlyPublish schemas at stable URLs before finalizing
Include ExpiryInclude expiry or ttl for token credentials

Documentation

PracticeDescription
Show, don’t just tellInclude complete JSON examples
Document error casesSpecify error handling
Version independentlyHandler version evolves independently of UCP

Security

PracticeDescription
Require bindingTie credentials to specific checkout via binding
Minimize credential exposureDesign flows to minimize raw credential exposure
Specify token lifetimesDocument single-use, time-limited, or session-scoped

Conformance Checklist

Before publishing, verify:

  • Uses standard template structure
  • All [REQUIRED] sections are present
  • All participants listed with roles
  • Prerequisites documented for each participant
  • Identity maps to PaymentIdentity structure
  • Config, instrument, and credential schemas documented
  • Protocol steps enumerated with examples
  • Binding requirements specified
  • Security requirements listed
  • Handler name follows reverse-DNS convention

Watch a simulated payment in the official Playground

The official draft spec ships a shopping Playground (a stepped walkthrough); step 6, “Mint Instrument”, simulates credential minting for three payment handlers right in the browser. It demonstrates message shape only: the mock backend does not validate payment parameters and charges nothing — it has no relation to production Stripe. Verified 2026-11-21: submitting with payment.instruments emptied still produces a demo order. Treat it as a sandbox for learning the request structure, not as evidence that any merchant path works.

Entries and versions:

  • draft entry (includes the Stripe option): ucp.dev/draft/specification/shopping/playground
  • latest entry (as of 2026-11-21 it does not include Stripe yet; the preview still shows the older shape): ucp.dev/latest/specification/shopping/playground
  • Use the draft entry to observe the Stripe simulation; when integrating a real service, trust the version its discovery returns.
  • If Continue does nothing on your first visit, look for the Cookie consent banner. To proceed with analytics disabled, choose Manage settings, uncheck Google Analytics, then choose Accept to save your settings. After the page reloads, click Continue again (verified November 28, 2026).

The three handlers selectable at step 6, with credentials minted in an actual run (2026-11-21):

Handler optionhandler_idcredential.typetoken shape
Stripe Payments (com.stripe.payments)stripe_payments_1234stripe_payment_tokenspt_demo_ + 24 random alphanumerics
Shop Pay (com.shopify.shop_pay)shop_pay_1234ShopPayTokenshoppay_tok_ + UUID
Google Pay (com.google.pay)gpay_1234PAYMENT_GATEWAYgpaytok_ + UUID

The step 7 request preview places the minted instrument into payment.instruments[] — all three handlers share the same array shape, matching the complete-checkout example (the payment.instruments[] field also appears in v2026-01-23 and v2026-04-08 examples). The mock order response reports ucp.version: "draft", and its order id, items, and amounts are demo data.

Telling demo from real: a token with the spt_demo_ prefix exists only in the Playground demo; real Stripe credentials follow the Stripe Payments handler spec (the spec the Playground’s handler declaration points to) and never carry a demo prefix. The simulated path also has no auth, risk control, or reconciliation — those belong to a real handler’s prerequisites, see the “Prerequisites” section above.

See Also