Skip to main content

Submitting additional data for purchase

Amanpay may sometimes request that you send it some data necessary for a purchase to be performed. It may happen:

  • when your request doesn't include some of required parameters
  • when the payment system sends your customer a one-time password (OTP) or confirmation code that you should then provide Amanpay with

When Amanpay needs you to provide it with some data, it sends you a callback indicating what data it needs to perform the purchase.

Here is an example of the data from such a callback.

{
"additional_fields": [ // The array where the data Amanpay needs to perform the purchase is indicated
"Otp"
],
"operationId": 29609,
"transactionId": 62861,
"status": "SPECIFICATION"
}

Upon receiving such a callback, you should provide Amanpay with the data it needs by sending it a request as follows:

URLhttps://gateway.amanpay.io
API endpoint/payments/purchases/specify/{operationId}
HTTP request methodPOST
Request body formatJSON
HeaderValueDescription
Content-Typeapplication/jsonHTTP header indicating the media type of the resource sent in the request body.
AuthorizationcalculatedSignature string. For the information on how to generate the signature, see Signature generation and verification.

The following table contains the parameters that have to be used in requests to provide Amanpay with the data it needs for the purchase to be performed.

ParameterTypeRequiredDescription
transactionIdintegerRequiredPayment ID within the Amanpay payment platform.
merchantIdintegerRequiredYour unique merchant ID that you got from Amanpay when integrating.
additionalFieldsobjectRequiredThe object where the data the payment platform needs are submitted.


Here is an example of a request where the necessary data are submitted to the Amanpay payment platform.

curl -X POST "https://gateway.amanpay.io/payments/purchases/specify/29609" \
-H "Content-Type: application/json" \
-H "Authorization: b78d07bc3e51899182339bfb39c85ab8629085c80f9b2312444669a3bdd78cc0522a1bcca50ede6be3a90fcf489100304cde09e14fa51a175a5fed0e36f6c26b" \
-d '{
"transactionId": 62861,
"merchantId": 1758378,
"additionalFields": {
"Otp": "385927471757185"
}
}'