Skip to main content
POST
Create a crypto charge

Authorizations

X-Suby-Api-Key
string
header
required

Secret API key. sk_live_… (production) or sk_sandbox_… (sandbox).

Headers

Idempotency-Key
string

Optional key (≤255 chars, e.g. a UUID v4) that makes this POST safe to retry: the first request executes and its response is cached for 24h; a retry with the SAME key replays that response instead of re-executing (no duplicate payment/subscription). A reused key with a different request → 422 IDEMPOTENCY_KEY_CONFLICT; a retry while the first is still in flight → 409. See the Idempotency guide.

Maximum string length: 255
Example:

"5f3b9c2e-1a4d-4f2b-9c31-7e2a1b6d8c04"

Body

application/json

Pricing: productId (the product's price snapshot) OR priceCents + currency. A customer is always required · the deposit address is HD-derived from one, and receipts, refunds and access all hang off it.

mode
enum<string>
required

qr_deposit returns an address the payer sends to; wallet_connect returns calldata their wallet signs.

Available options:
qr_deposit,
wallet_connect
chainId
integer
required

From GET /v3/crypto/assets.

Example:

8453

asset
string
required

The token's ticker on that chain, case-insensitive. (chainId, asset) is the public key · there is no numeric asset id on this surface, because ours means nothing outside our database.

Required string length: 2 - 12
Example:

"USDC"

customer
object
required

How a customer is named in a request body: exactly one of id or email. With id the name fields are ignored · the customer already has them on file. With email the customer is created on the fly (email is the get-or-create key). Supplying both, or neither, is a validation error.

productId
string
Example:

"pro_abc123"

priceCents
string

Minor units as a string of digits. Requires currency.

Pattern: ^[1-9]\\d*$
Example:

"1999"

currency
string
Pattern: ^[A-Z]{3}$
displayName
string
Maximum string length: 200
displayDescription
string | null
Maximum string length: 500
displayImageUrl
string<uri> | null
payerAddress
string

wallet_connect only · the connected wallet's address (Solana fee payer, EVM sender). Omit to charge the customer's HD-derived address.

externalRef
string
Maximum string length: 120
metadata
object

Key-value pairs. ≤50 keys, keys ≤40 chars, values are strings ≤500 chars (or null to clear). Nested structures must be JSON-stringified into a single string value.

Response

Charge created

success
boolean
required
Example:

true

data
object
required

Endpoint-specific payload.

message
string