Forage uses HTTP status codes to indicate the success or failure of an API requests. We support the following of status codes.
200
- OK, your request was accepted, and returned the requested data.201
- Created, your request was accepted, and successfully created a new resource.204
- No content, your request has succeeded, and there is no additional content to send in the response.400
- Bad request, your request can't be fulfilled due to a non-valid request body.401
- Unauthorized, your request didn't provide credentials to authenticate it.403
- Forbidden, attached credentials to your request don't have enough permissions or had expired.404
- Not Found, the resource you requested doesn't exist.429
- Too many requests, request rate limit was reached.50x
- Server error, Forage server issues that are independent of the request. These can encompass server outages as well as issues connecting to the EBT Processing Network. If you receive a50x
response, the issue may be temporary, so we suggest that you retry your request (with the same idempotency key), using exponential backoff.
Error Responses
If the HTTP status code is greater than 399, then the response body from the Payments API will contain an error object of a standard form (all values are strings),
{
"path": "/api/endpoint",
"errors": [
{
"code": "<one of the error codes below>",
"message": "<A long string with a more specific description and context>",
"source": {
"resource": "<one of the resource names below, if available>",
"ref": "<the 10 character ref of the resource that caused the error>"
}
}
]
}
The only exceptions to this rule are 401 and 403 responses, which will only have a detail
key in the response body. 401 and 403 responses are only produced by issues with the Bearer authentication token.
Resource Names
The resource
key in the error response above can have one of the following values,
Orders
Payments
Payment_Methods
Refunds
Sessions
Merchants
Idempotency_Key
Authentication_Token
Merchant_Account_Header
Tenants
Reports
Error codes
Our API would return a status code different than 2xx
whenever there is a problem with your request or a server error; an error response will include an error code and message explaining what went wrong. You can find in the following table the error codes that might be returned by the Forage Payments API.
HTTP Status | Error Code | Description |
---|---|---|
400 | cannot_parse_request_body | Parsing "<field name> " field failed with message: <message> . API was not able to parse request body for 1 or more fields. |
400 | invalid_merchant_account | The provided Merchant FNS number is not a valid Merchant on Forage. |
400 | missing_idempotency_key | You must include a value for the IDEMPOTENCY-KEY header in your requests to this endpoint and your request is missing Idempotency-Key header and/or the key value. |
400 | missing_merchant_account | No merchant account FNS number was provided. Your request is missing Merchant-Account header and/or the Merchant FNS number. |
401 | - | Authentication credentials were not provided. Your request is missing Authorization header and/or the Bearer access token. |
403 | invalid_token | You do not have permission to perform this action. The provided Bearer access token is not valid, expired or was revoked. |
404 | resource_not_found | <Resource type> with ref ########## does not exist for current Merchant with FNS ####### in the Merchant-Account header. |
500 | unknown_server_error | An internal server error, non related to your request, happened while processing |
400 | cannot_change_request | You submitted two different request bodies with the same idempotency key |
400 | no_payments_on_capture | An Order cannot be captured with no associated Payment objects (Payments indicate how much should be paid with each payment method) |
400 | exceeds_snap_total | The sum of Payment.snap_amount for all Payments associated with the order is greater than Order.snap_total |
400 | exceeds_ebt_cash_total | The sum of Payment.non_snap_amount for all EBT Payments associated with the order is greater than Order.ebt_cash_total |
400 | wrong_payment_total | Sum of Payment amounts on the order does not equal the order total |
500 | unkown_pin_failure | PIN entry failed, but no specific error was returned by the EBT network |
400 | balance_check_only_ebt | Balance checks can only be performed for PaymentMethods of type ebt |
500 | ebt_network_unresponsive | The EBT processor for the relevant state is not responding to requests from Forage's server |
400 | duplicate_payment_method | You attempted to POST a second Payment object which references the same PaymentMethod as another Payment on this order |
400 | cannot_update_payment | You attempted to update a Payment object which has already been captured (at least partially) |
400 | payment_already_captured | You attempted to cancel a Payment object which has already been captured (at least partially) |
400 | refund_exceeds_snap | Your Refund attempt would increase the total amount refunded to the SNAP balance of the EBT card past the amount that was originally charged to the SNAP balance for this Order. |
400 | refund_exceeds_non_snap | Your Refund attempt would increase the total amount refunded to the EBT Cash balance of the EBT card past the amount that was originally charged to the Cash balance for this Order. |
400 | cannot_refund_after_90_days | Per federal guidelines, you cannot refund an EBT payment method more than 90 days after the charge was processed |
400 | order_not_succeeded | You cannot bulk refund an Order (with the refund_all endpoint) that is not in the succeeded state |
400 | wait_for_batch_refund | You cannot bulk refund an Order (with the refund_all endpoint) while there are still some Refunds associated with this Order in the processing state. |
400 | order_already_refunded | You cannot bulk refund an Order (with the refund_all endpoint) that is already fully refunded |
400 | cannot_capture_order | Only orders in the draft or failed states can be submitted for capture. This error code can also arise if your banking information has not been set up in the Payments API backend. |
400 | cannot_cancel_order | Only orders in the draft or failed states can be canceled. |
400 | cannot_update_order | Orders which have been canceled cannot be updated. |
400 | order_is_cancelled | Orders which have been canceled cannot have new Payment objects associated with them. |
400 | invalid_filters | The filters on your reporting request could not be parsed. |
400 | user_error | Can be generated by SDK clients when input validations fail due to user input |
400 | invalid_input_data | Can be generated by SDK clients when input validations fail due to errors in the integrating application |
500 | secure_storage_inaccessible | The secure storage used in Forage's proprietary PIN solution is not available. Please try again shortly as this error is temporary. |
400 | missing_stripe_client_secret | The client secret field is needed to process Payments through Stripe as the credit/debit TPP |
400 | stripe_error | Calls to the Stripe API returned an unknown error code |
400 or 50x | ebt_error_XX | The XX will be replaced with a 2-digit code from the EBT network. Expand the 400 error description in our docs to see possible values and their meanings. |
400 or 500 | Some errors returned by the Stripe API (for credit/debit only) are piped back in the response to your original request, on the /capture or /refunds endpoints. The full list of possible errors from the Stripe API are here, although only a subset apply to Forage's integration which only makes use of the PaymentIntent, PaymentMethod, Customer, and Refunds objects on Stripe. |
EBT-related error codes
The following errors are returned in response to EBT-related issues.
HTTP status | Forage code | Forage message |
---|---|---|
400 | ebt_error_A1 | Invalid Voucher ID - Invalid Transaction |
400 | ebt_error_A2 | Invalid authorization number (approval code does not match voice approval code) - Invalid Transaction |
400 | ebt_error_A3 | Amount greater than original voice authorization - Invalid Transaction |
400 | ebt_error_A4 | Original voice authorization not found for cardholder - Invalid Transaction |
400 | ebt_error_A5 | FNS number does not match original voice authorization - Invalid Transaction |
400 | ebt_error_A6 | Item already cleared - Invalid Transaction |
400 | ebt_error_02 | Bad FNS status for merchant - Cannot Process - Call Customer Service |
400 | ebt_error_03 | Invalid merchant - Cannot Process - Call Customer Service |
400 | ebt_error_10 | Partial approval - Approved |
400 | ebt_error_14 | Invalid card number - Re-enter Transaction |
400 | ebt_error_19 | Re-enter transaction - Re-enter Transaction |
400 | ebt_error_31 | Card has invalid ISO prefix - Cannot Process - Call Customer Service |
400 | ebt_error_41 | Lost Card - Cannot Process - Call Customer Service |
400 | ebt_error_42 | No account - Cannot Process - Call Customer Service |
400 | ebt_error_43 | Lost/stolen card - Cannot Process - Call Customer Service |
400 | ebt_error_51 | Insufficient funds - Insufficient Funds |
400 | ebt_error_52 | No account on file - Cannot Process - Call Customer Service |
400 | ebt_error_54 | Expired card - Expired Card |
400 | ebt_error_55 | Invalid PIN or PIN not selected - Invalid PIN |
400 | ebt_error_56 | Card number not found - Cannot Process - Call Customer Service |
400 | ebt_error_57 | Transaction not permitted to cardholder - Transaction Not Defined |
400 | ebt_error_58 | Invalid transaction - Invalid Transaction |
400 | ebt_error_59 | Fraud (return card) - Cannot Process - Call Customer Service |
400 | ebt_error_61 | Return exceeds benefit authorization - Invalid Transaction |
400 | ebt_error_62 | Restricted card - Cannot Process - Call Customer Service |
400 | ebt_error_75 | PIN tries exceeded - PIN Tries Exceeded |
400 | ebt_error_80 | Voucher expired - Cannot Process - Call Customer Service |
400 | ebt_error_S5 | PIN not selected - PIN Not Selected |
400 | ebt_error_S6 | PIN already selected - PIN Already Selected |
400 | ebt_error_S7 | Unmatched voucher information - Unmatched Voucher Information |
500 | ebt_error_05 | General denial - Cannot Process - Call Customer Service |
500 | ebt_error_06 | Invalid transaction - Invalid Transaction |
500 | ebt_error_12 | Invalid transaction type - Transaction Not Defined |
500 | ebt_error_13 | Invalid amount field - Re-enter Transaction |
500 | ebt_error_23 | Unacceptable transaction fee - Cannot Process - Call Customer Service |
500 | ebt_error_30 | Format error - Cannot Process - Call Customer Service |
500 | ebt_error_40 | Function not available - Function Unavailable |
500 | ebt_error_58 | Invalid transaction - Invalid Transaction |
500 | ebt_error_76 | Key synchronization error - Cannot Process - Call Customer Service |
500 | ebt_error_86 | Invalid security code - Cannot Process - Call Customer Service |
500 | ebt_error_90 | Processor not logged on - Host Not Available |
500 | ebt_error_91 | Authorizer not available (time-out) - Host Not Available |
500 | ebt_error_92 | Transaction destination cannot be found for routing - Cannot Process |
500 | ebt_error_96 | System malfunction - Cannot Process - Call Customer Service |
502 | ebt_error_89 | Card verification value (CVV) Verification failed - No pick up - Cannot Process - Call Customer Service |
502 | ebt_error_FF | Invalid HIP Amount - Re-enter Transaction |