跳到主要内容

通过购买令牌获取支付数据

注意

该门户网站正在开发中。文档的完整版本请看这里.

此方法允许通过购买令牌获取支付信息。

交互参数

GET https://public-api.rustore.ru/public/purchase/{purchaseToken}
属性类型描述必须布局填写示例
Public-TokenstringPublic API Rustore的访问令牌header
purchaseTokenstring如何获取购买令牌path111.123

响应参数

属性类型描述必须布局填写示例
codestring响应代码bodyОК,ERROR,BAD_REQUEST,NOT_FOUND
messagestring响应代码解释body
timestampstring响应时间body
body{}object响应正文body

body

属性类型描述填写示例
error{}object错误解释
invoice_idstring发票号码12345
invoice_datestring发票创建日期2020-04-29T08:18:03+03
invoice_statusstring发票状态created --- 已创建; executed --- 用户选择了支付方式, 支付正在执行; cancelled --- 用户取消; paid --- 资金已预留, 发票等待确认 (只适用于消耗性产品的购买); confirmed --- 支付成功; refunded --- 资金已退还给购买者。
invoice{}object发票信息
imagestring图片链接https://i-love-png.com/images/grim-reaper-icon.png
application_codestring应用程序代码com.MashaAndTheBear.HairSalon
application_namestring应用程序名称《玛莎和熊》美容院
owner_codestring应用程序所有者代码com.MashaAndTheBear
owner_namestring应用程序所有者名称玛莎和熊
payment_info{}object支付信息
payment_methods{}object支付工具

body.error

属性类型描述填写示例
user_messagestring错误文本
error_descriptionobject错误描述
error_codenumber错误的数字代码0

body.invoice

属性类型描述填写示例
purchaser{}object关于买方的信息
delivery_info{}object配送信息
invoice_params\[\]array订单的额外参数
order{}object关于订单的信息

body.invoice.purchaser

属性类型描述填写示例
emailstringEmail买方qq@dd.eof
phonestring电话号码9123456789
contactstring首选的通信方式email

body.invoice. delivery_info

属性类型描述填写示例
address{}object地址
delivery_typestring配送方式courier
descriptionstring附加信息在1.5小时之前回电话

body.invoice. delivery_info.address

属性类型描述填写示例
countrystring国家标识符RU
citystring城市莫斯科
addressstring地址瓦维洛娃街19号,办公室1

body.invoice.invoice_params []

属性类型描述填写示例
keystring参数名称packageName
valuestring参数值com.MashaAndTheBear.HairSalon

body.invoice.order

属性类型描述填写示例
order_idstring订单的唯一标识符d290f1ee-6c54-4b01-90e6-d701748f0851
order_numberstring订单号145
order_datestring订单日期2020-04-29T08:17:03+03
service_idstring服务标识符223
amountnumber以货币最小单位(戈比)表示的订单金额11836
currencystring货币代码RUB
purposestring付款的简要目的在游戏"玛莎和熊,美容院魔女"中的购买
descriptionstring订单描述在游戏"玛莎和熊,美容院魔女"中购买游戏内内容
languagestring语言ru-RU
expiration_datestring发票有效期的日期和时间2022-10-11T14:05:44.741Z
tax_systemnumber税收制度0
trade_namestring组织的商业名称Romashka
visual_namestring操作名称购买/续订订阅
org_namestring组织名称有限责任公司"甘菊"
org_innstring组织的纳税人识别号1234567890
visual_amountstring金额1 500,45 ₽
order_bundle \[\]array订单组成

body.invoice.order.order_bundle []

属性类型描述填写示例
position_idnumber唯一产品标识符1
namestring产品名称或描述水晶
item_params\[\]array订单的额外参数
quantity{}object产品总数量的描述
item_amountnumber所有产品项的价值总额,以货币的最小单位(即戈比)表示11836
currencystring货币代码RUB
item_codestring产品编号(标识符)com.MashaAndTheBear.HairSalon.crystal100
item_pricenumber单个产品的价格,以货币的最小单位表示(即戈比)11836
discount_typestring产品折扣类型percent
discount_valuefloat产品折扣值5.25
interest_typestring销售产品的代理佣金类型agentPercent
interest_valuefloat销售产品的代理佣金值15.105
tax_typenumber增值税税率6
tax_sumnumber税款总额,以货币的最小单位表示(即戈比)2367
imagestring图片链接https://i-love-png.com/images/grim-reaper-icon.png

