Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Creating an Invoice

curl -X POST https://your-server/invoices \
  -H "Authorization: Bearer ak_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "store_id": "00000000-0000-0000-0000-000000000000",
    "currency": "USD",
    "amount": "25.00",
    "expiration_seconds": 900,
    "webhook_url": "https://your-server/webhooks/ethpayserver"
  }'

Fields

FieldRequiredNotes
store_idyesThe store this invoice belongs to
currencyyes"USD" and other fiat codes, or a crypto asset symbol directly for testing
amountyesAlways the currency’s standard human-readable unit — "25.00" for USD, "0.1" for ETH. Never pre-convert to the smallest unit; the server does that internally
expiration_secondsnoDefaults to 900 (15 minutes)
customer_emailnoUsed for a payment receipt, if set
redirect_urlnoWhere the customer lands after paying
webhook_urlnoWhere payment events are delivered — see Webhooks
metadatanoArbitrary JSON, echoed back on the invoice

The full request and response schema, including every field’s type, is in the API Reference.

What happens next

  1. The server picks (or derives) a payment address from the store’s configured wallet and registers it with the payment monitor.
  2. The customer sends funds to that address.
  3. The monitor detects the transfer, and the invoice moves through its status lifecycle as confirmations accumulate.
  4. If a webhook_url was set, you get notified at each step — see Webhooks.

Checking status

curl https://your-server/invoices/{invoice_id}/status \
  -H "Authorization: Bearer ak_your_api_key"

An API key scoped to cancreateinvoice and canviewinvoices is enough to both create and check the status of invoices — see API Keys & Permissions for the full permission list and how scoping works.