Airwallex logo

General Ledger Accounts

Copy for LLMView as Markdown

Manages General Ledger (GL) account entries used when coding Airwallex Spend transactions, such as expenses and bills.

Endpoints
POST /api/v1/accounting/gl_accounts/create
GET /api/v1/accounting/gl_accounts/{id}
GET /api/v1/accounting/gl_accounts
POST /api/v1/accounting/gl_accounts/{id}/update

Create a General Ledger AccountBeta

POST /api/v1/accounting/gl_accounts/create

Create a General Ledger Account is in beta
We may include major new functionality or changes before general release. Learn more about beta.

Creates a new General Ledger (GL) account for coding Airwallex Spend transactions.

Request body
request_idrequiredstring

Unique identifier for this request to ensure idempotency. Generate a random UUID to prevent accidental duplication.

valuerequiredstring

General ledger account name.

codestring

General ledger account code.

external_idstring

External ID from the accounting system.

legal_entity_idsarray

Legal entity IDs to which this general ledger account applies. Omit this field when it applies to all legal entities.

value_labelstring

Airwallex display name for the general ledger account.

Response body - 201 Created
codestring

General ledger account code.

created_atstring

Time at which the general ledger account was created, in ISO 8601 format.

external_idstring

External ID from the accounting system.

idstring

Unique identifier of the general ledger account.

legal_entity_idsarray

Legal entity IDs to which this general ledger account applies. Omit this field when it applies to all legal entities.

statusstring

Status of an Accounting resource used in Airwallex Spend.

ACTIVE
ARCHIVED
updated_atstring

Time at which the general ledger account was last updated, in ISO 8601 format.

valuestring

General ledger account name.

value_labelstring

Airwallex display name for the general ledger account.

Errors
Error statusDescription
400

Invalid request.

500

Internal server error.

POST /api/v1/accounting/gl_accounts/create
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/accounting/gl_accounts/create' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "request_id": "4b8d83d6-70c4-429d-8a0b-bb3281f6b17f",
> "code": "601022001-2",
> "value": "Travel Costs-Domestic-Transportation -2",
> "value_label": "Travel-Domestic-Flight | 601022001",
> "external_id": "601022001-2",
> "legal_entity_ids": [
> "le_U3jlHqQRNHWn2zAKeeT8sg"
> ]
>}'
Response (201 Created)
1{
2 "id": "985461d5-016f-4e1f-a387-5f1380b42d92",
3 "code": "601022001-2",
4 "value": "Travel Costs-Domestic-Transportation -2",
5 "value_label": "Travel-Domestic-Flight | 601022001",
6 "external_id": "601022001-2",
7 "legal_entity_ids": [
8 "le_U3jlHqQRNHWn2zAKeeT8sg"
9 ],
10 "status": "ACTIVE",
11 "created_at": "2025-01-01T00:00:00Z",
12 "updated_at": "2025-01-01T00:00:00Z"
13}
Was this section helpful?

Retrieve a General Ledger AccountBeta

GET /api/v1/accounting/gl_accounts/{id}

Retrieve a General Ledger Account is in beta
We may include major new functionality or changes before general release. Learn more about beta.

Retrieves an existing General Ledger (GL) account used in Airwallex Spend.

Path parameters
idrequiredstring

Unique identifier of the general ledger account.

Response body - 200 OK
codestring

General ledger account code.

created_atstring

Time at which the general ledger account was created, in ISO 8601 format.

external_idstring

External ID from the accounting system.

idstring

Unique identifier of the general ledger account.

legal_entity_idsarray

Legal entity IDs to which this general ledger account applies. Omit this field when it applies to all legal entities.

statusstring

Status of an Accounting resource used in Airwallex Spend.

ACTIVE
ARCHIVED
updated_atstring

Time at which the general ledger account was last updated, in ISO 8601 format.

valuestring

General ledger account name.

value_labelstring

Airwallex display name for the general ledger account.

Errors
Error statusDescription
400

Invalid request.

404

Not found.

500

Internal server error.

GET /api/v1/accounting/gl_accounts/{id}
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/accounting/gl_accounts/985461d5-016f-4e1f-a387-5f1380b42d92' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "id": "985461d5-016f-4e1f-a387-5f1380b42d92",
3 "code": "601022001-2",
4 "value": "Travel Costs-Domestic-Transportation -2",
5 "value_label": "Travel-Domestic-Flight | 601022001",
6 "external_id": "601022001-2",
7 "legal_entity_ids": [
8 "le_U3jlHqQRNHWn2zAKeeT8sg"
9 ],
10 "status": "ACTIVE",
11 "created_at": "2025-01-01T00:00:00Z",
12 "updated_at": "2025-02-02T00:00:00Z"
13}
Was this section helpful?

List all General Ledger AccountsBeta

GET /api/v1/accounting/gl_accounts

