Documentación/Referencia de API

API REFERENCE

Pedido de pago unificado

Parámetros de API, instrucciones de firma y ejemplos de solicitud y respuesta de la documentación existente de la API SimplePay.

POSThttps://mapi.yabandpay.com/Payments
Live API
API PLAYGROUND · Live API

Pedido de pago unificado

POSThttps://mapi.yabandpay.com/Payments
Automatically signed with your credentials

Request parameters9

Required fields first

统一下单支付

pay_methodRequiredstringdata.pay_methodonline
sub_pay_methodRequiredstringdata.sub_pay_methodWeChat Pay,Alipay,YabandPay
amountRequiredstringdata.amount金额数字。例如 € 24.99 应该写成24.99,CNY金额>=1,欧元金额>=0.1
currencyRequiredstringdata.currency货币代码,ISO 4217,例如EUR,CHF
descriptionRequiredstringdata.description订单描述
timeoutRequiredstringdata.timeout过期时间单位分钟(0-1440)
redirect_urlRequiredstringdata.redirect_url支付完成后跳转地址
notify_urlRequiredstringdata.notify_url支付完成后异步通知地址
Optional parameters 1
demoOptionalstringdata.demo自定义字段

Credentials stay on this page. Your secret key is never stored or sent to the documentation server.

Parámetros

ParameterTypeDescripciónObligatorio
data.pay_methodstringonline✓
data.sub_pay_methodstringWeChat Pay,Alipay,YabandPay✓
data.order_idstring商户的订单ID✓
data.amountstring金额数字。例如 € 24.99 应该写成24.99,CNY金额>=1,欧元金额>=0.1✓
data.currencystring货币代码,ISO 4217,例如EUR,CHF✓
data.descriptionstring订单描述✓
data.demostring自定义字段—
data.timeoutstring过期时间单位分钟(0-1440)✓
data.redirect_urlstring支付完成后跳转地址✓
data.notify_urlstring支付完成后异步通知地址✓

Supported payment methods: WeChat Pay and Alipay

Consejo

Please note that this payment option only supports WeChat Pay and Alipay. We recommend the Hosted Checkout, which includes all enabled payment methods.

ParámetroTipoDescripciónObligatorio
userStringCashier account UIDObligatorio
signStringSignatureObligatorio
methodStringv3.CreatePaymentsObligatorio
timeLongTimestampObligatorio
  • Parameters
ParámetroTipoDescripciónObligatorio
pay_methodStringonlineObligatorio
sub_pay_methodStringWeChat Pay,Alipay,YabandPayObligatorio
order_idStringMerchant order IDObligatorio
amountStringAmount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1.Obligatorio
currencyStringISO 4217 currency code, for example EUR or CHFObligatorio
descriptionStringOrder descriptionObligatorio
demoStringCustom fieldOpcional
timeoutStringExpiration time in minutes (0-1440)Obligatorio
redirect_urlStringRedirect URL after paymentObligatorio
notify_urlStringAsynchronous notification URL after paymentObligatorio

Signature example:

Sorted parameters concatenated into a URL-style query string

 "amount=0.1&currency=EUR&demo=test&description=YabandPay test&method=v3.CreatePayments&notify_url=https://www.yabandpay.com/notify&order_id=2024849687894683&pay_method=online&redirect_url=https://www.yabandpay.com&sub_pay_method=WeChat Pay&time=1555498137&timeout=0&user=YOUR_CASHIER_UID" 

Sign stringA using secret_key

The resulting signature is:

"YOUR_SIGNATURE"

Request example:

 {
  "user": "YOUR_CASHIER_UID",
  "sign": "YOUR_SIGNATURE",
  "method": "v3.CreatePayments",
  "time": 1555498137,
  "data": {
    "amount": "0.2",
    "currency": "EUR",
    "demo": "test",
    "description": "YabandPay test",
    "notify_url": "https://www.yabandpay.com/notify",
    "order_id": "YOUR_ORDER_ID",
    "pay_method": "online",
    "redirect_url": "https://www.yabandpay.com",
    "sub_pay_method": "WeChat Pay",
    "timeout": "0"
  }
}

Response example:

 {
  "status": true,
  "code": "200",
  "data": {
    "order_id": "YOUR_ORDER_ID",
    "trade_id": "4552eeea-1ae8-1e40-3b4b-802dc2f5686a",
    "amount": "0.2",
    "currency": "EUR",
    "settlement_amount": "0.2",
    "settlement_currency": "EUR",
    "exchange_rate": "1",
    "url": "https://pay.yabandpay.com/payments/callback/order/NDU1MmVlZWEtMWFlOC0xZTQwLTNiNGItODAyZGMyZjU2ODZh",
    "state": "processing"
  },
  "message": ""} 

1. Desktop or tablet browser

In a desktop or tablet browser, the merchant generates a QR code for the customer to scan and pay.

YabandPay supports native WeChat Pay and Alipay QR codes, as well as unified payment QR codes supporting both WeChat Pay and Alipay.

The merchant can redirect to the URL returned by the YabandPay API to generate a native WeChat Pay or Alipay payment QR code.

For a unified payment QR code, the merchant can encode the URL returned by the YabandPay API as a QR code and display it to the customer, then poll Query Order for the payment result or wait for an asynchronous notification.

2. Unified payments

YabandPay launches the appropriate WeChat Pay or Alipay payment flow according to the browser environment and use case (PC, H5, App, etc.).

sub_pay_method=

Browser typeWeChat PayAlipayYabandPay
Mobile browserGenerate a WeChat Pay QR code (launch WeChat Pay if H5 is enabled)Launch AlipayGenerate a unified QR code
Webview in a mobile AppGenerate a WeChat Pay QR codeLaunch AlipayGenerate a unified QR code
WeChat browser (inside the WeChat App)Launch WeChat PayGenerate an Alipay QR codeLaunch WeChat Pay
Alipay browser (inside the Alipay App)Generate a WeChat Pay QR codeLaunch AlipayLaunch Alipay
All desktop browsersGenerate a WeChat Pay QR codeGenerate an Alipay QR codeGenerate a unified QR code

Additional information:

Response result:
  1. A successful request returns "status": true.

  2. A failed request returns "status": false.

Recomendamos encarecidamente utilizar tanto Consulta de pedido como Notificaciones asíncronas para mantener los estados de pago precisos y actualizados.

Response codes:
StatusCodeMessage
true200Success
false-1000Internal error
false-3001Required field is missing
false-403The signature Error
false-4011Not support the payment method