Skip to content

Bohudur cURL / REST API

Complete REST API reference for the Bohudur Payment Automation platform. Use this with any language or tool that supports HTTP requests.

Base URL

https://request.bohudur.one

Authentication

All API requests must include your API Key in the request header.

Required Headers

http
Content-Type: application/json
AH-BOHUDUR-API-KEY: YOUR_API_KEY

Keep Your Key Secret

Never expose your API key in frontend JavaScript, mobile app code, or public repositories. Always call the API from your server.

API Flow

1. POST /create/v2/   → Get payment_url + paymentkey

2. Redirect user to payment_url

3. User pays or cancels on hosted checkout

4. POST /execute/v2/  → Confirm and finalize the payment

5. Webhook sent to your server (if configured)

6. POST /query/v2/    → Check status anytime

Create Payment

Creates a new payment session and returns a hosted checkout URL.

Endpoint

http
POST /create/v2/

cURL Example

bash
curl -X POST "https://request.bohudur.one/create/v2/" \
  -H "Content-Type: application/json" \
  -H "AH-BOHUDUR-API-KEY: YOUR_API_KEY" \
  -d '{
    "full_name": "Jane Doe",
    "email": "janedoe@gmail.com",
    "amount": 10,
    "return_type": "GET",
    "redirect_url": "https://example.com/redirect/",
    "cancel_url": "https://example.com/cancel/",
    "metadata": {
      "order_id": "ORD-1001",
      "user_id": 55
    },
    "webhook": {
      "success": "https://example.com/webhook/success.php",
      "cancel": "https://example.com/webhook/cancel.php"
    }
  }'

Request Parameters

FieldTypeRequiredDescription
full_namestringYESCustomer full name
emailstringYESCustomer email address
amountnumberYESPayment amount in your account's default currency
return_typestringYESHow params are returned after payment: GET or POST
redirect_urlstringYESURL to redirect customer after successful payment. Use "default" for Bohudur's default page
cancel_urlstringYESURL to redirect customer after cancellation. Use "default" for Bohudur's default page
metadataobjectNOAny custom key-value data to attach to this payment
webhook.successstringNOYour server URL to receive a POST notification when payment succeeds
webhook.cancelstringNOYour server URL to receive a POST notification when payment is cancelled

Success Response

json
{
  "responseCode": 200,
  "message": "Payment created successfully",
  "status": "success",
  "paymentkey": "5RWS4w2w1R5nFAvoP5U0JS4O74UrMXGt",
  "payment_url": "https://checkout.bohudur.one/payment/5RWS4w2w1R5nFAvoP5U0JS4O74UrMXGt"
}
FieldTypeDescription
responseCodenumber200 on success
messagestringHuman-readable result message
statusstringAlways "success" on success
paymentkeystringUnique 32-character key for this payment — store this
payment_urlstringHosted checkout URL — redirect your customer here

Failed Response

json
{
  "responseCode": 3018,
  "message": "Oops! Internal error. Try again",
  "status": "failed"
}

Create Payment Error Codes

CodeMessageDescription
3000API key not foundAH-BOHUDUR-API-KEY header is missing
3001Required parameters not foundOne or more required fields are missing
3002--- parameter is emptySpecific field value is empty
3003Invalid Full Name Formatfull_name must be a valid non-empty string
3004Invalid Email FormatEmail address is not valid
3005Invalid Amount FormatAmount must be a positive numeric value
3006Invalid Return Type FormatOnly GET or POST allowed
3007Invalid Return URL Formatredirect_url is not a valid URL
3008Invalid Cancel URL Formatcancel_url is not a valid URL
3009Invalid JSON format in metadatametadata must be a valid JSON object
3010Invalid JSON format in webhookwebhook must be a valid JSON object
3011Invalid webhook actionsOnly success and cancel keys allowed in webhook
3012Invalid JSON format in metadata or webhookOne or both JSON objects are malformed
3013Invalid API keyAPI key is incorrect or inactive
3014Oops! internal error. Try again.Temporary server-side issue — retry
3015Unknown amount providedAmount value is not acceptable
3016You don't have accessRequest blocked due to IP restriction
3017Oops! Internal error. Try again.Unexpected internal server error
3018Unable to create paymentPayment session could not be created

