Warning: Constant WP_MEMORY_LIMIT already defined in /var/www/wordpress/wp-config.php on line 116

Warning: Cannot modify header information - headers already sent by (output started at /var/www/wordpress/wp-config.php:116) in /var/www/wordpress/wp-includes/feed-rss2.php on line 8
API Reference – Payex is now Xendit https://payex.io Your Business. Our Priority. Tue, 28 Oct 2025 06:25:50 +0000 en-US hourly 1 https://wordpress.org/?v=6.9 /wp-content/uploads/2025/10/cropped-05-xendit_monogram-32x32.png API Reference – Payex is now Xendit https://payex.io 32 32 Introduction https://payex.io/docs/introduction/ Wed, 29 Nov 2023 00:23:52 +0000 https://payex.io/?post_type=docs&p=2883 Welcome! Here at Payex, our mission is to provide payments that help merchants sell more and maximize your sales.

The Payex API is organized around REST to make it clearer and easier to understand. All our API responses return JSON, including errors.

API Environment Summary

There are two servers for our API, one for sandbox and the other for production environments. You may test with sandbox endpoints before going into production, which doesn’t affect your live data or interact with live banking networks. 

The secret API key you use to authenticate the request determines whether the request is sandbox mode or production mode. Do not use Production Secret in the Sandbox Environment, or vice versa, as it will fail. API requests without authentication will also fail. 

You may get your API secret from Payex Portal links below. The login credentials are sent to the registered merchant email, titled “Account Set Up Successful” by Payex (contact@payex.io):

Note: To access the Sandbox portal, merchant to login with your registered email address and default password = “Password

Before you start

Go to https://portal.payex.io/Home/Register to sign up as a merchant. 

Submit all required documents as shown in the merchant portal and get approval from our processing team. If you need more assistance, please contact us at merchantsupport@payex.io

]]>
Authentication https://payex.io/docs/authentication/ Wed, 29 Nov 2023 03:38:17 +0000 https://payex.io/?post_type=docs&p=2887 In order to start exploring our APIs, make sure that you have registered an account with Payex. 
To authenticate your account, you have to include your secret API key in the request which can be accessed in the Payex Dashboard. Here are the steps to get authorisation token of your account:

Go to Payex Merchant Portal > Settings > Copy to Secret

screenshot 2024 02 29 142201


ParameterTypeCategoryDescriptionExample
SecretstringrequiredUse this for access to APIs, and integration with other e-commerce sites and systems (e.g. WordPress, WooCommerce, AdsHelper, EasyStore etc.)I8W25Imwl1vWVu3KevZGy2fcfAI43Uzp
Go to Payex API > Select the environment > Click “Authorize”
screenshot 2023 11 29 113708

Follow Authorization Steps

screenshot 2023 11 29 115615

Authentication Step 01: Basic (http, Basic)
  1. Under Username, input registered merchant email with Payex.
  2. Under Password (change to Secret), input Secret from Payex Merchant Portal.
  3. Click “Authorize” again. The “Authorize” button should be replaced with the “Logout” button.
screenshot 2023 11 29 120146

Authentication Step 02: Bearer (http, Bearer)
  1. Go to /api/Auth/Token
  2. Click “Try it out” > Click “Execute” > Access token will be returned

  1. Copy the Token
  2. Input the token in the Bearer section under Value in the same Authorize screen.
  3.  Click “Authorize” again

With that, you now have access to the rest of the APIs.


To make it easier to get familiar with Payex Authentication, we’ve published a sample payment flow through Swagger and Postman. Related video:

Payment Request through Swagger

Payment Request through Postman
]]>
Payment Intents API Endpoints https://payex.io/docs/payment-api-endpoints/ Wed, 29 Nov 2023 14:36:15 +0000 https://payex.io/?post_type=docs&p=2913 Create Payment Forms Request

This endpoint provides the following functionalities:

  • Initializes the payment/capture process for FPX, Cards, E-wallets and Subscription Payments (Direct Debit/Auto Debit).
  • Payment forms allow merchants to accept online payments through Payex web applications.
  • Customers can enter payment details or select e-wallet / installment options to complete the payment process from their smartphones and website.

screenshot 2023 11 29 220935
Body ParameterTypeValidationDescriptionExample
amount
required
integerMinimum: 100Actual amount of the transaction. Decimal places support up to two decimal places.

If the amount is not inputted upfront, the corresponding payment method will accept any amount as payment (open-ended amount).
Values should be in cents. For example, MYR 10.00 should be inputted as 1000.

Maximum of MYR 30,000.00 for FPX, and MYR 1,000,000.00 for FPX Corporate.
currency
required
stringDefault is MYRThree-letter code of the transaction’s currency. Will be auto-filled as MYR.MYR
collection_idstringDefault collection id will be used if not providedDWcUMile
capture
conditional
booleanDefault is trueDefault is “true” to capture the payment immediately. 

Set to “false” to authorize payment to be captured at a later date, using the /api/v1/Transactions/Capture endpoint.

Note: To try this, do ensure your account is enabled with pre-authorisation
true
customer_name
required
stringmaxLength = 50Name of the customerJohn Doe
emailstring ($email)maxLength = 50Email of the customerjohn@email.com
contact_numberstringmaxLength = 20Contact number of the customer0123456789
addressstringmaxLength = 200Address of the customer48 Jalan Gembira Taman Desa
postcodestringmaxLength = 10Postcode of the customer57100
citystringmaxLength = 50City of the customerPetaling Jaya
statestringmaxLength = 50State of the customerSelangor
countrystringmaxLength = 50Country of the customerMalaysia
shipping_namestringmaxLength = 50Name of the customer for deliveryJohn Doe
shipping_emailstring ($email)maxLength = 50Email of the customer for deliveryjohn@email.com
shipping_contact_numberstringmaxLength = 20Contact number of the customer for delivery0123456789
shipping_addressstringmaxLength = 200Address of the customer for delivery48 Jalan Gembira Taman Desa
shipping_postcodestringmaxLength = 10Postcode of the customer for delivery57100
shipping_citystringmaxLength = 50City of the customer for deliveryPetaling Jaya
shipping_statestringmaxLength = 50State of the customer for deliverySelangor
shipping_countrystringmaxLength = 2Country of the customer for deliveryMalaysia
descriptionstringmaxLength = 200Free-text field for any additional information during payment creation. Will be null if none is provided.beauty product
reference_numberstringmaxLength = 4080TJCFJeOpPh4r7f1
itemsAny data as long as in the form of array of dictionaries
metadataAny data as long as in the form of array of dictionaries
payment_typestringEnum:
[ card, fpx, ewallet, instalment ]
Authorized values for merchant can be retrieved using the /api/v1/Merchants/TransactionTypes endpoint.card
payment_typesstringEnum:
[ card, fpx, ewallet, instalment ]
Customize payment types that are visible to users for each transaction.

Defaults to all “payment_types” enabled for merchant if not specified.
card
show_payment_typesbooleanWhen “payment_type” is specified, use this flag to determine whether all payment types are visible to users, or just the specified “payment_type“.

Default when “payment_type” is specified is “false“, while default when “payment_type” is unspecified is “true“.
false
tokenizeboolean“true” if Merchant wants to tokenize customer’s card details, else, omit parametertrue
card_on_filestringType of “credential-on-file” / “card-on-file” payment for subsequent usage. Indicates future card-on-file usage where customer can save the card for future checkout.

When “tokenize” is checked, a “card_on_file” will be returned to Merchant at the end of the transaction, that ID must then be stored by Merchant in order to reuse CARD ON FILE functionality.
return_urlstringmaxLength = 150Upon payment, customers can click on a button. Return_url is the link where you want the customer to go back to after clicking the button.<any valid domain>
callback_urlstringmaxLength = 150URL to your server for Payex to update on response<any valid domain>
accept_urlstringmaxLength = 150Redirect URL upon accepted payment. If not provided, return_url will be used.

Note: This is for merchants who manually create payment link directly from Payex portal i.e. after payment is successful → accept_url is where they want customers to be redirected to.
<any valid domain>
reject_urlstringmaxLength = 150Redirect URL upon rejected payment.
If not provided, return_url will be used.

Note: This is for merchants who manually create payment link directly from Payex portal i.e. after payment is rejected → reject_url is where they want customers to be redirected to.
<any valid domain>
noncestringmaxLength = 80Unique identifier to be returned during payment response
sourcestringCustom field to specify source of transaction
send_emailboolean“true” to email payment intent link to recipient as specified by “email” parameterfalse
single_attemptboolean“true” if payment intent can only be attempted once and will be deactivated after the attempt regardless of payment status. “false” if payment intent can be reattempted multiple times and will only be deactivated once “expiry_date” of payment intent has passedfalse
expiry_datestring ($email)Expiry date of the payment intent, after which the payment intent will no longer be valid.

Parameter should be in UTC time zone, following the format of the example. Default is 2 day after creation.
yyyy-MM-ddTHH:mm:ssZ
splits

amount
required

integer

minimum: 100
This section is required if you need to split transactions to other accounts such as marketplace use case.

