Skip to main content

Send a Payment

The POST /v1/pay endpoint is Unwall’s unified payment interface. It accepts three types of recipients and automatically routes to the correct payment rail — no rail selection logic needed in your agent code.

x402 Payment

When the recipient is a URL, Unwall proxies the request and handles the x402 payment protocol automatically.
Response
The max_amount_usdc field is in micro-USDC (1 USDC = 1,000,000). Setting it to 1000000 means the agent will pay up to 1 USDC for this call. If the API charges more, the payment is rejected.

USDC Transfer

When the recipient is an Ethereum address (0x...), Unwall sends USDC on Base chain via Bridge.xyz.
Response

Fiat ACH Payment

When the recipient is an object with bank details, Unwall converts USDC to USD and sends via ACH bank transfer.
Response
ACH transfers are not instant. Expect 2-3 business days for settlement. Use the GET /v1/transactions endpoint to track status changes.

Idempotency

Include an idempotency_key to prevent duplicate payments. If a request is retried with the same key, the original transaction is returned without creating a new one.
This is especially important for AI agents that may retry requests on network errors or timeouts. Idempotency keys are scoped to each project — the same key can be used in different projects without conflict.

Error Handling

Example error response
Always check the status field in the response. A 200 response with "status": "processing" means the payment was accepted but has not yet settled. Use GET /v1/transactions or wait for webhook confirmation to verify completion.

Required Permissions