Airwallex logo

Webhooks

Copy for LLMView as Markdown

Subscribe to real-time events from Airwallex organisations or accounts via webhooks.

The event types available to you are limited by the API key scopes granted to the API key used in your authentication.

Endpoints
POST /api/v1/webhooks/create
GET /api/v1/webhooks/{id}
POST /api/v1/webhooks/{id}/update
POST /api/v1/webhooks/{id}/delete
GET /api/v1/webhooks

Create a webhook

POST /api/v1/webhooks/create

Creates a new Webhook and subscribes to a list of webhook events from Airwallex.

Request body
eventsrequiredarray

A list of events subscribed by this webhook. Events cannot be modified after creation. Only events matching your API key scopes are allowed.

request_idrequiredstring

A unique request identifier specified by the client for idempotency. Up to 50 characters.

urlrequiredstring

The endpoint where events are sent to.

versionrequiredstring

The API version which controls the event payload structure. It should be in YYYY-MM-DD format, e.g. 2022-11-11.

Response body - 201 Created
created_atstring

The time when this webhook was created.

eventsarray

A list of events subscribed by this webhook. Events cannot be modified after creation. Only events matching your API key scopes are allowed.

idstring

The unique identifier of the Webhook object.

request_idstring

A unique request identifier specified by the client for idempotency. Up to 50 characters.

secretstring

The secret to verify that events are sent from Airwallex. See this guide for details.

updated_atstring

The time when this webhook was last updated.

urlstring

The endpoint where events are sent to.

versionstring

The API version which controls the event payload structure. It should be in YYYY-MM-DD format, e.g. 2022-11-11.

Errors
Error statusDescription
400

Possible errors: field_required, invalid_argument

401

Possible errors: unauthorized

409

Possible errors: already_exists

429

Too many requests

500

Service unavailable

POST /api/v1/webhooks/create
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/webhooks/create' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "url": "https://www.airwallex.com",
> "version": "2022-11-11",
> "events": [
> "account.active",
> "account.connected",
> "account.suspended"
> ],
> "request_id": "c238a67b-75ae-446f-919c-e62c2a577631"
>}'
Response (201 Created)
1{
2 "id": "wh_E6JwepZbKpppjYftl3JUEXPI-ocQiSHS",
3 "url": "https://www.airwallex.com",
4 "secret": "whsec_RBS_GKogxv5PAdFUPABg94kjjLGRW50I",
5 "version": "2022-11-11",
6 "events": [
7 "account.active",
8 "account.connected",
9 "account.suspended"
10 ],
11 "created_at": "2022-12-23T02:57:29+0000",
12 "updated_at": "2022-12-23T02:57:29+0000",
13 "request_id": "c238a67b-75ae-446f-919c-e62c2a577631"
14}
Was this section helpful?

Retrieve a webhook

GET /api/v1/webhooks/{id}

Retrieves the details of a Webhook.

Parameters
idrequiredstring

Unique identifier of the Webhook object.

Response body - 200 OK
created_atstring

The time when this webhook was created.

eventsarray

A list of events subscribed by this webhook. Events cannot be modified after creation. Only events matching your API key scopes are allowed.

idstring

The unique identifier of the Webhook object.

request_idstring

A unique request identifier specified by the client for idempotency. Up to 50 characters.

secretstring

The secret to verify that events are sent from Airwallex. See this guide for details.

updated_atstring

The time when this webhook was last updated.

urlstring

The endpoint where events are sent to.

versionstring

The API version which controls the event payload structure. It should be in YYYY-MM-DD format, e.g. 2022-11-11.

Errors
Error statusDescription
400

Possible errors: invalid_argument

401

Possible errors: unauthorized

404

The requested resource doesn't exist

429

Too many requests

500

Service unavailable

GET /api/v1/webhooks/{id}
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/webhooks/webhook_id' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "id": "wh_E6JwepZbKpppjYftl3JUEXPI-ocQiSHS",
3 "url": "https://www.airwallex.com",
4 "secret": "whsec_RBS_GKogxv5PAdFUPABg94kjjLGRW50I",
5 "version": "2022-11-11",
6 "events": [
7 "account.active",
8 "account.connected",
9 "account.suspended"
10 ],
11 "created_at": "2022-12-23T02:57:29+0000",
12 "updated_at": "2022-12-23T02:57:29+0000",
13 "request_id": "c238a67b-75ae-446f-919c-e62c2a577631"
14}
Was this section helpful?

Update a webhook

POST /api/v1/webhooks/{id}/update

Updates the attributes of an existing Webhook. Only updates to url are currently supported.

