Payment Links
The PaymentLinks API allows you to accept payments from shoppers using a payment link URL. The payment link URL takes your shopper to an Airwallex hosted secure checkout page where they can make the payment with their preferred payment method.
The PaymentLink supports two pricing options:
- Fixed pricing - Both the payment
amountandcurrencyare locked. The shopper must pay the exact amount in the given currency. - Flexible pricing - The shopper chooses to pay from a list of supported currencies you specify and decide on the exact amount to pay.
POST /api/v1/pa/payment_links/createPOST /api/v1/pa/payment_links/{id}/updateGET /api/v1/pa/payment_links/{id}POST /api/v1/pa/payment_links/{id}/notify_shopperPOST /api/v1/pa/payment_links/{id}/activatePOST /api/v1/pa/payment_links/{id}/deactivateGET /api/v1/pa/payment_links
Create a PaymentLink
POST /api/v1/pa/payment_links/create
Create a new payment link.
The payment amount. For Fixed pricing only.
Every payment link requires the shopper to enter their name and email address. Additionally, you can request information for the following fields on each payment link.
Defaults to false. If true, the shopper is required to input their billing address.
Defaults to true. This is an optional field for the shopper to leave a message with their payment.
Defaults to false. If true, the shopper is required to input their phone number.
Defaults to false. If true, the shopper is required to input a reference.
Defaults to false. If true, the shopper is required to input their shipping address.
Airwallex assigned account identifier of the connected entity(another account which is linked with platform). It is to be used by the platform to indicate the connected entity in the transaction where platform is the owner of transaction. Notice: This can not be used with x-on-behalf-of header together.
The payment currency. For Fixed pricing only.
The Customer who is paying for this PaymentLink. Only applicable for links with reusable equals to false. This field is required if you want the payer to see the payment methods saved in the previous checkouts.
The default payment currency from the list of supported_currencies. The shopper can change the payment currency during checkout. For Flexible pricing only.
The additional description text that appears under the title in the payment checkout page.
Payment link expiry timestamp in ISO 8601 format
A set of key-value pairs that you can attach to the PaymentLink for storing additional information.
A reference only visible to the merchant.
Specifies whether the payment link can be used once or multiple times
List of supported currencies the shopper may choose from. For Flexible pricing only.
The title of the payment link that is displayed in the payment checkout page.
The payment link’s active status, either true or false.
The payment amount for Fixed pricing.
Every payment link requires the shopper to enter their name and email address. Additionally, you can request information for the following fields on each payment link.
Defaults to false. If true, the shopper is required to input their billing address.
Defaults to true. This is an optional field for the shopper to leave a message with their payment.
Defaults to false. If true, the shopper is required to input their phone number.
Defaults to false. If true, the shopper is required to input a reference.
Defaults to false. If true, the shopper is required to input their shipping address.
Timestamp in ISO 8601 format when the payment link was created
The payment currency for Fixed pricing.
The Customer who is paying for this PaymentLink. Only applicable for links with reusable equals to false. This field is required if you want the payer to see the payment methods saved in the previous checkouts.
The default currency for Flexible pricing.
The additional description text that appears under the title in the payment checkout page.
Payment link expiry timestamp in ISO 8601 format
Payment link unique identifier
PaymentIntent unique identifier of the latest payment (if any) successfully paid by your shopper via the payment link.
A set of key-value pairs that you can attach to the PaymentLink for storing additional information.
A reference only visible to the merchant.
Specifies whether the payment link can be used once or multiple times
Status of the payment link, one of UNPAID or PAID. The payment link transitions from UNPAID to PAID when a payment is received.
The number of PaymentIntents successfully paid by your shopper via the payment link.
The supported currencies for Flexible pricing.
The title of the payment link that is displayed in the payment checkout page.
Timestamp in ISO 8601 format when the payment link was last updated
The payment URL to the checkout page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/pa/payment_links/create' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "amount": 165.15,> "collectable_shopper_info": {> "billing_address": false,> "message": true,> "phone_number": false,> "reference": false,> "shipping_address": false> },> "connected_account_id": "acct_4lnVokTfP3ulKDlzLDJdjg",> "currency": "EUR",> "customer_id": "cus_ps8e0ZgQzd2QnCxVpzJrHD6KOVu",> "default_currency": "EUR",> "description": "shoes and dress",> "expires_at": "2021-11-04T16:00:00Z",> "metadata": {> "customer_id": "12345678"> },> "reference": "1529",> "reusable": false,> "supported_currencies": [> "EUR",> "AUD"> ],> "title": "Order #1529">}'
1{2 "active": true,3 "amount": 165.15,4 "collectable_shopper_info": {5 "billing_address": false,6 "message": true,7 "phone_number": false,8 "reference": false,9 "shipping_address": false10 },11 "created_at": "2021-08-17T11:00:00+00:00",12 "currency": "EUR",13 "customer_id": "cus_ps8e0ZgQzd2QnCxVpzJrHD6KOVu",14 "default_currency": "EUR",15 "description": "shoes and dress",16 "expires_at": "2021-11-04T16:00:00+00:00",17 "id": "475dc845-bc7c-47eb-b2b0-52782b9d078d",18 "latest_successful_payment_intent_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",19 "metadata": {20 "customer_id": "12345678"21 },22 "reference": "1529",23 "reusable": true,24 "status": "PAID",25 "successful_payment_intent_count": 1,26 "supported_currencies": [27 "EUR",28 "AUD"29 ],30 "title": "Order #1529",31 "updated_at": "2021-08-17T11:05:00+00:00",32 "url": "https://pay.airwallex.com/hkdab0d955b5"33}
Update a PaymentLink
POST /api/v1/pa/payment_links/{id}/update
Update attributes of an existing payment link.
Payment link unique identifier
The payment amount. For Fixed pricing only.
Every payment link requires the shopper to enter their name and email address. Additionally, you can request information for the following fields on each payment link.
Defaults to false. If true, the shopper is required to input their billing address.
Defaults to true. This is an optional field for the shopper to leave a message with their payment.
Defaults to false. If true, the shopper is required to input their phone number.
Defaults to false. If true, the shopper is required to input a reference.
Defaults to false. If true, the shopper is required to input their shipping address.
The payment currency. For Fixed pricing only.
The default payment currency from the list of supported_currencies. The shopper can change the payment currency during checkout. For Flexible pricing only.
The additional description text that appears under the title in the payment checkout page.
A set of key-value pairs that you can attach to the PaymentLink for storing additional information.
A reference only visible to the merchant.
List of supported currencies the shopper may choose from. For Flexible pricing only.
The title of the payment link that is displayed in the payment checkout page.
The payment link’s active status, either true or false.
The payment amount for Fixed pricing.
Every payment link requires the shopper to enter their name and email address. Additionally, you can request information for the following fields on each payment link.
Defaults to false. If true, the shopper is required to input their billing address.
Defaults to true. This is an optional field for the shopper to leave a message with their payment.
Defaults to false. If true, the shopper is required to input their phone number.
Defaults to false. If true, the shopper is required to input a reference.
Defaults to false. If true, the shopper is required to input their shipping address.
Timestamp in ISO 8601 format when the payment link was created
The payment currency for Fixed pricing.
The Customer who is paying for this PaymentLink. Only applicable for links with reusable equals to false. This field is required if you want the payer to see the payment methods saved in the previous checkouts.
The default currency for Flexible pricing.
The additional description text that appears under the title in the payment checkout page.
Payment link expiry timestamp in ISO 8601 format
Payment link unique identifier
PaymentIntent unique identifier of the latest payment (if any) successfully paid by your shopper via the payment link.
A set of key-value pairs that you can attach to the PaymentLink for storing additional information.
A reference only visible to the merchant.
Specifies whether the payment link can be used once or multiple times
Status of the payment link, one of UNPAID or PAID. The payment link transitions from UNPAID to PAID when a payment is received.
The number of PaymentIntents successfully paid by your shopper via the payment link.
The supported currencies for Flexible pricing.
The title of the payment link that is displayed in the payment checkout page.
Timestamp in ISO 8601 format when the payment link was last updated
The payment URL to the checkout page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/pa/payment_links/payment_link_id/update' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "amount": 165.15,> "collectable_shopper_info": {> "billing_address": false,> "message": true,> "phone_number": false,> "reference": false,> "shipping_address": false> },> "currency": "EUR",> "default_currency": "EUR",> "description": "shoes and dress",> "metadata": {> "customer_id": "12345678"> },> "reference": "1529",> "supported_currencies": [> "EUR",> "AUD"> ],> "title": "Order #1529">}'
1{2 "active": true,3 "amount": 165.15,4 "collectable_shopper_info": {5 "billing_address": false,6 "message": true,7 "phone_number": false,8 "reference": false,9 "shipping_address": false10 },11 "created_at": "2021-08-17T11:00:00+00:00",12 "currency": "EUR",13 "customer_id": "cus_ps8e0ZgQzd2QnCxVpzJrHD6KOVu",14 "default_currency": "EUR",15 "description": "shoes and dress",16 "expires_at": "2021-11-04T16:00:00+00:00",17 "id": "475dc845-bc7c-47eb-b2b0-52782b9d078d",18 "latest_successful_payment_intent_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",19 "metadata": {20 "customer_id": "12345678"21 },22 "reference": "1529",23 "reusable": true,24 "status": "PAID",25 "successful_payment_intent_count": 1,26 "supported_currencies": [27 "EUR",28 "AUD"29 ],30 "title": "Order #1529",31 "updated_at": "2021-08-17T11:05:00+00:00",32 "url": "https://pay.airwallex.com/hkdab0d955b5"33}
Retrieve a PaymentLink
GET /api/v1/pa/payment_links/{id}
Retrieve information about an existing payment link.
Payment link unique identifier
The payment link’s active status, either true or false.
The payment amount for Fixed pricing.
Every payment link requires the shopper to enter their name and email address. Additionally, you can request information for the following fields on each payment link.
Defaults to false. If true, the shopper is required to input their billing address.
Defaults to true. This is an optional field for the shopper to leave a message with their payment.
Defaults to false. If true, the shopper is required to input their phone number.
Defaults to false. If true, the shopper is required to input a reference.
Defaults to false. If true, the shopper is required to input their shipping address.
Timestamp in ISO 8601 format when the payment link was created
The payment currency for Fixed pricing.
The Customer who is paying for this PaymentLink. Only applicable for links with reusable equals to false. This field is required if you want the payer to see the payment methods saved in the previous checkouts.
The default currency for Flexible pricing.
The additional description text that appears under the title in the payment checkout page.
Payment link expiry timestamp in ISO 8601 format
Payment link unique identifier
PaymentIntent unique identifier of the latest payment (if any) successfully paid by your shopper via the payment link.
A set of key-value pairs that you can attach to the PaymentLink for storing additional information.
A reference only visible to the merchant.
Specifies whether the payment link can be used once or multiple times
Status of the payment link, one of UNPAID or PAID. The payment link transitions from UNPAID to PAID when a payment is received.
The number of PaymentIntents successfully paid by your shopper via the payment link.
The supported currencies for Flexible pricing.
The title of the payment link that is displayed in the payment checkout page.
Timestamp in ISO 8601 format when the payment link was last updated
The payment URL to the checkout page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/pa/payment_links/payment_link_id' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "active": true,3 "amount": 165.15,4 "collectable_shopper_info": {5 "billing_address": false,6 "message": true,7 "phone_number": false,8 "reference": false,9 "shipping_address": false10 },11 "created_at": "2021-08-17T11:00:00+00:00",12 "currency": "EUR",13 "customer_id": "cus_ps8e0ZgQzd2QnCxVpzJrHD6KOVu",14 "default_currency": "EUR",15 "description": "shoes and dress",16 "expires_at": "2021-11-04T16:00:00+00:00",17 "id": "475dc845-bc7c-47eb-b2b0-52782b9d078d",18 "latest_successful_payment_intent_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",19 "metadata": {20 "customer_id": "12345678"21 },22 "reference": "1529",23 "reusable": true,24 "status": "PAID",25 "successful_payment_intent_count": 1,26 "supported_currencies": [27 "EUR",28 "AUD"29 ],30 "title": "Order #1529",31 "updated_at": "2021-08-17T11:05:00+00:00",32 "url": "https://pay.airwallex.com/hkdab0d955b5"33}
Send a PaymentLink
POST /api/v1/pa/payment_links/{id}/notify_shopper
Send an email notification to shopper with a payment link.
Payment link unique identifier
Shopper email address
OK
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/pa/payment_links/payment_link_id/notify_shopper' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "shopper_email": "[email protected]">}'
1"<string>"
Activate a PaymentLink
POST /api/v1/pa/payment_links/{id}/activate
Activates an inactive payment link.
Payment link unique identifier
The payment link’s active status, either true or false.
The payment amount for Fixed pricing.
Every payment link requires the shopper to enter their name and email address. Additionally, you can request information for the following fields on each payment link.
Defaults to false. If true, the shopper is required to input their billing address.
Defaults to true. This is an optional field for the shopper to leave a message with their payment.
Defaults to false. If true, the shopper is required to input their phone number.
Defaults to false. If true, the shopper is required to input a reference.
Defaults to false. If true, the shopper is required to input their shipping address.
Timestamp in ISO 8601 format when the payment link was created
The payment currency for Fixed pricing.
The Customer who is paying for this PaymentLink. Only applicable for links with reusable equals to false. This field is required if you want the payer to see the payment methods saved in the previous checkouts.
The default currency for Flexible pricing.
The additional description text that appears under the title in the payment checkout page.
Payment link expiry timestamp in ISO 8601 format
Payment link unique identifier
PaymentIntent unique identifier of the latest payment (if any) successfully paid by your shopper via the payment link.
A set of key-value pairs that you can attach to the PaymentLink for storing additional information.
A reference only visible to the merchant.
Specifies whether the payment link can be used once or multiple times
Status of the payment link, one of UNPAID or PAID. The payment link transitions from UNPAID to PAID when a payment is received.
The number of PaymentIntents successfully paid by your shopper via the payment link.
The supported currencies for Flexible pricing.
The title of the payment link that is displayed in the payment checkout page.
Timestamp in ISO 8601 format when the payment link was last updated
The payment URL to the checkout page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/pa/payment_links/payment_link_id/activate' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "active": true,3 "amount": 165.15,4 "collectable_shopper_info": {5 "billing_address": false,6 "message": true,7 "phone_number": false,8 "reference": false,9 "shipping_address": false10 },11 "created_at": "2021-08-17T11:00:00+00:00",12 "currency": "EUR",13 "customer_id": "cus_ps8e0ZgQzd2QnCxVpzJrHD6KOVu",14 "default_currency": "EUR",15 "description": "shoes and dress",16 "expires_at": "2021-11-04T16:00:00+00:00",17 "id": "475dc845-bc7c-47eb-b2b0-52782b9d078d",18 "latest_successful_payment_intent_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",19 "metadata": {20 "customer_id": "12345678"21 },22 "reference": "1529",23 "reusable": true,24 "status": "PAID",25 "successful_payment_intent_count": 1,26 "supported_currencies": [27 "EUR",28 "AUD"29 ],30 "title": "Order #1529",31 "updated_at": "2021-08-17T11:05:00+00:00",32 "url": "https://pay.airwallex.com/hkdab0d955b5"33}
Deactivate a PaymentLink
POST /api/v1/pa/payment_links/{id}/deactivate
Deactivates an active payment link.
Payment link unique identifier
The payment link’s active status, either true or false.
The payment amount for Fixed pricing.
Every payment link requires the shopper to enter their name and email address. Additionally, you can request information for the following fields on each payment link.
Defaults to false. If true, the shopper is required to input their billing address.
Defaults to true. This is an optional field for the shopper to leave a message with their payment.
Defaults to false. If true, the shopper is required to input their phone number.
Defaults to false. If true, the shopper is required to input a reference.
Defaults to false. If true, the shopper is required to input their shipping address.
Timestamp in ISO 8601 format when the payment link was created
The payment currency for Fixed pricing.
The Customer who is paying for this PaymentLink. Only applicable for links with reusable equals to false. This field is required if you want the payer to see the payment methods saved in the previous checkouts.
The default currency for Flexible pricing.
The additional description text that appears under the title in the payment checkout page.
Payment link expiry timestamp in ISO 8601 format
Payment link unique identifier
PaymentIntent unique identifier of the latest payment (if any) successfully paid by your shopper via the payment link.
A set of key-value pairs that you can attach to the PaymentLink for storing additional information.
A reference only visible to the merchant.
Specifies whether the payment link can be used once or multiple times
Status of the payment link, one of UNPAID or PAID. The payment link transitions from UNPAID to PAID when a payment is received.
The number of PaymentIntents successfully paid by your shopper via the payment link.
The supported currencies for Flexible pricing.
The title of the payment link that is displayed in the payment checkout page.
Timestamp in ISO 8601 format when the payment link was last updated
The payment URL to the checkout page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/pa/payment_links/payment_link_id/deactivate' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "active": true,3 "amount": 165.15,4 "collectable_shopper_info": {5 "billing_address": false,6 "message": true,7 "phone_number": false,8 "reference": false,9 "shipping_address": false10 },11 "created_at": "2021-08-17T11:00:00+00:00",12 "currency": "EUR",13 "customer_id": "cus_ps8e0ZgQzd2QnCxVpzJrHD6KOVu",14 "default_currency": "EUR",15 "description": "shoes and dress",16 "expires_at": "2021-11-04T16:00:00+00:00",17 "id": "475dc845-bc7c-47eb-b2b0-52782b9d078d",18 "latest_successful_payment_intent_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",19 "metadata": {20 "customer_id": "12345678"21 },22 "reference": "1529",23 "reusable": true,24 "status": "PAID",25 "successful_payment_intent_count": 1,26 "supported_currencies": [27 "EUR",28 "AUD"29 ],30 "title": "Order #1529",31 "updated_at": "2021-08-17T11:05:00+00:00",32 "url": "https://pay.airwallex.com/hkdab0d955b5"33}
Get list of PaymentLinks
GET /api/v1/pa/payment_links
Retrieves a list of payment links that a merchant has created previously.
The payment link's active status, either true or false
Specifies start time (inclusive) in ISO 8601 for a range query by created timestamp
Page number starting from 0
Number of payment links to be listed per page
Specifies whether the payment link can be used once or multiple times
Status of the payment link, one of UNPAID or PAID.
Specifies end time (exclusive) in ISO 8601 for a range query by created timestamp
A flag which identifies whether there are more results.
List items
The payment link’s active status, either true or false.
The payment amount for Fixed pricing.
Every payment link requires the shopper to enter their name and email address. Additionally, you can request information for the following fields on each payment link.
Defaults to false. If true, the shopper is required to input their billing address.
Defaults to true. This is an optional field for the shopper to leave a message with their payment.
Defaults to false. If true, the shopper is required to input their phone number.
Defaults to false. If true, the shopper is required to input a reference.
Defaults to false. If true, the shopper is required to input their shipping address.
Timestamp in ISO 8601 format when the payment link was created
The payment currency for Fixed pricing.
The Customer who is paying for this PaymentLink. Only applicable for links with reusable equals to false. This field is required if you want the payer to see the payment methods saved in the previous checkouts.
The default currency for Flexible pricing.
The additional description text that appears under the title in the payment checkout page.
Payment link expiry timestamp in ISO 8601 format
Payment link unique identifier
PaymentIntent unique identifier of the latest payment (if any) successfully paid by your shopper via the payment link.
A set of key-value pairs that you can attach to the PaymentLink for storing additional information.
A reference only visible to the merchant.
Specifies whether the payment link can be used once or multiple times
Status of the payment link, one of UNPAID or PAID. The payment link transitions from UNPAID to PAID when a payment is received.
The number of PaymentIntents successfully paid by your shopper via the payment link.
The supported currencies for Flexible pricing.
The title of the payment link that is displayed in the payment checkout page.
Timestamp in ISO 8601 format when the payment link was last updated
The payment URL to the checkout page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 403 | Forbidden |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/pa/payment_links' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "has_more": false,3 "items": [4 {5 "active": true,6 "amount": 165.15,7 "collectable_shopper_info": {8 "billing_address": false,9 "message": true,10 "phone_number": false,11 "reference": false,12 "shipping_address": false13 },14 "created_at": "2021-08-17T11:00:00+00:00",15 "currency": "EUR",16 "customer_id": "cus_ps8e0ZgQzd2QnCxVpzJrHD6KOVu",17 "default_currency": "EUR",18 "description": "shoes and dress",19 "expires_at": "2021-11-04T16:00:00+00:00",20 "id": "475dc845-bc7c-47eb-b2b0-52782b9d078d",21 "latest_successful_payment_intent_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",22 "metadata": {23 "customer_id": "12345678"24 },25 "reference": "1529",26 "reusable": true,27 "status": "PAID",28 "successful_payment_intent_count": 1,29 "supported_currencies": [30 "EUR",31 "AUD"32 ],33 "title": "Order #1529",34 "updated_at": "2021-08-17T11:05:00+00:00",35 "url": "https://pay.airwallex.com/hkdab0d955b5"36 }37 ]38}