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 codeTypeDescription
200OKThe request was successful.
201CreatedThe resource was successfully created.
400Bad RequestThe request was invalid or improperly formatted.
401UnauthorizedAuthentication is required or has failed.
403ForbiddenThe authenticated user does not have permission to access the requested resource.
404Not FoundThe requested resource does not exist.
422Unprocessable EntityThe request is well-formed, but validation errors occurred.
429Too Many RequestsRate limit exceeded.
500Internal Server ErrorAn 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."
      }
    ]
  }
}