Documentation/API Reference

API REFERENCE

Cancel Payment

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

Cancel Payment

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

Request parameters1

Required fields first

Cancel Payment

trade_idRequiredstringdata.trade_idYabandPay order number

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

This API cancels payment orders, including unpaid, paid, and successfully authorized orders.

If you have not received YabandPay's final payment result (success or failure), or want to close a payment order, call this API to cancel it.

Tip

  1. Time limit: Payment orders can only be cancelled within the specified window, from transaction initiation until 00:30 on the following day (T+1 day 00:30), Central European time.
  1. Amount restriction: Cancellation must be for the full amount. Partial cancellation is not supported.
  1. Refund restriction: A payment order cannot be cancelled if any refund operation has been performed on it.
  1. Settlement and fees: Cancelled payment orders are not cleared or settled, and YabandPay does not charge any transaction fees.
ParameterTypeDescriptionRequired
userStringCashier account UIDRequired
signStringSignatureRequired
methodStringv3.CancelPaymentRequired
timeLongTimestampRequired
  • Parameters
ParameterTypeDescriptionRequired
trade_idStringYabandPay order numberRequired

Signature example:

Sorted parameters concatenated into a URL-style query string

"method=v3.CancelPayment&time=1546588959&trade_id=4a49ffb3-a30f-ba92-9422-1969afb6f121&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.CancelPayment",
	"time": 1546588959,
	"data": {
		"trade_id": "4a49ffb3-a30f-ba92-9422-1969afb6f121"
    }
}

Response example:

{
    "status": true,
    "code": "200",
    "data": {
        "type": "payment",
        "user": "YOUR_CASHIER_UID",
        "amount": "0.10",
        "currency": "EUR",
        "trade_id": "4a49ffb3-a30f-ba92-9422-1969afb6f121",
        "description": "YabandPay test",
        "order_id": "YOUR_ORDER_ID",
        "createDate": "1706771212",
        "demo": "test",
        "transaction_id": "",
        "state": "cancelled"
    },
    "message": ""
}

Additional information:

Response result:
  1. If cancellation succeeds, "status": true is returned.
  2. If cancellation fails, "status": false is returned.

Call Order Query to check the order status. If the order status state is cancelled, cancellation succeeded.

Response codes:
StatusCodeMessage
true200
false-4111Exceed cancel window
false-4112The transaction has been cleared cannot be cancelled
false-4114The trade_id does not exist
false-4115The transaction cannot be cancelled
false-4116The transaction has been cancelled
false-4117The transaction has been Expired