Parameters
idrequiredstring

Unique identifier of the Webhook object.

Request body
urlrequiredstring

The endpoint where events are sent to.

Response body - 200 OK
created_atstring

The time when this webhook was created.

eventsarray

A list of events subscribed by this webhook. Events cannot be modified after creation. Only events matching your API key scopes are allowed.

idstring

The unique identifier of the Webhook object.

request_idstring

A unique request identifier specified by the client for idempotency. Up to 50 characters.

secretstring

The secret to verify that events are sent from Airwallex. See this guide for details.

updated_atstring

The time when this webhook was last updated.

urlstring

The endpoint where events are sent to.

versionstring

The API version which controls the event payload structure. It should be in YYYY-MM-DD format, e.g. 2022-11-11.

Errors
Error statusDescription
400

Possible errors: field_required, invalid_argument

401

Possible errors: unauthorized

404

The requested resource doesn't exist

429

Too many requests

500

Service unavailable

POST /api/v1/webhooks/{id}/update
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/webhooks/webhook_id/update' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "url": "https://www.airwallex.com"
>}'
Response (200 OK)
1{
2 "id": "wh_E6JwepZbKpppjYftl3JUEXPI-ocQiSHS",
3 "url": "https://www.airwallex.com",
4 "secret": "whsec_RBS_GKogxv5PAdFUPABg94kjjLGRW50I",
5 "version": "2022-11-11",
6 "events": [
7 "account.active",
8 "account.connected",
9 "account.suspended"
10 ],
11 "created_at": "2022-12-23T02:57:29+0000",
12 "updated_at": "2022-12-23T02:57:29+0000",
13 "request_id": "c238a67b-75ae-446f-919c-e62c2a577631"
14}
Was this section helpful?

Delete a webhook

POST /api/v1/webhooks/{id}/delete

Deletes a Webhook. A deleted webhook will no longer receive webhook events of any Airwallex organisations or accounts.

Parameters
idrequiredstring

Unique identifier of the Webhook object.

Response body - 200 OK
deletedboolean

Whether the webhook was successfully deleted

idstring

Unique identifier of the Webhook object.

Errors
Error statusDescription
400

Possible errors: field_required, invalid_argument

401

Possible errors: credentials_invalid, credentials_expired

404

The requested resource doesn't exist

429

Too many requests

500

Service unavailable

POST /api/v1/webhooks/{id}/delete
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/webhooks/webhook_id/delete' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "id": "wh_E6JwepZbKpppjYftl3JUEXPI-ocQiSHS",
3 "deleted": false
4}
Was this section helpful?

Get a list of webhooks

GET /api/v1/webhooks

Retrieves a list of Webhooks.

Parameters
pagestring

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.

page_sizeinteger

Number of Webhooks per page. Defaults to 20.

Response body - 200 OK
itemsarray

Paged results.

items.created_atstring

The time when this webhook was created.

items.eventsarray

A list of events subscribed by this webhook. Events cannot be modified after creation. Only events matching your API key scopes are allowed.

items.idstring

The unique identifier of the Webhook object.

items.request_idstring

A unique request identifier specified by the client for idempotency. Up to 50 characters.

items.secretstring

The secret to verify that events are sent from Airwallex. See this guide for details.

items.updated_atstring

The time when this webhook was last updated.

items.urlstring

The endpoint where events are sent to.

items.versionstring

The API version which controls the event payload structure. It should be in YYYY-MM-DD format, e.g. 2022-11-11.

page_afterstring

The page cursor used for searching after page.

page_beforestring

The page cursor used for searching before page.

Errors
Error statusDescription
400

Possible errors: invalid_argument

401

Possible errors: credentials_invalid, credentials_expired

429

Too many requests

500

Service unavailable

GET /api/v1/webhooks
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/webhooks' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "items": [
3 {
4 "id": "wh_E6JwepZbKpppjYftl3JUEXPI-ocQiSHS",
5 "url": "https://www.airwallex.com",
6 "secret": "whsec_RBS_GKogxv5PAdFUPABg94kjjLGRW50I",
7 "version": "2022-11-11",
8 "events": [
9 "account.active",
10 "account.connected",
11 "account.suspended"
12 ],
13 "created_at": "2022-12-23T02:57:29+0000",
14 "updated_at": "2022-12-23T02:57:29+0000",
15 "request_id": "c238a67b-75ae-446f-919c-e62c2a577631"
16 }
17 ],
18 "page_before": "<string>",
19 "page_after": "<string>"
20}
Was this section helpful?