Best Practice

Always check status === "success" and responseCode === 200 before redirecting. Never assume success without checking both fields.

Execute Payment

Finalizes a completed payment. Call this from your server after the customer returns from the checkout page and the payment status is COMPLETED.

Endpoint

http
POST /execute/v2/

cURL Example

bash
curl -X POST "https://request.bohudur.one/execute/v2/" \
  -H "Content-Type: application/json" \
  -H "AH-BOHUDUR-API-KEY: YOUR_API_KEY" \
  -d '{
    "paymentkey": "YOUR_PAYMENT_KEY"
  }'

Success Response

json
{
  "full_name": "Gabriel Adams",
  "email": "gabriel@gmail.com",
  "amount": 40,
  "converted_amount": 4878,
  "total_amount": 40,
  "transaction_fee": 0,
  "default_currency": "USD",
  "payment_currency": "BDT",
  "currency_value": 121.951,
  "metadata": [],
  "created_time": "2026-01-04 16:04:35",
  "payment_time": "2026-01-04 16:12:37",
  "paymentkey": "fnPwIkdIsMjN4FJxYxw6DF75GuW9qStn",
  "receipt": "https://pay.bohudur.one/receipt/download/102f89389f9e",
  "webhook": [],
  "payment_info": {
    "m0": "Stripe",
    "status": "succeeded",
    "tran_id": "pi_demo_payment_intent"
  },
  "status": "EXECUTED"
}

Execute Response Parameters

FieldTypeDescription
full_namestringCustomer full name
emailstringCustomer email address
amountnumberOriginal payment amount in your default currency
converted_amountnumberAmount converted to the payment currency
total_amountnumberTotal amount charged including any fees
transaction_feenumberTransaction fee applied (0 if none)
default_currencystringYour account's default currency code
payment_currencystringCurrency the customer actually paid in
currency_valuenumberExchange rate used (default → payment currency)
metadataarray/objectCustom data attached during payment creation
created_timestringTimestamp when payment session was created
payment_timestringTimestamp when customer completed payment
paymentkeystringUnique 32-character payment identifier
receiptstringURL to download the PDF receipt for this payment
webhookarray/objectWebhook URLs configured for this payment
payment_infoobjectGateway-specific transaction details
payment_info.m0stringPayment gateway used (e.g. "Stripe", "SSLCommerz")
statusstringAlways "EXECUTED" on success

Execute Error Response

json
{
  "responseCode": 3108,
  "message": "Payment already executed!",
  "status": "failed"
}

Execute Error Codes

CodeMessageDescription
3100API key not foundAH-BOHUDUR-API-KEY header missing
3101API key not validAPI key is invalid or inactive
3102Invalid Payment Keypaymentkey is malformed or does not exist
3103Invalid api keyAPI key does not match any active account
3104You don't have access! Your IP: ...Your server IP is not authorized
3105Payment Data Not FoundNo payment exists for this paymentkey
3106Payment is pending!Customer has not completed payment yet
3107Payment is cancelled!Payment was cancelled — cannot be executed
3108Payment already executed!This payment was already executed once
3109Failed to execute paymentServer or processing error

Execute is One-Time Only

A payment can be executed exactly once. Any second attempt returns 3108. This is intentional — it prevents duplicate charges. Always store the execute response in your database immediately after a successful execution.

Query Payment

Retrieve the full details and current status of any payment at any time.

Endpoint

http
POST /query/v2/

cURL Example

bash
curl -X POST "https://request.bohudur.one/query/v2/" \
  -H "Content-Type: application/json" \
  -H "AH-BOHUDUR-API-KEY: YOUR_API_KEY" \
  -d '{
    "paymentkey": "YOUR_PAYMENT_KEY"
  }'

Query Response Types

The Query API returns one of four responses based on the current payment status.

1. PENDING

Payment session created but the user has not yet completed payment.

json
{
  "full_name": "Chloe Morales",
  "email": "chloe@gmail.com",
  "amount": 1,
  "converted_amount": 1,
  "total_amount": 1,
  "transaction_fee": 0,
  "default_currency": "USD",
  "payment_currency": "USD",
  "currency_value": 1,
  "metadata": [],
  "created_time": "2026-01-07 10:02:20",
  "payment_time": "NONE",
  "paymentkey": "7QWQsOhg9X7dgQlfRO4EPxWKK9qaCWka",
  "receipt": "NONE",
  "webhook": [],
  "payment_info": [],
  "status": "PENDING"
}

