Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 10 min read Announcement mediumAdept

Introducing the commerce payments protocol

The Commerce Payments Protocol, built by Coinbase and Shopify on Base, brings card-style authorize-and-capture flows onchain using an immutable escrow smart contract between payer and receiver. Operators submit transactions and pay gas on behalf of merchants but are constrained: payers sign a hash of the payment terms (receiver, token, max amount, expiries, operator), signatures cannot be replayed, payers can reclaim funds after authorization expiry, and each operator's funds sit in separate buckets. Six operations (authorize, capture, charge, void, reclaim, refund) cover the payment lifecycle, with partial captures and ERC-3009 signature-based token collection enabling gasless USDC payments. The protocol powers Shopify's USDC payment method and is open for extension via operator, receiver and token-collector contracts.

Assumes: smart contracts basicscard authorize and capture flowdigital signatures

Related posts

  • Building the Universal Commerce Protocol

    Shopify Engineering mediumAdept

    Universal Commerce Protocol (UCP), co-developed by Shopify and Google, is an open standard for AI agents to discover merchant capabilities and complete transactions. It layers a core shopping service (checkout sessions, line items, totals) under independently versioned capabilities (Checkout, Orders, Catalog) and composable extensions namespaced by reverse-domain names, so anyone owning a domain can define extensions without a central registry. Merchants publish profiles at /.well-known/ucp, agents pass their own profile URL, and the merchant computes the intersection of supported capabilities and payment handlers, similar to HTTP content negotiation. A checkout state machine (incomplete, requires_escalation, ready_for_complete) plus a continue_url and the JSON-RPC-based Embedded Checkout Protocol handle handoff to a human buyer when the agent cannot finish.

  • Agents that can pay: building Restock with Stripe's Link and Managed Deep Agents

    LangChain mediumAdept

    Restock is a sample Slack office-supply agent on Managed Deep Agents that makes real purchases. It searches Zinc, builds a cart, and pays through Stripe's Link wallet over the Machine Payments Protocol, where the merchant returns HTTP 402 with payment instructions and the client retries with a shared payment token. Spending limits and approvals live in code the model can't touch. The user sets an upfront amount under the budget, approves it through a Slack interrupt and again in Link, and the agent reads actual fees from the 402 challenge first. Credentials stay in per-user Connections and a sandbox, tokens are deleted after use, and an order counts as placed only when the merchant reports it.

  • Navigating Recurring Payments in India: A Backend Perspective

    Shopify Engineering mediumAdept

    Shopify adapted its internal payment service to India's 2021 RBI recurring-payment rules by working with a local provider supporting cards and UPI. It reused its existing source model to represent e-mandates, verifying the source while recording and auto-refunding the ₹1 authorization charge for an audit trail. A single recurring-payment tokenization serves both recurring and one-time payments to avoid double AFA challenges, at the cost of a 24-48 hour pre-debit delay. Because UPI limits are min(bank, daily, app) and can't be read at runtime, mandates are capped at ₹5,000 and larger charges go through an on-session flow. Idempotency is built on the provider's unique order `receipt` field to prevent double charges.

  • Stripe’s payments APIs: The first 10 years

    Stripe mediumAdept

    Stripe's payments API evolved from a card-centric Token-and-Charge model, famous as "seven lines of code", through ad hoc extensions for ACH debit (a pending state) and Bitcoin (a separate BitcoinReceiver), to the unified Sources API. Each extension piled product debt onto abstractions built for cards, the simplest payment method because it finalizes immediately and needs no customer action. The result was two state machines split across client and server, parallel synchronous and webhook-driven fulfillment paths, and lost payments when browsers dropped connectivity before a Charge was created. The key lesson is that global payment methods are not the exception, cards are, and that recognition drove the redesign toward the PaymentIntents API.

  • Beyond rate limits: scaling access to Codex and Sora

    OpenAI mediumAdept

    OpenAI replaced hard rate-limit stops for Codex and Sora with a real-time access engine that treats rate limits, free tiers, credits, promotions and enterprise entitlements as layers in a single decision waterfall evaluated per request. Rate limits are consumed synchronously, and credits are checked in the same request but debited asynchronously through a streaming processor. Three chained datasets (product usage events, monetization events, balance updates) make every outcome auditable and replayable. Idempotency keys prevent double-debits, per-account serialized atomic transactions pair each balance decrement with an attributed record, and brief overshoots from the async delay are automatically refunded, trading strict enforcement for provable correctness.

The quest for software engineering knowledge.

Look:
Layout: