Complaint Statuses
Swagger - detailed complaint API.
Complaint Status Check Request Body Interface:
{
"publicKey": "string",
"hash": "string",
"id": "string", // optional
"paymentId": "string", // optional
"merchantPaymentId": "string" // optional
}
Table Describing All Fields in the Request Body:
| Field | Type | Required | Description | |||||
|---|---|---|---|---|---|---|---|---|
| publicKey | String | Yes | Public key issued during merchant registration on the FirstPay platform (the key is provided as a file; the entire contents must be included). | |||||
| hash | String | Yes | Encoded request body string. For instructions on how to generate it, see the "Authorization" section. | |||||
| id | String | As appropriate | Payment ID in the FirstPay system. The request must include either id, paymentId, or merchantPaymentId. If multiple fields are provided, the server will first check for a complaint by id, then by paymentId, and finally by merchantPaymentId. | |||||
| paymentId | String | As appropriate | Payment ID in the FirstPay system. | |||||
| merchantPaymentId | String | As appropriate | Payment ID in the merchant’s system, as specified in the merchantPaymentId field during payment creation. | |||||
Table of returned responses:
| code | Response body | Description |
|---|---|---|
| 200 | Complaint | Upon a successful request, the complaint data is returned. |
| 400 | {"error": "some text here..."} | An error occurs if the request body and query parameters could not be parsed (most likely due to incorrect formatting). |
| 401 | {"error": "NO_LOGIN"} | An error occurs if the publicKey field is missing in the request body. |
| 401 | {"error": "NO_TOKEN"} | An error occurs if the hash field is missing in the request body. |
| 401 | {"error": "NO_KEY"} | An error occurs if an invalid publicKey is provided. |
| 401 | {"error": "UNAUTHORIZED"} | An error occurs if there is a validation error with the publicKey and hash. |
| 404 | {"error": "NOT_FOUND"} | An error occurs if the specified complaint does not exist in the system. |
| 500 | {"error": "some text here..."} | An error occurs when the server fails to process the request due to an unexpected or non-standard situation. |
Complaint Fields Description
Complaint Interface:
{
"id": "string",
"merchantPaymentId": "string",
"merchantUserId": "string", // optional
"paymentMethodId": "string",
"currencyCode": "string",
"paymentId": "string", // optional
"status": "string",
"amount": 0, // optional
"comment": "string", // optional
"createdAt": "string",
"updatedAt": "string"
}
Table Describing All Fields:
| Field | Type | Description | |||||
|---|---|---|---|---|---|---|---|
| id | String | Payment ID. | |||||
| merchantPaymentId | String | Equal to the merchantPaymentId specified when creating a payment. | |||||
| merchantUserId | String | Optional field. Equal to the merchantUserId specified when creating a payment. | |||||
| paymentMethodId | String | Payment method ID. | |||||
| currencyCode | Enum | ISO currency code: USD, INR, BDT, PKR, etc. | |||||
| paymentId | String | Optional field. Payment ID in the FirstPay system. | |||||
| status | Enum | Complaint status: PENDING, NEED_CHECK, APPROVED, DECLINED, COMPLETED. | |||||
| amount | Number | Optional field. Amount in the specified currency. | |||||
| comment | String | Optional field. Additional comment. | |||||
| createdAt | string | Complaint creation date. | |||||
| updatedAt | string | Complaint editing date. | |||||