Skip to content

Yandex Pay in your mobile application

If you want to accept payments with the Yandex Pay button in your mobile application, follow the steps below:

1. Register your application in Yandex Pay. Review and adhere to the regulation on forbidden goods and Yandex Pay branding requirements to display the Yandex Pay button correctly.

2. Get the payment method token from Yandex Pay using the following Yandex Pay SDKs:

  • Yandex Pay Android SDK

    Using Yandex Pay Android SDK, at Step 6 set the following parameters in the paymentMethods.card.YPCardPaymentMethod section:

    Parameter Description
    Gateway.from {psp.yandex_pay.gateway_id}
    GatewayMerchantID.from Your Shop ID in the bePaid system.
  • Yandex Pay iOS SDK

    Using Yandex Pay iOS SDK, at the step of adding Yandex Pay button in Swift and Objective-C projects, set the following parameters in the listOf.PaymentMethod section:

    Parameter Description
    gateway {psp.yandex_pay.gateway_id}
    gatewayMerchantId Your Shop ID in the bePaid system.

3. Submit a transaction with the encrypted Yandex Pay token.

Request

Send the payment, authorization or charge request, where you should submit the encrypted Yandex Pay token as the value of request.credit_card.token in the format described below.

For recurring payments and payments with the saved card data, get the bePaid payment token by sending the request.additional_data.contract parameter in the payment, authorization or charge requests.

The required format of the encrypted Yandex Pay token sent as the card token

Submit the encrypted Yandex Pay token in requests as the card token in the $begateway_yandex_pay_1_0_0$<base64_PaymentToken_here> format, where:

  • $begateway_yandex_pay_1_0_0$ is the required prefix for the encrypted Yandex Pay token;
  • <base64_PaymentToken_here> is the received Yandex Pay token in the JSON format converted to the Base64 format.
Example of the encrypted Yandex Pay token
{
   "type":"Yandex",
   "signedMessage":"{\"encryptedMessage\":\"3EIGHhaRWlLBY3CQ4+hMWfbiE8vDLy2vwG5VkY5XgILaq5Vjh/MED5XO1w6KwWnQiT3TJDV5rj/ixLHzPjpN4eUwkaQTgwUcFGYSCbwu4paBhuaOlYKvx3UhxlGs+sWfCxlJHawFWlEcX254u/4yc45CnIAmaJLGR7RLvAX66VOiCO/GpeqPZXpctRzj068TThESmRKv/2Vb9S54CRID1Z0+QIamZIwoKhkEt99F0EXwnfKdlzakpL+N4i99X3EkavQA2Im3lFJ6C9MvIKqahnNF9E89MIAigsnYZ+/Zu7QvtfAe1mVbLDMGJRFqk7NYF0Q/XXrwajJCMFcCvTNkSXh0WmyWI7Fa9r1+EydJmaou1XTo/RUvvbfJ3l7asepcvFcs7wcKUgi9wWGKe9td0ny4EqzVi++hm/ZiJhcSknQBwsNBSHOy7aJZVoxI5DUL7gEV7X3KAS0Q\",\"tag\":\"nPCkBdXgdvb+VhTSM5Rc9QdvEpPFd1mNtSyE0cWCuZU=\",\"ephemeralPublicKey\":\"BFig2qqGHsX/LA6GrFbHcG83eLjTAiBkTTkJe5lki37WMMZUJjfT8tTLOd+vhRmkIru4hcMRfpxfER13WIhNayE=\"}",
   "protocolVersion":"ECv2",
   "signature":"MEUCIQDOBSSB1yFm3E9gM1kTp3CHMkhHM1g4dsYKo9/TXiEhmwIgSMCp2t1tCorBjhGw1k9Ev9tw4IyKVUrMAbJnfAg0Ng0=",
   "intermediateSigningKey":{
      "signedKey":"{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqYNePt6BPgCv5JxfO9dF2vrSqmnp4Mhe/vF+XO+Devbs6/KVpVVoTD8LLcAo4TZh6IuODVnVpHrTObhg3HJVJA==\",\"keyExpiration\":\"1764950892000\"}",
      "signatures":[
         "MEQCIDRslMW7wNZbpqVw/dD7hDQh30hGhqfjfWTBvc7zAYJSAiAGAvjAslA2AxwdAEuOfacFr6DaE5yiiUuUtM6DUreZYg=="
      ]
   }
}
Example of the payment request with the encrypted Yandex Pay token
{
"request": {
   "amount": 100,
   "currency": "RUB",
   "description": "Yandex Pay test transaction",
   "tracking_id": "Your unique ID",
   "credit_card": {
      "token": "$begateway_yandex_pay_1_0_0$eyJ0eXBlIjoiWWFuZGV4Iiwic2lnbmVkTWVzc2FnZSI6IntcImVuY3J5cHRlZE1lc3NhZ2VcIjpcInExNHBnMzNWQlV6NW9WTE1vN2R6WVFHcDNRb2h3MGY5dWtqN0dOV2w4VXVZL2hwQ0cwaDUxOHV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ZTdaYzZIekRwZVllK0hCNC9XMW5mdVBrb0lPZWgiLCJpbnRlcm1lZGlhdGVTaWduaW5nS2V5Ijp7InNpZ25lZEtleSI6IntcImtleVZhbHVlXCI6XCJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVxWU5lUHQ2QlBnQ3Y1SnhmTzlkRjJ2clNxbW5wNE1oZS92RitYTytEZXZiczYvS1ZwVlZvVEQ4TExjQW80VFpoNkl1T0RWblZwSHJUT2JoZzNISlZKQT09XCIsXCJrZXlFeHBpcmF0aW9uXCI6XCIxNzY0OTUwODkyMDAwXCJ9Iiwic2lnbmF0dXJlcyI6WyJNRVFDSURSc2xNVzd3TlpicHFWdy9kRDdoRFFoMzBoR2hxZmpmV1RCdmM3ekFZSlNBaUFHQXZqQXNsQTJBeHdkQUV1T2ZhY0ZyNkRhRTV5aWlVdVV0TTZEVXJlWllnPT0iXX19"
   }
   }
}
Response

The response to the payment request with Yandex Pay token will be returned with transaction processing statuses. It fully matches the responses to payment or authorization requests.