Documentation/API Reference

API REFERENCE

Voucher

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

Voucher

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

Request parameters11

Required fields first

Introduction

pay_methodRequiredstringdata.pay_methodonline
sub_pay_methodRequiredstringdata.sub_pay_methodVoucher
amountRequiredstringdata.amountNumeric amount. For example, € 24.99 must be written as 24.99; euro amount>=1
currencyRequiredstringdata.currencyEUR
descriptionRequiredstringdata.descriptionOrder description
timeoutRequiredstringdata.timeoutExpiration time in minutes (0-1440)
notify_urlRequiredstringdata.notify_urlAsynchronous notification URL after payment
Optional parameters 4
demoOptionalstringdata.demoCustom field
redirect_urlOptionalstringdata.redirect_urlRedirect URL after payment completion when using the hosted page
cardnumberOptionalstringdata.cardnumberGift card number (not required when redirecting to the hosted page)
pincodeOptionalstringdata.pincodeGift card PIN (required if cardnumber is provided)

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

Applies to: gift cards

This payment method uses gift card funds to pay for an order. Gift cards must be activated at the point of sale.

ParameterTypeDescriptionRequired
userStringCashier account UIDRequired
signStringSignatureRequired
methodStringv3.CreatePaymentsVoucherRequired
timeLongTimestampRequired
  • Parameters
ParameterTypeDescriptionRequired
pay_methodStringonlineRequired
sub_pay_methodStringVoucherRequired
order_idStringMerchant order IDRequired
amountStringNumeric amount. For example, € 24.99 must be written as 24.99; euro amount>=1Required
currencyStringEURRequired
descriptionStringOrder descriptionRequired
demoStringCustom fieldOptional
timeoutStringExpiration time in minutes (0-1440)Required
redirect_urlStringRedirect URL after payment completion when using the hosted pageOptional
notify_urlStringAsynchronous notification URL after paymentRequired
cardnumberStringGift card number (not required when redirecting to the hosted page)Optional
pincodeStringGift card PIN (required if cardnumber is provided)Optional

Signature example:

Sorted parameters concatenated into a URL-style query string

"amount=0.01&cardnumber=6064364245787814896&currency=EUR&demo=test&description=YabandPay test VVV&method=v3.CreatePaymentsVoucher&notify_url=https://www.yabandpay.com/notify&order_id=202405110140188881&pay_method=online&pincode=568971&redirect_url=https://www.yabandpay.com&sub_pay_method=Voucher&time=1546588959&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.CreatePaymentsVoucher",
    "time": 1546588959,
    "data": {
        "description": "YabandPay test VVV",
        "timeout": "0",
        "pay_method": "online",
        "sub_pay_method": "Voucher",
        "order_id": "YOUR_ORDER_ID",
        "amount": "0.01",
        "currency": "EUR",
        "redirect_url": "https://www.yabandpay.com",
        "notify_url": "https://www.yabandpay.com/notify",
        "demo": "test",
        "cardnumber": "6064364245787814896",
        "pincode": "568971"
    }
}

Response example:

{
    "status": true,
    "code": "200",
    "data": {
        "order_id": "YOUR_ORDER_ID",
        "trade_id": "535ea4a1-917a-bc14-58e2-d1565720af90",
        "amount": "0.01",
        "currency": "EUR",
        "settlement_amount": "0.01",
        "settlement_currency": "EUR",
        "exchange_rate": "1",
        "url": "",
        "state": "processing"
    },
    "message": ""
}

Hosted page integration:

Use this method to verify the gift card number and PIN on the YabandPay hosted page. In this case, do not pass cardnumber or pincode. After the API call, redirect to the returned url to continue the payment flow.

Request example:

{
    "user": "YOUR_CASHIER_UID",
    "sign": "YOUR_SIGNATURE",
    "method": "v3.CreatePaymentsVoucher",
    "time": 1546588959,
    "data": {
        "description": "YabandPay test VVV",
        "timeout": "0",
        "pay_method": "online",
        "sub_pay_method": "Voucher",
        "order_id": "YOUR_ORDER_ID",
        "amount": "0.01",
        "currency": "EUR",
        "redirect_url": "https://www.yabandpay.com",
        "notify_url": "https://www.yabandpay.com/notify",
        "demo": "test"
    }
}

Response example:

{
    "status": true,
    "code": "200",
    "data": {
        "order_id": "YOUR_ORDER_ID",
        "trade_id": "c0d9c0bb-0b40-1cb6-7373-fd1a97c7124e",
        "amount": "0.01",
        "currency": "EUR",
        "url": "https://pay.yabandpay.com/payments/callback/order/YzBkOWMwYmItMGI0MC0xY2I2LTczNzMtZmQxYTk3YzcxMjRl",
        "state": "processing"
    },
    "message": ""
}

Additional information:

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

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

We strongly recommend using both Query Order and Asynchronous Notifications to keep payment statuses accurate and up to date.

Response codes:
StatusCodeMessage
true200
false-1000Internal error
false-104000You have entered an invalid amount
false-104221The voucher has insufficient funds
false-104222Invaild PinCode
false-104223This is an invalid giftcard, we are unable to find the giftcard brand