Skip to main content

Void


  • Description: Void the order if the payment method allows
  • Path: /hosted-checkout/void
  • Method: POST
  • Request Header: Content-Type: application/json

Request Parameters

ParameterTypeRequired/optionalDescription
merchantIdstringRequiredMerchant identifier
orderIdnumberConditionalOrder ID of the payment. Required when merchantReference is not given
merchantReferencestringConditionalUnique reference of the order. Required when orderId is not given

Example:

{
    "request": "{\"merchantId\":3,\"orderId\":5570}",
    "signature": "0hQ714e4KZ8uAktdRPS75LXTftfddHhYMiZ4zHW+O9Yywcdg8JkBzpYFeeb0OfaY55ZlmZesVgd+y7G14aojm7pRV0ZHhYHBtHXPat4TRuZQdtcAbuAU7j3WM4lupw1nfLrn5zvEmo41fPR725/C2qS8SRa/7lUWLKnVC5H4vN7MCc7v60AoKPxMnpAkIVfu9qT3QeD23kf720bkv0g33TAzvByqWz4rtUPu1i4OHekY5orQoq7C1T0Kr/nG/28BCmCTk/y6VkYqV+vfZBwbU1gXGuw2Z+3HeSHordAFybPzZy7L7b8HaC59Np474WbXqZshfbOHgMS8JCJxfXMNXw=="
}

Response Parameters

ParameterTypeRequired/optionalDescription
responseCodestringRequiredPayment Gateway response code
messagestringRequiredPayment Gateway response message
orderobjectRequired 
order.idnumberRequiredOrder identifier
order.merchantIdnumberRequiredMerchant identifier which own this order
order.merchantReferencestringRequiredYour reference for the order
order.currencystringRequired3-Letters ISO currency code of the order
order.amountnumberRequiredOrder amount
order.netAmountnumberRequiredNet amount of the order
order.cardTypestringRequiredCard type of the order
order.emailstringRequiredCustomer's email if provided
order.createTimedatetimeRequiredTimestamp when the order is created. Maintained by the Payment Gateway
order.updateTimedatetimeRequiredTimestamp when the order is last updated. Maintained by the Payment Gateway
order.statusstringRequiredStatus of the order. Maintained by the Payment Gateway
order.recurringbooleanRequiredFlags the order is a recurring order or not
transactionobjectRequired 
transaction.idnumberRequiredTransaction identifier for the void transaction
transaction.merchantIdnumberRequiredMerchant identifier which own this transaction
transaction.typestringRequiredTransaction type
transaction.amountnumberRequiredTransaction amount
transaction.statusstringRequiredStatus of the transaction. Maintained by the Payment Gateway
transaction.maskedPanstringRequiredMasked card number of the original sale transaction if supported by the payment method
transaction.stanstringRequiredSystem trace audit number for the transaction

Example:

{
    "responseCode": "0000",
    "order": {
        "id": 5570,
        "merchantId": 3,
        "merchantReference": "merRef1656603707555",
        "currency": "HKD",
        "amount": 50.00,
        "netAmount": 0,
        "cardType": "MASTER",
        "createTime": "2022-06-30T15:41:48.000+00:00",
        "updateTime": "2022-06-30T15:42:16.000+00:00",
        "status": "VOIDED",
        "recurring": false
    },
    "transaction": {
        "id": 3754,
        "merchantId": 3,
        "type": "SALE_VOID",
        "amount": 50.00,
        "currency": "HKD",
        "status": "SUCCESS",
        "maskedPan": "545668XXXXXX9797",
        "stan": "S3753"
    }
}