3.1 Create PayIn
POST /api/v1/payins
Request
- Headers
- Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-API-Key | string | Yes | API key. |
| X-Timestamp | string | Yes | Request time (ISO-8601 or UNIX sec). |
| X-Signature | string | Yes | HMAC-SHA256(timestamp + body, secret). |
| Content-Type | string | Yes | application/json. |
| Parameter | Type | Required | Description |
|---|---|---|---|
| external_id | string | Yes | Unique payin identifier on the merchant side (idempotency). |
| amount | string | Yes | Payin amount as a positive decimal string greater than 0. |
| currency | string (3) | Yes | Must be BDT for this GEO. |
| shop_code | string | No | Shop code. If not provided, default shop is used. |
| callback_url | string | No | URL for status change notifications (must be a valid URL). |
| merchant_user_id | string | Yes | Merchant user identifier (for accounting). |
| merchant_user_ip | string | Yes | User IP (for accounting). |
Example request
{
"external_id": "PIN-BDT-001",
"amount": "5000.00",
"currency": "BDT",
"shop_code": "your_bdt_shop",
"merchant_user_id": "merchant-user-001",
"merchant_user_ip": "203.0.113.10",
"callback_url": "https://merchant.example.com/webhooks/payin"
}
Response
Response fields
Fields with null values and empty paymentData are omitted from the response.
| Parameter | Type | Description |
|---|---|---|
| id | number | Payfield operation ID. |
| status | string | Current payin status. |
| external_id | string | Unique payin identifier from the request. |
| amount | string | Payin amount. |
| currency | string | Payin currency. |
| shop_code | string | Shop code used for routing. |
| merchant_user_id | string | Merchant user identifier from the request. |
| merchant_user_ip | string | User IP from the request. |
| callback_url | string | Callback URL from the request, when provided. |
| paymentData.payment_link | string | Payment link for completing the payin. |
| transaction_type | string | Always payin. |
| created_at | string | Creation timestamp. |
| updated_at | string | Last update timestamp. |
| finalization_date | string | Returned when the payin reaches a final status. |
Example response
- Success
- Error
{
"id": 12345,
"status": "pending",
"external_id": "PIN-BDT-001",
"amount": "5000.00",
"currency": "BDT",
"shop_code": "your_bdt_shop",
"merchant_user_id": "merchant-user-001",
"merchant_user_ip": "203.0.113.10",
"callback_url": "https://merchant.example.com/webhooks/payin",
"paymentData": {
"payment_link": "https://pay.example.com/bdt/PIN-BDT-001"
},
"transaction_type": "payin",
"created_at": "2025-12-05T10:00:00.000000Z",
"updated_at": "2025-12-05T10:00:00.000000Z"
}
{
"message": "amount must be a positive decimal string",
"code": "validation_error",
"errors": [
{
"field": "amount",
"message": "amount must be a positive decimal string"
}
],
"error": {
"code": "validation_error",
"message": "amount must be a positive decimal string"
}
}