Skip to main content

Sending complaint

A complaint creation request is sent in case of technical issues or other problems related to payments.

Swagger - detailed complaint API.

Mechanism of operation

  1. An unexpected issue occurs.
  2. The merchant sends a request to create a complaint.

API

To submit a complaint: send a POST request to https://{firstpay_url}/api/complaints/v1/init.

Complaint Creation Request Body Interface

{
"publicKey": "string",
"hash": "string",
"merchantPaymentId": "string",
"merchantUserId": "string" || null,
"paymentMethodId": "string" || null,
"attachmentId": "string" || null,
"paymentId": "string" || null,
"amount": "number" || null,
"clientFieldsValues": [
{
"key": "string",
"value": "string"
}
] | null,
"comment": "string" || null,
"postBackUrl": "string" || null
}

Table Describing All Fields in the Request Body

FieldTypeRequiredDescription
publicKeyStringYesThe public key issued during merchant registration on the FirstPay platform (the key is provided in a file; the entire contents of the file must be included).
hashStringYesEncoded string of the request body. For instructions on how to generate it, see the "Authorization" section.
merchantPaymentIdStringNoOptional field. You can specify the payment Id from your own system.
merchantUserIdStringNoOptional field. You can specify the user Id from your own system.
paymentMethodIdStringYesPayment method Id.
attachmentIdStringNoIf the payment method’s isAttachmentRequired field is set to true, this field becomes mandatory. You must upload an image as proof of payment — see the "Media Upload" section. The response will include an id field, which must be specified when creating the payment.
paymentIdStringNoOptional field. Payment ID in the FirstPay system.
amountNumberYesPayment amount.
clientFieldsValuesArrayYesList of fields filled out by the user. All these fields are received within the payment method.
keyStringYesField identifier/Id.
valueStringYesValue entered by the user.
commentStrungNoOptional field. Additional comment.
postBackUrlStrungNoOptional field. When postBackUrl is specified, FirstPay will send a request to the provided URL after the payment is confirmed. If this parameter is not provided, the request will be sent to the URL registered on the merchant's page.

Table of Returned Responses:

codeResponse bodyDescription
200Response bodyIf the request is successful, the response will contain data about the created complaint.
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 not included in the request body.
401{"error": "NO_TOKEN"}An error occurs if the hash field is not included in the request body.
401{"error": "NO_KEY"}An error occurs if an incorrect publicKey is provided.
401{"error": "UNAUTHORIZED"}An error occurs if there is a validation failure for publicKey and hash.
403{"error": "ACCESS_DENIED"}An error occurs if the merchant specifies a payment method in the request to which they do not have access.
404{"error": "NOT_FOUND"}An error occurs when requesting a payment method by id if that method 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 situation.

Complaint Creation Response Body Interface:

{
"id": "string",
"merchantId": "string",
"merchantPaymentId": "string",
"merchantUserId": "string" || null,
"paymentMethodId": "string" || null,
"currencyCode": "string" || null,
"paymentId": "string" || null,
"status": "string",
"amount": "number" || null,
"comment": "number" || null,
"createdAt": "string",
"updatedAt": "string"
}

Table Describing All Fields:

FieldTypeDescription
idStringComplaint ID in the FirstPay system.
merchantIdStringMerchant ID in the FirstPay system.
merchantPaymentIdStringPayment ID in the merchant system.
merchantUserIdStringOptional field. User ID in the merchant system.
paymentMethodIdStringOptional field. Payment method ID.
currencyCodeStringOptional field. Currency code.
paymentIdStringOptional field. Payment ID in the FirstPay system.
statusStringComplaint status in the FirstPay system.
amountNumberOptional field. Payment amount.
commentStringOptional field. Additional comment.
createdAtStringDate and time the complaint was created.
updatedAtStringDate and time the complaint was changed.