Values should be in cents. For example, MYR 10.00 should be inputted as 1000, or if 1.00% should be inputted as 100
1000
split_type
required
stringEnum:
(“abs”, “pct”)
Whether split should be absolute amount or percentage amountabs
destination
required
stringPayex Registered Merchant email for transaction split tocontact@payex.io
type
required
stringType of splitplatform
descriptionstringDescription of splitPlatform commission fees

Create Payment Forms Response

screenshot 2023 11 29 233411

A successful Payment Request creation returns a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
Status of paymentApproved
result
status

key

url

error
string

string

string

string

Enum:
[ 00, 99 ]


{api_environment}/Payment/Form/{key}.


Payment Intent ID


Redirect to URL returned to access payment form
messagestringSuccess
screenshot 2023 11 29 233551

Body ParameterTypeValidationDescriptionExample
amountstringActual amount of the transaction. Decimal places support up to two decimal places.

If the amount is not inputted upfront, the corresponding payment method will accept any amount as payment (open-ended amount).
Values should be in cents. For example, MYR 10.00 should be inputted as 1000.

Maximum of MYR 30,000.00 for FPX, and MYR 1,000,000.00 for FPX Corporate.
currencystringThree-letter code of the transaction’s currency. Will be auto-filled as MYR.MYR
customer_namestringName of the customerJohn Doe
descriptionstringFree-text field for any additional information during payment creation. Will be null if none is provided.beauty product
reference_numberstringmaxLength: 40
You may input any reference number here80TJCFJeOpPh4r7f1
mandate_reference_numberstringRefers to reference number for mandate generated by PayexMN10000011621583965
payment_intentstringThis refers to Payment Intent endpoint for creating payment forms.b96165b897c746c0a2a42032e8bfafea
collection_idstringCollection IDowbnr7xq
invoice_idstring
txn_idstringTransaction IDPX10000011627008035
txn_datestring($yyyyMMddHHmmss)Transaction Date20210723104035
external_txn_idstringExternal Transaction ID2009151119230241
responsestringPayment status description. Unique to each payment type
auth_codestringPayment response code. ’00’ – Successful, ’09’ – Pending, ’99’ – Pending when FPX, everything else – Failed. For detailed descriptions of each response code, please refer to reference table sheet at the top of the documentation
auth_numberstringAuthorization Number15733223
fpx_modestringEnum:
[ 01, 02 ]
01 – retail, 02 – corporate
fpx_buyer_namestringName of FPX buyerN@me()/ .-_,&Buyer’`~*;:
fpx_buyer_bank_idstringBank code of FPX buyerRefer to list of FPX buyer bank code
fpx_buyer_bank_namestringBank name of FPX buyerCIMB Bank
card_holder_namestringN@me()/ .-_,&Buyer’`~*;:
card_numberstring************1111
card_expirystring03/27
card_brandstringCan be any of “VISA”, “MASTERCARD”, “UNIONPAY”VISA
card_on_filestring64 alphanumeric key lengthType of “credential-on-file” / “card-on-file” payment for subsequent usage. Indicates future card-on-file usage where customer can save the card for future checkout.761d35566422d504c96a0f28f3637eeea0d9808a73897f533b53dd9850e4dfbb
signaturestringSHA512(secret + | + txn_id)3b0806197e8b948a81b2faff2839b3194b9f52707a336e5039a52204a2591abfbd5d4e5aceec4381b15cf0431e02aa6e2c9d17c255e6e7083e47ccfe
c182cbaa
txn_typestringUsed to differentiate between different transaction typeFPX
FPX CCA
FPX B2B
FPX CCA B2B
Direct Debit
Mandate – Authorization
Mandate – Approval
Mandate – Maintenance
Mandate – Termination
Malaysian Debit Card
Malaysian Credit Card
Foreign Card
Card – Foreign Currency
Auto Debit – Authorization
GrabPay
PayLater by Grab
Postpaid PayLater by Grab Instalment Touch ‘n Go eWallet
ShopeePay
Riipay
Split
Unpaid
noncestringlenKjMY3VInjYHmtSX398aT2socMZGCOkLIQ8OPPeIaerXSVRW0Arzd33dLnd5M8

]]>
Transactions API Endpoint https://payex.io/docs/transactions-api-endpoint/ Wed, 27 Dec 2023 07:16:20 +0000 https://payex.io/?post_type=docs&p=3836 You can use this endpoint to get the status of a transaction or settlement.

  • This API allows you to manage, search and view Transactions and Settlement.
  • This API is equivalent to the “Transactions” and “Settlements” tab from Payex dashboard. See payex.io/docs on how to use transaction and settlement tabs in Payex dashboard.

Get transaction by Transaction ID

Request this endpoint to get specific transaction details by ‘id’ as required parameter below.

screenshot 2023 12 27 131844

Successful response returns parameters below with status code 200

Body ParameterTypeValidationDescriptionExample
txn_datestring($yyyyMMddHHmmss)Transaction date
midstringMerchant ID number
namestringMerchant name
titlestring
collection_idstringDefault collection id will be used if not providedowbnr7xq
invoice_idstringInvoice ID<any string>
txn_idstringTransaction ID of PayexPX10000011627008035
statusstringEnum:
[ 00, 99 ]
Status: 00 if create successfully
Status: 99 if error occurred
00
customer_namestringName of the customerTest Customer
currencystringThree-letter code of the transaction’s currency. Will be auto-filled as MYR.MYR
base_amountnumber($double)Base amount
amountnumber($double)Amount
txn_typestringUsed to differentiate transaction typesFPX
FPX CCA
FPX B2B
FPX CCA B2B
Direct Debit
Mandate – Authorization
Mandate – Approval
Mandate – Maintenance
Mandate – Termination
Malaysian Debit Card
Malaysian Credit Card
Foreign Card
Card – Foreign Currency
Auto Debit – Authorization
GrabPay
PayLater by Grab
Postpaid PayLater by Grab Instalment Touch ‘n Go eWallet
ShopeePay
Riipay
Split
Unpaid
fpx_modestringEnum:
[ 01, 02 ]
Whether or not the customer uses a retail or corporate bank account for FPX payment01 – Retail, 02 – Corporate
fpx_buyer_namestringName of FPX buyerTest Customer
fpx_buyer_bank_idstringBank code of FPX buyerTEST0021

Refer to list of FPX buyer bank code
fpx_buyer_bank_namestringBank name of FPX buyerCIMB Bank
card_holder_namestringCardholder nameN@me()/ .-_,&Buyer’`~*;:
card_numberstringCard number************1111
card_expirystringCard expiration date03/27
card_brandstringCan be any of “VISA”, “MASTERCARD”, “UNIONPAY”VISA
external_txn_idstringExternal Transaction ID2009151119230241
auth_codestringPayment response code00
auth_numberstringAuthorization number15733223
emailstringEmail of customertest@email.com
contact_numberstringContact number of customer0123456789
delivery_addressstringDelivery address of customer48 Jalan Gembira Taman Mega
addressstringAddress of customer48 Jalan Gembira Taman Mega
postcodestringPostcode of customer57100
citystringCity of customerPetaling Jaya
statestringState of customerSelangor
countrystringCountry of customerMalaysia
shipping_namestringName of the customer for deliveryJohn Doe
shipping_emailstringEmail of the customer for deliverytest@email.com
shipping_contact_numberstringContact number of the customer for delivery0123456789
shipping_addressstringAddress of the customer for delivery48 Jalan Gembira Taman Mega
shipping_postcodestringPostcode of the customer for delivery57100
shipping_citystringCity of the customer for deliveryPetaling Jaya
shipping_statestringState of the customer for deliverySelangor
shipping_countrystringCountry of the customer for deliveryMalaysia
descriptionstringFree-text field for any additional information regarding the mandate authorization payment methodBeauty Product
reference_numberstringPassed by merchant as optional parameter.<any string>
mandate_reference_numberstringRefers to reference number for mandate generated by PayexMN10000171626860885
collection_numberstringRefers to collection number generated by PayexCL10000023077b6050c4
collection_reference_numberstringPassed by merchant as optional parameter<any string>
payment_intentstringThis refers to Payment Intent endpoint for creating payment forms.b96165b897c746c0a2a42032e8bfafea
split_typestringType of splitplatform
split_descriptionstringDescription of splitplatform commission fees
itemsstring{
}
metadatastring{
}
voidablestring

Get all transactions

Request this endpoint to get all transactions from a date range using ‘start_date’ and ‘end_date’, or get transactions using specific identifiers like ‘payment_intent’, ‘txn_id’, ‘reference_number’, etc. Use ‘search_text’ if unsure of the actual identifier.

screenshot 2023 12 28 164953
screenshot 2023 12 28 165045

Note: Limit is how many rows to get, for example, 10 limit means will return up to 10 rows, and 10 limit and page 2, means rows 11 to 20 of the results

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
result
txn_date

string($yyyyMMddHHmmss)

Transaction date

20210723104035
midstringMerchant ID1000017
namestringMerchant namePayex
titlestring
collection_idstringCollection IDowbnr7xq
invoice_idstringInvoice ID<any string>
txn_idstringTransaction IDPX10000011627008035
statusstringEnum:
[ 00, 99 ]
Status: 00 if create successfully
Status: 99 if error occurred
customer_namestringName of customerJohn Doe
currencystringThree-letter code of the transaction’s currency. Will be auto-filled as MYR.MYR
base_amountnumber($double)Transaction base amount888
amountnumber($double)Transaction amount888
txn_typestringUsed to differentiate transaction typesFPX
FPX CCA
FPX B2B
FPX CCA B2B
Direct Debit
Mandate – Authorization
Mandate – Approval
Mandate – Maintenance
Mandate – Termination
Malaysian Debit Card
Malaysian Credit Card
Foreign Card
Card – Foreign Currency
Auto Debit – Authorization
GrabPay
PayLater by Grab
Postpaid PayLater by Grab Instalment Touch ‘n Go eWallet
ShopeePay
Riipay
Split
Unpaid
fpx_modestringEnum:
[ 01, 02 ]
Whether or not the customer uses a retail or corporate bank account for FPX payment01 – Retail, 02 – Corporate

fpx_buyer_namestringName of FPX buyerN@me()/ .-_,&Buyer’`~*;:
fpx_buyer_idstringBank code of FPX buyerTEST0021

