Payment Sources
A Payment Source represents a Billing Customer's funding instrument that can be used to pay for invoices.
POST /api/v1/billing/payment_sources/createGET /api/v1/billing/payment_sources/{id}GET /api/v1/billing/payment_sources
Create a payment source
POST /api/v1/billing/payment_sources/create
Creates a PaymentSource using a linked payment method from a supported Payment Service Provider (PSP). When Airwallex Payments is used as the PSP, you can create a PaymentSource with a PaymentMethod authorized for merchant-initiated payments. This authorization can be obtained in two ways:
- Indirectly, by creating a PaymentIntent with
payment_consent.next_triggered_by=merchant, andpayment_consent.merchant_trigger_reason=unscheduled. - Directly, by creating a PaymentConsent with
next_triggered_by=merchant, andmerchant_trigger_reason=unscheduled.
For more details, refer to the PaymentIntents API and PaymentConsents API documentation.
ID of the Billing Customer that this Payment Source belongs to.
ID of the Payment Method associated with the Payment Source.
Unique request ID specified by the merchant.
ID of the linked payment account to collect payment. You can find this ID in the Airwallex web app > Settings > Account details, within the Account Information section. Required if you have more than 1 payment account in your organisation.
A set of string key-value pairs that you can attach to this object for storing additional information.
ID of the Billing Customer that this Payment Source belongs to.
Time when this Payment Source was created.
ID of the Payment Method associated with the Payment Source.
ID of the Payment Source object.
ID of the linked payment account to collect payment. You can find this ID in the Airwallex web app > Settings > Account details, within the Account Information section.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time when this Payment Source was last updated.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api.sandbox.airwallex.com/api/v1/billing/payment_sources/create' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",> "external_id": "mtd_hkpd1dsjklad5sa",> "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",> "metadata": {> "foo": "bar"> },> "request_id": "ee939540-3203-4a2c-9172-89a566485dd9">}'
1{2 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",3 "created_at": "2022-01-01T10:15:30+0000",4 "external_id": "mtd_hkpd1dsjklad5sa",5 "id": "psrc_d3Ds20ae5VihKs092",6 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",7 "metadata": {8 "foo": "bar"9 },10 "updated_at": "2022-01-01T10:15:30+0000"11}
Retrieve a payment source
GET /api/v1/billing/payment_sources/{id}
Retrieves the details of a Payment Source.
ID of the Payment Source object.
ID of the Billing Customer that this Payment Source belongs to.
Time when this Payment Source was created.
ID of the Payment Method associated with the Payment Source.
ID of the Payment Source object.
ID of the linked payment account to collect payment. You can find this ID in the Airwallex web app > Settings > Account details, within the Account Information section.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time when this Payment Source was last updated.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api.sandbox.airwallex.com/api/v1/billing/payment_sources/payment_source_id' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",3 "created_at": "2022-01-01T10:15:30+0000",4 "external_id": "mtd_hkpd1dsjklad5sa",5 "id": "psrc_d3Ds20ae5VihKs092",6 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",7 "metadata": {8 "foo": "bar"9 },10 "updated_at": "2022-01-01T10:15:30+0000"11}
Get list of payment sources
GET /api/v1/billing/payment_sources
Retrieves a list of Payment Sources based on the query parameters.
ID of the Billing Customer that the Payment Source belongs to.
The corresponding Payment Source ID on the payment provider's side. For Airwallex, this is the Payment Method ID.
The start time of created_at in ISO8601 format (inclusive).
ID of the linked payment account that this Payment Source is created with. You can find this in the "Account ID" section under Account Details in the Settings on the Airwallex Webapp.
A bookmark for use in pagination to retrieve either the next page or the previous page of results. You can fetch the value for this identifier from the response of the previous API call. To retrieve the next page of results, pass the value of page_after (if not null) from the response to a subsequent call. To retrieve the previous page of results, pass the value of page_before (if not null) from the response to a subsequent call.
Number of Payment Sources to be listed per page. Defaults to 20.
The end time of created_at in ISO8601 format (exclusive).
Paged results.
ID of the Billing Customer that this Payment Source belongs to.
Time when this Payment Source was created.
ID of the Payment Method associated with the Payment Source.
ID of the Payment Source object.
ID of the linked payment account to collect payment. You can find this ID in the Airwallex web app > Settings > Account details, within the Account Information section.
Time when this Payment Source was last updated.
A set of string key-value pairs that you can attach to this object for storing additional information.
The page cursor used for searching after page.
The page cursor used for search before page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api.sandbox.airwallex.com/api/v1/billing/payment_sources' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "items": [3 {4 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",5 "created_at": "2022-01-01T10:15:30+0000",6 "external_id": "mtd_hkpd1dsjklad5sa",7 "id": "psrc_d3Ds20ae5VihKs092",8 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",9 "metadata": {10 "foo": "bar"11 },12 "updated_at": "2022-01-01T10:15:30+0000"13 }14 ],15 "page_after": "<string>",16 "page_before": "<string>"17}