Airwallex logo

How Airwallex Spend works

Understand the key features and data model of the Airwallex Spend APIs.

Copy for LLMView as Markdown

The Spend API provides programmatic access to expense and accounts payable data in Airwallex for custom ERP integrations. Understanding how the API is structured is important when building sync workflows, as it helps you design efficient, reliable integrations with external financial systems.

Primary use cases

The Spend API supports two main integration scenarios:

  • Custom ERP sync: Build automated sync workflows for accounting or ERP systems that Airwallex does not integrate with directly.
  • Programmatic sync status management: Mark card expenses, reimbursements, and bills as synced or paid to prevent re-processing and keep records in sync across systems.

Spend data model

The Spend API organizes data across two main areas: Expenses and Accounts Payable.

Expenses

  • Card expenses: Transactions made on Airwallex-issued cards. Each expense includes details such as attachments, line items, accounting field selections, and comments.
  • Reimbursements: Out-of-pocket expense reports submitted by employees. Reimbursement reports can be retrieved, marked as synced, and marked as paid externally when payment occurs outside Airwallex.

Accounts Payable

  • Vendors: External suppliers or service providers your organization pays. Each vendor is associated with one or more legal entities in your organization.
  • Purchase orders (POs): Formal requests to purchase goods or services from a vendor. POs require line items with accounting field selections.
  • Bills: Invoices received from vendors for goods or services. Bills can be retrieved, and have their sync status updated.

Sync status

A core concept in the Spend API is sync status tracking. When you retrieve spend items, you can filter by sync_status to find items that have not yet been ingested into your system. After processing an item, you mark it as synced to prevent duplicate processing on subsequent API calls.

Typical sync statuses include:

  • NOT_SYNCED: The item has not been synced to an external system.
  • SYNCED: The item has been successfully synced.
  • SYNC_FAILED: The sync attempt failed. An error message provides details.
  • READY_TO_SYNC: The item is ready for sync but has not been picked up yet.

Accounting field selections

The Spend API uses accounting field selections to associate items with your chart of accounts, tax rates, and custom fields.

When writing (for example, creating purchase orders), you specify accounting_field_selections with field_id, field_value_id, and identifier_type set to EXTERNAL_ID. These IDs correspond to the external IDs you define during custom accounting data setup.

When reading (for example, retrieving expenses, bills, or reimbursements), the API returns accounting field selections with name, type, value, external_id, and value_label.

Only identifier_type: EXTERNAL_ID is supported for write operations.

Webhooks

Webhooks send real-time notifications for asynchronous updates about your spend data. You can subscribe to events for card expenses, reimbursements, vendors, purchase orders, and bills. For setup instructions, see Set up Spend webhooks. For a list of available events, see Spend webhook event types.

See also

To deepen your understanding or see how the Spend API applies in practice, refer to our how-to guides:

Was this page helpful?