# Stablecoin payment API documentation

The public testnet beta uses test USDC on Base Sepolia and Ethereum Sepolia, and test USDT on TRON Nile. There is no real-money charge.

## Discover assets with a test key

Issue a project test key in the dashboard. Keep ZERO_TO_ONE_PAY_API_KEY in the server environment. The API origin is https://api.0to1pay.com and the HTTP paths start with /v1.

```
curl --fail-with-body https://api.0to1pay.com/v1/chain/assets \
  -H "Authorization: Bearer ${ZERO_TO_ONE_PAY_API_KEY}"
```

## From order to access pass

Register single-use merchant recipients, then create a payment and quote. The buyer signs before transferring and again when submitting the transaction hash. Verify the raw signed webhook, persist the command, then grant access in a worker. The Next.js example runs this flow on Base Sepolia.

## Networks and connections

- `GET /v1/chain/assets` · `listChainAssets` · List enabled network assets (`payments:read`)
- `POST /v1/chain/connections` · `createChainConnection` · Create a watch-only connection (`connections:manage`)
- `POST /v1/connections/{connection_id}/chain-recipients` · `registerChainRecipients` · Register one-use recipient addresses (`connections:manage`)
- `GET /v1/connections` · `listConnections` · List project connections (`connections:read`)
- `GET /v1/connections/{connection_id}` · `getConnection` · Read connection metadata (`connections:read`)
- `POST /v1/connections/{connection_id}/disable` · `disableConnection` · Disable new collection on a connection (`connections:manage`)

## Payments and quotes

- `POST /v1/payments` · `createPayment` · Create a payment obligation (`payments:write`)
- `GET /v1/payments` · `listPayments` · List project payments (`payments:read`)
- `GET /v1/payments/{payment_id}` · `getPayment` · Read payment, decision and fulfillment (`payments:read`)
- `GET /v1/payments/{payment_id}/receipt` · `getPaymentReceipt` · Read confirmed funds by asset and network (`payments:read`)
- `POST /v1/payments/{payment_id}/quotes` · `createQuote` · Reserve a recipient and freeze the payable terms (`payments:write`)
- `GET /v1/quotes/{quote_id}` · `getQuote` · Read the frozen quote (`payments:read`)
- `POST /v1/payments/{payment_id}/attempts` · `createAttempt` · Open the assigned transfer attempt (`attempts:initiate`)
- `GET /v1/payments/{payment_id}/attempts` · `listAttempts` · List the payment attempts (`payments:read`)
- `GET /v1/attempts/{attempt_id}` · `getAttempt` · Read a payment attempt (`payments:read`)
- `POST /v1/payments/{payment_id}/cancel` · `cancelPayment` · Stop new collection attempts (`payments:write`)

## Wallet approval and verification

- `POST /v1/quotes/{quote_id}/chain-intents` · `createChainIntent` · Create a buyer-wallet signing challenge (`payments:write`)
- `POST /v1/quotes/{quote_id}/chain-intents/{intent_id}/authorize` · `authorizeChainIntent` · Authorize a quote with the chosen wallet (`payments:write`)
- `POST /v1/quotes/{quote_id}/chain-intents/{intent_id}/submit` · `submitChainIntent` · Submit the signed transaction claim (`payments:write`)
- `POST /v1/payments/{payment_id}/verify` · `requestVerification` · Queue evidence verification (`payments:verify`)
- `POST /v1/payments/{payment_id}/reviews` · `reviewPayment` · Record an audited payment review (`payments:review`)
- `GET /v1/operations/{operation_id}` · `getOperation` · Read the result of an operation (`operations:read`)

## Webhooks and events

- `POST /v1/webhook-endpoints` · `createWebhookEndpoint` · Register a webhook endpoint (`webhooks:manage`)
- `GET /v1/webhook-endpoints/{endpoint_id}` · `getWebhookEndpoint` · Read webhook endpoint metadata (`webhooks:read`)
- `POST /v1/webhook-endpoints/{endpoint_id}/rotate-secret` · `rotateWebhookSecret` · Rotate a webhook signing secret (`webhooks:manage`)
- `GET /v1/events` · `listEvents` · Replay events using an opaque cursor (`events:read`)

## Fulfillment

- `GET /v1/fulfillments/{command_id}` · `getFulfillment` · Read a fulfillment command and execution (`fulfillment:read`)
- `POST /v1/fulfillments/{command_id}/claim` · `claimFulfillment` · Claim permission to execute a command (`fulfillment:execute`)
- `POST /v1/fulfillments/{command_id}/results` · `reportFulfillmentResult` · Report an execution result (`fulfillment:results`)
- `POST /v1/fulfillments/{command_id}/retry-delivery` · `retryFulfillmentDelivery` · Redeliver the same command (`fulfillment:retry`)

## Subscriptions and usage

- `GET /v1/billing/plans` · `listBillingPlans` · List plans, prices and available payment networks and tokens (`billing:read`)
- `GET /v1/billing/subscription` · `getBillingSubscription` · Read subscription and request usage (`billing:read`)
- `GET /v1/billing/invoices` · `listBillingInvoices` · List recent subscription invoices (`billing:read`)
- `POST /v1/billing/invoices` · `createBillingInvoice` · Create a stablecoin invoice and signing challenge (`billing:write`)
- `GET /v1/billing/invoices/{invoice_id}` · `getBillingInvoice` · Read a subscription invoice (`billing:read`)
- `POST /v1/billing/invoices/{invoice_id}/authorize` · `authorizeBillingInvoice` · Authorize an invoice with the payer wallet (`billing:write`)
- `POST /v1/billing/invoices/{invoice_id}/submit` · `submitBillingInvoice` · Submit the signed subscription transaction (`billing:write`)
- `POST /v1/billing/test-keys` · `issueTestBillingKey` · Issue a Sandbox server key (`billing:write`)
- `POST /v1/billing/keys` · `issueBillingKey` · Issue a scoped project server key (`billing:write`)

## Integration resources

- [Accept Base USDC in Next.js and grant an access pass with a webhook](https://0to1pay.com/guides/nextjs-base-usdc)
- [Integration guide (Markdown)](https://0to1pay.com/guides/nextjs-base-usdc.md)
- [Try the 0.01 test USDC demo](https://0to1pay.com/demo/base-usdc)
- [Next.js example source (ZIP)](https://0to1pay.com/examples/nextjs-base-usdc.zip)
- [@0to1pay/server-sdk](https://www.npmjs.com/package/@0to1pay/server-sdk)
- [@0to1pay/fulfillment-sdk](https://www.npmjs.com/package/@0to1pay/fulfillment-sdk)
- [OpenAPI JSON](https://api.0to1pay.com/openapi.json)
- [Find the merchant and project IDs in project settings](https://pay.0to1pay.com/merchant#settings)
- [Test projects and API keys](https://pay.0to1pay.com/merchant)
