# 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.