Refer to list of FPX buyer bank code
fpx_buyer_bank_namestringBank name of FPX buyerCIMB Bank
card_holder_namestringCardholder nameN@me()/ .-_,&Buyer’`~*;:
card_numberstringCard number************1111
card_expirystringCard expiration date03/27
card_brandstringCan be any of “VISA”, “MASTERCARD”, “UNIONPAY”VISA
external_txn_idstringExternal Transaction ID2009151119230241
auth_codestringPayment response code00
auth_numberstringAuthorization Number15733223
emailstringEmail of customertest@email.com
contact_numberstringContact number of customer0123456789
delivery_addressstringDelivery address of customer48 Jalan Gembira Taman Mega
addressstringAddress of customer48 Jalan Gembira Taman Mega
postcodestringPostcode of customer57100
citystringCity of customerPetaling Jaya
statestringState of customerSelangor
countrystringCountry of customerMalaysia
shipping_namestringName of the customer for deliveryJohn Doe
shipping_emailstringEmail of the customer for deliverytest@email.com
shipping_contact_numberstringContact number of the customer for delivery0123456789
shipping_addressstringAddress of the customer for delivery48 Jalam Gembira Taman Desa
shipping_postcodestringPostcode of the customer for delivery57100
shipping_citystringCity of the customer for deliveryPetaling Jaya
shipping_statestringState of the customer for deliverySelangor
shipping_countrystringCountry of the customer for deliveryMalaysia
descriptionstringFree-text field for any additional information regarding the payment method.Annual medical payment
reference_numberstringRefers to reference number generated by Payex. Example for:
– 0% credit card instalment (Ezbeli)
– FPX


79479
OD12497015877a457621
mandate_reference_numberstringRefers to reference number for mandate generated by PayexMN10000174107a3b8050
collection_numberstringRefers to collection number generated by PayexCL10000175f00783ad76
collection_reference_numberstringCollection reference number
payment_intentstringThis refers to Payment Intent endpoint for creating payment forms.b96165b897c746c0a2a42032e8bfafea
split_typestringType of splitplatform
split_descriptionstringDescription of splitplatform commission fees
itemsstring{
}
metadatastring{
}
voidablestring
messagestringSuccess
total_pagesinteger

Get transactions settlements

Request this endpoint to get transaction settlements by ‘start_date’ and ‘end_date’ as required parameters.

screenshot 2023 12 29 111121

Note: Limit is how many rows to get, for example, 10 limit means will return up to 10 rows, and 10 limit and page 2, means rows 11 to 20 of the results

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
result
date

string($yyyyMMdd)

Date
midstringMerchant ID1000017
namestringMerchant namePayex
settled_bystringWhich party settles the transactionPayex
settlement_idstringSettlement IDBA100001720231211
txn_idstringTransaction IDPX1000017e8efd441f8b
reference_numberstringRefers to reference number generated by Payex. Example for:
– 0% credit card instalment (Ezbeli)
– FPX


79479
OD12497015877a457621
mandate_reference_numberstringRefers to reference number for mandate generated by PayexMN1000017c69b3e1954a
collection_numberstringCollection NumberCL1000017f7ae4ba18e9
collection_reference_numberstringCollection Reference Number

Passed by merchant as optional parameter
<any string>
base_currencystringBase currencyMYR
base_amountnumber($double)Base amount 888
base_mdrnumber($double)Base MDR44.4
currencystringThree-letter code of the settlement’s currency. Will be auto-filled as MYR.MYR
gross_amountnumber($double)Gross settlement amount888
mdrnumber($double)Payex fees charged to merchant.

Also known as merchant discount rate (MDR)
44.4
commissionnumber($double)Commission amount of referrer0
net_amountnumber($double)Net settlement amount (after deduction of MDR)843.6
net_amount_payexnumber($double)Net settlement amount (after deduction of Payex MDR)0
net_amount_othersnumber($double)Net settlement amount (after deduction of DCR MDR)843.6
messagestring
total_pagesinteger

Void transaction by Transaction ID

Request this endpoint to cancel pre-authorized transactions with ‘id’ as required parameter.

screenshot 2023 12 29 144520

A successful request returns a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
txn_idstringTransaction IDPX1000017e8efd441f8b
txn_datestringTransaction date20210723104035
external_txn_idstringExternal Transaction ID2009151119230241
auth_codestringPayment response code00
auth_nostringAuthorisation Number
errorstring<Error Description>Invalid Data Format

A bad request returns a HTTP 400 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
txn_idstringTransaction IDPX1000017e8efd441f8b
txn_datestringTransaction date20210723104035
external_txn_idstringExternal Transaction ID2009151119230241
auth_codestringPayment response code00
auth_nostringAuthorisation Number
errorstring<Error Description>Invalid Data Format

Refund transaction by Transaction ID

Request this endpoint to refund transactions with ‘id’ and ‘amount’ as required parameters.

  • All payment types can be refunded via this endpoint except for Online Banking (FPX).
  • Card transactions that have been made on the same day can only be refunded completely.
  • Refunded amounts will either be automatically deducted from merchant upcoming settlement, or a payment link will be generated to prompt merchant for manual payment before transaction can be refunded.
screenshot 2024 01 01 163613

A successful request returns a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
txn_idstringTransaction IDPX1000017e8efd441f8b
txn_datestringTransaction date20210723104035
external_txn_idstringExternal Transaction ID2009151119230241
auth_codestringPayment response code00
auth_nostringAuthorisation Number
refund_urlstringWhen there is no upcoming settlement, or refund amount is more than upcoming settlement, a payment link will be generated to prompt merchant for manual payment before transaction can be refunded
errorstring<Error Description>Invalid Data Format

A bad request returns a HTTP 400 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
txn_idstringTransaction IDPX1000017e8efd441f8b
txn_datestringTransaction date20210723104035
external_txn_idstringExternal Transaction ID2009151119230241
auth_codestringPayment response code00
auth_nostringAuthorisation Number
refund_urlstringWhen there is no upcoming settlement, or refund amount is more than upcoming settlement, a payment link will be generated to prompt merchant for manual payment before transaction can be refunded
errorstring<Error Description>Invalid Data Format

Capture pre-authorized transactions by Transaction ID

Request this endpoint to capture pre-authorized transactions with ‘id’ and ‘amount’ as required parameters.

screenshot 2024 01 01 164635

A successful request returns a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
amountstring
customer_namestringName of customer
descriptionstringFree-text field for any additional information regarding the payment method.
reference_numberstring
mandate_reference_numberstringRefers to reference number for mandate generated by PayexMN10000011621583965

collection_idstringCollection IDowbnr7xq
invoice_idstringInvoice ID
txn_idstringTransaction IDPX10000011627008035
external_txn_idstringExternal Transaction ID2009151119230241
responsestringDescription of auth_codeApproved
auth_codestringPayment response code00
auth_numberstringAuthorization Number15733223
txn_datestringTransaction Date20210723104035
signaturestringSHA512(secret + | + txn_id)3b0806197e8b948a81b2faff2839b3194b9f52707a336e5039a52204a2591abfbd5d4e5aceec4381b15cf0431e02aa6e2c9d17c255e6e7083e47ccfe
c182cbaa

A bad request returns a HTTP 400 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
messagestringBad Request

Get FPX Bank List

Request this endpoint to get FPX Bank List with ‘type’ as required parameter.

screenshot 2024 01 01 165315

A successful request returns a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
idstring
displayNamestring
statusstring

Splits transaction to other merchant accounts

Request this endpoint to splits transaction to other merchant accounts with ‘id’ as required parameter.

screenshot 2024 01 01 165737
Body ParameterTypeValidationDescriptionExample
amount
required
integerminimum: 100Values should be in cents or multiplied by 100. For example, MYR 10.00 should be inputed as 1000, and 1.00% should be inputed as 1001000
split_type
required
stringEnum:
[ abs, pct ]
Whether split should be absolute amount or percentage amountabs
destination
required
stringPayex Registered Merchant email for transaction split tocontact@payex.io
type
required
stringType of splitplatform
descriptionstringDescription of splitPlatform commission fees

A successful request returns a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
Status: 00 if create successfully
Status: 99 if error occurred
resultstring
messagestringSuccess

A bad request returns a HTTP 400 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
Status: 00 if create successfully
Status: 99 if error occurred
resultstring
messagestringBad Request
]]>
Mandates API Endpoints https://payex.io/docs/mandates-api-endpoint/ Thu, 30 Nov 2023 08:19:34 +0000 https://payex.io/?post_type=docs&p=2948 Create Mandates Request

This endpoint provides the following functionalities:

  • Subscriptions payment via online banking (bank account and credit card).
  • Subscriptions payment via Visa/Mastercard (credit card, debit card, foreign card).

screenshot 2023 11 30 155313
Request Body ParameterTypeValidationDescriptionExample
customer_namestringmaxLength: 50Name of customerTan Boon Hua
emailstring($email)maxLength: 50Email of customeruser@example.com
merchant_reference_numberstringmaxLength: 40You may input any reference number here
id_typeinteger
Enum:
[ 1, 2, 3, 4, 5 ]
ID type of customer1 – New IC Number,
2 – Old IC Number,
3 – Passport Number,
4 – Business Registration,
5 – Others
id_numberstringmaxLength: 18ID number of customer900525086780
fpx_modestringEnum:
[ 01, 02 ]
Whether or not the FPX user uses a retail or corporate bank account for FPX payment01 – retail,
02 – corporate
fpx_buyer_bank_idstringmaxLength: 10Bank code of FPX buyerTEST0021

Refer to list of FPX buyer bank code
effective_date
required
string($yyyyMMdd)For example, 20/05/2023 means collect payment on every 20th of month.20/05/2023
expiry_datestring($yyyyMMdd)You may leave it blank if you do not have a date (i.e. if you choose 30/12/2023, the last collection will fall on 20/12/2023)
max_amountintegerminimum: 100
Cannot be lower than 100 (RM1.00)
This refers to the maximum amount of charge to be deducted (e.g. monthly/daily/ weekly).

Values should be in cents.
Example if MYR 10.00 should be inputed as 1000. Maximum of MYR 30,000.00 for FPX, and MYR 1,000,000.00 for FPX Corporate
1000
initial_amountintegerminimum: 100
Cannot be lower than 100 (RM1.00)
This refers to upfront charge during authorization of mandate by customers. Only applicable when debit_type = “AD” (using cards). Specify initial charge of mandate, to be charged on authorization of mandate, outside of the specified collection schedule.

Example, if create a mandate where
auto is set to “false
initial_amount is set to “1000″
max_amount is set to “20000“, merchant will charge immediately 1000 upfront, and every month will charge 20000.

In other words, can for one-time-charges, upfront fees, etc.
1000
frequency
required
stringEnum:
[ DL, WK, MT, QR, YR ]
Frequency of deduction/charge. DL – daily,
WK – weekly,
MT – monthly,
QR – quarterly,
YR – yearly
frequency_interval
required
integerminimum: 1Frequency of deduction/charge interval.

frequency_interval‘ = “3“, and ‘frequency‘ = “MT“, means every 3 months

Example, if merchant wants to deduct twice a month to input
frequency_interval‘ = “2“, and ‘frequency‘ = “WK“.

Note: If our frequency_interval does meet requirement, can create schedule on merchant end.
1
max_frequency
required
integerminimum: 1
maximum: 999
Max number of charges within a collection cycle1
purpose
required
stringmaxLength: 200Free-text field for any additional information regarding the purpose of payment.Monthly subscription
debit_typestringEnum:
[ DD, AD ]
Omit parameter if allow customer to choose debit type. Specify debit type to determine debit type for customerDD – direct debit (using bank account),
AD – auto debit (using card)
return_urlstringmaxLength: 150Upon payment, customers can click on a button e.g. return to merchant site.

Return_url is the link where you want the customer to go back to after clicking the button.
<any valid domain>
callback_urlstringmaxLength: 150URL to your server for Payex to update on mandate response<any valid domain>
accept_urlstringmaxLength: 150Redirect URL upon accepted payment. If not provided, return_url will be used by default.

Note: This is for merchants who manually create payment link directly from Payex portal i.e. after payment is successful → where they want customers to be redirected to.
<any valid domain>
reject_urlstringmaxLength: 150Redirect URL upon rejected payment. If not provided, return_url will be used by default.

Note: This is for merchants who manually create payment link directly from Payex portal i.e.
after payment is rejected
where they want customers to be redirected to.
<any valid domain>
addressstringmaxLength: 200Address of customer48 Jalan Gembira, Taman Desa
postcodestringmaxLength: 10Postcode of customer57100
citystringmaxLength: 150City of customerPetaling Jaya
statestringmaxLength: 50State of customerSelangor
countrystringmaxLength: 2Country of customerMalaysia
metadataAny data as long as in the form of dictionary.
statusstringEnum:
[ Pending, Draft ]
Pending
autobooleanEnable this to auto collect every monthtrue
retrybooleanEnable this to let system auto retry if previous collection has failedtrue
retry_countintegermaximum: 44 (the maximum retry count for system is 4) (i.e. payment failed to collect on 20th, system will retry on 21st, 22nd, 23rd & 24th)4

Create Mandates Response

A successful Mandate Request creation returns a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
Status Codes:
– For mandate authorization, refer to Response Codes with Type = ‘FPX’ for Direct Debit and Response Codes with Type = ‘Card’ for Auto Debit
– For auto debit collection, refer to Response Codes with Type = ‘Card’
– For direct debit collection, refer to Response Codes with Type = ‘BILLING’
resultstring($email)maxLength: 50
statusstringEnum:
[ 00, 99 ]
Status: 00 if create successfully
Status: 99 if error occurred
reference_numberstring<System generated>
keystring<System generated>
urlstring<System generated>
errorstring<Error Description>Invalid Data Format
messagestringSuccess

Create Mandate Response Codes
  • For mandate authorization, refer to Response Codes with Type = ‘FPX’ for Direct Debit and Response Codes with Type = ‘Card’ for Auto Debit
  • For auto debit collection, refer to Response Codes with Type = ‘Card’
  • For direct debit collection, refer to Response Codes with Type = ‘BILLING’

Authorization Callback Response (Mandate Authorization Completion)

This refers to callback response upon mandate authorization completion (for both Direct Debit and Auto Debit) which will be sent via webhook to the specified callback_url. We will be using the charged by cards (Auto Debit) example below:

Body ParameterTypeValidationDescriptionExample
amountstringFor authorization purpose and non-refundable1.00
currencystringCurrencyMYR
customer_namestringName of CustomerTest Customer
descriptionstringFree-text field for any additional information regarding the mandate authorization payment method. Monthly Subscription Plan
reference_numberstringRefers to mandate’s ‘merchant_reference_number’ passed by merchant as optional parameter. <any string>
mandate_reference_numberstringRefers to reference number for mandate generated by PayexMN10000011621583965
payment_intentstringThis refers to Payment Intent endpoint for creating payment forms.b96165b897c746c0a2a42032e8bfafea
collection_idstringCollection IDowbnr7xq
invoice_idstringInvoice ID
txn_idstringTransaction IDPX10000011627008035
txn_datestring
($yyyyMMddHHmmss)
Transaction Date20210723104035
external_txn_idstringExternal Transaction ID2009151119230241
responsestringDescription of auth_codeApproved
auth_codestring– For mandate authorization, refer to Response Codes with Type = ‘FPX’ for Direct Debit and Response Codes with Type = ‘Card’ for Auto Debit
– For auto debit collection, refer to Response Codes with Type = ‘Card’
– For direct debit collection, refer to Response Codes with Type = ‘BILLING’
00
auth_numberstringAuthorization Number15733223
fpx_modestringnull
fpx_buyer_namestringnull
fpx_buyer_bank_idstringnull
fpx_buyer_bank_namestringnull
card_holder_namestringN@me()/ .-_,&Buyer’`~*;:
card_numberstring411111******1111
card_expirystring03/27
card_brandstringCan be any of “VISA”, “MASTERCARD”, “UNIONPAY”VISA
card_on_filestring64 alphanumeric key lengthType of “credential-on-file” / “card-on-file” payment for subsequent usage. Indicates future card-on-file usage where customer can save the card for future checkout.761d35566422d504c96a0f28f3637eeea0d9808a73897f533b53dd9850e4dfbb
signaturestringSHA512(secret + | + txn_id)3b0806197e8b948a81b2faff2839b3194b9f52707a336e5039a52204a2591abfbd5d4e5aceec4381b15cf0431e02aa6e2c9d17c255e6e7083e47ccfe
c182cbaa
txn_typestringEnum:
[ Mandate – Authorization, Auto Debit – Authorization, Malaysia Debit Card, Malaysia Credit Card, Foreign Card ]
Used to differentiate between different callback responses (refer to the list below) 
List of available ‘txn_type’ for callback 
1. Mandate – Authorization
2. Auto Debit – Authorization
3. Mandate – Approval
4. Malaysian Debit Card
5. Malaysian Credit Card
6. Foreign Card

