DEVELOPER DOCUMENTATION

Connect bestuPay to your payment flow

Create a payment on your server, redirect the customer to checkout and confirm fulfillment through a signed webhook.

OVERVIEW

A short, server-side payment flow

bestuPay is non-custodial. Customers pay the receiving wallet configured for your site, while the platform handles payment creation, exact-amount matching, on-chain status and notifications.

BASE URLhttps://dash.bestupay.com/api/v1JSON over HTTPS
01

Create an order

Your server sends the local order number, amount and title.

02

Redirect to checkout

Send the customer to the returned checkout URL.

03

Track payment

bestuPay monitors the selected receiving wallet on-chain.

04

Verify the webhook

Validate the signature before fulfilling the local order.

QUICK START

Create your first payment

Store the API secret on your server. Never expose it in browser JavaScript, a mobile application or public source control.

curl -X POST https://dash.bestupay.com/api/v1/simple/payments \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_SECRET" \
  -d '{
    "order_no": "ORDER-20260921-001",
    "amount": "328.00",
    "title": "Business Plan"
  }'
{
  "success": true,
  "data": {
    "payment_id": "pay_...",
    "checkout_url": "https://dash.bestupay.com/checkout/?payment_id=pay_..."
  }
}
API REFERENCE

Create payment

The quick endpoint uses your site configuration for the receiving wallets, callback URL and return URL.

POST/api/v1/simple/paymentsBearer API secret
FieldTypeRequiredDescription
order_nostringYesYour unique local order number.
amountdecimal stringYesOriginal order value in USDT, with up to two decimal places.
titlestringYesProduct or order summary shown in merchant records.
notify_urlURLNoFallback callback URL when none is configured for the site.
return_urlURLNoCustomer return destination. Do not use it as proof of payment.
expires_inintegerNoPayment lifetime in seconds, from 300 to 86400.
Configuration priority: callback URL, return URL and wallets configured in the merchant dashboard take precedence over optional request values.
WEBHOOKS

Verify before fulfillment

Read the raw JSON request body and calculate its HMAC-SHA256 digest using the Webhook Secret for the site. Compare the lowercase hexadecimal result with X-BestuPay-Signature using a timing-safe function.

X-BestuPay-Signature = HMAC-SHA256(raw JSON body, Webhook Secret)

Processing rules

  • Return an HTTP 2xx response only after the event has been accepted.
  • Use the event ID for idempotency so retries cannot fulfill an order twice.
  • Match the local record using merchant_order_no or order_no.
  • Fulfill only verified events whose status is paid.
  • Route underpaid, overpaid, expired and late payments to review.
INTEGRATION OPTIONS

Choose the shortest path for your stack

Custom backend

Use the REST API from PHP, Node.js, Python, Java, Go or another server-side environment.

View examples

WordPress plugin

Configure credentials, callback handling and checkout redirects from your WordPress installation.

Download kit

WooCommerce

Install the payment gateway, configure merchant credentials and complete orders after verified webhooks.

Download plugin
SECURITY CHECKLIST

Production readiness

  • Keep API and Webhook secrets server-side.
  • Use HTTPS for callback and return URLs.
  • Validate signatures with the raw request body.
  • Make webhook processing idempotent.
  • Do not fulfill from the browser return URL.
  • Log event IDs and payment IDs for audits.
  • Rotate credentials after suspected exposure.
  • Handle exception statuses explicitly.

Need help with your integration?

Share your stack and expected payment flow with the bestuPay support team.

Contact support
Code copied