Skip to main content

Recurring


  • Description: Make recurring payment form subscribed customer
  • Path: /hosted-checkout/recurring
  • Method: POST
  • Request Header: Content-Type: application/json

Request Parameters

ParameterTypeRequired/optionalDescription
merchantIdstringRequiredMerchant identifier
amountnumberRequiredRecurring amount
merchantReferencestringRequiredAn unique reference to identify the recurring order, different from the reference of the parent order
parentOrderIdnumberRequiredOrder ID which is returned from response of PayAPI Create: /hosted-checkout/create

Example:

{
    "request": "{\"merchantId\":3,\"merchantReference\":\"merRef1656607451426\",\"amount\":20,\"parentOrderId\":5583}",
    "signature": "gjlsOvmWKy639oOwcrns7TzLeSgjpdddSsdI0/xJQ32p/qdf7Q/vFTopIeAbY+o0lMdP8EjesrcAwxwmeOHvQD0Wj9GaRf3gF3RpiPNZOjbrs8J8YajGuANWg0nyv67ntf9wdK7Y4lsXvwpYEQ1Lw07z5c29RVKJAXjptydontXX3Fi9pRvTaHMWlCsPmSDsj8PSQetKO8CH5Qdf6lKh3188RB96XUF+X+wtOq3Qj3Mzced2egx9/MJjjUr83rKx9b3fCdS1AHN18PEo4d9nsZXKBVYB+JmqRR9hG359/6L9TaWZmEW7ObitNHZ++CgnuZx1UeJPyZaQ58iSoI310g=="
}

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 recurring 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 transaction if supported by the payment method
transaction.stanstringRequiredSystem trace audit number for the transaction

Example:

{
      "responseCode": "0000",
      "message": "Success",
      "order": {
        "id": 5584,
        "merchantId": 3,
        "merchantReference": "merRef1656607451426",
        "currency": "HKD",
        "amount": 20,
        "netAmount": 20,
        "cardType": "MASTER",
        "createTime": "2022-06-30T16:44:11.708+00:00",
        "updateTime": "2022-06-30T16:44:14.141+00:00",
        "status": "SUCCESS",
        "recurring": true
      },
      "transaction": {
        "id": 3770,
        "merchantId": 3,
        "type": "SALE",
        "amount": 20,
        "status": "SUCCESS",
        "maskedPan": "552343XXXXXX9425",
        "stan": "3770"
      }
}