Skip to main content

X402Requirements

schemestringrequired
Constant value: exact
networkstringrequired
amountDecimalStringrequired

Non-negative integer as decimal string (pricing document family).

Possible values: Value must match regular expression ^[0-9]+$

assetstringrequired

Payment token of the serving network, from the contract configuration (USDC-c76f1f on mainnet, USDC-350c4e on devnet staging).

Example: USDC-c76f1f
payToAddressrequired

MultiversX bech32 address.

Possible values: Value must match regular expression ^erd1[02-9ac-hj-np-z]{58}$

Example: erd1mf4u0jr6786wtz7s7dj6gmpyfafg8e0exh5wvye5cygvvxyyxhpsmj8q0e
maxTimeoutSecondsintegerrequired

Seconds by the x402 standard; the millisecond truth is extra.quoteExpiresAtMs.

Constant value: 120
extra objectrequired
quoteMacstringrequired

HMAC-SHA256 (base64url) over the canonical JSON (RFC 8785) of this whole requirements object, with extra.quoteMac, extra.lease and extra.leaseExpiresAtMs removed. On the paid retry, accepted is verified by recomputing this MAC on whichever API host receives it, never by lookup. The lease is left out because the server may renew it at the paid retry, and it carries its own HMAC. Domain-separation prefix: corelayer/x402-quote/v1. The MAC covers extra.quoteId and, for plans, the embedded extra.quote (which carries its own quoteMac).

Possible values: Value must match regular expression ^[A-Za-z0-9_-]{43}$

assetTransferMethodstringrequired
Constant value: esdt
paymentFlowstringrequired
Constant value: upfront
scFunctionstringrequired

Possible values: [deposit, depositFor, depositAndSubscribe]

argumentsstring[]required

Hex arguments after the function name.

gasLimitinteger<int64>required
gasPriceinteger<int64>required

Equality with minGasPrice on the free purchase flow.

relayerAddressrequired

MultiversX bech32 address.

Possible values: Value must match regular expression ^erd1[02-9ac-hj-np-z]{58}$

Example: erd1mf4u0jr6786wtz7s7dj6gmpyfafg8e0exh5wvye5cygvvxyyxhpsmj8q0e
leasestringrequired
leaseExpiresAtMsinteger<int64>required

Unix time in milliseconds.

Possible values: >= 0

registryVersioninteger<int64>
expectedNonceinteger<int64>
chainIdstringrequired
quoteIdstringrequired
quoteExpiresAtMsinteger<int64>required

Unix time in milliseconds.

Possible values: >= 0

quote object

A price quote, with amounts as decimal strings. Stateless: quoteMac authenticates the canonical JSON (RFC 8785) of all other members, so any API host can verify a quote it did not issue by recomputing the MAC. No quote is stored; two prepare calls simply give two valid quotes. The MAC key differs per environment, so a devnet quote never verifies on mainnet.

quoteIdstringrequired

At most 12 ASCII bytes, because it becomes the ref of the contract call and data bytes are billed at full gas price. It is q_ followed by the first 10 Crockford base32 characters of an HMAC, keyed with the service's quote key, over corelayer/quote-id/v1 followed by the canonical JSON of every member except quoteId and quoteMac. Any API host can recompute it.

Possible values: Value must match regular expression ^q_[0-9A-Z]{10}$

quoteMacstringrequired

HMAC-SHA256 with the service's quote key over corelayer/quote/v1 followed by the canonical JSON of every other member, quoteId included. Base64url without padding.

Possible values: Value must match regular expression ^[A-Za-z0-9_-]{43}$

tierIdintegerrequired
monthsintegerrequired

Possible values: >= 0 and <= 12

tariffDecimalStringrequired

Non-negative integer as decimal string (pricing document family).

Possible values: Value must match regular expression ^[0-9]+$

tariffVersionintegerrequired
tariffEffectiveMsinteger<int64>required

Unix time in milliseconds.

Possible values: >= 0

priceMicroUsdcDecimalStringrequired

Non-negative integer as decimal string (pricing document family).

Possible values: Value must match regular expression ^[0-9]+$

maxPriceDecimalStringrequired

Non-negative integer as decimal string (pricing document family).

Possible values: Value must match regular expression ^[0-9]+$

pendingTariffstring | nullnullablerequired
issuedAtMsinteger<int64>required

Unix time in milliseconds.

Possible values: >= 0

expiresAtMsinteger<int64>required

Unix time in milliseconds.

Possible values: >= 0

dataTemplatestringrequired
namestring
decimalsinteger
X402Requirements
{
"scheme": "exact",
"network": "string",
"amount": "string",
"asset": "USDC-c76f1f",
"payTo": "erd1mf4u0jr6786wtz7s7dj6gmpyfafg8e0exh5wvye5cygvvxyyxhpsmj8q0e",
"maxTimeoutSeconds": 120,
"extra": {
"quoteMac": "string",
"assetTransferMethod": "esdt",
"paymentFlow": "upfront",
"scFunction": "deposit",
"arguments": [
"string"
],
"gasLimit": 0,
"gasPrice": 0,
"relayer": "erd1mf4u0jr6786wtz7s7dj6gmpyfafg8e0exh5wvye5cygvvxyyxhpsmj8q0e",
"lease": "string",
"leaseExpiresAtMs": 0,
"registryVersion": 0,
"expectedNonce": 0,
"chainId": "string",
"quoteId": "string",
"quoteExpiresAtMs": 0,
"quote": {
"quoteId": "string",
"quoteMac": "string",
"tierId": 0,
"months": 0,
"tariff": "string",
"tariffVersion": 0,
"tariffEffectiveMs": 0,
"priceMicroUsdc": "string",
"maxPrice": "string",
"pendingTariff": "string",
"issuedAtMs": 0,
"expiresAtMs": 0
},
"dataTemplate": "string",
"name": "string",
"decimals": 0
}
}