If a request to submit an EBT Element fails, then the returned Promise rejects with a ForageError.

{
  errors: [
    {
      httpStatusCode: 400,
      code: 'invalid_merchant_account',
      message: 'Merchant account FNS number not valid.'
    }
  ]
}

ForageError

A ForageError is an object with a single errors key.

TypeDescription
errorsarrayAn array of error objects returned from the Forage API.

Error objects

The error objects listed in the errors array contain the following fields:

TypeDescription
httpStatusCode400

401

402

403

404

429

500

502

504
The HTTP status that the Forage API returns in response to the request.
codestringA short string explaining why the request failed. The error code string corresponds to the HTTP status code.
messagestringA developer-facing message about the error, not to be displayed to customers.

📘

Error handling examples