Skip to content

Bohudur cURL Documentation

Developer-first payment automation API.

Base URL

text
https://request.bohudur.one

Authentication

All API requests must include your API Key in headers.

Required Headers

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

Note

Keep your API key secret. Never expose it in frontend or client-side code.

API Flow Overview

  1. Create a payment
  2. Redirect user to payment page
  3. Execute (finalize) payment
  4. Receive webhook (optional)
  5. Query payment data (Anytime when you need)

Create Payment

Creates a new payment session.

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": "default",
    "cancel_url": "default",
    "metadata": {
      "data1": "value1",
      "data2": "value2"
    },
    "webhook": {
      "success": "https://example.com/success.php",
      "cancel": "https://example.com/cancel.php"
    }
  }'

Request Parameters

FieldTypeRequiredDescription
full_namestringYESCustomer full name
emailstringYESCustomer email
amountnumberYESPayment amount
return_typestringYESGET or POST
redirect_urlstringYESRedirect URL after success
cancel_urlstringYESRedirect URL after cancel
metadataobjectNOCustom key-value data
webhook.successstringNOSuccess webhook URL
webhook.cancelstringNOCancel webhook URL

Success Response

Returned when a payment link is created successfully.

Example Response

json
{
  "responseCode": 200,
  "message": "Payment created successfully",
  "status": "success",
  "paymentkey": "5RWS4w2w1R5nFAvoP5U0JS4O74UrMXGt",
  "payment_url": "https://checkout.bohudur.one/payment/5RWS4w2w1R5nFAvoP5U0JS4O74UrMXGt"
}

Response Parameters

FieldTypeDescription
responseCodenumberHTTP-like response code. 200 indicates success.
messagestringHuman-readable message describing the result.
statusstringPayment creation status. Always success on success.
paymentkeystringA unique 32-character alphanumeric key generated for each payment.
payment_urlstringHosted checkout URL where the customer completes the payment.

Failed Response

Returned when the payment request cannot be processed.

Example Response

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

Failed Response Parameters

FieldTypeDescription
responseCodenumberError code indicating the reason for failure.
messagestringDescriptive error message explaining what went wrong.
statusstringRequest status. Always failed for errors.

Error Codes Reference

The following table lists all possible error codes returned by the Create Payment API.

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

Error Handling Best Practices

Developer Tip

Always handle failed responses gracefully. Do not assume payment creation was successful without checking status and responseCode.

Important

Never rely solely on client-side responses. Always verify payment status using the Query API.

Execute Payment

Execute Payment and finalizes a payment.

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": "PAYMENT_KEY_HERE"
  }'

Success Response Example

json
{
  "full_name": "Gabriel Adams",
  "email": "jsondoe@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",
  "webhook": [],
  "payment_info": {
    "m0": "Stripe",
    "status": "VALID",
    "tran_date": "2026-01-04 16:05:04",
    "tran_id": "IGQM_695a3b59h6a9"
  },
  "status": "EXECUTED"
}

Response Parameters

FieldTypeDescription
full_namestringCustomer’s full name
emailstringCustomer’s email address
amountnumberOriginal payment amount in default currency
converted_amountnumberAmount converted to the payment currency
total_amountnumberTotal amount charged (amount + fees)
transaction_feenumberTransaction fees applied (if any)
default_currencystringYour account default currency
payment_currencystringCurrency used for the payment
currency_valuenumberConversion rate applied (default → payment currency)
metadataarrayOptional metadata submitted during creation
created_timestringPayment creation timestamp
payment_timestringTime when the payment was completed by the customer
paymentkeystringUnique key identifying this payment
webhookarrayWebhook URLs configured for this payment
payment_infoobjectTransaction-specific info
statusstringPayment execution status. Always EXECUTED on success

Error Response Example

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

Common Error Codes

CodeMessageDescription
3100API key not foundThe request did not include an API key. Ensure the AH-BOHUDUR-API-KEY header is set.
3101API key not validThe provided API key is invalid or inactive.
3102Invalid Payment KeyThe paymentkey provided is malformed or does not exist.
3103Invalid api keyThe API key used does not match any active account.
3104You don't have access! Your IP: ...Your IP address is not authorized to perform this request. Replace ... with your server IP in the message.
3105Payment Data Not FoundNo payment data exists for the given paymentkey.
3106Payment is pending!The payment has not yet been completed by the customer. Execute is only allowed after completion.
3107Payment is cancelled!The payment was cancelled by the customer or system.
3108Payment already executed!This payment has already been executed. Execution can only happen once.
3109Failed to execute paymentThe payment could not be executed due to a server or processing error.

Important