2. COMPLETED

User has paid. Payment is ready to be executed by your server.

json
{
  "full_name": "Jane Doe",
  "email": "jane@gmail.com",
  "amount": 150,
  "converted_amount": 150,
  "total_amount": 150,
  "transaction_fee": 0,
  "default_currency": "USD",
  "payment_currency": "USD",
  "currency_value": 1,
  "metadata": [],
  "created_time": "2025-12-11 21:47:11",
  "payment_time": "2025-12-11 23:11:25",
  "paymentkey": "TYtsYll15iqsDqsR4h8EJrMfou9NavE2",
  "receipt": "https://pay.bohudur.one/receipt/download/102f89389f9e",
  "webhook": [],
  "payment_info": {
    "m0": "Stripe",
    more....
  },
  "status": "COMPLETED"
}

Note

status: "COMPLETED" means the customer has paid. You must now call /execute/v2/ to finalize and deliver your product or service.

3. EXECUTED

Payment has been finalized by your server via the Execute API.

json
{
  "full_name": "Gabriel Adams",
  "email": "gabriel@gmail.com",
  "amount": 40,
  "converted_amount": 4878,
  "total_amount": 40,
  "transaction_fee": 0,
  "default_currency": "USD",
  "payment_currency": "BDT",
  "currency_value": 121.951,
  "metadata": [],
  "created_time": "2026-01-04 16:04:35",
  "payment_time": "2026-01-04 16:12:37",
  "paymentkey": "fnPwIkdIsMjN4FJxYxw6DF0I92W9qStn",
  "receipt": "https://pay.bohudur.one/receipt/download/102f89389f9e",
  "webhook": [],
  "payment_info": {
    "m0": "SSLCommerz",
    more....
  },
  "status": "EXECUTED"
}

4. CANCELLED

Payment was cancelled by the user or system. Cannot be executed.

json
{
  "full_name": "Jane Doe",
  "email": "jane@gmail.com",
  "amount": 1,
  "converted_amount": 1,
  "total_amount": 1,
  "transaction_fee": 0,
  "default_currency": "USD",
  "payment_currency": "USD",
  "currency_value": 1,
  "metadata": {
    "order_id": "ORD-1001",
    "user_id": 55
  },
  "created_time": "2026-01-18 19:30:56",
  "payment_time": "NONE",
  "paymentkey": "P4m1OEiopqPy4cFx9QO0mARuzqxx7bsf",
  "receipt": "NONE",
  "webhook": {
    "success": "https://example.com/success.php",
    "cancel": "https://example.com/cancel.php"
  },
  "payment_info": [],
  "status": "CANCELLED"
}

Payment Info By Gateways

