Get your card expenses
Retrieve approved card expenses and mark them as synced to your ERP.
Beta: The Card Expenses API is in Beta.
To sync approved card expenses from Airwallex to your ERP or accounting system, complete the steps in this document. This quickstart walks you through the typical integration flow: listing expenses that are not yet synced, retrieving details, and marking them as synced.
Before you begin
- Obtain your access token API by authenticating to Airwallex using your unique Client ID and API key. You can create scoped API keys in Settings > Developer > API keys in the Airwallex web app. Spend resources require Organization-level permissions.
- Have at least one approved card expense in your Airwallex account.
List approved expenses
To retrieve card expenses that are approved, you can complete these steps:
-
Call the List card expenses API endpoint with the
status:Shell1curl -G \2 'https://api-demo.airwallex.com/api/v1/spend/expenses' \3 --data-urlencode 'status=APPROVED' \4 -H 'Authorization: Bearer {{ACCESS_TOKEN}}' -
Review the response. Each item in the list includes a unique
idyou use to retrieve full details:JSON1{2 "items": [3 {4 "account_id": "acct_a2y0pxz3m4k5hoZldn97hjzp",5 "approvers": [6 ],7 "billing_amount": "1234.56",8 "billing_currency": "USD",9 "card_id": "bdfd278d-14f8-4d12-a04f-a7a1871babd2",10 "created_at": "2025-01-01T00:00:00Z",11 "description": "Business lunch with client",12 "id": "f865c064-57bb-4ca0-9793-54011e00cb53",13 "legal_entity_id": "le_U3jlHqQRNHWn2zAKeeT8sg",14 "merchant": "Restaurant ABC",15 "settled_at": "2025-03-03T00:00:00Z",16 "status": "APPROVED",17 "sync_status": "NOT_SYNCED",18 "card_transaction": {19 "status": "CLEARED",20 "amount": "1234.56",21 "currency": "USD"22 },23 "updated_at": "2025-02-02T00:00:00Z"24 }25 ],26 "page_after": "eyJwYWdlX2JlZm9yZSI6IjIwMjUtMDctMDFUMDA6MDA6MDBaIn0=",27 "page_before": "eyJwYWdlX2JlZm9yZSI6IjIwMjUtMDctMDFUMDA6MDA6MDBaIn0="28 }
Retrieve expense details
To get the full details of a specific expense, including attachments, line items, and accounting fields, complete these steps:
-
Use the
idfrom the list response to call the Get card expense API endpoint:Shell1curl -G \2 'https://api-demo.airwallex.com/api/v1/spend/expenses/{{ID}}' \3 -H 'Authorization: Bearer {{ACCESS_TOKEN}}' -
The response includes the complete expense details:
JSON1 {2 "account_id": "acct_a2y0pxz3m4k5hoZldn97hjzp",3 "accounting_field_selections": [4 {5 "name": "Cost Center",6 "type": "OTHER",7 "value": "Office Expense",8 "external_id": "1036f6f7-87e4-4508-b865-f670b1926022",9 "value_label": "Office Expense"10 }11 ],12 "approvers": [13 "[email protected]",14 "[email protected]"15 ],16 "attachments": [17 {18 "content_type": "image/jpeg",19 "created_at": "2025-02-02T00:00:00Z",20 "file_name": "receipt.jpg",21 "file_url": "https://www.airwallex.com/receipt.jpg",22 "id": "0fd62109-cfc0-4c94-86a5-d01c42506b76"23 }24 ],25 "billing_amount": "100.0",26 "billing_currency": "USD",27 "card_id": "93eed14b-104d-4f40-ae1d-3633c6538276",28 "comments": [29 {30 "content": "Please review this expense.",31 "created_at": "2025-02-02T08:00:00Z",32 "created_by": "[email protected]"33 }34 ],35 "created_at": "2025-01-01T00:00:00Z",36 "description": "This is a description of the expense.",37 "id": "ba46f0ff-8081-4db6-8333-4e011fe9561d",38 "legal_entity_id": "le_U3jlHqQRNHWn2zAKeeT8sg",39 "line_items": [40 {41 "accounting_field_selections": [42 {43 "name": "Cost Center",44 "type": "OTHER",45 "value": "Office Expense",46 "external_id": "a7e44855-e7f3-47ce-be50-182b666d543c",47 "value_label": "Office Expense"48 }49 ],50 "description": "Office supplies purchase",51 "id": "a12fca5e-4aeb-4adb-85b0-428b4f078aba",52 "transaction_amount": "100.00"53 }54 ],55 "merchant": "Airwallex",56 "settled_at": "2025-03-03T00:00:00Z",57 "status": "APPROVED",58 "sync_status": "SYNCED",59 "card_transaction": {60 "status": "AUTHORIZED",61 "amount": "100.0",62 "currency": "USD"63 },64 "updated_at": "2025-02-02T00:00:00Z"65 }
Next steps
Now that you have retrieved your card expenses, explore these related guides: