Beta: The Spend API is in Beta. Error codes and messages may be updated as the API evolves.
This page lists the possible errors associated with the HTTP 400 status code while managing card expenses, reimbursements, vendors, purchase orders, and bills via the Spend API endpoints.
For 400 errors, the response contains a code specifying the error encountered, a message about the error, and a source providing additional context.
General errors with example response
A general error provides an error response with code, message, and source. The response contains:
code: Unique identifier of the specific validation error encountered.message: A message about the specific error encountered.source: The specific field or object within the request that failed.
Example:
1{2 "code": "invalid_argument",3 "message": "sync_status must be one of NOT_SYNCED, SYNCED, SYNC_FAILED, READY_TO_SYNC.",4 "source": "sync_status"5}
Card expense errors
Error codes for List card expenses API, Get card expense API, and Sync card expense API.
| Code | Description | Next steps |
|---|---|---|
invalid_argument | A provided argument has an incorrect type or failed validation. | See the message and source in the response for details. |
resource_not_found | The specified expense ID does not exist. | Verify the expense ID and try again. |
invalid_request | The expense cannot be transitioned to the requested sync status. | Check the current sync status and verify the transition is valid. |
Reimbursement errors
Error codes for List reimbursement reports API, Get reimbursement report API, Sync reimbursement report API, and Mark reimbursement as paid API.
| Code | Description | Next steps |
|---|---|---|
invalid_argument | A provided argument has an incorrect type or failed validation. | See the message and source in the response for details. |
resource_not_found | The specified reimbursement ID does not exist. | Verify the reimbursement ID and try again. |
invalid_request | The reimbursement cannot be transitioned to the requested status. | Check the current status and verify the transition is valid. |
Vendor errors
Error codes for Create vendor API, Update vendor API, List vendors API and Get vendor API.
| Code | Description | Next steps |
|---|---|---|
invalid_argument | A provided argument has an incorrect type or failed validation. | See the message and source in the response for details. |
resource_not_found | The specified vendor ID does not exist. | Verify the vendor ID and try again. |
Purchase order errors
Error codes for Create purchase order API, Update purchase order API, List purchase orders API and Get purchase order API.
| Code | Description | Next steps |
|---|---|---|
invalid_argument | A provided argument has an incorrect type or failed validation. | See the message and source in the response for details. |
resource_not_found | The specified purchase order ID does not exist. | Verify the purchase order ID and try again. |
Bill errors
Error codes for List bills API, Get bill API, and Update bill API.
| Code | Description | Next steps |
|---|---|---|
invalid_argument | A provided argument has an incorrect type or failed validation. | See the message and source in the response for details. |
resource_not_found | The specified bill ID does not exist. | Verify the bill ID and try again. |