JustCryptoPay Developer Docs

API Reference

Accept USDT and USDC across five chains with a single REST API. Create a charge, redirect to hosted checkout or render your own screen, and receive a signed webhook the moment funds confirm on-chain, then a second event once they settle to your wallet. Payments are non-custodial by design.

Base URL

https
https://justcryptopay.io
Protocol
REST + JSON
Auth
API key header
Fee
0.5% flat
Custody
Non-custodial

Supported networks

Each charge gets a unique deposit address on the chain you request. Stablecoins and chains currently accepted:

TronTRC-20 · USDT BNB Smart ChainBEP-20 · USDT/USDC PolygonUSDT/USDC BaseUSDT/USDC SolanaUSDT/USDC

How a payment flows

  • Create a charge with the fiat amount, chain and asset. You receive a unique address, the exact token amount expected, a QR and a hosted pay_url.
  • Collect payment by redirecting the customer to pay_url, or build your own screen from the charge fields.
  • Confirm once the deposit confirms on-chain. We send a signed charge.confirmed webhook and the charge flips to confirmed — the payer is done.
  • Settle is a separate step for managed acceptance: the funds are swept to your wallet and a charge.settled webhook fires with the settlement tx hash and timestamp. Settlement can be pending, held, failed or complete.

Authentication

All API requests are authenticated with your merchant API key, sent in the X-API-Key header. Create and rotate keys from the dashboard. Keep keys server-side and never ship them in browser or mobile code.

Header
X-API-Key: sk_live_your_merchant_api_key
🔐
Requests over plain HTTP, or with a missing or invalid key, are rejected with 401 unauthorized. Always call the API over HTTPS.

Create a charge

POST/v1/charges

Creates a payment request. Pass the fiat amount in USD plus the chain and asset you want to accept. We return a unique on-chain address and the exact token amount the customer must send.

Request body

FieldTypeRequiredDescription
amount_usdstringYesAmount to collect in USD, as a decimal string. Example "29.99".
chainstringYesOne of tron, polygon, bsc, base, solana.
assetstringYesUSDT or USDC (Tron is USDT only).
order_idstringNoYour own reference. Echoed back and included in the webhook.
metadataobjectNoArbitrary key/value object stored with the charge.

Example request

cURL
curl -X POST https://justcryptopay.io/v1/charges \
  -H "X-API-Key: sk_live_your_merchant_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_usd": "29.99",
    "chain": "tron",
    "asset": "USDT",
    "order_id": "ORD-10231",
    "metadata": { "customer": "u_8842", "plan": "pro" }
  }'

Example response 201 Created

JSON
{
  "id": "chg_3Qa8Rn2kLpWv",
  "status": "pending",
  "amount_usd": "29.99",
  "expected_amount": "29.990000",
  "asset": "USDT",
  "chain": "tron",
  "network": "TRC-20",
  "address": "TJmV5r8mKq2Yd9wN7sPcXbH4eLf6ZgApQe",
  "order_id": "ORD-10231",
  "pay_url": "https://justcryptopay.io/pay/chg_3Qa8Rn2kLpWv",
  "expires_at": "2026-11-26T12:45:00Z",
  "qr": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
}
📍
The address is unique to this charge. Collect the exact expected_amount of the token. Under-payments stay pending until topped up or expired.

Code snippets

Node.js — fetch
// Node 18+ (global fetch)
const res = await fetch("https://justcryptopay.io/v1/charges", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.JCP_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    amount_usd: "29.99",
    chain: "tron",
    asset: "USDT",
    order_id: "ORD-10231",
    metadata: { customer: "u_8842" },
  }),
});

if (!res.ok) throw new Error(`JustCryptoPay ${res.status}`);
const charge = await res.json();
console.log(charge.pay_url, charge.address);

Fetch a charge

GET/v1/charges/{id}

Retrieve the current state of a charge by its id. Uses the same X-API-Key auth. Useful for polling status or reconciling an order.

cURL
curl https://justcryptopay.io/v1/charges/chg_3Qa8Rn2kLpWv \
  -H "X-API-Key: sk_live_your_merchant_api_key"

Get networks

GET/v1/networks

Returns the chain/asset combinations your account can accept. Use it to render a payment-method picker without hard-coding the list.

cURL
curl https://justcryptopay.io/v1/networks \
  -H "X-API-Key: sk_live_your_merchant_api_key"

Example response