json
{
    "payment_info": {
        "id": 1,
        "gateway": "bkash",
        "method": "Send Money",
        "number": "01XXXXXXXXX",
        "amount": 100,
        "trx": "TRX123ABC456",
        "time": "01/01/2026 12:00",
        "m0": "Bkash Send Money"
    }
}
json
{
    "payment_info": {
        "id": 1,
        "gateway": "nagad",
        "method": "Send Money",
        "number": "01XXXXXXXXX",
        "amount": 100,
        "trx": "TRX123ABC456",
        "time": "01/01/2026 12:00",
        "m0": "Nagad Send Money"
    }
}
json
{
    "payment_info": {
        "id": 1,
        "gateway": "rocket",
        "method": "Send Money",
        "number": "01XXXXXXXXX",
        "amount": 100,
        "trx": "TRX123ABC456",
        "time": "01/01/2026 12:00",
        "m0": "Rocket Send Money"
    }
}
json
{
    "payment_info": {
        "id": 1,
        "gateway": "upay",
        "method": "Send Money",
        "number": "01XXXXXXXXX",
        "amount": 100,
        "trx": "TRX123ABC456",
        "time": "01/01/2026 12:00",
        "m0": "Upay Send Money"
    }
}
json
{
    "payment_info": {
        "id": 1,
        "gateway": "mcash",
        "method": "Send Money",
        "number": "01XXXXXXXXX",
        "amount": 100,
        "trx": "TRX123ABC456",
        "time": "01/01/2026 12:00",
        "m0": "mCash Send Money"
    }
}
json
{
    "paymentID": "TRX_PAYMENT_ID_EXAMPLE",
    "trxID": "TRX123ABC456",
    "transactionStatus": "Completed",
    "amount": "100",
    "currency": "BDT",
    "intent": "sale",
    "paymentExecuteTime": "2026-01-01T12:00:00 GMT+0600",
    "merchantInvoiceNumber": "invoice_demo_12345",
    "payerType": "Customer",
    "payerReference": "CUSTOMER_REF",
    "customerMsisdn": "01XXXXXXXXX",
    "payerAccount": "01XXXXXXXXX",
    "maxRefundableAmount": "100",
    "statusCode": "0000",
    "statusMessage": "Successful",
    "m0": "Bkash Merchant"
}
json
{
    "status": "VALID",
    "tran_date": "2026-01-01 12:00:00",
    "tran_id": "SSLCZ_DEMO_TRANSACTION",
    "val_id": "VALIDATION_ID_EXAMPLE",
    "amount": "100.00",
    "store_amount": "97.50",
    "currency": "BDT",
    "bank_tran_id": "BANK_TRANSACTION_ID",
    "card_type": "NAGAD-Nagad",
    "card_no": "",
    "card_issuer": "Nagad",
    "card_brand": "MOBILEBANKING",
    "card_category": "MOBILE",
    "card_sub_brand": "",
    "card_issuer_country": "Bangladesh",
    "card_issuer_country_code": "BD",
    "currency_type": "BDT",
    "currency_amount": "100.00",
    "currency_rate": "1.0000",
    "base_fair": "0.00",
    "value_a": "",
    "value_b": "",
    "value_c": "",
    "value_d": "",
    "emi_instalment": "0",
    "emi_amount": "0.00",
    "emi_description": "",
    "emi_issuer": "Nagad",
    "account_details": "",
    "risk_title": "Safe",
    "risk_level": "0",
    "discount_percentage": "0",
    "discount_amount": "0.00",
    "discount_remarks": "",
    "APIConnect": "DONE",
    "validated_on": "2026-01-01 12:00:10",
    "gw_version": "",
    "offer_avail": 1,
    "card_ref_id": "CARD_REFERENCE_ID_EXAMPLE",
    "isTokeizeSuccess": 0,
    "campaign_code": "",
    "m0": "SSLCommerz"
}
json
{
    "id": "pi_demo_payment_intent",
    "object": "payment_intent",
    "amount": 10000,
    "amount_capturable": 0,
    "amount_details": {
        "tip": []
    },
    "amount_received": 10000,
    "application": null,
    "application_fee_amount": null,
    "automatic_payment_methods": null,
    "canceled_at": null,
    "cancellation_reason": null,
    "capture_method": "automatic_async",
    "client_secret": "pi_demo_payment_intent_secret_example",
    "confirmation_method": "automatic",
    "created": 1767225600,
    "currency": "usd",
    "customer": null,
    "customer_account": null,
    "description": "Demo Payment",
    "excluded_payment_method_types": null,
    "last_payment_error": null,
    "latest_charge": "ch_demo_charge_id",
    "livemode": false,
    "managed_payments": {
        "enabled": false
    },
    "metadata": [],
    "next_action": null,
    "on_behalf_of": null,
    "payment_details": {
        "customer_reference": null,
        "order_reference": "ORDER_REFERENCE_EXAMPLE"
    },
    "payment_method": "pm_demo_payment_method",
    "payment_method_configuration_details": null,
    "payment_method_options": {
        "card": {
            "installments": null,
            "mandate_options": null,
            "network": null,
            "request_three_d_secure": "automatic"
        }
    },
    "payment_method_types": [
        "card"
    ],
    "presentment_details": {
        "presentment_amount": 12000,
        "presentment_currency": "bdt"
    },
    "processing": null,
    "receipt_email": "customer@example.com",
    "review": null,
    "setup_future_usage": null,
    "shared_payment_granted_token": null,
    "shipping": null,
    "source": null,
    "statement_descriptor": null,
    "statement_descriptor_suffix": null,
    "status": "succeeded",
    "transfer_data": null,
    "transfer_group": null,
    "m0": "Stripe"
}
json
{
    "uid": 123456789,
    "counterpartyId": 987654321,
    "orderId": "ORDER_ID_EXAMPLE",
    "orderType": "CRYPTO_BOX",
    "transactionId": "TRANSACTION_ID_EXAMPLE",
    "transactionTime": 1767225600000,
    "amount": "10.00",
    "currency": "USDT",
    "walletType": 1,
    "walletTypes": [
        "1"
    ],
    "fundsDetail": [
        {
            "currency": "USDT",
            "amount": "10.00"
            "walletAssetCost": {
                "1": "10.00"
            }
        }
    ],
    "payerInfo": {
        "name": "John Doe",
        "type": "USER",
        "email": "customer@example.com",
        "countryCode": 880,
        "phoneNumber": "01XXXXXXXXX",
        "mobileCode": "BD",
        "unmaskData": false
    },
    "receiverInfo": {
        "binanceId": 123456789,
        "accountId": 987654321,
        "unmaskData": false
    },
    "totalPaymentFee": "0",
    "m0": "Binance Personal"
}

