API reference

April 18, 2026 · View on GitHub

Endpoints that sellers use to register and advertise their payment acceptance.

POST /register

Register a seller wallet and receive a merchantId plus the Facilitator's receiving address on every enabled chain.

Rate limit: 3 requests per hour per IP.

Request body

FieldTypeRequiredValidationDescription
walletstringyes≥ 10 charsSeller's wallet address on network. EVM 0x…, Solana base58, Stellar G….
networkstringyes≥ 3 chars, must be an enabled CAIP-2The chain the seller will receive settlement on.

Response 201 Created

FieldTypeDescription
merchantIdstringStable identifier for this seller. Use it in every subsequent call.
walletstringEchoed seller wallet.
networkstringEchoed seller network (CAIP-2).
facilitatorAddressesobjectMap of CAIP-2 → facilitator receiving address on that chain.
codeSnippetstringReady-to-paste JavaScript showing how to wire @x402/express.

Errors

StatuserrorCause
400validationMissing or invalid wallet / network.
400UNSUPPORTED_NETWORKnetwork is not enabled on this relay. Response details include supportedNetworks and an example payload to retry.
429RATE_LIMITToo many registrations from this IP.

Example

curl -X POST https://api.402md.com/register \
  -H "Content-Type: application/json" \
  -d '{ "wallet": "GSELLER...", "network": "stellar:pubnet" }'
{
  "merchantId": "hb-a1b2c3",
  "wallet": "GSELLER...",
  "network": "stellar:pubnet",
  "facilitatorAddresses": {
    "eip155:8453": "0xFacilitatorBase",
    "solana:mainnet": "FacilitatorSolAddr",
    "stellar:pubnet": "GFacilitatorStellarAddr"
  },
  "codeSnippet": "…"
}

GET /discover

Look up a seller's payment configuration. Useful as a cacheable substitute for embedding the full accepts array in your app.

Rate limit: 100 requests per minute per IP.

Query parameters

ParamRequiredDescription
merchantIdyesThe merchantId from /register.

Response 200 OK

FieldTypeDescription
merchantIdstring
acceptedNetworksarrayOne entry per enabled chain (see below).
sellerNetworkstringThe seller's own chain (where they receive).
fees.platformstringHuman-readable platform fee (e.g. "0%").
fees.gasAllowancestringPointer to /bridge/fees for exact values.
fees.sameChainstringSame-chain gas allowance note.
estimatedSettlement.standardstringHuman estimate ("~5–30s" or similar).
estimatedSettlement.notestringLonger explanation.
gasFreebooleantrue if the buyer does not pay gas (x402 model).

Each entry of acceptedNetworks:

FieldTypeDescription
networkstringCAIP-2 of the accepting chain.
payTostringFacilitator receiving address on that chain.
assetstringAlways "USDC".
maxTimeoutSecondsnumberMax age of a signed authorization.
extra.merchantIdstringPre-filled for you — copy into the extra you expose via @x402/express.
bridgebooleantrue if paying on this network bridges via CCTP to the seller's chain.

Errors

StatuserrorCause
400validationMissing merchantId.
404SELLER_NOT_FOUNDUnknown merchantId.
429RATE_LIMIT

Example

curl "https://api.402md.com/discover?merchantId=hb-a1b2c3"

GET /supported

List every x402 version, scheme, and network the relay currently accepts. Use this at boot time to decide which accepts entries to declare.

No rate limit.

Response 200 OK

{
  "kinds": [
    { "x402Version": 2, "scheme": "exact", "network": "eip155:8453" },
    { "x402Version": 2, "scheme": "exact", "network": "solana:mainnet" },
    { "x402Version": 2, "scheme": "exact", "network": "stellar:pubnet" }
  ],
  "extensions": [],
  "signers": {}
}
FieldTypeDescription
kindsarrayEach entry = { x402Version, scheme, network }. Currently the only scheme is "exact".
extensionsarrayReserved for future x402 extensions.
signersobjectReserved.

GET /.well-known/x402.json

Standard x402 capability manifest. Used by x402-aware agents to discover the Facilitator.

No rate limit.

Response 200 OK

{
  "version": "2",
  "facilitator": {
    "name": "402md",
    "url": "https://api.402md.com",
    "networks": ["eip155:8453", "solana:mainnet", "stellar:pubnet"],
    "bridgeProvider": "circle-cctp-v2",
    "crossChain": true
  }
}
FieldTypeDescription
versionstringx402 protocol version (currently "2").
facilitator.namestringDisplay name.
facilitator.urlstringCanonical URL of this facilitator.
facilitator.networksarrayEnabled CAIP-2 networks.
facilitator.bridgeProviderstringAlways "circle-cctp-v2".
facilitator.crossChainbooleantrue — this facilitator bridges across chains.