API API Payment bill
Endpoint: /api/v1/service/bill/pay
Method: POST
Header: How to generate JWT_TOKEN
{
"X-APPOTAPAY-AUTH": Bearer JWT_TOKEN,
"Content-Type": "application/json"
}
Params
| Params | Required | Type | Description |
|---|---|---|---|
| partnerRefId | √ | String | Transaction id partner send to API query bill information |
| billCode | √ | String | Bill code |
| serviceCode | √ | String | Service code(see more Table Of Content menu Service code) |
| amount | √ | Integer | Payment money |
| billDetail | √ | String | JSON String is array information bill is result from API check bill |
| signature | √ | String | Signature of parameter passed to the API, the parameter is included into signature like this: amount + billCode + billDetail + partnerRefId + serviceCode (see more how to generate signature) |
Data result
| Params | Type | Description |
|---|---|---|
| errorCode | Integer | Error code result |
| message | String | Description detail error code |
| billDetail | Array | MInformation detail bill |
| billDetail[].billNumber | String | ID bill |
| billDetail[].period | String | Period payment bill |
| billDetail[].amount | Integer | Bill amount |
| billDetail[].billCreated | String | Created time bill |
| billDetail[].billExpiry | String | Expired payment |
| billDetail[].billType | String | Bill type |
| billDetail[].billOtherInfo | String | Other information |
| billDetail[].isPartialPaymentAllowed | Bool | Does the invoice allow partial payments? (default: false) |
| billDetail[].extraInfo | String | Extra information |
| transaction | Object | Information transaction |
| transaction.appotapayTransId | String | Transaction id from AppotaPay |
| transaction.amount | Integer | Money transaction |
| transaction.billAmount | Integer | Money bill payment |
| transaction.time | String | Transaction time |
| account | Object | Account information |
| account.balance | Integer | Balance account after payment |
| signature | String | Signature of parameter passed to the API, the parameter is included into signature like this (amount + appotapayTransId + billAmount + errorCode + time) |
Example
Request
{
"amount": 100000,
"billDetail": [
{
"billNumber": "117934",
"period": "4/2020",
"amount": 100000,
"billCreated": "",
"billExpiry": "",
"billType": "",
"billOtherInfo": "",
"isPartialPaymentAllowed": false,
"extraInfo": ""
}
],
"partnerRefId": "AB123",
"billCode": "PD12121",
"serviceCode": "ENVHN",
"signature": "b10294bae53e89919b3efd62a763bf3..."
}
Response
{
"errorCode": 0,
"message": "Thành công",
"billDetail": [
{
"billNumber": "117934",
"period": "4/2020",
"amount": 100000,
"billCreated": "",
"billExpiry": "",
"billType": "",
"billOtherInfo": "",
"isPartialPaymentAllowed": false,
"extraInfo": ""
}
],
"transaction": {
"amount": 100000,
"billAmount":100000,
"appotapayTransId": "01ARXAAWEBDS",
"time": "10-04-2020 10:10:10"
},
"account": {
"balance": 12200000
},
"signature": "b10294bae53e89919b3efd62a763bf3228e260ef1a329..."
}