Code · AsyncAPI Specification

Code Webhooks

Version

View Spec View on GitHub CompanyPaymentsMicropaymentsWalletsSolanaBlockchainCryptocurrencygRPCSelf-CustodialAsyncAPIEvents

AsyncAPI Specification

code-webhooks.yml Raw ↑
generated: '2026-07-18'
method: searched
source: https://code-payments.github.io/code-sdk/docs/example/payment-events.html
spec_type: Webhooks
description: >-
  Code delivers server-side payment events as JWT-signed webhook notifications.
  There is no separately published AsyncAPI document; this captures the webhook
  catalog verbatim from the Payment Events docs. Client-side, the payment button
  also emits events over a WebSocket connection to the Code Sequencer.
delivery:
  transport: HTTPS POST
  signing: JWT
  registration: >-
    Register a publicly accessible URL by passing `webhook: { url:
    'https://example.com/webhook' }` to paymentIntents.create(). The endpoint
    must be live at the time the intent is created.
payload:
  fields:
    - name: amount
      description: Payment amount in the requested currency.
    - name: currency
      description: Fiat currency of the payment (e.g. usd).
    - name: destination
      description: Destination Solana wallet address.
    - name: exchangeRate
      description: Fiat-to-token exchange rate applied.
    - name: intent
      description: Payment intent id the event corresponds to.
    - name: quarks
      description: On-chain amount in quarks (smallest unit).
    - name: state
      description: Payment state for the intent.
client_events:
  transport: WebSocket (Code Sequencer)
  events:
    - name: success
      handler: button.on('success', async (event) => { ... })
      description: Fired client-side when a payment completes; event carries the intent id.
    - name: cancel
      handler: button.on('cancel', async (event) => { ... })
      description: Fired client-side when a payment is cancelled.

Work with this as data

Every AsyncAPI spec here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for asyncapi

4 MCP tools reach this
  • find_asyncapisBrowse and filter every AsyncAPI spec in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This AsyncAPI spec
curl "https://apis.io/api/v1/asyncapis/code-webhooks"
All asyncapi
curl "https://apis.io/api/v1/asyncapis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.