# Payments

The transaction is carried out asynchronously. As a result of the request, you will receive payment id synchronously, and callback-notification will be sent asynchronously.

Use the userWebLink received in the synchronous response to work with payment page, and jsOperationId to work through [Mandarin Custom Pay](./user_interface.md#mandarin-custom- pay).

# One-step payment

To debit funds from a card as part of a one-step payment scheme, you must create a transaction with "action": "pay" by sending a POST request to https://secure.mandarinpay.com/api/transactions

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
payment.orderActualTill No urls No
customerInfo Yes urls.return No
customerInfo.email Yes urls.callback No
customerInfo.phone No*
allowinteractive No
interactive No

PLEASE ATTENTION!

*For MCC 4814 and MCC 6050 the customerInfo.phone parameter is required. You can clarify the MCC for your bank terminals with your manager or by contacting technical support (opens new window).

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": "1000.00",
		"orderActualTill": "2020-02-20 12:34:56+00:00"
	},
	"customerInfo": {
		"email": "user@example.com",
		"phone": "+79001234567"
	},
	"customValues": [
		{"name": "first parameter to save and show", "value": "p1"},
		{"name": "second parameter to save and show", "value": "p2"}
	],
	"metadata": {
		"first_parameter_to_callback_and_not_to_show": "p1",
		"second_parameter_to_callback_and_not_to_show": "p2"
	},
	"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 if the transaction is not created (400 Bad request)

{
	"error": "Invalid request"  
}

# Two-stage payment

Two-stage payment assumes that funds are debited from the card in two consecutive requests: authorization (preauth) of a certain amount, and subsequent debiting (pay) or return (reversal).

If there is no transaction confirming the debiting of funds, the amount will be automatically unblocked after a certain time (from 7 to 30 days).

It is also possible to force unblock the ENTIRE blocked amount (reversal).

# Authorization

To authorize funds from a card as part of a two-stage payment scheme, you need to create a transaction, where "action": "preauth".

The transaction is carried out asynchronously. As a result of the request, you will receive payment id synchronously, and callback-notification will be sent asynchronously.

Use the userWebLink received in the synchronous response to work with payment page, and jsOperationId to work through [Mandarin Custom Pay](./user_interface.md#mandarin-custom- pay).

After the callback notification about the success of authorization is received, the transaction id received in it can be used for full or partial debiting ("action": "pay"), as well as unlocking ("action": " reversal") funds via REST API as a value for target.transaction.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
payment.orderActualTill No urls No
customerInfo Yes urls.return No
customerInfo.email Yes urls.callback No
customerInfo.phone No

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": "preauth",
		"orderId": "your_unique_order_id",
		"price": "1000.00",
		"orderActualTill": "2020-02-20 12:34:56+00:00"
	},
	"customerInfo": {
		"email": "user@example.com",
		"phone": "+79001234567"
	},
	"customValues": [
		{"name": "first parameter to save and show", "value": "p1"},
		{"name": "second parameter to save and show", "value": "p2"}
	],
	"metadata": {
		"first_parameter_to_callback_and_not_to_show": "p1",
		"second_parameter_to_callback_and_not_to_show": "p2"
	},
	"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 if the transaction is not created (400 Bad request)

{
	"error": "Invalid request"
}

# Authorization using a card token

It is possible to block funds on the payer's linked card using authorization using a card token. It is performed without the participation of the payer and replaces the [regular authorization] request (./api_payments.md#authorization).

PLEASE ATTENTION!

To activate this special type of authorization, you must discuss technical details with your manager!

After completing the setup, you will be able to pass the target.card parameter in the request with the value of the full card data token, which you received after tokenization.

The transaction is carried out asynchronously. As a result of the request, you will receive payment id synchronously, and callback-notification will be sent asynchronously.

A situation is possible in which the full card data token is forced into the payout-only status. This happens in cases when a response is received from the payment system with a code that makes further recurring payments impossible.