body.invoice.order.order_bundle.item_params []

属性类型描述填写示例
keystring参数名称packageName
valuestring参数值com.MashaAndTheBear.HairSalon

body.invoice.order.order_bundle.quantity

属性类型描述填写示例
valuefloat含义1.05
measurestring计量单位公斤

body.payment_info

属性类型描述填写示例
payment_datenumber发票支付日期和时间2022-10-11T14:05:44.741Z
payment_idstring唯一支付标识符d290f1ee-6c54-4b01-90e6-d701748f0851
payment_params{}object支付的附加参数
device_info{}object设备信息
loyalty_info{}object忠诚计划信息
card_idstring银行卡的唯一标识符ad454ffg-6c54-4b01-90e6-d701748f0851
namestring卡别名重要
paysys_codestringRBS-shortname
masked_panstring银行卡掩码号**1111
expiry_datestring卡到期日期201912
cardholderstring卡持有人姓名Ivan Petrov
payment_systemstring支付系统Visa
payment_system_imagestring支付系统标志链接https://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Visa_2021.svg/1280px-Visa_2021.svg.png
imagestring卡标志链接http://www.sberbank.ru/common/img/uploaded/craftmigrate/retail/page_1635249630987/images/50a5ed66-5854-43ae-b368-e65e93207771/1673605800000_16801_teaser_teaserimageurl.jpg
paysysstring支付运营商名称RBS
paysys_imagestring支付运营商标志链接https://www.sberbank.ru/common/img/uploaded/redirected/s_m_business/acquiring/assets/images/intro@2x.png
payment_waystring支付方式SberPay
payment_way_codestring支付方式标识符SberPay
payment_way_logostring支付方式标志链接https://cdn1.telegram.one/i/f7640dada78306b1c993e04001b8738d/828b1eb30921659e22e53a9edc92c4c4/24e01830d213d75deb99c22b9cd91ddd
bank_info{}object银行信息

body.payment_info.payment_params

属性类型描述填写示例
keystring参数名称googlePurchaseToken
valuestring参数值ameinkbophchljaejnocadib

body.payment_info. device_info

属性类型描述填写示例
device_platform_typestring设备平台iOS
device_platform_versionstring平台操作系统版本13.6.1
device_modelstring设备型号iPhone7
device_manufacturerstring制造商Apple
device_idstring设备序列号83c3f257-46d8-41fe-951b-f79d04e288c2
surfacestringRuStore
surface_versionstring软件版本11.5.0

body.payment_info.loyalty_info

属性类型描述填写示例
service_codestring奖励计划代码sbrf_spasibo
service_namestring奖励计划名称Sberbank 谢谢
change_ratenumber积分兑换卢布的系数1
payment_bonusnumber使用积分支付发票的金额(以戈比计算)19800
award_bonusnumber用于积分计算的资金总额,在支付订单时指明以最小单位(即戈比)21850
imagestring图片链接https://cdn-icons-png.flaticon.com/512/3473/3473861.png

body.payment_info.bank_info

属性类型描述填写示例
bank_namestring发行银行名称俄罗斯联邦储蓄银行股份公司
bank_country_codestring发行银行的国家代码RU
bank_country_namestring发行银行的国家名称俄罗斯
bank_imagestring银行标志链接https://emoji.slack-edge.com/TKK9DHNCV/sber/ad2df81a6cd9812d.png

body. payment_methods

属性类型描述填写示例
user_messagestring用户的消息(非必需)为了连接订阅,请在移动应用程序中保存您的银行卡信息
methods\[\]array支付选项

body. payment_methods.methods []

