Skip to main content
ShadhinPay Docs

Payments

Create a payment, redirect the customer to checkout, track its status, and list payments.

A payment represents one attempt to collect money from a customer. You create it, send the customer to the hosted checkout, and ShadhinPay tells you the outcome via status and webhooks.

The flow at a glance

Create the payment (POST /payment/create) and get a paymentUrl.
Redirect the customer to paymentUrl to pay with their preferred provider (bKash, Nagad, Rocket, Upay, or Cards via Stripe).
The customer is returned to your callbackUrl, and you receive a payment.completed webhook.
Confirm by reading the payment status, then fulfil the order.

Supported currencies & amount limits

CurrencyMinimum amountMaximum amount
BDT10.00200,000.00
USD0.801,000.00
EUR0.801,000.00
GBP0.801,000.00

Amounts outside the currency's allowed range return VALIDATION_ERROR. Requests with any other currency return UNSUPPORTED_CURRENCY.

Create a payment

POST /api/v1/payment/create

Requires the auth headers and an X-Idempotency-Key.

Request body

FieldTypeRequiredNotes
amountstringyesDecimal string within the currency's allowed min/max range (see Supported currencies & amount limits)
currencystringyes"BDT", "USD", "EUR", or "GBP". Requests with any other currency return "Unsupported Currency".
merchantTxnIdstringyesYour order reference; unique per business
callbackUrlstringyesWhere the customer returns after paying (HTTPS in live)
preferredVendorstringnoBKASH, NAGAD, ROCKET, UPAY, STRIPE, or NULL — pass null to let the customer pick on checkout
customerPhonestringyesCustomer's phone number; required for bKash and Nagad
customerEmailstringnoCustomer email address
descriptionstringnoShown on checkout
valueA–valueDstringnoYour own metadata, echoed back on reads/webhooks
expiresInMinutesintegernoCheckout window; default 15

Example

curl -X POST https://request.shadhinpay.com/api/v1/payment/create \
  -H "Client-Id: SM_87ixWd_8" \
  -H "Business-Id: SB_01M6KF7RG99VW2CAXD7Y3PN5CW" \
  -H "X-Api-Key: SPay_9bgvOl24P2zfvj8Ai0Fa6XO8qyGSIavL" \
  -H "X-Idempotency-Key: order-7831-attempt-1" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "1500.50",
    "currency": "BDT",
    "merchantTxnId": "order-7831",
    "callbackUrl": "https://shop.example.com/checkout/return",
    "preferredVendor": null,
    "customerPhone": "8801712345678",
    "description": "Order #7831",
    "valueA": "campaign=summer",
    "expiresInMinutes": 15
  }'

Response — 201 Created

{
  "status": "success",
  "message": "Payment initiated successfully",
  "data": {
    "paymentId": "PAY_20260517_K8X3M2",
    "merchantTxnId": "order-7831",
    "amount": "1500.50",
    "currency": "BDT",
    "status": "PENDING",
    "vendor": "BKASH",
    "paymentUrl": "https://pay.shadhinpay.com/payment/PAY_20260517_K8X3M2",
    "description": "Order #7831",
    "refundTotal": "0.00",
    "initiatedAt": "2026-05-17T10:00:00Z",
    "completedAt": null,
    "expiresAt": "2026-05-17T10:15:00Z",
    "valueA": "campaign=summer"
  }
}

Your next step: redirect the customer's browser to paymentUrl. That hosted page either jumps straight to the chosen provider (if you set preferredVendor) or shows a picker. After paying, the customer is sent back to your callbackUrl.

Don't fulfil on the redirect alone

The return to your callbackUrl is a UX signal, not proof of payment. Always confirm the outcome from the webhook or by reading the payment status before releasing goods.

Payment statuses

StatusMeaning
PENDINGCreated; waiting for the customer to approve at the provider
COMPLETEDPaid successfully
FAILEDThe provider rejected the payment
CANCELLEDThe customer cancelled
EXPIREDThe checkout window passed without payment
REFUNDEDFully refunded (partial refunds keep status COMPLETED)

You may also briefly see INITIATED — an internal pre-PENDING state — in reads immediately after creation.

Get a payment

GET /api/v1/payment/{paymentId}

Returns the full payment object, including current status and refundTotal. Use this to confirm an outcome or reconcile against your records.

curl https://request.shadhinpay.com/api/v1/payment/PAY_20260517_K8X3M2 \
  -H "Client-Id: SM_87ixWd_8" \
  -H "Business-Id: SB_01M6KF7RG99VW2CAXD7Y3PN5CW" \
  -H "X-Api-Key: SPay_9bgvOl24P2zfvj8Ai0Fa6XO8qyGSIavL"

List payments

GET /api/v1/payment/list

Supports pagination plus filters:

Query paramNotes
statusFilter by payment status (PENDING, COMPLETED, FAILED, etc.)
vendorBKASH, NAGAD, ROCKET, UPAY, or STRIPE
currencyFilter by currency (BDT, USD, EUR, GBP)
from / toISO-8601 date-time range
merchantTxnIdFind by your order reference
page / sizePage index (from 0) and page size (max 100)

The list response may include a summary block with successCount, failedCount, and totalAmount for the filtered set.

Next steps

  • Webhooks — get notified the moment a payment settles
  • Refunds
  • Testing — drive each outcome in the sandbox

On this page