Developer Docs

How it works

  1. Create a payment with your Brand API Key — you get a checkout_url.
  2. Send your customer to that URL. They pay and submit their TrxID.
  3. The AutoPayz SMS app on your phone forwards the payment SMS to our server.
  4. We match amount + TrxID, mark the payment completed and call your webhook.

Create a payment

POST https://autopayz.online/api/payment with header X-API-Key: YOUR_BRAND_KEY

curl -X POST https://autopayz.online/api/payment \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_BRAND_KEY" \
  -d '{
    "amount": 500,
    "method": "bkash",
    "invoice": "INV-1001",
    "webhook": "https://yoursite.com/hook",
    "redirect": "https://yoursite.com/success"
  }'

Response

{
  "success": true,
  "invoice": "INV-1001",
  "checkout_url": "https://autopayz.online/pay/INV-1001",
  "status": "pending"
}

Webhook payload

When a payment is verified we POST to your webhook URL:

{
  "invoice": "INV-1001",
  "status": "completed",
  "amount": 500,
  "method": "bkash",
  "trxId": "BKA7X9Q2LM"
}

Request parameters

ParameterRequiredDescription
amountYesPayment amount
methodYesbkash / nagad / rocket / upay / binance
invoiceYesUnique invoice reference
webhookNoPayment notification URL
redirectNoCustomer return URL

Error codes

401Invalid API key
422Invalid payment details
409Duplicate invoice or transaction ID
429Too many requests

Telegram Bot

Create a payment from your bot, send checkout_url to the customer, and wait for a verified webhook before delivering an order.

# Example only — API not live yet
checkout_url = data["checkout_url"]
await update.message.reply_text(
    f"Complete your payment: {checkout_url}"
)
# Deliver only after a server-verified payment webhook.

Demo documentation — the API is not live yet.