属性类型描述填写示例
methodstring代码QR
actionstring名称通过QR码支付

示例回复:

{
"code": "OK",
"message": null,
"body": {
"invoice_id": "2850",
"invoice_date": "2023-07-18T14:31:33+03",
"invoice_status": "confirmed",
"application_code": "3399750",
"application_name": "Маша и медведь",
"owner_code": "4384191",
"owner_name": "ООО \"Нарана\"",
"payment_info": {
"payment_date": "2023-07-18T14:31:42+03",
"payment_id": "82022-123456",
"payment_params": null,
"loyalty_info": null,
"card_id": "193",
"paysys_code": "RBS-shortname",
"masked_pan": "XX1111",
"expiry_date": "202412",
"payment_system": "Visa",
"payment_system_image": "https://smartmarket.online.sberbank.ru/image/visa.png",
"paysys_image": null,
"payment_way": "Оплата сохраненной картой",
"payment_way_code": "CARD_BINDING",
"payment_way_logo": "https://static.tildacdn.com/tild6236-3530-4235-b966-326630656238/___14_-removebg-prev.png",
"bank_info": {
"bank_name": "Sberbank",
"bank_country_code": "SU",
"bank_country_name": null,
"bank_image": null
},
"device_info": null,
"name": null,
"cardholder": "CARDHOLDER NAME",
"image": null,
"paysys": "RBS"
},
"payment_methods": null,
"error": {
"user_message": "Счет подтвержден",
"error_description": "",
"error_code": 0
},
"invoice": {
"delivery_info": {
"delivery_type": null,
"address": {
"country": null,
"city": null,
"address": null
},
"description": null
},
"invoice_params": [
{
"key": "inapp_serviceparam_message_about_loyalty",
"value": "Оплатить подписку сейчас можно бонусами, а продлить её — только за рубли."
},
{
"key": "inapp_serviceparam_action_name",
"value": "Подключить подписку"
},
{
"key": "inapp_serviceparam_features",
"value": "VERIFY"
},
{
"key": "period_type",
"value": "DAY"
},
{
"key": "period_duration",
"value": "1"
},
{
"key": "current_period",
"value": "STANDARD"
},
{
"key": "payment_type",
"value": "INITIAL"
}
],
"purchaser": {
"email": null,
"phone": null,
"contact": null
},
"order": {
"order_id": "a090a93c-ca06-493d-a90a-ce2bac722358",
"order_number": "311",
"order_date": "2023-07-18T14:31:33+03",
"service_id": "4720",
"expiration_date": "2023-07-18T14:51:33+03",
"tax_system": null,
"trade_name": null,
"visual_name": "Покупка/Продление подписки",
"org_name": "ООО Супер ООО",
"org_inn": "4419198349",
"visual_amount": "1 ₽",
"order_bundle": [
{
"position_id": 1,
"item_params": [
{
"key": "_auto_itemAttributes_agent_info.type",
"value": "7"
},
{
"key": "_auto_itemAttributes_supplier_info.name",
"value": "ООО \"Нарана\""
},
{
"key": "_auto_itemAttributes_supplier_info.inn",
"value": "4419198349"
}
],
"item_amount": 100,
"item_code": "1day",
"item_price": 100,
"discount_type": null,
"discount_value": null,
"interest_type": null,
"interest_value": null,
"tax_type": 6,
"tax_sum": null,
"name": "Оплата за покупку подписки \"1day\". Провайдер: \"Покупка/Продление подписки\"",
"quantity": {
"value": 1,
"measure": "шт"
},
"currency": "RUB",
"image": ""
}
],
"amount": 100,
"currency": "RUB",
"purpose": "1day",
"description": "1day",
"language": "ru-RU"
}
},
"image": ""
},
"timestamp": "2023-08-02T10:11:04.655684723+03:00"
}

请求验证

在接收请求时,将检查通过获取授权令牌方法获得的授权令牌:

  • 所有者和/或应用程序不应被封锁;
  • 令牌应该是有效的;
  • 应用程序代码 application_code 应该与获得授权令牌的所有者相对应。