View Categories

Payment Intents API Endpoints

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

Scroll to Top