---
updatedAt: 2026-05-15T15:22:44.000Z
agentTools:
  projectIndex: https://docs.joinforage.app/llms.txt
---

# Forage JS Errors

# Forage JS Errors

If a request to submit an [`EBT Element`](https://docs.joinforage.app/reference/ebt-elements#ebt-element) or [Payment Sheet Element](https://docs.joinforage.app/reference/tokenize-a-payment-sheet)  fails, then the returned Promise rejects with a `ForageError`.

```javascript Example ForageError
{
  httpStatusCode: 400,
  code: 'invalid_merchant_account',
  message: 'Merchant account FNS number not valid.'
}
```

## ForageError

A `ForageError` is an object that contains the following fields:

<table>
  <thead>
    <tr>
      <th style={{textAlign:"left"}} />

      <th style={{textAlign:"left"}}>Type</th>
      <th style={{textAlign:"left"}}>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td style={{textAlign:"left"}}><code>httpStatusCode</code></td>
      <td style={{textAlign:"left"}}>400<br /><br />401<br /><br />402<br /><br />403<br /><br />404<br /><br />429<br /><br />500<br /><br />502<br /><br />504</td>
      <td style={{textAlign:"left"}}>The HTTP status that the Forage API returns in response to the request.</td>
    </tr>

    <tr>
      <td style={{textAlign:"left"}}><code>code</code></td>
      <td style={{textAlign:"left"}}>string</td>
      <td style={{textAlign:"left"}}>A short string that helps identify the cause of the error. For example, <code>ebt\_error\_55</code> indicates that a user entered an invalid EBT Card PIN.<br /><br />Learn more about <a href="/reference/errors#universal-code-and-message-pairs">SDK error codes</a>.</td>
    </tr>

    <tr>
      <td style={{textAlign:"left"}}><code>message</code></td>
      <td style={{textAlign:"left"}}>string</td>
      <td style={{textAlign:"left"}}>A developer-facing description of the error.</td>
    </tr>

    <tr>
      <td style={{textAlign:"left"}}><code>details</code></td>
      <td style={{textAlign:"left"}}>object | undefined</td>
      <td style={{textAlign:"left"}}>Additional details about the error, included for your convenience.<br /><br />\* <em>Only included for specific codes that have details, such as <a href="/docs/sdk-errors#ebt_error_51">ebt\_error\_51</a>.</em></td>
    </tr>
  </tbody>
</table>

> 📘 Error Handling Examples
>
> * [Tokenize a Card](https://docs.joinforage.app/reference/store-an-ebt-card#example-submit-a-forageebtcardnumberelement)
> * [Check the balance of an EBT Card](https://docs.joinforage.app/reference/check-the-balance-of-an-ebt-card#example-perform-a-balance-check)
> * [Capture an EBT Payment](https://docs.joinforage.app/reference/capture-ebt-payment#example-submit-a-forageebtpaymentelement)
> * [Tokenize a Payment Sheet](https://docs.joinforage.app/reference/tokenize-a-payment-sheet)

# Sibling pages

* [Introduction](https://docs.joinforage.app/reference/js-sdk-reference.md)
* [Forage Elements](https://docs.joinforage.app/reference/ebt-elements.md)
* [Methods](https://docs.joinforage.app/reference/methods.md)
* [Events](https://docs.joinforage.app/reference/events.md)
* [Input Validation](https://docs.joinforage.app/reference/input-validation.md)