Query Response Fields

FieldTypeDescription
full_namestringCustomer full name
emailstringCustomer email
amountnumberOriginal payment amount
converted_amountnumberAmount in the payment currency
total_amountnumberTotal charged including fees
transaction_feenumberFee applied (0 if none)
default_currencystringYour account default currency
payment_currencystringCurrency customer paid in
currency_valuenumberExchange rate applied
metadataarray/objectCustom data from payment creation
created_timestringPayment creation timestamp
payment_timestringWhen customer completed payment ("NONE" if not yet)
paymentkeystringUnique payment identifier
receiptstringPDF receipt download URL ("NONE" if not yet available)
webhookarray/objectConfigured webhook URLs
payment_infoarray/objectGateway transaction data (empty if pending)
statusstringPENDING / COMPLETED / EXECUTED / CANCELLED

Note

m0 indicates gateway name. It's available in all payments. To get payment method developers can use this.

Query Error Codes

CodeMessageDescription
3050API key not foundAH-BOHUDUR-API-KEY header missing
3051API key not validAPI key invalid or inactive
3052Invalid Payment Keypaymentkey does not exist or is malformed
3053Invalid api keyAPI key does not match any active account
3054You don't have access! Your IP: ...IP not authorized
3055Payment Data Not FoundNo payment found for this key

Webhooks

Bohudur sends a POST request to your server when a payment is completed or cancelled. Webhooks are configured per payment during the Create step.

Success Webhook Payload

Sent when a customer completes payment successfully.

json
{
  "full_name": "Jane Doe",
  "email": "janedoe@gmail.com",
  "amount": 1,
  "paymentkey": "CrD85r3ibMK6ip38reUcuECvVhaF0xOT",
  "status": "COMPLETED"
}

Cancel Webhook Payload

Sent when a payment is cancelled.

json
{
  "full_name": "Jane Doe",
  "email": "janedoe@gmail.com",
  "amount": 1,
  "paymentkey": "CrD85r3ibMK6ip38reUcuECvVhaF0xOT",
  "status": "CANCELLED"
}

Webhook Parameters

FieldTypeDescription
full_namestringCustomer full name
emailstringCustomer email
amountnumberPayment amount
paymentkeystringUnique payment identifier
statusstringCOMPLETED or CANCELLED

Webhooks Are Not Final Truth

Always call the Query API after receiving a webhook to verify the actual payment status before delivering products or services. Webhooks can occasionally be delayed or retried.

Acknowledge Webhooks

Your webhook endpoint must return HTTP 200 OK. Failure to respond correctly may cause Bohudur to retry the webhook, which could slow down payment processing on your end.

Webhook Best Practices

  1. Respond with HTTP 200 immediately
  2. Process the payment logic asynchronously
  3. Always verify via Query API before fulfilling orders
  4. Log raw webhook payloads for debugging

Support

Bohudur is free and open to everyone. No trade license required.