Errors
Understand BFG API error codes and how to troubleshoot them.
BFG APIs use standard HTTP status codes to indicate the success or failure of a request. Each response includes clear messages or error details to help identify and resolve issues efficiently.
HTTP status codes
BFG sends the following HTTP status codes:
| Status code | Type | Description |
|---|---|---|
| 200 | OK | The request was successful. |
| 201 | Created | The resource was successfully created. |
| 400 | Bad Request | The request was invalid or improperly formatted. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user does not have permission to access the requested resource. |
| 404 | Not Found | The requested resource does not exist. |
| 422 | Unprocessable Entity | The request is well-formed, but validation errors occurred. |
| 429 | Too Many Requests | Rate limit exceeded. |
| 500 | Internal Server Error | An unexpected error occurred on the server. |
Error response structure
When an error occurs, the response typically includes a message detailing the issue, optionally accompanied by a data object that specifies particular records or fields involved.
Example
This example shows an error response indicating that a product update was skipped during CSV import because the UPC from the CSV file wasn't found in the BFG system:
{
"message": "Product inventory updated successfully.",
"data": {
"skipped_records": [
{
"upc": "082442935631",
"reason": "Product not found."
}
]
}
}Updated 3 months ago