curl --request POST \
--url https://api.beta.suby.fi/v3/crypto/charges \
--header 'Content-Type: application/json' \
--header 'X-Suby-Api-Key: <api-key>' \
--data '
{
"chainId": 8453,
"asset": "USDC",
"customer": {
"id": "cus_abc123",
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
},
"productId": "pro_abc123",
"priceCents": "1999",
"currency": "<string>",
"displayName": "<string>",
"displayDescription": "<string>",
"displayImageUrl": "<string>",
"payerAddress": "<string>",
"externalRef": "<string>",
"metadata": {}
}
'import requests
url = "https://api.beta.suby.fi/v3/crypto/charges"
payload = {
"chainId": 8453,
"asset": "USDC",
"customer": {
"id": "cus_abc123",
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
},
"productId": "pro_abc123",
"priceCents": "1999",
"currency": "<string>",
"displayName": "<string>",
"displayDescription": "<string>",
"displayImageUrl": "<string>",
"payerAddress": "<string>",
"externalRef": "<string>",
"metadata": {}
}
headers = {
"X-Suby-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Suby-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chainId: 8453,
asset: 'USDC',
customer: {
id: 'cus_abc123',
email: 'jsmith@example.com',
firstName: '<string>',
lastName: '<string>'
},
productId: 'pro_abc123',
priceCents: '1999',
currency: '<string>',
displayName: '<string>',
displayDescription: '<string>',
displayImageUrl: '<string>',
payerAddress: '<string>',
externalRef: '<string>',
metadata: {}
})
};
fetch('https://api.beta.suby.fi/v3/crypto/charges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.beta.suby.fi/v3/crypto/charges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chainId' => 8453,
'asset' => 'USDC',
'customer' => [
'id' => 'cus_abc123',
'email' => 'jsmith@example.com',
'firstName' => '<string>',
'lastName' => '<string>'
],
'productId' => 'pro_abc123',
'priceCents' => '1999',
'currency' => '<string>',
'displayName' => '<string>',
'displayDescription' => '<string>',
'displayImageUrl' => '<string>',
'payerAddress' => '<string>',
'externalRef' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Suby-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.beta.suby.fi/v3/crypto/charges"
payload := strings.NewReader("{\n \"chainId\": 8453,\n \"asset\": \"USDC\",\n \"customer\": {\n \"id\": \"cus_abc123\",\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"productId\": \"pro_abc123\",\n \"priceCents\": \"1999\",\n \"currency\": \"<string>\",\n \"displayName\": \"<string>\",\n \"displayDescription\": \"<string>\",\n \"displayImageUrl\": \"<string>\",\n \"payerAddress\": \"<string>\",\n \"externalRef\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Suby-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.beta.suby.fi/v3/crypto/charges")
.header("X-Suby-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chainId\": 8453,\n \"asset\": \"USDC\",\n \"customer\": {\n \"id\": \"cus_abc123\",\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"productId\": \"pro_abc123\",\n \"priceCents\": \"1999\",\n \"currency\": \"<string>\",\n \"displayName\": \"<string>\",\n \"displayDescription\": \"<string>\",\n \"displayImageUrl\": \"<string>\",\n \"payerAddress\": \"<string>\",\n \"externalRef\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beta.suby.fi/v3/crypto/charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Suby-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chainId\": 8453,\n \"asset\": \"USDC\",\n \"customer\": {\n \"id\": \"cus_abc123\",\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"productId\": \"pro_abc123\",\n \"priceCents\": \"1999\",\n \"currency\": \"<string>\",\n \"displayName\": \"<string>\",\n \"displayDescription\": \"<string>\",\n \"displayImageUrl\": \"<string>\",\n \"payerAddress\": \"<string>\",\n \"externalRef\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"payment": {
"rail": "card",
"id": "pay_abc123",
"organizationId": "<string>",
"customerId": "<string>",
"productId": "<string>",
"subscriptionId": "<string>",
"status": "PENDING",
"paymentMethodCategory": "CARD",
"declineCode": "<string>",
"declineCategory": "SOFT",
"declineAdvice": "TRY_AGAIN_LATER",
"declineNetworkCode": "<string>",
"threeDSecureResult": "AUTHENTICATED",
"displayName": "<string>",
"displayDescription": "<string>",
"displayImageUrl": "<string>",
"priceCents": "<string>",
"currency": "<string>",
"tokenAmount": "<string>",
"tokenFeeAmount": "<string>",
"quoteFiatAmountCents": 123,
"quoteFiatCurrency": "<string>",
"grossAmountCents": 123,
"platformFeeCents": 123,
"merchantNetCents": 123,
"vatAmountCents": 123,
"vatRateBps": 123,
"taxInclusive": true,
"fxSurchargeCents": 123,
"internationalCardSurchargeCents": 123,
"rollingReserveCents": 123,
"refundedAmountCents": 123,
"refundedAt": "2023-11-07T05:31:56Z",
"cryptoSettlementMode": "<string>",
"settlementChainId": 123,
"settlementAsset": "<string>",
"settlementRecipient": "<string>",
"depositAddress": "<string>",
"settlementTxHash": "<string>",
"lifiTxHash": "<string>",
"lifiSubstatus": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"externalRef": "<string>",
"paymentReceivedAt": "2023-11-07T05:31:56Z",
"paymentSettledAt": "2023-11-07T05:31:56Z",
"paymentConfirmedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"statusTimeline": [
{
"status": "PENDING",
"at": "2023-11-07T05:31:56Z"
}
],
"items": [
{
"productId": "<string>",
"name": "<string>",
"quantity": 123,
"unitPriceCents": 123
}
],
"asset": {
"chainId": 123,
"chainName": "<string>",
"chainLogoUrl": "<string>",
"symbol": "<string>",
"decimals": 123,
"address": "<string>",
"logoUrl": "<string>"
},
"settlementChain": {
"chainId": 123,
"name": "<string>",
"logoUrl": "<string>"
},
"deposit": {
"expected": "<string>",
"received": "<string>",
"remaining": "<string>",
"confirmations": {
"observed": 123,
"required": 123,
"detectedAt": "2023-11-07T05:31:56Z"
},
"warnings": [
{
"code": "INSUFFICIENT_DEPOSIT_AMOUNT",
"message": "<string>",
"data": {}
}
]
}
},
"instruction": {
"kind": "qr_deposit",
"chainId": 123,
"depositAddress": "<string>",
"expectedAmount": "<string>",
"decimals": 123,
"symbol": "<string>",
"address": "<string>",
"bip21Uri": "<string>",
"surchargeNote": "<string>"
}
},
"message": "<string>"
}{
"success": false,
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found",
"data": "<unknown>"
}Create a crypto charge
The headless rail: render this flow inside your own site.
The fence on POST /v3/payments exists because collecting a card means PCI
scope and a tokenizer we do not hand out. Neither applies here · the payer’s
wallet is the instrument, and a deposit address or a calldata payload is
public information. Nothing sensitive crosses the boundary.
Returns the charge plus the instruction that completes it:
qr_deposit gives an address and the exact amount to send (with a BIP21 URI
on Bitcoin); wallet_connect gives calldata for the connected wallet to
sign · ABI-encoded on EVM, a base64 transaction on Solana.
Poll GET /v3/payments/{id} for the outcome. Its deposit envelope
carries expected / received / remaining and a confirmations
counter, which is what lets you show “payment detected, 1/3 confirmations”
instead of leaving the payer on a QR code.
Where the funds end up is not decided here. Settlement routing · same-chain, or bridged to your account’s convergence target · is an account setting applied after the deposit lands. A treasury decision does not belong in a checkout call.
It does constrain ONE thing, though: an account that converges to a
stablecoin on another chain can only be paid through qr_deposit, because
the bridge needs a Suby-held address to move funds out of. Asking for
wallet_connect on such an account returns
CRYPTO_AUTOSWAP_MODE_NOT_SUPPORTED rather than quietly settling in the
source asset on the source chain.
curl --request POST \
--url https://api.beta.suby.fi/v3/crypto/charges \
--header 'Content-Type: application/json' \
--header 'X-Suby-Api-Key: <api-key>' \
--data '
{
"chainId": 8453,
"asset": "USDC",
"customer": {
"id": "cus_abc123",
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
},
"productId": "pro_abc123",
"priceCents": "1999",
"currency": "<string>",
"displayName": "<string>",
"displayDescription": "<string>",
"displayImageUrl": "<string>",
"payerAddress": "<string>",
"externalRef": "<string>",
"metadata": {}
}
'import requests
url = "https://api.beta.suby.fi/v3/crypto/charges"
payload = {
"chainId": 8453,
"asset": "USDC",
"customer": {
"id": "cus_abc123",
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
},
"productId": "pro_abc123",
"priceCents": "1999",
"currency": "<string>",
"displayName": "<string>",
"displayDescription": "<string>",
"displayImageUrl": "<string>",
"payerAddress": "<string>",
"externalRef": "<string>",
"metadata": {}
}
headers = {
"X-Suby-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Suby-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chainId: 8453,
asset: 'USDC',
customer: {
id: 'cus_abc123',
email: 'jsmith@example.com',
firstName: '<string>',
lastName: '<string>'
},
productId: 'pro_abc123',
priceCents: '1999',
currency: '<string>',
displayName: '<string>',
displayDescription: '<string>',
displayImageUrl: '<string>',
payerAddress: '<string>',
externalRef: '<string>',
metadata: {}
})
};
fetch('https://api.beta.suby.fi/v3/crypto/charges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.beta.suby.fi/v3/crypto/charges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chainId' => 8453,
'asset' => 'USDC',
'customer' => [
'id' => 'cus_abc123',
'email' => 'jsmith@example.com',
'firstName' => '<string>',
'lastName' => '<string>'
],
'productId' => 'pro_abc123',
'priceCents' => '1999',
'currency' => '<string>',
'displayName' => '<string>',
'displayDescription' => '<string>',
'displayImageUrl' => '<string>',
'payerAddress' => '<string>',
'externalRef' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Suby-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.beta.suby.fi/v3/crypto/charges"
payload := strings.NewReader("{\n \"chainId\": 8453,\n \"asset\": \"USDC\",\n \"customer\": {\n \"id\": \"cus_abc123\",\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"productId\": \"pro_abc123\",\n \"priceCents\": \"1999\",\n \"currency\": \"<string>\",\n \"displayName\": \"<string>\",\n \"displayDescription\": \"<string>\",\n \"displayImageUrl\": \"<string>\",\n \"payerAddress\": \"<string>\",\n \"externalRef\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Suby-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.beta.suby.fi/v3/crypto/charges")
.header("X-Suby-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chainId\": 8453,\n \"asset\": \"USDC\",\n \"customer\": {\n \"id\": \"cus_abc123\",\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"productId\": \"pro_abc123\",\n \"priceCents\": \"1999\",\n \"currency\": \"<string>\",\n \"displayName\": \"<string>\",\n \"displayDescription\": \"<string>\",\n \"displayImageUrl\": \"<string>\",\n \"payerAddress\": \"<string>\",\n \"externalRef\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beta.suby.fi/v3/crypto/charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Suby-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chainId\": 8453,\n \"asset\": \"USDC\",\n \"customer\": {\n \"id\": \"cus_abc123\",\n \"email\": \"jsmith@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n },\n \"productId\": \"pro_abc123\",\n \"priceCents\": \"1999\",\n \"currency\": \"<string>\",\n \"displayName\": \"<string>\",\n \"displayDescription\": \"<string>\",\n \"displayImageUrl\": \"<string>\",\n \"payerAddress\": \"<string>\",\n \"externalRef\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"payment": {
"rail": "card",
"id": "pay_abc123",
"organizationId": "<string>",
"customerId": "<string>",
"productId": "<string>",
"subscriptionId": "<string>",
"status": "PENDING",
"paymentMethodCategory": "CARD",
"declineCode": "<string>",
"declineCategory": "SOFT",
"declineAdvice": "TRY_AGAIN_LATER",
"declineNetworkCode": "<string>",
"threeDSecureResult": "AUTHENTICATED",
"displayName": "<string>",
"displayDescription": "<string>",
"displayImageUrl": "<string>",
"priceCents": "<string>",
"currency": "<string>",
"tokenAmount": "<string>",
"tokenFeeAmount": "<string>",
"quoteFiatAmountCents": 123,
"quoteFiatCurrency": "<string>",
"grossAmountCents": 123,
"platformFeeCents": 123,
"merchantNetCents": 123,
"vatAmountCents": 123,
"vatRateBps": 123,
"taxInclusive": true,
"fxSurchargeCents": 123,
"internationalCardSurchargeCents": 123,
"rollingReserveCents": 123,
"refundedAmountCents": 123,
"refundedAt": "2023-11-07T05:31:56Z",
"cryptoSettlementMode": "<string>",
"settlementChainId": 123,
"settlementAsset": "<string>",
"settlementRecipient": "<string>",
"depositAddress": "<string>",
"settlementTxHash": "<string>",
"lifiTxHash": "<string>",
"lifiSubstatus": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"externalRef": "<string>",
"paymentReceivedAt": "2023-11-07T05:31:56Z",
"paymentSettledAt": "2023-11-07T05:31:56Z",
"paymentConfirmedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"statusTimeline": [
{
"status": "PENDING",
"at": "2023-11-07T05:31:56Z"
}
],
"items": [
{
"productId": "<string>",
"name": "<string>",
"quantity": 123,
"unitPriceCents": 123
}
],
"asset": {
"chainId": 123,
"chainName": "<string>",
"chainLogoUrl": "<string>",
"symbol": "<string>",
"decimals": 123,
"address": "<string>",
"logoUrl": "<string>"
},
"settlementChain": {
"chainId": 123,
"name": "<string>",
"logoUrl": "<string>"
},
"deposit": {
"expected": "<string>",
"received": "<string>",
"remaining": "<string>",
"confirmations": {
"observed": 123,
"required": 123,
"detectedAt": "2023-11-07T05:31:56Z"
},
"warnings": [
{
"code": "INSUFFICIENT_DEPOSIT_AMOUNT",
"message": "<string>",
"data": {}
}
]
}
},
"instruction": {
"kind": "qr_deposit",
"chainId": 123,
"depositAddress": "<string>",
"expectedAmount": "<string>",
"decimals": 123,
"symbol": "<string>",
"address": "<string>",
"bip21Uri": "<string>",
"surchargeNote": "<string>"
}
},
"message": "<string>"
}{
"success": false,
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found",
"data": "<unknown>"
}Authorizations
Secret API key. sk_live_… (production) or sk_sandbox_… (sandbox).
Headers
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.
255"5f3b9c2e-1a4d-4f2b-9c31-7e2a1b6d8c04"
Body
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.
qr_deposit returns an address the payer sends to; wallet_connect returns calldata their wallet signs.
qr_deposit, wallet_connect From GET /v3/crypto/assets.
8453
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.
2 - 12"USDC"
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.
Show child attributes
Show child attributes
"pro_abc123"
Minor units as a string of digits. Requires currency.
^[1-9]\\d*$"1999"
^[A-Z]{3}$200500wallet_connect only · the connected wallet's address (Solana fee payer, EVM sender). Omit to charge the customer's HD-derived address.
120Key-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.
Show child attributes
Show child attributes
Was this page helpful?