List all General Ledger Accounts is in beta
We may include major new functionality or changes before general release. Learn more about beta.

Returns General Ledger (GL) accounts used in Airwallex Spend, filtered by the specified query parameters.

Query parameters
external_idstring

Filter by external ID.

legal_entity_idstring

Filter by legal entity ID.

pagestring

A bookmark for use in pagination to retrieve the next or previous page of results.

statusstring

Filter by general ledger account status.

ACTIVE
ARCHIVED
Response body - 200 OK
itemsarray

List of general ledger accounts returned.

items.created_atstring

Time at which the general ledger account was created, in ISO 8601 format.

items.idstring

Unique identifier of the general ledger account.

items.statusstring

Status of an Accounting resource used in Airwallex Spend.

ACTIVE
ARCHIVED
items.updated_atstring

Time at which the general ledger account was last updated, in ISO 8601 format.

items.valuestring

General ledger account name.

items.codestring

General ledger account code.

items.external_idstring

External ID from the accounting system.

items.legal_entity_idsarray

Legal entity IDs to which this general ledger account applies. Omit this field when it applies to all legal entities.

items.value_labelstring

Airwallex display name for the general ledger account.

page_afterstring

A pointer to the end of the page list used to retrieve the next page of results.

page_beforestring

A pointer to the start of the page list used to retrieve the previous page of results.

Errors
Error statusDescription
400

Invalid request.

500

Internal server error.

GET /api/v1/accounting/gl_accounts
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/accounting/gl_accounts' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "items": [
3 {
4 "id": "985461d5-016f-4e1f-a387-5f1380b42d92",
5 "code": "601022001-2",
6 "value": "Travel Costs-Domestic-Transportation -2",
7 "value_label": "Travel-Domestic-Flight | 601022001",
8 "external_id": "601022001-2",
9 "legal_entity_ids": [
10 "le_U3jlHqQRNHWn2zAKeeT8sg"
11 ],
12 "status": "ACTIVE",
13 "created_at": "2025-01-01T00:00:00Z",
14 "updated_at": "2025-02-02T00:00:00Z"
15 }
16 ],
17 "page_after": "eyJwYWdlIjoiMiJ9"
18}
Was this section helpful?

Update a General Ledger AccountBeta

POST /api/v1/accounting/gl_accounts/{id}/update

Update a General Ledger Account is in beta
We may include major new functionality or changes before general release. Learn more about beta.

Updates an existing General Ledger (GL) account used in Airwallex Spend.

Path parameters
idrequiredstring

Unique identifier of the general ledger account.

Request body
statusrequiredstring

Status of an Accounting resource used in Airwallex Spend.

ACTIVE
ARCHIVED
valuerequiredstring

General ledger account name.

codestring

General ledger account code.

external_idstring

External ID from the accounting system.

legal_entity_idsarray

Legal entity IDs to which this general ledger account applies. Omit this field when it applies to all legal entities.

value_labelstring

Airwallex display name for the general ledger account.

Response body - 200 OK
codestring

General ledger account code.

created_atstring

Time at which the general ledger account was created, in ISO 8601 format.

external_idstring

External ID from the accounting system.

idstring

Unique identifier of the general ledger account.

legal_entity_idsarray

Legal entity IDs to which this general ledger account applies. Omit this field when it applies to all legal entities.

statusstring

Status of an Accounting resource used in Airwallex Spend.

ACTIVE
ARCHIVED
updated_atstring

Time at which the general ledger account was last updated, in ISO 8601 format.

valuestring

General ledger account name.

value_labelstring

Airwallex display name for the general ledger account.

Errors
Error statusDescription
400

Invalid request.

404

Not found.

500

Internal server error.

POST /api/v1/accounting/gl_accounts/{id}/update
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/accounting/gl_accounts/985461d5-016f-4e1f-a387-5f1380b42d92/update' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "code": "601022001-2",
> "value": "Travel Costs-Domestic-Transportation -2",
> "value_label": "Travel-Domestic-Flight | 601022001",
> "external_id": "601022001-2",
> "legal_entity_ids": [
> "le_U3jlHqQRNHWn2zAKeeT8sg"
> ],
> "status": "ACTIVE"
>}'
Response (200 OK)
1{
2 "id": "985461d5-016f-4e1f-a387-5f1380b42d92",
3 "code": "601022001-2",
4 "value": "Travel Costs-Domestic-Transportation -2",
5 "value_label": "Travel-Domestic-Flight | 601022001",
6 "external_id": "601022001-2",
7 "legal_entity_ids": [
8 "le_U3jlHqQRNHWn2zAKeeT8sg"
9 ],
10 "status": "ACTIVE",
11 "created_at": "2025-01-01T00:00:00Z",
12 "updated_at": "2025-02-02T00:00:00Z"
13}
Was this section helpful?