Request for currency exchange rate

This section provides the instructions on how to build the request for currency exchange rate.

HTTP request method POST
Request body format JSON
API endpoint /v2/customer/validate
Table 1. Basic parameters of a request

strictly required—the parameter must be in the initial request.

Object Parameter Description

general
object
strictly required

project_id
integer
strictly required

Project ID you obtained from Flashpay when integrating.

Example: 1234

payment_id
string
strictly required

Payment ID unique within your project.

Example: payment_47

signature
string
strictly required

Signature created after you've specified all the request parameters. For more information about signature generation, see Signature generation and verification.

customer
object
strictly required

id
string
strictly required

Unique ID of the customer within your project.

Example: customer_123

card
object
strictly required

pan
string
strictly required

Customer card number.

Example: 1234567890123456

payment
object
strictly required

amount
integer
strictly required

Payment amount in minor currency units without any decimal point or comma except for the cases when the currency doesn't have any minor currency units.

If the currency doesn't have any minor units (i.e. the number of digits for minor currency units is zero), set this parameter to the amount in the major currency units. To check whether the currency has any minor units, see Currency units and Currency codes.

Example: 100.00 RUB must be sent as 10000

currency
string
strictly required

Code of the payment currency in the ISO-4217 alpha-3 format.

Example: RUB

by_method
string
strictly required

ID of the payment method. Set this parameter to card.

Example: card

Here is an example of the data from a request for currency exchange rate:

Figure 1. Example of the request body
{
    "general": {
        "project_id": 1234,
        "payment_id": "payment_47",
        "signature": "kUi2x9dKHAVNU0FYldJrxh4yo+52Kt8KU+Y19vySO/RLUkDJrOcZzUCwX6R/ekpZhkIQg=="
    },
    "customer": {
        "id": "customer_123"
    },
    "card": {
        "pan": "1234567890123456"
    }
    "payment": {
        "amount": 10000,
        "currency": "RUB",
        "by_method": "card"
    }
}

Response with currency exchange rate

After receiving and processing your payout request, the payment platform sends you a synchronous response with information about the currency exchange rate.

Figure 2. Example of the response body
{
    "project_id": 1234,
    "status": "success",
    "request_id": "e0d123123ab4678ec2e"
    "payment_id": "payment_47",
    "code": "1",
    "operation": {
        "sum_initial": {
            "amount": 10000,
            "currency": "RUB"
        },
        "sum_converted": {
            "amount": 5900,
            "currency": "TRY"
        },
        "exchange_rate": 0.59,
        "exchange_rate_description": "Exchange rate RUB/TRY 0.59"
    }
}