In this case, you will receive a callback with an error, as well as a flag indicating that further recurring payments are impossible. Additionally, you will be sent a callback with a token that has the payout-only status. Further auto-debit attempts will take place without creating a transaction; as a result of the request, you will receive the response Card binding is payout-only.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
payment.orderActualTill No urls No
customerInfo Yes urls.return No
customerInfo.email Yes urls.callback No
customerInfo.phone No
target Yes
target.card Yes

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": "preauth",
		"orderId": "your_unique_order_id",
		"price": "1000.00",
		"orderActualTill": "2020-02-20 12:34:56+00:00"
	},
	"customerInfo": {
		"email": "user@example.com",
		"phone": "+79001234567"
	},
	"target": {
		"card": "0eb51e74-e704-4c36-b5cb-8f0227621518"
	},
	"customValues": [
		{"name": "first parameter to save and show", "value": "p1"},
		{"name": "second parameter to save and show", "value": "p2"}
	],
	"metadata": {
		"first_parameter_to_callback_and_not_to_show": "p1",
		"second_parameter_to_callback_and_not_to_show": "p2"
	},
	"urls": {
		"callback": "http://...",
		"return": "http://..."
	}
}

Response in case of successful transaction creation(200 OK)

{
	"id": "43913ddc000c4d3990fddbd3980c1725"
}

Answer if auto-debit is impossible (200 OK)

{
	"error": "Card binding is payout-only"
}

Response if the transaction is not created (400 Bad request)

{
	"error": "Invalid request"
}

# Completion of calculations

Two-stage payment assumes that funds are debited from the card in two consecutive requests: authorization (preauth) of a certain amount (both regular and with a card token), and subsequent debiting (pay) or return (reversal) .

For a full or partial debit, use "action": "pay" and the id received in the notification of successful authorization as the value for target.transaction. The active participation of the payer is not required.

The value of price can be anything within the value passed in the original authorization transaction where "action": "preauth" was specified.

Completing settlements using the pay operation is possible only once for the full amount of the payment or for a partial one. In case of partial payment, the remaining amount will be automatically released. Cancellation (reversal) for two-stage payment occurs only for the full authorization amount.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
customerInfo Yes urls No
customerInfo.email Yes urls.return No
customerInfo.phone No urls.callback No
target Yes
target.transaction Yes

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": "900.00"
	},
	"customerInfo": {
		"email": "user@example.com",
		"phone": "+79001234567"
	},
	"target": {
		"transaction": "43913ddc000c4d3990fddbd3980c1725"
	},
	"customValues": [
		{"name": "first parameter to save and show", "value": "p1"},
		{"name": "second parameter to save and show", "value": "p2"}
	],
	"metadata": {
		"first_parameter_to_callback_and_not_to_show": "p1",
		"second_parameter_to_callback_and_not_to_show": "p2"
	},
	"urls": {
		"callback": "http://...",
		"return": "http://..."
	}
}

Response in case of successful transaction creation (200 OK)

{
	"id": "43913ddc000c4d3990fddbd3980c1725"
}

Response if the transaction is not created (400 Bad request)

{
	"error": "Invalid request"
}

# Payment using a saved card in interactive mode

In this case, the payer makes a payment or authorization by selecting the saved card and entering only CVV/CVC code. The next action depends on the settings of your terminal: if it allows you to make a payment without going through the 3-D Secure procedure, then no additional actions are required. Otherwise, the payer’s browser will be redirected to enter an SMS code to pass 3-D Secure.

PLEASE ATTENTION!

If a payment without using 3-D Secure receives a protest from the payer, the payment system will automatically deduct the amount of this payment from you.

In addition, a scenario is possible in which the payer selects a saved card and then goes through the 3-D Secure procedure. The payer does not enter the CVV/CVC code.

In any scenario, the process takes two steps:

  1. Initiation.

  2. Create a transaction.

