Skip to documentation
DocumentationAPI referenceDeposit USD with x402
POSTBearer token

Deposit USD with x402

/api/v1/deposits/x402

Create or resume a fixed-team USD deposit using the x402 v2 payment flow.

Before you call

The first request returns HTTP 402 and PAYMENT-REQUIRED. Retry the identical body with a base64 JSON PAYMENT-SIGNATURE header. Keep the wallet key local and query the same payment ID when settlement is pending.

Request example

cURL
curl "https://tovahub.com/api/v1/deposits/x402" -X POST \
  -H "Authorization: Bearer $TOVAHUB_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{
  "requestKey": "docs_example_001",
  "amount": "1000"
}'

Examples only. No requests are sent from this page.

Illustrative response
JSON
{
  "x402Version": 2,
  "error": "Payment required",
  "resource": {
    "url": "https://tovahub.com/api/v1/payments/507f1f77bcf86cd799439011",
    "description": "deposit 1000 USD cents",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "10000000",
      "asset": "0x2222222222222222222222222222222222222222",
      "payTo": "0x3333333333333333333333333333333333333333",
      "maxTimeoutSeconds": 300
    }
  ]
}

Parameters

requestKeyJSON body · Required

string

8–100 characters: A–Z, a–z, 0–9, underscore or hyphen. Keep the same key and identical input when retrying the same operation.

amountJSON body · Required

string · integer

Integer USD cents as digits, from 100 to 999999999999 (minimum 1 USD).

Response

HTTP status 402 / 200 / 202

The response body depends on payment state. The initial HTTP 402 carries a PaymentRequired object; settlement details use PAYMENT-RESPONSE.

x402Versionnumber

x402 protocol version; currently 2.

resourceobject

Payment-required message and resource details for the original payment intent.

acceptsobject[]

Accepted payment requirements for configured networks.