JSON
{
  "networks": [
    { "chain": "tron",    "asset": "USDT", "label": "Tron (TRC-20)" },
    { "chain": "bsc",     "asset": "USDT", "label": "BNB Smart Chain (BEP-20)" },
    { "chain": "bsc",     "asset": "USDC", "label": "BNB Smart Chain (BEP-20)" },
    { "chain": "polygon", "asset": "USDT", "label": "Polygon" },
    { "chain": "polygon", "asset": "USDC", "label": "Polygon" },
    { "chain": "base",    "asset": "USDT", "label": "Base" },
    { "chain": "base",    "asset": "USDC", "label": "Base" },
    { "chain": "solana",  "asset": "USDT", "label": "Solana" },
    { "chain": "solana",  "asset": "USDC", "label": "Solana" }
  ]
}
ℹ️
Supported processing is resolved per mode × network × asset. This endpoint returns only the combinations that are verified and live for your account — treat it as the source of truth rather than assuming every chain or coin is available.

Hosted checkout

The fastest integration: create a charge, then redirect the customer to the returned pay_url. The hosted page shows the deposit address, the exact amount, a scannable QR, a live countdown to expires_at, and the payment status as it updates, with no front-end work on your side.

Redirect
// after creating the charge
res.redirect(charge.pay_url);
// -> https://justcryptopay.io/pay/chg_3Qa8Rn2kLpWv
🧩
Prefer your own UI? Every field you need is on the charge object: address, expected_amount, qr (a ready-to-render data-URI image) and expires_at. Treat the webhook as your source of truth for "paid", not the browser returning.

Embed on your site

Take payments without ever sending the customer to our domain. Drop in one script and open the checkout in a modal that stays on your page. Include the widget once:

HTML
<script src="https://justcryptopay.io/embed.js"></script>

Option A — Pre-created charge (most secure)

Create the charge on your backend with your secret key (POST /v1/charges), then open it by id. The amount is fixed server-side, so it cannot be tampered with in the browser.

JavaScript
JustCryptoPay.open({
  charge: 'CHARGE_ID_FROM_YOUR_BACKEND',
  onSuccess: function (d) { window.location = '/thank-you'; },
  onClose:   function () {},
  onExpired: function () {}
});

Option B — Publishable key (no backend)

No server at all. Ship your publishable key (pk_live_…) in the browser — it can only create a charge, never read, settle, or pay out. The widget calls POST /v1/checkout for you and opens the modal.

JavaScript
JustCryptoPay.open({
  key: 'pk_live_xxx',
  amount: 25,
  chain: 'tron',
  asset: 'USDT',
  order_id: 'order-123',
  onSuccess: function (d) { window.location = '/thank-you'; }
});
⚠
With a publishable key the amount is supplied by the browser. For fixed prices, always re-check the paid amount on the signed webhook before fulfilling — never trust the browser for how much was owed.

Option C — No-code button

No JavaScript to write. Add data-jcp-* attributes to any element and the widget wires the click automatically.

HTML
<button data-jcp-key="pk_live_xxx"
        data-jcp-amount="25"
        data-jcp-chain="tron"
        data-jcp-asset="USDT"
        data-jcp-order-id="order-123"
        data-jcp-success-url="/thank-you">
  Pay with crypto
</button>

Option D — Fixed-price Payment Links (tamper-proof)

The safest no-backend option. Create a Payment Link in your dashboard with a fixed amount; the price lives on our server, so a tampered browser amount is ignored entirely. Open it by link id — no publishable key needed, the link id is the capability.

JavaScript
JustCryptoPay.open({ link: 'plink_xxx', onSuccess: function (d) { window.location = '/thank-you'; } });

No-code button and clean shareable URL work the same way:

HTML / URL
<button data-jcp-link="plink_xxx">Pay with crypto</button>

// or just link to it:
https://justcryptopay.io/l/plink_xxx
🛡
For raw publishable-key checkouts (Option B/C) you can also set a per-key amount cap in your dashboard → API & Webhooks. Any raw checkout above the cap is rejected; fixed-price links are exempt. Belt and braces against amount tampering.

Shareable payment link

For invoices and emails, link straight to a hosted checkout. We create the charge and show the payment page — no code anywhere.

URL
https://justcryptopay.io/pay/new?key=pk_live_xxx&amount=25&chain=tron&asset=USDT&order_id=order-123
🔑
Your publishable key is in your dashboard next to the API key. It is safe to put in public HTML. Keep the sk_live_… secret key on your server only.

Payouts API

Send crypto from your own server to any wallet or batch of wallets. Authenticate every call with your secret X-API-Key — the same key used for charges. This API is server-to-server only: never expose the secret key in browser or mobile code.

🔒
API-key requests do not need an Origin/Referer header (that CSRF check is only for dashboard cookie sessions). Call it from your backend, e.g. Node, Python, PHP or Go.

Custodial balance payouts

Fund a per-chain balance, then withdraw from it. Deposits are credited after 20 confirmations. Current limits: minimum 1, maximum 25,000 per payout; platform fee is 0% at the time of writing (the response always returns the exact fee). Supported token payouts: Tron, BSC, Polygon, Base and Solana — verify the live combinations with GET /v1/networks.

GET/v1/payouts/deposit-address?chain=tron&asset=USDT

