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 expensesAPI, Get card expenseAPI, and Sync card expenseAPI.
| 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 reportsAPI, Get reimbursement reportAPI, Sync reimbursement reportAPI, and Mark reimbursement as paidAPI.
| 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 vendorAPI, Update vendorAPI, List vendorsAPI and Get vendorAPI.
| 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 orderAPI, Update purchase orderAPI, List purchase ordersAPI and Get purchase orderAPI.
| 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 billsAPI, Get billAPI, and Update billAPI.
| 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. |