The Execute API is idempotent by design.
A payment can only be executed once. Any attempt to execute the same payment again will return Payment already executed!.
This prevents duplicate payments.

Query Payment API

The Query Payment API allows you to check the status and details of a payment using the paymentkey. This is useful for verifying payment status, retrieving transaction details, or confirming before executing a payment.

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": "PAYMENT_KEY_HERE"
  }'

Response Types

The Query API can return four types of responses, depending on the payment status.

1. PENDING Payment

Payment created but not yet completed by the user.

json
{
  "full_name": "Chloe Morales",
  "email": "demo@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",
  "webhook": [],
  "payment_info": [],
  "status": "PENDING"
}

2. COMPLETED Payment

Payment successfully completed by the user.

json
{
  "full_name": "Jane Doe",
  "email": "demo@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",
  "webhook": [],
  "payment_info": {
    "m0": "Stripe",
    "status": "succeeded",
    "tran_id": "IGQM_695a3b59h6a9"
  },
  "status": "COMPLETED"
}

Explanation

  • payment_time → Timestamp when payment was completed
  • payment_info → Contains transaction details (processor-specific info)
  • statusCOMPLETED indicates payment is successful and ready for execution

3. EXECUTED Payment

Payment has been executed/confirmed via the Execute API.

json
{
  "full_name": "Gabriel Adams",
  "email": "demo@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",
  "webhook": [],
  "payment_info": {
    "m0": "SSLCommerz",
    "status": "VALID",
    "tran_date": "2026-01-04 16:05:04",
    "tran_id": "SSLCZ_695a3b501c0a9",
    "val_id": "2601041612331iZhrh0JGKL0TyN",
    "currency": "BDT",
    "bank_tran_id": "2601041612331PW4mLgtug0uJ6x"
  },
  "status": "EXECUTED"
}

Important

An executed payment is final and cannot be executed again. This protects your system from duplicate payments and ensures each payment key is one-time use only.

4. CANCELLED Payment

Payment that was cancelled by the user or system.

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

Notice

A cancelled payment cannot be executed. If a user cancels a payment, the payment link becomes inactive and the status is set to CANCELLED.

Explanation

FieldTypeDescription
full_namestringCustomer’s full name
emailstringCustomer’s email
amountnumberOriginal payment amount
converted_amountnumberAmount converted to payment currency
total_amountnumberTotal amount including fees
transaction_feenumberTransaction fee applied (if any)
default_currencystringYour account default currency
payment_currencystringPayment currency
currency_valuenumberConversion rate applied
metadataarrayOptional metadata sent during creation
created_timestringPayment creation timestamp
payment_timestringTime payment completed (NONE if pending)
paymentkeystringUnique identifier for this payment
webhookarrayWebhook URLs (if configured)
payment_infoarrayEmpty while pending
statusstringPENDING

Error Codes

CodeMessageDescription
3050API key not foundRequest missing the AH-BOHUDUR-API-KEY header
3051API key not validAPI key is invalid or inactive
3052Invalid Payment KeyProvided paymentkey does not exist or is malformed
3053Invalid api keyAPI key does not match an active account
3054You don't have access! Your IP: ...Request blocked due to IP restrictions
3055Payment Data Not FoundNo payment found for the given paymentkey

Webhooks

Bohudur sends webhook notifications to your server when a payment is successfully completed or cancelled. Webhook requests are sent using the HTTP POST method in JSON format.

Webhooks allow your system to automatically receive payment updates without polling the Query API.


When Webhooks Are Triggered

  • Success webhook → Sent when a payment is completed
  • Cancel webhook → Sent when a payment is cancelled by the user or system

Webhook Payload (Cancel)

Sent when a payment is cancelled.

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

Webhook Payload (Success)

Sent when a payment is completed successfully.

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

Webhook Parameters

FieldTypeDescription
full_namestringCustomer’s full name
emailstringCustomer’s email address
amountnumberPayment amount
paymentkeystringUnique payment identifier
statusstringPayment status (COMPLETED or CANCELLED)

Best Practice

Always verify the payment status using the Query Payment API after receiving a webhook. Webhooks are reliable but should not be the only source of truth.

Important

Your webhook endpoint must return HTTP 200 OK to acknowledge successful receipt. Failure to respond correctly may slow down payment verification speed.


Summary

  • Webhooks are sent via POST
  • Data format is JSON
  • Triggered on payment success or cancellation
  • Use Query API for final verification

API Versioning

  • Current Version: v2
  • Base path includes versioning for stability

Changelog

  • v2: Improved response structure, webhook support, metadata support

Support

For technical support or integration issues, contact in Bohudur Telegram Support.