Returns your stable deposit address for that chain. Send USDT/USDC there; the watcher credits your balance after confirmations. One address per chain receives any supported token on that chain.

cURL
curl "https://justcryptopay.io/v1/payouts/deposit-address?chain=tron&asset=USDT" \
  -H "X-API-Key: sk_live_your_merchant_api_key"
GET/v1/payouts/balances

Returns the available balance per chain/asset: {"balances":[{"chain":"tron","asset":"USDT","available":"25.000000"}]}.

POST/v1/payouts

Creates a withdrawal from your balance. The amount plus fee is debited atomically; the send is queued. Send an idempotency_key so retries can never pay twice — repeat the same key and you get the original payout back.

cURL
curl -X POST https://justcryptopay.io/v1/payouts \
  -H "X-API-Key: sk_live_your_merchant_api_key" \
  -H "Content-Type: application/json" \
  -d '{"chain":"tron","asset":"USDT","destination":"T...your...address","amount":25,"idempotency_key":"payout-2026-001"}'
201 JSON
{
  "id": "po_...", "status": "queued", "chain": "tron", "asset": "USDT",
  "destination": "T...", "amount": "25.000000", "fee": "0.000000",
  "tx_hash": null, "idempotency_key": "payout-2026-001",
  "created_at": "2026-11-30T...", "sent_at": null
}

Track it with GET /v1/payouts/{id} or list with GET /v1/payouts?limit=100&status=queued. tx_hash is filled once broadcast; status becomes sent.

Non-custodial wallet payouts

Pull funds straight from your own wallet in one on-chain transaction — no custodial balance is debited. You sign an allowance once, then execute batches. Check GET /v1/payouts/config for the live chains; at the time of writing BSC is live (other chains return 503 until their router is deployed).

  1. GET /v1/payouts/config — router, Permit2, relayer, chain id and supported tokens per chain.
  2. POST /v1/payouts/link-wallet — store the source wallet: {"chain_family":"evm","address":"0x..."} (families: evm, tron, solana).
  3. Grant an allowance to our router from that wallet: EVM Permit2 or a plain ERC-20 approve; optionally submit an EIP-2612 signature via POST /v1/payouts/grant-permit (gasless for you). Tron uses a TRC-20 approve; Solana uses an SPL delegate.
  4. GET /v1/payouts/allowance?chain=bsc&asset=USDT — confirm the router can pull at least your batch total.
  5. POST /v1/payouts/execute — one transaction pays every recipient plus the platform fee.
cURL
curl -X POST https://justcryptopay.io/v1/payouts/execute \
  -H "X-API-Key: sk_live_your_merchant_api_key" \
  -H "Content-Type: application/json" \
  -d '{"chain":"bsc","asset":"USDT","recipients":[{"address":"0x...","amount":5},{"address":"0x...","amount":7.5}],"idempotency_key":"batch-2026-001"}'
JSON
{"tx_hash":"0x...","status":"sent","count":2,"fee":"...","chain":"bsc","asset":"USDT"}

Disconnect the stored source wallet with POST /v1/payouts/unlink-wallet {"chain_family":"evm"} (on-chain allowances remain until you revoke them in your wallet).

Payout errors

  • 401 — missing/invalid X-API-Key.
  • 403 — only for cookie-session (dashboard) calls without a valid Origin/Referer; server-to-server API-key calls are exempt.
  • 422 — validation, unsupported chain/asset, insufficient balance, missing linked wallet, or allowance too low.
  • 503 — payouts not yet live on that chain (check GET /v1/payouts/config).
🔑
Full machine-readable schema: /openapi.json. Keep sk_live_... on your server; the publishable pk_live_... key can never create or read payouts.

Webhooks / IPN

Set a webhook URL in your dashboard. When a charge confirms on-chain, we POST a JSON body to that URL with a signature header. This is the reliable, server-to-server signal that a payment succeeded.

Payment states

Confirmed and settled are two distinct states — don't treat one as the other:

  • confirmed — the deposit has been detected and has the required confirmations on-chain. The payer is done, but for managed acceptance the funds are not necessarily in your wallet yet. This is when charge.confirmed fires.
  • settled / swept — the funds have actually been moved to your merchant wallet. This is reported separately by a charge.settled event that carries the settlement transaction hash and timestamp.
ℹ️
For managed acceptance, settlement is its own step and can be pending, held (for example while a prepaid balance to cover the network fee is topped up), failed or complete. A confirmed charge is not proof that funds reached your wallet — wait for charge.settled (or settlement.state = complete) before treating a payout as received. For direct acceptance the customer pays your own wallet, so there is no separate sweep.

Webhook payload

