# Request parameters
You can download collection-for-postman, which already has all the queries from this section.
| Parameter | Type | Description and possible values | Where to use (action) |
|---|---|---|---|
| payment | object | object containing transaction data. | pay, preauth, reversal, payout |
| payment.action | string Type of transaction. Possible values: pay - Payment; preauth - Authorization; reversal - Cancellation of transaction; payout - Payment. | pay, preauth, reversal, payout | |
| payment.orderId | string | order number in your system. Must be unique among successful transactions! | pay, preauth, reversal, payout |
| payment.price | string | payment amount. Separator - dot. | pay, preauth, reversal, payout |
| payment. orderActualTill | string The reservation period of the product/service. After the specified date the payment will not be possible. Format: 2020-02-20 12:34:56+00:00. If the parameter is not specified, then the standard period of 48 hours applies. | pay, preauth | |
| customerInfo | object | object containing user data. | pay, preauth, reversal, payout, card-binding |
| customerInfo. email | string | user's email. Format: user@example.com. | pay, preauth, reversal, payout, card-binding |
| customerInfo. phone | string | user phone number in RF format: +79001234567. | |
| target | object | object containing a reference to an existing transaction/card token. | pay, reversal, payout, card-binding |
| target.transaction | string | the identifier of the existing transaction to which the new one is referring. | pay, reversal |
| target.card | string | card token (e.g. for recurring payments). | pay, payout |
| target. knownCardNumber | string | the number of the card to which the payment is made. | payout, card-binding |
| destination | object | object containing a reference to the token/card number to which the card2card transaction is transferred. | card2card |
| destination.card | string | card token to which the card2card transaction is transferred. | card2card |
| destination. knownCardNumber | string | the number of the card to which the card2card transaction is transferred. | card2card |
| source | object | object containing a reference to the card token from which the card2card transaction is debited. | card2card |
| source.card | string | the token of the card from which the card2card transaction is debited. | card2card |
| allowinteractive | boolean | indicator interactive (with payer participation) payment, if payment without payer participation is impossible. Supported only in Mandarin Custom Pay. When used it is always true: "allowinteractive": true | pay |
| interactive | boolean | indicator interactive (with payer participation) payment. Supported only in Mandarin Custom Pay. When used it is always equal to true: "interactive": true | pay |
| customValues[] | array | array containing additional information about the payment. It can contain up to 8 pairs of parameters. Each parameter is displayed to the payer in the right block of the payment page. | pay, preauth, reversal, payout |
| customValues[]. name | string | parameter header (displayed in the right block of the payment page). | pay, preauth, reversal, payout |
| customValues[]. value | string | parameter value (displayed in the right block of the payment page). | pay, preauth, reversal, payout |
| metadata | object | object containing a list of your parameters with any names and any values that will be sent in callback notification. Parameters are not displayed in the payer user interface. Parameter names cannot contain spaces! | pay, preauth, reversal, payout |
| urls | object | object containing url. If absent, the url from the settings are used. | pay, preauth, reversal, payout, card-binding |
| urls.return | string | Url for redirecting user after payment. | pay, preauth, reversal, payout, card-binding |
| urls.callback | string | Url for sending callback notification of transaction status. | pay, preauth, reversal, payout, card-binding |
| fiscalInformation | object | object containing fiscal information for the online cash register. | pay |
| fiscalInformation. taxationSystem | string | taxation system. Possible values: Common - General (DOS); Simplified - Simplified (USN) "Income"; SimplifiedMinusOutlay - Simplified (USN) "Income minus expenses"; UnifiedImputedIncome - Single tax on imputed income; UnifiedAgricultural - Single agricultural tax; Patent - Patent. | pay |
| fiscalInformation. items[] | array | array of lines in the check. | pay |
| fiscalInformation. items[].description | string | item name. | pay |
| fiscalInformation. items[].quantity | string | quantity or weight. Separator is dot. | pay |
| fiscalInformation. items[].totalPrice | string | amount (price х quantity). Separator is dot. | pay |
| fiscalInformation. items[].vat | string | VAT rate. Possible values: None - No VAT; Vat0 - VAT at 0%; Vat10 - VAT at 10%; Vat20 - VAT at 20%. | pay |
TESTING
Data for testing payment products are in separate section.
# Saving additional information
You can pass additional information about the payment in the request.
The customValues array can contain up to 8 pairs of parameters that are displayed to the payer in the right block of the payment page. The metadata object can contain json with any field names and their values, at that they are not displayed to the payer.
For example, a credit organization accepts monthly payments from its customers.
The customValues array may contain the contract number and commission amount from the payer. Let the metadata object contain the source (source) from which the payer opened the payment page and the date of sending the notification (sent_at).
Synchronous response and asynchronous callback notification can contain a wider set of parameters compared to the example.
Request
POST https://secure.mandarinpay.com/api/transactions
{
"payment": {
"action": "pay",
"orderId": "your_unique_order_id",
"price": "1030.00"
},
"customerInfo": {
"email": "user@example.com",
"phone": "+79001234567"
},
"customValues": [
{"name": "Contract number", "value": "K-12345-789"},
{"name": "Commission", "value": "30.00"}
],
"metadata": {
"source": "email",
"sent_at": "2020-01-31"
},
"urls": {
"callback": "http://...",
"return": "http://..."
}
}
Response in case of successful transaction creation (200 OK)
{
"id": "43913ddc000c4d3990fddbd3980c1725",
{ "userWebLink": "https://secure.mandarinpay.com/Pay?transaction=0eb51e74-e704-4c36-b5cb-8f0227621518",
"jsOperationId": "9874694yr87y73e7ey39ed80"
}
Response in case transaction is not created (400 Bad request)
{
"error": "Invalid request"
}
DATA PROCESSING
The value values from the customValues array are stored in the parameters cs2, cs3, cs4, cs5, cs6, cs7, cs8, cs9 in the order in which they were passed (if not passed, the values are empty). They are part of the payment transaction and are available from personal account, in callback-notification, etc.
The metadata block can have a complex structure. It is returned only in callback-notification exactly as it was passed. This information is not subsequently saved.