Capture — Record Actual Amount
Process
- Merchant calls the Capture API to record the held amount after successful Authorization above.
- Only applies to transactions that have been Authorized previously.
- If the requested capture amount is less than total authorized amount, Baokim will treat this as Partial Capture, and the remaining amount will automatically reverse after 5-7 days.
- After transaction completes Capture, reversal is no longer possible. Use Void/Refund to cancel/refund the transaction instead.
API Information
Method:
URL:
Request
Main Parameters Table
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | request_id | String(100) | ✅ | Unique request ID |
| 2 | request_time | String(20) | ✅ | Request send time. Format: YYYY-MM-DD H:i:s |
| 3 | master_merchant_code | String(50) | ✅ | Unique Master Merchant identifier |
| 4 | sub_merchant_code | String(50) | ✅ | Unique Sub Merchant identifier |
| 5 | order_code | String(50) | ✅ | Baokim order code from Authentication step |
| 6 | capture_amount | Number | ✅ | Capture amount |
| 7 | description | String(255) | ❌ | Transaction description |
| 8 | extend | Object | ❌ | Extended data |
Extend Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | billing | Object | ❌ | Payer information |
Extend.billing Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | firstname | String(255) | ❌ | Payer first name |
| 2 | lastname | String(255) | ❌ | Payer last name |
| 3 | address | String(500) | ❌ | Payer address |
| 4 | city | String(50) | ❌ | City (Example: HANOI) |
| 5 | state | String(255) | ❌ | State/Province |
| 6 | country | String(2) | ❌ | Country ISO2 (Example: VN) |
| 7 | String(255) | ❌ | Payer email | |
| 8 | phone | String(10) | ❌ | Phone number |
| 9 | postal_code | String(6) | ❌ | Postal code |
Example Request
{
"request_id":"MERCHANT050015588AXE012",
"request_time":" 2020-08-11 14:41:00 ",
"master_merchant_code": "MASTER_MERCHANT",
"sub_merchant_code": "SUB_MERCHANT",
"capture_amount":10100000,
"extend": {
"billing": {
"firstname": "A",
"lastname": "NGUYEN VAN",
"address": "313 Truong Chinh, Dong Da",
"city": "HANOI",
"state": null,
"country": "VN",
"email": "[email protected]",
"phone": "0394899999",
"postal_code": "10000"
}
},
"description": "description GD capture"
}
Response
Main Parameters Table
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | code | Number(3) | ✅ | Baokim error code |
| 2 | message | String(200) | ✅ | Baokim error message |
| 3 | data | Object | ✅ | Data returned by Baokim |
Data Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | order_code | String | ✅ | Baokim order code |
| 2 | bank_code | String(50) | ✅ | Bank code |
| 3 | capture_status | Number | ✅ | Capture status: 0 = Pending, 1 = Captured, 2 = Partial Captured, 3 = Fail |
| 4 | status | Number | ✅ | Overall order status |
| 5 | capture_amount | Number | ✅ | Capture amount |
| 6 | total_amount | Number | ✅ | Total order amount |
| 7 | extend | Object | ❌ | Extended data |
Example Response
{
"code": 0,
"message": "Success",
"data": {
"order_code": "VLAD_1753867524",
"bank_code": "970415",
"capture_status": 1,
"status": 1,
"capture_amount": 10100000,
"total_amount": 10100000,
"extend": {}
}
}
Error Code Table
| Error Code | Description |
|---|---|
| 100 | Success |
| 11 | Failed |
| 101 | Baokim system error |
| 104 | OAuth authentication error |
| 105 | Signature authentication error |
| 422 | Validation error: RequestId invalid |
| 422 | Validation error: RequestTime invalid |
| 422 | Validation error: PartnerCode invalid |
| 422 | Card_data invalid |
| 422 | Amount invalid |
| 301 | Order not found by order_code |
| 302 | Card issue (does not exist, expired) |
| 303 | Card declined |
| 304 | Insufficient card balance |
| 305 | User cancelled transaction |
| 306 | Incorrect OTP |
| 308 | Transaction has not completed Authentication |
| 309 | Transaction has not completed Authorization |
| 310 | Transaction already reversed — cannot capture |
| 311 | Transaction already captured — cannot reverse |
| 313 | Bank-side processing error |