USDT checkout API
One authenticated POST creates an invoice with its own deposit address and a hosted checkout link. Status, webhooks and signatures follow a small, predictable set of rules.
Overview
The OpenBCP API is plain REST over HTTPS with JSON bodies. You create an invoice from your server, redirect the customer to the hosted checkout, and fulfil the order when the webhook says the payment is complete.
- Live base URL:
https://openbcp.com - Sandbox base URL:
https://sandbox.openbcp.com(test keys start withtest_) - Authentication: the
X-openbcp-Api-Keyheader, from your server only
Create an invoice
POST /api/v1/payment
| Field | Required | Description |
|---|---|---|
amount_usdt | Yes | The price as a string, for example "29.99". The platform fee is added on top. |
external_id | No | Your own order id. Returned in webhooks. |
callback_url | No | Where to send webhooks. Must be a public http(s) URL. |
success_url | No | Where to send the customer after payment. |
metadata | No | Free-form JSON object. |
curl
curl -s -X POST https://openbcp.com/api/v1/payment \
-H "X-openbcp-Api-Key: $PAYGATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount_usdt":"29.99","external_id":"order-123","callback_url":"https://example.com/webhook"}'
Python
import os, requests
r = requests.post(
"https://openbcp.com/api/v1/payment",
headers={"X-openbcp-Api-Key": os.environ["PAYGATE_API_KEY"]},
json={"amount_usdt": "29.99", "external_id": "order-123",
"callback_url": "https://example.com/webhook"},
timeout=15,
)
r.raise_for_status()
invoice = r.json()
print(invoice["payment_url"])
Node.js
const res = await fetch("https://openbcp.com/api/v1/payment", {
method: "POST",
headers: {
"X-openbcp-Api-Key": process.env.PAYGATE_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
amount_usdt: "29.99",
external_id: "order-123",
callback_url: "https://example.com/webhook",
}),
});
const invoice = await res.json();
console.log(invoice.payment_url);
Response
{
"status": "success",
"invoice_id": 42,
"checkout_token": "...",
"deposit_address": "0x...",
"amount_usdt": "30.020000",
"merchant_amount_usdt": "29.990000",
"platform_fee_usdt": "0.03",
"payment_url": "https://openbcp.com/pay/...",
"network": "BEP20",
"token": "USDT",
"expires_at": "2026-01-01T12:05:00Z"
}
Redirect the customer to payment_url. The example values above are illustrative; the fee in your response is the current platform fee (0.01 USDT).
Check status
GET /api/v1/payment/{invoice_id}/status with your API key (or the invoice's checkout token as a token query parameter).
| Status | Meaning | Fulfil? |
|---|---|---|
UNPAID | Waiting for payment | No |
PARTIAL | A confirmed payment below 98% of the amount | No |
PAID | 98% to 105% of the amount confirmed | Yes |
OVERPAID | More than 105% confirmed | Yes |
EXPIRED | The invoice timed out | No |
CANCELLED | The invoice was cancelled | No |
Webhooks
When an invoice reaches a final state, OpenBCP sends a signed POST to your callback_url. Verify the signature on the raw body before trusting it. See webhooks and signature verification for code in Python, Node.js and PHP.
Errors
Errors return JSON like {"status":"error","message":"..."} with a standard HTTP code: 400 for an invalid field, 401 for a missing or invalid key, 404 for an unknown invoice and 429 when you are rate limited.
SDKs and tools
Official SDKs exist for Python, Node.js and Go, and there is an MCP server for AI agents. The full reference is in the documentation. You can build and test everything first in the sandbox.
Frequently asked questions
How do I authenticate API requests?
Send your API key in the X-openbcp-Api-Key header from your server. Never expose the key in browser code.
What does the create-payment request need?
Only amount_usdt is required. You can also send external_id (your order id), callback_url, success_url and free-form metadata.
What are the payment statuses?
UNPAID, PARTIAL, PAID, OVERPAID, EXPIRED and CANCELLED. Treat PAID and OVERPAID as success.
Are there SDKs?
Yes: Python, Node.js and Go SDKs, plus an MCP server for AI agents. The API is also plain REST, so any language works.
What are the rate limits?
The sandbox allows 60 requests per minute per key. See the documentation for the live limits.