In addition to the user interface in the webapp, Airwallex offers merchants an API solution for our Pay By Link product. Pay by Link enables merchants to issue payment links (URL or QR code) to share with their customers and accept payments very easily with a redirect to our secure hosted payment page. Merchants can customize the payment links, choose the amount, the currency, and the expiration date. Merchants can also choose to make the link reusable or one-off.
Below are the main steps to generate the payment links:
Our API allows merchants to:
|Features||Pay By Link API|
|Update a payment link||✅|
|Get the payments links the merchant created||✅|
|Activate payment links||✅|
|Deactivate payments links||✅|
|Delete payment links||✅|
|Get link information||✅|
|Handle errors with relevant error codes||✅|
Our Pay By Link API is a typical REST API with JSON. To get started with our API, merchants will need their account ID provided at onboarding to proceed.
In order to start using the Merchant Links API, merchants will need to complete its configuration with the Merchant Config API first. The first two steps should be complete in webapp. To proceed with the link creation, merchants will need to call the Merchant Links API.
Merchant Links API
This API is used for CRUD operations on payment links and allows merchants to perform the following actions described below.
- Create Payment Link will allow merchants to generate payment links and choose among the following parameter: "code", “expiryDate", "reusable", "amount", "minAmount", "title", "description", "merchantRef"
- Update Payment Link will allow merchants to make changes to an existing payment link.
- Retrieve Merchant's Payment Links will allow merchants to obtain the payments details made from a given linkID.
- Get list of PaymentLinks will return the links that a merchant has created previously. This endpoint will return all links that are not DELETED.
- Activate Link will allow merchants to activate a given payment link ID.
- Deactivate Link will allow merchants to deactivate a given payment link ID.
- Delete Link will allow merchants to delete a given payment link ID.
Send a PaymentLink
This endpoint of the main API is used to send emails to merchants and shoppers. There are two different emails that can be generated as part of the Pay by Link product. One email is sent to notify merchants whenever there is a successful payment from a payment link previously created by the merchant. The second link is sent to the shopper as a payment receipt and will contain the main payment details.
- Payment Link Created Shopper Notification will allow merchants to be notified when a successful payment is completed
Please note that merchants can also subscribe to webhooks to receive notifications about successful payments (
payment_intent.succeeded). See Notifications and Webhooks .
In general, all API calls can be failed and in this case, merchants will get a specific HTTP status and error code and error message in the body.
|Error code||Error description|
|OTHER_ERROR||some other errors, it should contain trace-id in the message for debug|
|INPUT_MISSING||requested input field is missing|
|INPUT_TOO_LONG||requested input field is too long|
|CODE_BAD_SYMBOLS||requested code had unsupported symbols|
|CODE_NOT_FOUND||requested code not found|
|CODE_NOT_UNIQUE||requested code not unique in the system|
|EMAIL_NOT_VALID||requested shopper email is not valid or is too long|
|BAD_EXPIRY||expiry date in the past|
|ACTIVATION_FAILED||can't activate link (current status not DEACTIVATED)|
|DEACTIVATION_FAILED||can't deactivate link (current status not ACTIVE)|
|INTENT_CREATED||intent already created for one-time links|
|LINK_FORBIDDEN||link belongs to another merchant|
|LINK_NOT_FOUND||link not found|
|LINK_NOT_ACTIVE||link not active|
|CONFIG_NOT_FOUND||merchant config not found|
|CORE_FAILED||payment core failed to create intent|
|CONFIG_CENTER_FAILED||config centre failed to provide merchant available currency|
|AMOUNT_WRONG||requested amount is wrong (less than min or other currency)|
|MERCHANT_NOT_ENABLED_PA||merchant config is not full in config-centre or no active PMPs configured|
|HEADER_MISSING||missing required header|
|ARGUMENT_MISMATCH||failed to deserialize JSON from the body|