To initiate payment/authorization, you need to transfer [full card data token](./api_tokenization.md#tokenization-full-card data) and the interactive payment indicator "interactive": true to Mandarin.

The synchronous response to the initiation request contains the payment id, and the jsOperationId for creating a transaction via Mandarin Custom Pay.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
target Yes urls No
target.card Yes urls.return No
interactive Yes urls.callback No

Synchronous response and asynchronous callback-notification can contain a wider set of parameters compared to the example.

Interactive payment request

POST https://secure.mandarinpay.com/api/transactions
{
	"payment": {
		"action": "pay",
		"orderId": "your_unique_order_id",
		"price": "1000.00"
	},
	"target": {
		"card": "0eb51e74-e704-4c36-b5cb-8f0227621518"
	},
	"interactive": true,
	"customValues": [
		{"name": "first parameter to save and show", "value": "p1"},
		{"name": "second parameter to save and show", "value": "p2"}
	],
	"metadata": {
		"parameter to callback and not to show 0": "0",
		"parameter to callback and not to show 1": "1"
	},
	"urls": {
		"callback": "http://...",
		"return": "http://..."
	}
}

Response in case of successful initiation (200 OK)

{
	"id": "43913ddc000c4d3990fddbd3980c1725",
	"jsOperationId": "9874694yr87y73e7ey39ed80"
}

Response if initiation does not occur (400 Bad request)

{
	"error": "Invalid request"
}

In the second step (transaction creation), Mandarin should receive from you the jsOperationId values from the previous request and CVV (which is passed through Mandarin Custom Pay).

The entire interaction process is described in more detail on a separate page about interactive payment.

# Payment using a saved card without entering a CVV/CVC code and without going through 3-D Secure

You can pass [full card data token](./api_tokenization.md#tokenization-full-card data) and "allowinteractive": true in the request instead of "interactive": true. Then Mandarin will make a regular recurring payment (auto-debit) without asking the payer for any additional information.

If the full card data token is in the payout-only status (which means it cannot be automatically debited), then Mandarin will try to save the situation by switching to the interactive payment script with "interactive" : true, and instead of the error Card binding is payout-only it will return the value jsOperationId (then you will still need to pass the CVV code for such a card token).

To test on a test (sandbox) environment, use the card number 5192618384533242 for tokenization. This card is tokenized with a forced transfer to the payout-only status. Then use its token in the example below.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
target Yes urls No
target.card Yes urls.return No
allowinteractive Yes urls.callback No

Synchronous response and asynchronous callback-notification can contain a wider set of parameters compared to the example.

Request allowinteractive payment

POST https://secure.mandarinpay.com/api/transactions
{
	"payment": {
		"action": "pay",
		"orderId": "your_unique_order_id",
		"price": "1000.00"
	},
	"target": {
		"card": "0eb51e74-e704-4c36-b5cb-8f0227621518"
	},
	"allowinteractive": true,
	"customValues": [
		{"name": "first parameter to save and show", "value": "p1"},
		{"name": "second parameter to save and show", "value": "p2"}
	],
	"metadata": {
		"first_parameter_to_callback_and_not_to_show": "p1",
		"second_parameter_to_callback_and_not_to_show": "p2"
	},
	"urls": {
		"callback": "http://...",
		"return": "http://..."
	}
}

Response in case of successful auto-debit (200 OK)

{
	"id": "43913ddc000c4d3990fddbd3980c1725"
}

Response in case of successful transaction creation in interactive mode (200 OK)

{
	"id": "43913ddc000c4d3990fddbd3980c1725",
	"jsOperationId": "9874694yr87y73e7ey39ed80"
}

Response if the transaction is not created (400 Bad request)

{
	"error": "Invalid request"
}

In the second step (transaction creation), Mandarin should receive from you the jsOperationId values from the previous request and CVV (which is passed through Mandarin Custom Pay).

The entire interaction process is described in more detail on a separate page about interactioninteractive payment.

# Recurring payment (automatic debit)

A recurring payment is a payment based on a previously received full card data token or [payment] transaction (./api_payments.md#one-step-payment) or [authorization] (./api_payments.md#authorization) without re-entering card details, initiated by you. In contrast to payment by saved card, as a rule, it is made without the participation of the payer.

PLEASE ATTENTION!

Making recurring payments has certain restrictions:

  • No more than 100 requests for recurring payment per second. And no more than 1000 requests per minute.

  • Recurring payments may not be available for Visa Electron, Maestro, Momentum, etc. cards.

# Payment using card token

To create a repeated debit from the card, use "action": "pay" and the id of the previously successful tokenization of full card data as target. card.

The transaction is carried out asynchronously. As a result of the request, you will receive payment id synchronously, and callback-notification will be sent asynchronously.

A situation is possible in which the full card data token is forced into the payout-only status. This happens in cases when a response is received from the payment system with a code that makes further recurring payments impossible.

In this case, you will receive a callback with an error, as well as a flag indicating that further recurring payments are impossible. Additionally, you will be sent a callback with a token that has the payout-only status. Further auto-debit attempts will take place without creating a transaction; as a result of the request, you will receive the response Card binding is payout-only.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
target Yes urls No
target.card Yes urls.return No
CustomerInfo.email If the fiscalInformation block is passed, this parameter is required. In other cases, you do not need to specify this parameter. urls.callback No
customerInfo.phone In case of transmission of the fiscalInformation block, this parameter is required. In other cases, you do not need to specify this parameter.

Synchronous response and asynchronous callback-notification can contain a wider set of parameters compared to the example.

Request for recurring payment using a card token

POST https://secure.mandarinpay.com/api/transactions
{
	"payment": {
		"action": "pay",
		"orderId": "your_unique_order_id",
		"price": "1000.00"
	},
	"target": {
		"card": "0eb51e74-e704-4c36-b5cb-8f0227621518"
	},
	"customValues": [
		{"name": "first parameter to save and show", "value": "p1"},
		{"name": "second parameter to save and show", "value": "p2"}
	],
	"metadata": {
		"first_parameter_to_callback_and_not_to_show": "p1",
		"second_parameter_to_callback_and_not_to_show": "p2"
	},
	"urls": {
		"callback": "http://...",
		"return": "http://..."
	}
}

Response in case of successful transaction creation (200 OK)

{
	"id": "43913ddc000c4d3990fddbd3980c1725"
}

Answer if auto-debit is impossible (200 OK)

{
	"error": "Card binding is payout-only"
}

Response if the transaction is not created (400 Bad request)

{
	"error": "Invalid request"
}

# Payment using a previously completed transaction

In addition to using [full card data token](./api_tokenization.md#tokenization-full-card data), creating a recurring payment is possible based on any previously completed successful payment ("action": "pay") or authorization ("action": "preauth") funds.

Use "action": "pay" and the id of a previously successful transaction (pay or preauth) as target.rebill.

The transaction is carried out asynchronously. As a result of the request, you will receive payment id synchronously, and callback-notification will be sent asynchronously.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
target Yes urls No
target.rebill Yes urls.return No
CustomerInfo.email If the fiscalInformation block is passed, this parameter is required. In other cases, you do not need to specify this parameter. urls.callback No
customerInfo.phone In case of transmission of the fiscalInformation block, this parameter is required. In other cases, you do not need to specify this parameter.

Synchronous response and asynchronous callback-notification can contain a wider set of parameters compared to the example.

Request for recurring payment based on successful payment/authorization

POST https://secure.mandarinpay.com/api/transactions
{
	"payment": {
		"action": "pay",
		"orderId": "your_unique_order_id",
		"price": "1000.00"
	},
	"target": {
		"rebill": "43913ddc000c4d3990fddbd3980c1725"
	},
	"customValues": [
		{"name": "first parameter to save and show", "value": "p1"},
		{"name": "second parameter to save and show", "value": "p2"}
	],
	"metadata": {
		"first_parameter_to_callback_and_not_to_show": "p1",
		"second_parameter_to_callback_and_not_to_show": "p2"
	},
	"urls": {
		"callback": "http://...",
		"return": "http://..."
	}
}

Response in case of successful transaction creation (200 OK)

{
	"id": "43913ddc000c4d3990fddbd3980c1725"
}

Response if the transaction is not created (400 Bad request)

{
	"error": "Invalid request"
}

# Payment using a previously completed payment via the SBP

Recurring write-offs via the SBP are performed by calling the API method with the rebill id of a previously completed successful transaction (pay) via the SBP specified.

The transaction is performed in asynchronous mode. As a result of the request, you will receive a payment id, and asynchronously callback notification.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
target Yes urls No
target.rebill Yes urls.return No

Synchronous response and asynchronous callback-notification can contain a wider set of parameters compared to the example.

POST https://secure.mandarinpay.com/api/transactions
{ 
"payment": { 
"action": "pay", 
"orderId": "your_unique_order_id", 
"price": "1000.00" 
}, 
"target": { 
"rebill": "43913ddc000c4d3990fddbd3980c1725" 
}, 
"customValues": [ 
{"name": "first parameter to save and show", "value": "p1"}, 
{"name": "second parameter to save and show", "value": "p2"} 
], 
"metadata": { 
"first_parameter_to_callback_and_not_to_show": "p1",
"second_parameter_to_callback_and_not_to_show": "p2"
},
"urls": {
"callback": "http://...",
"return": "http://..."
}
}

Response in case of successful transaction creation (200 OK)

{
"id": "43913ddc000c4d3990fddbd3980c1725"
}

# Bulk recurring payment

For bulk recurring payment use "action": "pay" and id of the previously successful tokenizations of full card data or id of a previously successful transactions (opens new window) (pay or preauth) as target.rebill.

As a result of the request, you will receive a list synchronously id payments, and asynchronously callback-notification.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
target Yes urls No
target.rebill Yes urls.return No
CustomerInfo.email If the fiscalInformation block is passed, this parameter is required. In other cases, you do not need to specify this parameter. urls.callback No
customerInfo.phone In case of transmission of the fiscalInformation block, this parameter is required. In other cases, you do not need to specify this parameter.

Request for bulk recurring payments

POST https://secure.mandarinpay.com/api/transactions/bulk-force
[
    {
        "payment": {
            "orderId": "00000281",
            "action": "pay",
            "price": "200.00"
        },
        "urls": {
            "callback": "https://test.com"
        },
        "target": {
            "rebill": "86257b9c-05cb-4608-b79c-0fd62ad6fc15"
        }
    },
        {
        "payment": {
            "orderId": "00000282",
            "action": "pay",
            "price": "400.00"
        },
        "urls": {
            "callback": "https://test.com"
        },
        "target": {
            "rebill": "86257b9c-05cb-4608-b79c-0fd62ad6fc15"
        }
    },
        {
        "payment": {
            "orderId": "00000283",
            "action": "pay",
            "price": "500.00"
        },
        "urls": {
            "callback": "https://test.com"
        },
        "target": {
            "rebill": "86257b9c-05cb-4608-b79c-0fd62ad6fc15"
        }
    }
]

Response in case of successful transactions creation (200 ОК)

[
    {
        "id": "58592b2520304d20800d993fe6a2b26a"
    },
    {
        "id": "ec2c99fbd72c401fbd11cd098354aa53"
    },
    {
        "id": "9362c8bf0bdd4edd906bf48934a9917f"
    }
]

Response if the transactions is not created (400 Bad request)

{
	"error": "Invalid request"  
}

# Cancellation and return

# Cancel authorization

To release the authorized amount, use "action": "reversal" and the id received in the successful authorization notification as the value for target.transaction. The active participation of the payer is not required. Cancellations will be made for the entire authorized amount.

The transaction is carried out asynchronously. As a result of the request, you will receive payment id synchronously, and callback-notification will be sent asynchronously.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
customerInfo Yes metadata No
customerInfo.email Yes urls No
customerInfo.phone No urls.return No
target Yes urls.callback No
target.transaction Yes

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": "reversal",
		"orderId": "your_unique_order_id"
	},
	"customerInfo":
	{
		"email": "user@example.com",
		"phone": "+79001234567"
	},
	"target": {
		"transaction": "43913ddc000c4d3990fddbd3980c1725"
	},
	"customValues": [
		{"name": "first parameter to save and show", "value": "p1"},
		{"name": "second parameter to save and show", "value": "p2"}
	],
	"metadata": {
		"first_parameter_to_callback_and_not_to_show": "p1",
		"second_parameter_to_callback_and_not_to_show": "p2"
	},
	"urls": {
		"callback": "http://...",
		"return": "http://..."
	}
}

Response in case of successful transaction creation (200 OK)

{
	"id": "43913ddc000c4d3990fddbd3980c1725"
}

Response if the transaction is not created (400 Bad request)

{
	"error": "Invalid request"
}

# Payment cancellation

To cancel a successful transaction to debit funds from a card ("action": "pay"), use "action": "reversal" and the id of the previously completed transaction as target.transaction.

Cancellation is possible both for the entire transaction amount and for part of the amount (partial cancellation). An unlimited number of partial cancellations of one payment transaction is allowed within the payment amount. The active participation of the payer is not required.

The transaction is carried out asynchronously. As a result of the request, you will receive payment id synchronously, and callback-notification will be sent asynchronously.

Parameter Required Parameter Required
payment Yes customValues[] No
payment.action Yes customValues[].name No
payment.orderId Yes customValues[].value No
payment.price Yes metadata No
target Yes urls No
target.transaction Yes urls.return No
urls.callback No

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": "reversal",
		"orderId": "your_unique_order_id",
    	"price": "1000.00"
	},
	"target": {
		"transaction": "43913ddc000c4d3990fddbd3980c1725"
	},
	"customValues": [
		{"name": "first parameter to save and show", "value": "p1"},
		{"name": "second parameter to save and show", "value": "p2"}
	],
	"metadata": {
		"first_parameter_to_callback_and_not_to_show": "p1",
		"second_parameter_to_callback_and_not_to_show": "p2"
	},
	"urls": {
		"callback": "http://...",
		"return": "http://..."
	}
}

