Handling Postback Requests
Request Body Interface
{
"publicKey": "string",
"hash": "string",
"id": 0,
"status": "string",
"failedCode": "string" || null,
"paymentMethodId": "string",
"amount": 0,
"currency": "string",
"clientFieldsValues": [
{
"key": "string",
"value": "string"
}
],
"merchantPaymentId": "string",
"merchantUserId": "string",
"createdAt": "2023-11-13T20:20:15.221Z",
"payments": [
{
"id": 0,
"status": "string",
"failedCode": "string" || null,
"paymentMethodId": "string",
"amount": 0,
"currency": "string",
"clientFieldsValues": [
{
"key": "string",
"value": "string"
}
],
"merchantPaymentId": "string",
"merchantUserId": "string",
"createdAt": "2023-11-13T20:20:15.221Z"
}
]
}
Table Describing All Fields in the Request Body
| Field | Type | Required | Description | |||||
|---|---|---|---|---|---|---|---|---|
| publicKey | String | Yes | FirstPay public key required for validating the request body. | |||||
| hash | String | Yes | The encoded string of the request body. For information on how to validate it, see the "Authorization" section. | |||||
| id | Number | Yes | Payment ID in the FirstPay system. | |||||
| status | Enum | Yes | Payment status in the FirstPay system. The response will always be either SUCCESS or FAILED. | |||||
| failedCode | Enum | Yes | This field characterizes the error when making a payment. If status=`SUCCESS`, then `null` will be returned in this field. If status=`FAILED`, then failedCode will contain one of the values: `INCORRECT_AMOUNT` (incorrect amount of funds transferred), `NO_AMOUNT` (funds were not transferred), `INCORRECT_FIELDS` (fields in the form were filled in incorrectly), `ANOTHER_REASON` (another error not related to the above). | |||||
| paymentMethodId | String | Yes | Payment method ID. | |||||
| amount | Number | Yes | Payment amount. | |||||
| currency | Enum | Yes | ISO currency code: USD, INR, BDT, PKR, etc. | |||||
| clientFieldsValues | Array | Yes | Array of fields filled by the user. All these fields are sent when the merchant creates a payment. | |||||
| key | String | Yes | Field identifier / ID. | |||||
| value | String | Yes | Value entered by the user. | |||||
| merchantPaymentId | String | No | Optional field. Payment ID in the merchant’s system. Provided if specified during payment creation. | |||||
| merchantUserId | String | No | Optional field. User ID in the merchant’s system. Provided if specified during payment creation. | |||||
| createdAt | String | Yes | UTC timestamp of payment creation. | |||||
| payments (deprecated) | Array | Yes | Array of user payments. | |||||
| id | Number | Yes | Payment ID in the FirstPay system. | |||||
| status | Enum | Yes | Payment status in the FirstPay system. The response will always be either SUCCESS or FAILED. | |||||
| failedCode | Enum | Yes | This field characterizes the error when making a payment. If status=`SUCCESS`, then `null` will be returned in this field. If status=`FAILED`, then failedCode will contain one of the values: `INCORRECT_AMOUNT` (incorrect amount of funds transferred), `NO_AMOUNT` (funds were not transferred), `INCORRECT_FIELDS` (fields in the form were filled in incorrectly), `ANOTHER_REASON` (another error not related to the above). | |||||
| paymentMethodId | String | Yes | Payment method ID. | |||||
| amount | Number | Yes | Payment amount. | |||||
| currency | Enum | Yes | ISO currency code: USD, INR, BDT, PKR, etc. | |||||
| clientFieldsValues | Array | Yes | Array of fields filled by the user. All these fields are sent when the merchant creates a payment. | |||||
| key | String | Yes | Field identifier / ID. | |||||
| value | String | Yes | Value entered by the user. | |||||
| merchantPaymentId | String | No | Optional field. Payment ID in the merchant’s system. Provided if specified during payment creation. | |||||
| merchantUserId | String | No | Optional field. User ID in the merchant’s system. Provided if specified during payment creation. | |||||
| createdAt | String | Yes | UTC timestamp of payment creation. | |||||