Documentation/API Reference

API REFERENCE

Swish

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

Swish

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

Request parameters9

Required fields first

Introduction

pay_methodRequiredstringdata.pay_methodonline
sub_pay_methodRequiredstringdata.sub_pay_methodSwish
amountRequiredstringdata.amountNumeric amount. For example, EUR 24.99 must be written as 24.99
currencyRequiredstringdata.currencyEUR
descriptionRequiredstringdata.descriptionOrder description
timeoutRequiredstringdata.timeoutExpiration time in minutes (0-1440)
notify_urlRequiredstringdata.notify_urlAsynchronous notification URL after payment
Optional parameters 2
demoOptionalstringdata.demoCustom field
redirect_urlOptionalstringdata.redirect_urlRedirect URL after payment

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

Swish supports creating online payment orders by setting pay_method to online and sub_pay_method to Swish.


ParameterTypeDescriptionRequired
userStringCashier account UIDRequired
signStringSignatureRequired
methodStringv3.CreatePaymentsRequired
timeLongTimestampRequired
  • Parameters
ParameterTypeDescriptionRequired
pay_methodStringonlineRequired
sub_pay_methodStringSwishRequired
order_idStringMerchant order IDRequired
amountStringNumeric amount. For example, EUR 24.99 must be written as 24.99Required
currencyStringEURRequired
descriptionStringOrder descriptionRequired
demoStringCustom fieldOptional
timeoutStringExpiration time in minutes (0-1440)Required
redirect_urlStringRedirect URL after paymentOptional
notify_urlStringAsynchronous notification URL after paymentRequired

Signature example:

Sorted parameters concatenated into a URL-style query string

"amount=1&currency=EUR&demo=test&description=YabandPay test&method=v3.CreatePayments&notify_url=https://www.yabandpay.com/notify&order_id=20240726785412369&pay_method=online&redirect_url=https://www.yabandpay.com&sub_pay_method=Swish&time=1646388458&timeout=0&user=YOUR_CASHIER_UID"

Sign the resulting stringA using secret_key.

The resulting signature is:

"YOUR_SIGNATURE"

Request example:

{
  "user": "YOUR_CASHIER_UID",
  "sign": "YOUR_SIGNATURE",
  "method": "v3.CreatePayments",
  "time": 1646388458,
  "data": {
    "description": "YabandPay test",
    "timeout": "0",
    "pay_method": "online",
    "sub_pay_method": "Swish",
    "order_id": "YOUR_ORDER_ID",
    "amount": "1",
    "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": "0b43eaa1-0146-4f41-acf6-1c27c8809d55",
    "amount": "1.00",
    "currency": "EUR",
    "url": "https://pay.yabandpay.com/pay_method/c3dpc2g=/MGI0M2VhYTEtMDE0Ni00ZjQxLWFjZjYtMWMyN2M4ODA5ZDU1",
    "state": "processing"
  },
  "message": ""
}

Additional information:

Response result:
  1. If the call succeeds, "status": true is returned.

  2. If the call fails, "status": false is returned.

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

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