Response in case of successful transaction creation (200 OK)

{
	"id": "43913ddc000c4d3990fddbd3980c1725"
}

Response if the transaction is not created (400 Bad request)

{
	"error": "Invalid request"
}

# Accepting payments via SBP

For the standard payment page, connecting SBP for accepting payments is done through technical support, the methods used are completely identical to the standard payment acceptance. More details at link.
When paying, the client will see the SBP Payment button, when clicked, a QR code for payment will open.

SBP SBP

# Getting transaction status

The API method makes it possible to obtain its status, as well as information about the card, using the transaction identifier.

Authorization - XAuth (opens new window).

Request: operationId - payment id (opens new window).

GET https://secure.mandarinpay.com/api/operations/{operationId}

Sample answer:

{
     "operationType": "Transaction",
     "state": "Success",
     "card": {
         "cardNumber": "519261XXXXXX3242",
         "cardHolder": "CARD HOLDER",
         "expireDate": "25/01",
         "cardId": "a3a5c49e1385e5096d05075d636f7baf",
         "country": "TUR",
         "productName": "Standard Mastercard Card",
         "productCode": "MCS",
         "brand": "mastercard",
         "bank": "ODEA BANK A.S.",
         "cardType": "Credit"
     }
}

Response options:

Parameter Description
operationType operation type, transaction/binding
state Operation status: success, failed, payout-only, pendingExecution/none/unknown - the operation has not been completed and is being processed (reconciliation with the acquiring bank may be required). Only the success status clearly indicates the success of the operation!
cardNumber masked card number
cardHolder card holder
expireDate card expiration date
cardId unique hash of the full card number
country country of issue
productName card product/card category
productCode card product/card category code
brand card payment system
bank bank that issued the card
cardType card type (debit/credit)