FieldTypeDescription
eventstringEvent name — charge.confirmed (deposit confirmed on-chain) or charge.settled (funds swept to your wallet).
idstringThe charge id.
order_idstringYour reference, if you supplied one.
amount_usdstringRequested USD amount.
received_amountstringToken amount actually received.
fee_amountstringPlatform fee for this charge (0.5% by default).
net_amountstringAmount due to your wallet after fee; moved when the charge settles, not at confirmation.
asset / chainstringStablecoin and chain of the payment.
tx_hashstringOn-chain hash of the customer's deposit (not the settlement sweep — see settlement.tx_hash).
statusstringCharge status. confirmed means the deposit confirmed on-chain; settlement to your wallet is tracked separately (see settlement.state and Payment states).
settlement.statestringManaged settlement state: pending, held, failed or complete. Absent for direct acceptance.
settlement.tx_hashstringHash of the sweep that moved funds to your wallet. Present once settled; distinct from the deposit tx_hash.
settlement.settled_atstringISO-8601 time the funds were swept to your wallet. Present once settled.

Example webhook body

JSON · POST to your URL
{
  "event": "charge.confirmed",
  "id": "chg_3Qa8Rn2kLpWv",
  "order_id": "ORD-10231",
  "amount_usd": "29.99",
  "received_amount": "29.990000",
  "fee_amount": "0.150000",
  "net_amount": "29.840000",
  "asset": "USDT",
  "chain": "tron",
  "tx_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "status": "confirmed"
}

Once the funds are swept to your wallet, a separate charge.settled event is delivered. It carries a settlement object with its own transaction hash and timestamp — distinct from the deposit above:

JSON · charge.settled
{
  "event": "charge.settled",
  "id": "chg_3Qa8Rn2kLpWv",
  "order_id": "ORD-10231",
  "asset": "USDT",
  "chain": "tron",
  "tx_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "status": "confirmed",
  "settlement": {
    "state": "complete",
    "tx_hash": "a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
    "settled_at": "2026-11-26T12:48:10Z"
  }
}
⚠️
Respond 2xx quickly. We retry non-2xx deliveries with backoff. Make your handler idempotent by keying on id or tx_hash, so a retried webhook never double-credits an order.

Signature verification

Every webhook carries an X-JCP-Signature header: an HMAC-SHA256 of the raw request body computed with your webhook secret (found in the dashboard). Recompute it and compare using a constant-time check before trusting the payload.

Header
X-JCP-Signature: 9f1c0b…e7a2   # hex HMAC-SHA256 of the raw body
Node.js — Express
import crypto from "crypto";
import express from "express";

const app = express();
const SECRET = process.env.JCP_WEBHOOK_SECRET;

// capture the RAW body, sign exactly what was received
app.post(
  "/webhooks/justcryptopay",
  express.raw({ type: "application/json" }),
  (req, res) => {
    const signature = req.get("X-JCP-Signature") || "";
    const expected = crypto
      .createHmac("sha256", SECRET)
      .update(req.body)            // req.body is a Buffer
      .digest("hex");

    const ok =
      signature.length === expected.length &&
      crypto.timingSafeEqual(
        Buffer.from(signature),
        Buffer.from(expected)
      );

    if (!ok) return res.status(400).send("invalid signature");

    const event = JSON.parse(req.body.toString("utf8"));
    if (event.event === "charge.confirmed") {
      // fulfil order, idempotent on event.id
    }
    res.sendStatus(200);
  }
);
🛡️
Always hash the raw, unparsed body. Re-serializing JSON can change byte order or spacing and break the signature. Reject on mismatch before doing any business logic.

Status values

A charge moves through a small set of states. Poll GET /v1/charges/{id} or rely on the webhook for the terminal state.

StatusMeaning
pendingCharge created, waiting for the deposit to arrive and confirm.
confirmingDeposit seen on-chain, waiting for the required confirmations.
confirmedDeposit confirmed on-chain — the payer is done. For managed acceptance, funds are not necessarily in your wallet yet; the charge.confirmed webhook fires here.
settledFunds swept to your wallet, reported with a settlement tx hash and timestamp. Managed settlement runs through pending → held → complete (or failed); the charge.settled webhook fires on completion.
expiredexpires_at passed with no (or insufficient) payment.

Errors

The API uses standard HTTP status codes. Error responses return a JSON body with a stable error code and a human-readable message.

JSON · 422
{
  "error": "invalid_request",
  "message": "chain must be one of: tron, polygon, bsc, base, solana"
}
HTTPerrorWhen
400bad_requestMalformed JSON or missing body.
401unauthorizedMissing or invalid X-API-Key.
404not_foundNo charge matches the given id.
422invalid_requestA field failed validation (e.g. unsupported chain/asset pair).
429rate_limitedToo many requests. Back off and retry.
500server_errorSomething went wrong on our side. Safe to retry idempotent reads.
✅
Ready to build? Grab your API key and webhook secret from the dashboard, then create your first charge against the live endpoint.