TrustBill Developers
Merchant API, integrations and webhook tools
Merchant Portal

One-Time Payments API

Create a single crypto payment for an order, invoice, product or service.

Open One-Time Payments API Test in API Console

POST /api/v1/payment-ordersGET /api/v1/payment-orders/:idGET /api/v1/payment-orders/by-external-id/:externalIdGET /api/v1/payment-orders/:id/status
POST /api/v1/payment-orders
X-API-KEY: mch_live_...
Content-Type: application/json

{
  "externalId": "INV-10025",
  "asset": "USDT-TRC20",
  "amount": "10",
  "expiresInMinutes": 60
}

Subscriptions API

Plans, recurring authorizations, mandatory wallet login, funding-asset selection, six-digit PIN approval, upgrades, pauses and cancellations.

Open Interactive Subscription API

POST /api/v1/subscriptionsPOST /api/v1/subscriptions/:id/change-sessions

OpenAPI & Swagger

Interactive endpoint documentation and schemas.

Open Swagger UI

API Console

Create and inspect payment orders directly.

Open Console

Webhook Tester

Generate and verify HMAC-SHA256 signatures.

Open Tester

Payments Quick Start

One-time payment: authenticate using X-API-KEY, create a payment with POST /api/v1/payment-orders, display the returned address and exact amount, then poll its status or consume signed webhooks.

This endpoint is for a single payment only. Recurring payments are available in the Subscriptions API section.

POST /api/v1/payment-ordersGET /api/v1/payment-orders/:idGET /api/v1/payment-orders/by-external-id/:externalIdGET /api/v1/payment-orders/:id/status
OpenAPI JSON · Download Postman collection

PHP

<?php
$payload = json_encode([
  'externalId' => 'INV-10025',
  'externalCustomerId' => 'CUSTOMER-458',
  'asset' => 'USDT-TRC20',
  'amount' => '10',
  'expiresInMinutes' => 60,
]);
$ch = curl_init('https://api.trustbill.net/api/v1/payment-orders');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['X-API-KEY: mch_live_...', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);

Node.js

const response = await fetch('https://api.trustbill.net/api/v1/payment-orders', {
  method: 'POST',
  headers: { 'X-API-KEY': process.env.TRUSTBILL_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({ externalId: 'INV-10025', externalCustomerId: 'CUSTOMER-458', currency: 'USD', amount: '10', asset: 'USDT-TRC20', expiresInMinutes: 60 }),
});
const order = await response.json();

Python

import os, requests
response = requests.post(
    'https://api.trustbill.net/api/v1/payment-orders',
    headers={'X-API-KEY': os.environ['TRUSTBILL_API_KEY']},
    json={'externalId': 'INV-10025', 'externalCustomerId': 'CUSTOMER-458', 'currency': 'USD', 'amount': '10', 'asset': 'USDT-TRC20', 'expiresInMinutes': 60},
)
order = response.json()

Security notes

Keep API keys server-side. Never expose a live key in browser JavaScript or mobile applications. Verify webhook signatures against the exact raw request body before parsing JSON. Use a unique externalId for reconciliation.