When ‘txn_type’ is either of ‘Mandate – Authorization’ will incur a non-refundable amount of MYR 1.00 to your customer
Auto Debit – Authorization
noncestringlenKjMY3VInjYHmtSX398aT2socMZGCOkLIQ8OPPeIaerXSVRW0Arzd33dLnd5M8

Approval Callback (Mandate Approval for Direct Debit only)

This refers to response upon mandate approval completion which will be sent via webhook to the specified callback_url. There’s two callback for Direct Debit, as first callback is for customer authorization while second callback is for bank approval.

Body ParameterTypeValidationDescriptionExample
application_typestringRefer to mandate authorization, maintenance or rejection. 01
approval_statusstringMandate approval status00
approval_datestringMandate approval date20210721
txn_idstringTransaction ID of PayexPX10000171626952548
reference_numberstringRefers to mandate’s ‘merchant_reference_number’ passed by merchant as optional parameter. <any string>
mandate_reference_numberstringRefers to reference number for mandate generated by PayexMN10000171626860885
record_numberstringRefers to bank reference numberE-20210721Q964879
fpx_modestringEnum:
[ 01, 02 ]
Whether or not the customer uses a retail or corporate bank account for FPX payment01 – Retail, 02 – Corporate
fpx_buyer_namestringName of FPX buyerN@me()/ .-_,&Buyer’`~*;:
fpx_buyer_bank_namestringBank name of FPX buyerCIMB Bank
fpx_buyer_bank_accountstringBank account of FPX buyer********1234
signaturestring68f21dfb966f264dbd996ad809828b8e763bc5798fbefb5ada434af3
c6a87873d525f7066c5b9e9963ef676f2e672d2835779bc59b09522
3a43058dc935b04f3
txn_typestringEnum:
[ Mandate – Approval ]
This is applicable to Direct Debit only.Mandate – Approval

Get Mandate Response

This endpoint allows you to retrieve the details of mandate payment by the following parameters (optional fields):

screenshot 2023 12 18 225312

Note: Limit is how many rows to get, for example, 10 limit means will return up to 10 rows, and 10 limit and page 2, means rows 11 to 20 of the results

If successful, this endpoint returns HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
Status Codes:
– For mandate authorization, refer to Response Codes with Type = ‘FPX’ for Direct Debit and Response Codes with Type = ‘Card’ for Auto Debit
result
id

integer
datestring($yyyyMMddHHmmss)Date when mandate is created
midstringMerchant ID
namestringName of merchant
titlestring
collection_idstringCollection IDowbnr7xq
customer_namestringName of CustomerTest Customer
contact_numberstringContact number of Customer0123456789
emailstringEmail of Customertest@payex.io
txn_idstringTransaction ID of PayexPX10000171626952548
reference_numberstringRefers to reference number for mandate generated by PayexMN10000171626860885
merchant_reference_numberstringRefers to mandate’s ‘merchant_reference_number’ passed by merchant as optional parameter.<any string>
record_numberstringRefers to bank reference numberE-20210721Q964879
status_codestringEnum:
[ 01, 02, 03, 04, 05, 06, 07 ]
Status code of mandate authorisation02
statusstringEnum:
[ Draft, Pending Authorization, Pending Approval, Approved, Rejected, Terminated, Expiry ]
Status of mandate authorisation by customerPending Authorization
approval_status_codestringStatus code of approval00
approval_statusstringStatus of approvalApproved
currencystringCurrencyMYR
max_amountnumber($double)minimum: 100This refers to the maximum amount of charge to be deducted. RM500
amountnumber($double)For authorization purpose and non-refundableRM1.00
fpx_modestringEnum:
[ 01, 02 ]
Whether or not the customer uses a retail or corporate bank account for FPX payment01 – retail,
02 – corporate
fpx_buyer_bank_idstringmaxLength: 10Bank code of FPX buyerTEST0021

Refer to list of FPX buyer bank code
fpx_buyer_bank_namestringBank name of FPX buyerCIMB Bank
fpx_buyer_namestringName of FPX buyerN@me()/ .-_,&Buyer’`~*;:
fpx_buyer_bank_accountstringBank account of FPX buyer********1234
card_holder_namestringCardholder nameN@me()/ .-_,&Buyer’`~*;:
card_numberstringCard number411111******1111
card_expirystringCard expiration date03/27
card_brandstringCan be any of “VISA”, “MASTERCARD”, “UNIONPAY”VISA
card_typestringType of card used for auto debitDebit or Credit
card_idstring64 characters unique identifierID of the store card on file, similar to card_on_file

Type of “credential-on-file” / “card-on-file” payment for subsequent usage. Indicates future card-on-file usage where customer can save the card for future checkout.
761d35566422d504c96a0f28f3637eeea0d9808a73897f533b53dd9850e4dfbb
id_typestringEnum:
[ 1, 2, 3, 4, 5 ]
ID type of customer1 – New IC Number,
2 – Old IC Number,
3 – Passport Number,
4 – Business Registration,
5 – Others
id_numberstringID number of customer900525086780
addressstringAddress of customer48 Jalan Gembira Taman Mega
postcodestringPostcode of customer57100
citystringCity of customerPetaling Jaya
statestringState of customerSelangor
countrystringCountry of customerMalaysia
effective_datestring($yyyyMMdd)For example, 20/05/2023 means collect payment on every 20th of month. 20/05/2023 
expiry_datestring($yyyyMMdd)You may leave it blank if you do not have a date (i.e. if you choose 30/12/2023, the last collection will fall on 20/12/2023)30/12/2023
frequencystringEnum:
[ DL, WK, MT, QR, YR ]
Frequency of deduction/chargeDL – daily,
WK – weekly,
MT – monthly,
QR – quarterly,
YR – yearly
frequency_intervalinteger‘frequency_interval’ = 3, and ‘frequency’ = “MT”, means every 3 months1
max_frequencyintegerMax number of charges within a collection cycle1
dayintegerminimum: 0
maximum: 31
Day of mandate creation
monthintegerminimum: 1
maximum: 12
Month of mandate creation
purposestringmaxLength: 200Purpose of paymentMonthly Subscription
debit_typestringEnum:
[ DD, AD ]
Type of mandateDD – direct debit, AD – auto debit
activebooleanEnable this to make active or active the mandatetrue
autobooleanEnable this to auto collect every monthtrue
retrybooleanEnable this to let system auto retry if previous collection has failedtrue
retry_countinteger44 (the maximum retry count for system is 4) (i.e. payment failed to collect on 20th, system will retry on 21st, 22nd, 23rd & 24th)4
metadata{
}
Any data as long as in the form of dictionary
keystring<System generated>
messagestringSuccess
total_pagesinteger

Update Mandates Request

This endpoint allows you to update mandates (only in Draft status) that have been created using ‘reference_number’ as the request parameter below (required field):

‘reference_number’ refers to reference number for mandate generated by Payex (e.g. MN10000171626860885)

screenshot 2023 12 19 140040
Request Body ParameterTypeValidationDescriptionExample
customer_name
required
stringmaxLength: 50Name of CustomerTest Customer
email
required
string($email)maxLength: 50Email of Customertest@payex.io
contact_numberstringmaxLength: 20Contact Number of Customer0123456789
id_typeintegerEnum:
[ 1, 2, 3, 4, 5 ]
ID Type of Customer1 – New IC Number,
2 – Old IC Number,
3 – Passport Number,
4 – Business Registration,
5 – Others
id_numberstringmaxLength: 18ID Number of Customer900525086780
fpx_modestringEnum:
[ 01, 02 ]
Whether or not the customer uses a retail or corporate bank account for FPX payment01 – retail, 02 – corporate
fpx_buyer_bank_idstringmaxLength: 10Bank code of FPX buyerRefer to list of FPX buyer bank code
effective_date
required
string($yyyyMMdd)yyyyMMddFor example, 20/05/2023 means collect payment on every 20th of month. 20/05/2023
expiry_datestring($yyyyMMdd)yyyyMMddYou may leave it blank if you do not have a date (i.e. if you choose 30/12/2023, the last collection will fall on 20/12/2023)30/12/2023
max_amountintegerminimum: 100Values should be in cents.
Example if MYR 10.00 should be inputed as 1000. Maximum of MYR 30,000.00 for FPX, and MYR 1,000,000.00 for FPX Corporate
1000
initial_amountintegerminimum: 100Only applicable when debit_type = “AD”
frequency
required
stringEnum:
[ DL, WK, MT, QR, YR ]
Frequency of deduction/chargeDL – daily,
WK – weekly,
MT – monthly,
QR – quarterly,
YR – yearly
frequency_interval
required
integerminimum: 1‘frequency_interval’ = 3, and ‘frequency’ = “MT”, means every 3 months1
max_frequency
required
integerminimum: 1
maximum: 999
Max number of charges within a collection cycle1
purpose
required
stringmaxLength: 200Purpose of paymentMonthly Subscription
debit_typestringEnum:
[ DD, AD ]
Only applicable when debit_type = “AD”. Specify initial charge of mandate, to be charged on authorization of mandate, outside of the specified collection schedule. Can use used for one-time-charges, upfront fees, etc.DD – direct debit, AD – auto debit
statusstringEnum:
[ Draft ]
Only “Draft” status of mandate can be updated.Draft
autobooleanEnable this to auto collect every month. If auto is set to false, true
retrybooleanEnable this to let system auto retry if previous collection has failedtrue
retry_countintegermaximum: 44 (the maximum retry count for system is 4) (i.e. payment failed to collect on 20th, system will retry on 21st, 22nd, 23rd & 24th)4
metadataAny data as long as in the form of dictionary

A successful Update Mandate Request will return a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
Status Codes:
– For mandate authorization, refer to Response Codes with Type = ‘FPX’ for Direct Debit and Response Codes with Type = ‘Card’ for Auto Debit
result
status
stringEnum:
[ 00, 99 ]
Status: 00 if create successfully
Status: 99 if error occurred
00
reference_numberstringRefers to reference number for mandate generated by PayexMN10000171626860885
keystring<System generated>
urlstring<System generated>
When update requires customers’ authorization.
errorstring<Error Description>Invalid Data Format
messagestringSuccess

Delete Mandates Request

This endpoint allows you to delete mandates using reference_number as the request parameter below (required field):

‘reference_number’ refers to reference number for mandate generated by Payex (e.g. MN10000171626860885)

screenshot 2023 12 19 152825 1

Note: reference_number is the required parameter for this endpoint and it refers to a list/array of reference numbers for mandate generated by Payex. You may choose to delete multiple mandates at a time and the parameter format will be [“MNxxxx”,”MNxxxx”].

A successful Delete Mandates will return a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
Status Codes:
– For mandate authorization, refer to Response Codes with Type = ‘FPX’ for Direct Debit and Response Codes with Type = ‘Card’ for Auto Debit
result
status

string

Enum:
[ 00, 99 ]
Status: 00 if create successfully
Status: 99 if error occurred
00
reference_numberstringRefers to reference number for mandate generated by PayexMN10000171626860885
keystring<System generated>
urlstring<System generated>
When termination requires customers’ authorization.
errorstring<Error Description>Invalid Data Format
messagestringSuccess

Update Mandate Collection Settings Request

This endpoint allows you to update mandate collection settings with ‘reference_number’ as required parameter:

‘reference_number’ refers to reference number for mandate generated by Payex (e.g. MN10000171626860885)

screenshot 2023 12 19 152415

Body ParameterTypeValidationDescriptionExample
amountintegerminimum: 100For example, if max amount was set as rm100, then here can set to any amount less or equal to max amount for the auto collection.100
dayintegerminimum: 0
maximum: 31
Day of mandate
monthintegerminimum: 1
maximum: 12
Month of mandate
activebooleanEnable this to make active or inactive the mandatetrue
autobooleanEnable this to auto collect every month. If auto is set to false, Payex will wait for merchant’s instructions before next deduction.true
retrybooleanEnable this to let system auto retry if previous collection has failedtrue
retry_countintegermaximum: 44 (the maximum retry count for system is 4) (i.e. payment failed to collect on 20th, system will retry on 21st, 22nd, 23rd & 24th)4

A successful Update Mandate Collection Settings Request will return a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
resultstringList []
messagestring

Create Collections Request

This endpoint allows you to create collection request upon authorisation of mandate by your customers.

screenshot 2023 12 19 155528

Body ParameterTypeValidationDescriptionExample
reference_number
required
stringRefers to reference number for mandate generated by PayexMN10000011621583965
collection_reference_numberstringPassed by merchant as optional parameter<any string>
collection_date
required
string($yyyyMMdd)Date of collection
amountintegerValues should be in cents. For example, MYR 10.00 should be inputed as 1000. Value must be less than or equal to “max_amount” of mandate. Maximum of MYR 30,000.00 for FPX, and MYR 1,000,000.00 for FPX Corporate.
retrybooleanEnable this to let system auto retry if previous collection has failedtrue
retry_countintegermax: 44 (the maximum retry count for system is 4) (i.e. payment failed to collect on 20th, system will retry on 21st, 22nd, 23rd & 24th)
metadataAny data as long as in the form of dictionary

A successful Create Collection Request will return a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
– For auto debit collection, refer to Response Codes with Type = ‘Card’
– For direct debit collection, refer to Response Codes with Type = ‘BILLING’
result
status
stringEnum:
[ 00, 99 ]
Status: 00 if create successfully
Status: 99 if error occurred
reference_numberstringRefers to reference number for mandate generated by PayexMN10000011621583965
collection_numberstringRefers to collection number generated by PayexCL10000023077b6050c4
errorstring<Error Description>Invalid Data Format
messagestring

Collection Callback

Response upon mandate collection completion which will be sent via webhook to the specified callback_url.

Body ParameterTypeValidationDescriptionExample
collection_statusstringDirect Debit (Refer to BILLING response codes) and Auto Debit (Refer to Card response codes)Approved
collection_datestringDate of Collection15/01/2023
txn_idstringTransaction ID of PayexPX10000171626952548
mandate_reference_numberstringRefers to reference number for mandate generated by PayexMN10000171626860885
reference_numberstringRefers to mandate’s ‘merchant_reference_number’ passed by merchant as optional parameter.<any string>
batch_numberstringBatch number is unique number for the batch of collections submitted to bank
collection_numberstringRefers to collection number generated by PayexCL10000023077b6050c4
collection_reference_numberstringPassed by merchant as optional parameter<any string>
amountstringValues should be in cents. For example, MYR 10.00 should be inputed as 1000. Value must be less than or equal to “max_amount” of mandate. Maximum of MYR 30,000.00 for FPX, and MYR 1,000,000.00 for FPX Corporate.
signaturestringSHA512(secret + | + txn_id)3b0806197e8b948a81b2faff2839b3194b9f52707a336e5039a52204a2591abfbd5d4e5aceec4381b15cf0431e02aa6e2c9d17c255e6e7083e47ccfe
c182cbaa
txn_typestringEnum:
[ Direct Debit, Malaysia Debit Card, Malaysia Credit Card, Foreign Card ]
Transaction Type

Read Collections Response

This endpoint allows you to read collections by the following parameters (optional fields):

screenshot 2023 12 21 085730

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
result
id
integer
datestring($yyyyMMddHHmmss)
collection_datestring($yyyyMMdd)Date of Collection15/01/2023
reference_numberstringRefers to reference number for mandate generated by PayexMN10000171626860885
merchant_reference_numberintegerRefers to mandate’s ‘merchant_reference_number’ passed by merchant as optional parameter.<any string>
batch_numberintegerBatch number is unique number for the batch of collections submitted to bank
collection_numberstringRefers to collection number generated by PayexCL10000023077b6050c4
collection_reference_numberstringPassed by merchant as optional parameter<any string>
amountnumber($double)For example, if max amount was set as rm100, then here will be any amount less or equal to max amount for the auto collection.
batch_status_codestringRefers to batch status code under Batch response codes01
batch_statusstringRefers to batch status under Batch response codesPending
collection_status_codestringStatus code of collection00
collection_statusstringDirect Debit (Refer to BILLING response codes) and Auto Debit (Refer to Card response codes)Approved
autobooleanEnable this to auto collect every month. If auto is set to false, Payex will wait for merchant’s instructions before next deduction.true
retrybooleanEnable this to let system auto retry if previous collection has failedtrue
retry_countintegermaximum: 44 (the maximum retry count for system is 4) (i.e. payment failed to collect on 20th, system will retry on 21st, 22nd, 23rd & 24th)4
retry_leftintegerNumber of retry remaining3
retry_datestring($yyyyMMdd)Date of retry
metadataAny data as long as in the form of dictionary
messagestringSuccess
total_pagesinteger

Delete Collections Response

This endpoint allows you to delete collections with ‘collection_number’ as the required parameter below:

screenshot 2023 12 21 093353

A successful Delete Collection will return a HTTP 200 status code with the following response parameters.

Body ParameterTypeValidationDescriptionExample
statusstringEnum:
[ 00, 99 ]
result
status

string

Enum:
[ 00, 99 ]
reference_numberstringRefers to reference number for mandate generated by PayexMN10000171626860885
collection_numberstringRefers to collection number generated by PayexCL10000023077b6050c4
errorstring<Error Description>Invalid Data Format
messagestringSuccess
]]>
API Flow for Subscription Payment (Mandates) https://payex.io/docs/integration-guide-for-subscription-payment/ Thu, 23 Nov 2023 09:19:10 +0000 https://payex.io/?post_type=docs&p=2691 Sign up for a Payex Account

Ensure that you already have a Payex account. You may register here or checkout our Activation page, if otherwise. Once you’ve registered and provided your business documents, your account will be automatically enabled for integration testing access. 

Create a mandate

If all inputs validation and general inputs handling are valid, you’ll receive a SUCCESS response from Payex

What to take note

  • You only have to provide one callback url and we will send different responses to it
  • txn_type’ is used to differentiate between different callback responses. List of available ‘txn_type’ for callback as below:
    • Mandate – Authorization
    • Auto Debit – Authorization
    • Mandate – Approval
    • Malaysian Debit Card
    • Malaysian Credit Card
    • Foreign Card
  • Direct Debit mandate: There’s two callbacks, first callback is for customer authorization and second callback is for bank approval
    • If the customer did not click the payment link, status will be “Pending
    • If the customer clicks the payment link and fills out relevant information and click “Proceed” customer will receive email notification on authorisation.
    • Upon successful collection of 1st payment, customer will receive another email notification.
  • Auto Debit mandate: There’s only one callback for authorization and approval at the same time.
    • If the customer clicks the payment link, the 1st instalment will be collected on the effective date.
    • If you wish to instantly charge customer the 1st instalment during authorisation, include the ‘initial_amount’ parameter.
  • There will be a one-time charge of RM 1 (via bank account) for the purpose of account verification and it takes 1 working day to be approved by RHB
  • There will be no charge (via local / foreign cards) for the purpose of account verification and it is instant approval by Visa/Mastercard
  • Once it has been approved by RHB or Visa/Mastercard then you can start collecting payment from your customers.

What to do next (for success case)

  1. Send mandate link to your customer for authorization
  2. Customer fills out relevant information and submits (Day t)
  3. Wait for Mandate Authorization Callback (Day t)

Direct Debit

Callback for customer authorization

-> Wait for Mandate Approval Callback (Day t + 1 – Next working day after submission)

Callback for bank approval

-> Create Collection Settings for next collection at Day t + 2

Auto Debit

  • If ‘initial_amount‘ > RM1.00

-> System created Collection Settings for you automatically at Day t

  • If ‘initial_amount‘ < RM1.00
-> Create Collection Settings for next collection at Day t

]]>
Usage Based Subscriptions API https://payex.io/docs/usage-based-subscriptions-api/ Wed, 16 Apr 2025 13:54:07 +0000 https://payex.io/?post_type=docs&p=4103 Scenario A: Collect varying amounts at specific month

i) For this example, we will pretend to be a merchant that wants to collect a fixed amount for the first 23 months, followed by collection of different amount only for the final month.

  • I have created a Direct Debit mandate for 24 months, where each month collection is fixed at RM300.00.
  • Now I need to collect only RM150.50 for the final month. How can I update it for the final month via Payex API?

Few ways to do it via Update Mandate Collection Settings Request endpoint /api/v1/mandates/collectionSettings/reference_number:

Option 1: Mandate setting for auto collection to ‘false’

  • If auto = false, Payex will wait for your instructions before next deduction
  • You would need to create one mandate and 24 collections
  • Create collections for 23 months for RM300.00, and final month RM150.50

Option 2: Mandate setting for auto collection to ‘true’

  • If auto = true, system will auto collect every month
  • After 23rd month collection or before 24th month collection, you need to change collection amount to RM150.50

Option 3: Mandate setting for auto collection to ‘true’

  • If auto = true, system will auto collect every month
  • Create collection for the 24th month for RM150.50, then Payex auto collection schedule will skip the 24th month when the time comes
  • For example, if mandate’s effective date 1st Jan 2024, for 24 months period the last collection will be 1st Dec 2025. So, you need to create collection for 1st Dec 2025 as RM150.50, the rest of months will follow auto collection schedule.

ii) For this example, we will pretend to be a merchant that wants to collect a different amount only for the first month, followed by a fixed amount for the next 11 months.

Few ways to do it via Create Mandate Request endpoint /api/v1/Mandates:

Option 1: Mandate for auto collection to ‘false’
  • Call create mandates endpoint to authorise (max amount = RM300, auto=false)
  • Call create collection endpoint to collect RM100 for 1st month
  • Call create collection endpoint to collect RM300 for 2nd to 12month

Option 2: Mandate for auto collection to ‘true’
  • Call create mandates endpoint to authorise (max amount = RM300, auto=true)
  • Call create collection endpoint to collect RM100 for 1st month
  • RM300 collection will be auto created for 2nd to 12month

Option 3: Mandate for auto collection to ‘true’
  • Call create mandates endpoint to authorise (max amount = RM300, auto=true)
  • Call payment intent endpoint to collect RM100 for 1st month using one time payment
  • RM300 collection will be auto created for 2nd to 12month

Scenario B: Terminate collection halfway through

For this example, we will pretend to be a merchant that wants to stop all collection from the customer who has decided to pay down all dues / early settle the outstanding amount

  • I have created a Direct Debit mandate for 60 months, where each month collection is fixed at RM300.00.
  • Customer started paying for January and in February decides to pay down all outstanding amount. Which API can I use to instruct Payex to stop collecting funds from my customer in March onwards?

Option 1: Use Update Mandate Collection Settings Request endpoint

/api/v1/mandates/collectionSettings/reference_number

  • Note: Reference number is path instead of query param

Option 2: Use Delete Mandates Request endpoint

/api/v1/Mandates

  • If delete mandate then all collections under the mandate will be deactivated
  • You can still delete mandates although some collections are active
  • Delete mandate endpoint will need customer to authorise the termination link

Scenario C: Collect at varying dates for different customers

For this example, we will pretend to be a merchant that wants to initiate two types of subscription plan depending on the customer’s subscription start date

  • Subscription Plan A: When customer subscribes on any date between 1st to 29th April; the next payment i.e. 2nd payment = 1st May
  • Through Payex API
    • Set the param “day” to whichever day of month as anchor day, so if 1st of May then set day=1
    • Effective date can remain as any date from 1st to 29th April (e.g. 20240415). So next billing will be 1st of every month.
    • Once setup, Payex system will automatically charge the customer if the setting for auto=true
    • Alternatively if auto=false, then you can send collection request to Payex on whichever date and Payex will process accordingly

  • Subscription Plan B: When customer subscribes on 30th April (last day of the month); the next payment i.e. 2nd payment = 1st June
    • Option 1: You will have to call Payex API to make “inactive” the mandate and activate again on 1st June
    • Option 2: For these types of non-standard collection schedule, will be better to use your own schedule (set auto=false)

See more:

]]>
Payex Response Codes https://payex.io/docs/payex-response-codes/ Tue, 05 Dec 2023 04:46:51 +0000 https://payex.io/?post_type=docs&p=3004 For details on the response codes and other reference codes for the APIs, you may refer table below or download the Excel reference table at Reference Codes.

FPX

Response CodeStatus
00Approved
03Invalid Merchant
05Invalid Seller Or Acquiring Bank Code
09Transaction Pending
12Invalid Transaction
13Invalid Amount
14Invalid Buyer Account
1ABuyer Session Timeout At Internet Banking Login Page
1BBuyer Failed To Provide The Necessary Info To Login To Internet Banking Login Page
1CBuyer Choose Cancel At Login Page
1DBuyer Session Timeout At Account Selection Page
1EBuyer Failed To Provide The Necessary Info At Account Selection Page
1FBuyer Choose Cancel At Account Selection Page
1GBuyer Session Timeout At TAC Request Page
1HBuyer Failed To Provide The Necessary Info At TAC Request Page
1IBuyer Choose Cancel At TAC Request Page
1JBuyer Session Timeout At Confirmation Page
1KBuyer Failed To Provide The Necessary Info At Confirmation Page
1LBuyer Choose Cancel At Confirmation Page
1MInternet Banking Session Timeout
20Invalid Response
2ATransaction Amount Is Lower Than Minimum Limit
2XTransaction Is Canceled By Merchant
30Format Error
31Invalid Bank
39No Credit Account
45Duplicate Seller Order Number
46Invalid Seller Exchange Or Seller
47Invalid Currency
48Maximum Transaction Limit Exceeded
49Merchant Specific Limit Exceeded
50Invalid Seller for Merchant Specific Limit
51Insufficient Funds
53No Buyer Account Number
57Transaction Not Permitted
58Transaction To Merchant Not Permitted
70Invalid Serial Number
76Transaction Not Found
77Invalid Buyer Name Or Buyer ID
78Decryption Failed
79Host Decline When Down
80Buyer Cancel Transaction
83Invalid Transaction Model
84Invalid Transaction Type
85Internal Error At Bank System
87Debit Failed Exception Handling
88Credit Failed Exception Handling
89Transaction Not Received Exception Handling
90Bank Internet Banking Unavailable
92Invalid Buyer Bank
96System Malfunction
98MAC Error
99Pending Authorization (Applicable for B2B model)
BBBlocked Bank
BCTransaction Cancelled by Customer
DAInvalid Application Type
DBInvalid Email Format
DCInvalid Maximum Frequency
DDInvalid Frequency Mode
DEInvalid Expiry Date
DFInvalid e-Mandate Buyer Bank ID
FEInternal Error
OETransaction Rejected As Not In FPX Operating Hours
OFTransaction Timeout
SBInvalid Acquiring Bank Code
XAInvalid Source IP Address (Applicable for B2B2 model)
XBInvalid Seller Exchange IP
XCSeller Exchange Encryption Error
XEInvalid Message
XFInvalid Number Of Orders
XIInvalid Seller Exchange
XMInvalid FPX Transaction Model
XNTransaction Rejected Due To Duplicate Seller Exchange Order Number
XODuplicate Exchange Order Number
XSSeller Does Not Belong To Exchange
XTInvalid Transaction Type
XWSeller Exchange Date Difference Exceeded

Card

Note: This is applicable for one-time card payment, credit card instalment payment and auto debit (subscription payment).

Response CodeStatus
00Approved
01Refer To Issuer
02Refer To Issuer, special condition
03Invalid Merchant ID
04Pick Up Card
05Do Not Honour
06Error
07Pick Up Card, special condition
08Check Signature/Id or Honor with ID
10Partial Approval
11VIP Approval
12Invalid Transaction
13Invalid Amount
14Invalid Card No
15Invalid Issuer
16Approved to update track 3 (Reserved)
17Customer Cancellation (Reversal only)
19Re-enter Transaction
21No Transactions
22Related Transaction Error; Suspected Malfunction
23Invalid/Unacceptable Transaction Fee
24Invalid Currency Code
25Terminated/Inactive card
30Message Format Error
31Bank ID Not Found
32Partial Reversal
38PIN Try Limit Exceeded
41Card Reported Lost
43Stolen Card
44PIN Change Require
45Card Not Activated For Use
51Insufficient Fund
52No Checking Account
53No Savings Account
54Expired Card
55Invalid PIN
56Invalid Card
57Transaction Not Permitted to Cardholder
58Transaction Not Permitted to Terminal
59Suspected Fraud
61Over Limit
62Restricted Card
63Security Violation
64Transaction does not fulfill AML requirement
65Exceeds Withdrawal Count Limit
68Transaction timeout (No reply from acquirer)
70Contact Card Issuer
71PIN not changed
75PIN Tries Exceeded
76Invalid Description Code
77Reconcile Error
78Invalid Trace No
79Batch Already Open
80Invalid Batch No
83Unable to verify PIN
85Batch Not Found
86PIN Validation Not Possible
87Purchase Amount Only, No Cash Back Allowed
88Cryptographic Failure, Call Issuer
89Invalid Terminal ID
91Issuer/Switch Inoperative
92Destination Cannot Be Found for Routing
93Transaction cannot be completed; violation of law
94Duplicate Transaction
95Total Mismatch
96System Malfunction/Error
98Issuer Response Not Receive by UnionPay
99Declined
N7Decline for CVV2 failure
P1Failed 3D Authentication

GrabPay

Response CodeStatus
00success
01failed
01confirm_failed
01consent_required
01invalid_argument
01invalid_request
01mfa_not_completed
01server_error
01session_expired
02cancelled
03authorisation_declined
09processing

TNGD

Response CodeStatus
00SUCCESS
01FAILED
01CLOSED
09INIT

Shopee

Response CodeStatus
00Success
01Failed
09Processing

Riipay

Response CodeStatus
00Accepted
00Success
01Failed
01Cancelled by Customer
01Gateway Request Error
01Not Found
01Payment Failed
01Too Many Requests
01User Limit Exceeded

Split

Response CodeStatus
00approved
09in_progress
12failed

Batch (For Collection)

Note: This is applicable batch collection status under subscription payments.

Response CodeStatus
00Processed
01Pending
02Submitted
03Expired
04Retrying
05Cancelled

BILLING (For Direct Debit)

Response CodeStatus
00Approved
01INSUFFICIENT_FUNDS
02ACCOUNT_CLOSED
03NO_ACCOUNT
04INVALID_ACCOUNT_NUMBER
05WITHDRAWAL_FREQUENCY_EXCEEDED
06RETURNED PER OFI’S REQUEST
07AUTHORISATION REVOKED BY CUSTOME
08PAYMENT STOPPED
09WITHDRAWAL_LIMIT_EXCEEDED
10CONSUMER ADVISE NOT AUTHORISED
11MISMATCH ACCOUNT TYPE
14ACCOUNT HOLDER DECEASED
15BENEFICIARY DECEASED
16ACCOUNT FROZEN
17FILE RECORD EDIT CRITERIA
20NON_TRANSACTION_ACCOUNT
21INVALID COMPANY IDENTIFICATION
22INVALID INDIVIDUAL ID NUMBER
23CREDIT ENTRY REFUSED BY RECEIVER
24DUPLICATE ENTRY
32UNABLE_TO_PROCESS

ENRP

Response CodeStatus
00Approved
01Signature Differ
02Invalid Account Number
03Signature Incomplete
04Amendment Not Countersigned
05Different Account Holder
06Others
81Missing Mandatory Fields
82Invalid Data
83Duplicated Form
84Missing Signature
85Unclear Image

Mandate

Note: This is applicable for both direct debit and auto debit subscription payments.

Response CodeStatusDescription
01DraftAwaiting submission of mandate
02Pending AuthorizationAwaiting customer’s authorization
03Pending ApprovalAwaiting bank’s approval. Please wait 2 days for direct debit
04ApprovedMandate approved
05RejectedCustomer’s authorization was rejected
06TerminatedMandate terminated
07ExpiredMandate expired
Note:
1. “Pending” status includes pending authorization and pending approval. On merchant dashboard (under Auto Payment), when pending is selected at the filter, both “Pending Authorization” and “Pending Approval” will be displayed.
2. For Direct Debit, refer to BILLING response codes
3. For Auto Debit, refer to Card response codes
]]>
FPX Buyer Bank Response Code https://payex.io/docs/fpx-buyer-bank-response-code/ Tue, 19 Dec 2023 05:58:14 +0000 https://payex.io/?post_type=docs&p=3472 List of FPX Buyer Bank Response Code

fpx_buyer_bank_idfpx_buyer_bank_namefpx_mode (retail – 01, corporate, 02)
ABB0232Affin Bank02
ABB0233Affin Bank01
ABB0234Affin B2C – Test ID01
ABB0235Affin Bank B2B02
ABMB0212Alliance Bank (Personal)01
ABMB0213Alliance Bank (Business)02
AGRO01AGRONet01
AGRO02AGRONetBIZ02
AMBB0208AmBank02
AMBB0209AmBank01
BCBB0235CIMB Bank02
BCBB0235CIMB Clicks01
BIMB0340Bank Islam02
BIMB0340Bank Islam01
BKRM0602i-bizRAKYAT02
BKRM0602Bank Rakyat01
BMMB0341Bank Muamalat01
BMMB0342Bank Muamalat02
BNP003BNP Paribas02
BOCM01Bank Of China01
BSN0601BSN01
CIT0218Citibank Corporate Banking02
CIT0219Citibank01
DBB0199Deutsche Bank02
HLB0224Hong Leong Bank02
HLB0224Hong Leong Bank01
HSBC0223HSBC Bank02
HSBC0223HSBC Bank01
KFH0346KFH02
KFH0346KFH01
MB2U0227Maybank2u01
MBB0228Maybank2E02
MBB0228Maybank2E01
OCBC0229OCBC Bank02
OCBC0229OCBC Bank01
PBB0233Public Bank PBe02
PBB0233Public Bank01
PBB0234Public Bank PB enterprise02
RHB0218RHB Bank02
RHB0218RHB Bank01
SCB0215Standard Chartered02
SCB0216Standard Chartered01
TEST0021SBI Bank A02
TEST0021SBI Bank A01
TEST0022SBI Bank B02
TEST0022SBI Bank B01
TEST0023SBI Bank C02
TEST0023SBI Bank C01
UOB0226UOB Bank01
UOB0227UOB Bank02
UOB0228UOB Regional02
UOB0229UOB Bank – Test ID01
]]>
Payex Instalments API https://payex.io/docs/payex-instalments-api/ Wed, 16 Apr 2025 13:54:07 +0000 https://payex.io/?post_type=docs&p=3992
  • Please refer to PaymentIntents endpoint in the api docs, and set payment_type=instalment to specify just instalments. For other payment methods, specify accordingly
  • Cannot choose instalment tenure only, have to either choose a specific bank and tenure from API request, or completely let customer choose
  • This payment flow is supported. You can use below parameters in addition to PaymentIntents endpoint for this payment flow.
  • POST https://api.payex.io/api/v1/PaymentIntents

    Below are the bank codes, please use format “bank codes” + “_” + tenure (06/12/18/24/36/48/60) for parameter “provider”, do follow the available combinations of banks and tenures. For example 48/60 months are only available for CIMB etc

    abb
    ambb
    cimb
    hlbb
    hsbc
    mbb
    ocbc
    pbb
    rhb
    scb
    uob

    If the goal is to be able to capture the instalment info, that info is actually provided in the callback param “txn_type”, so if customer chooses bank and tenure on payex page, you will still be able to tell which bank and tenure after the transaction.

    Payment Simulation

    Card

    “card_holder_name”: “TEST CARD”,
    “card_number”: “5453 0100 0009 5323”,
    “card_expiry”: “0822”,
    “card_cvc”: “123”,

    ]]>