# HTTP Status Codes for ERP API Calls: Retry or Stop Reference

> Source: https://netray.co/tools/http-status-codes-for-erp-api-agents-reference
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Look up an HTTP status code and see what it usually means on an ERP API and whether an agent should retry, fix the request or escalate.

## Category

developer

## Audience

- Integration developer
- ERP developer
- AI engineer

## Tool

**Kind:** worksheet

**Mode:** reference

**Columns:**

#### Status

**Key:** code

**Type:** text

#### Name

**Key:** name

**Type:** text

#### Class

**Key:** klass

**Type:** text

#### Typical meaning on an ERP API

**Key:** erp

**Type:** text

#### Safe to retry automatically?

**Key:** retry

**Type:** text

#### What the agent or integration should do

**Key:** action

**Type:** text

**Rows:**

#### OK

**Code:** 200

**Klass:** 2xx success

**Erp:** Read or update succeeded and a body is returned

**Retry:** Not needed

**Action:** Parse the body and continue

#### Created

**Code:** 201

**Klass:** 2xx success

**Erp:** A new record such as an order or item was created

**Retry:** No, a retry may create a duplicate

**Action:** Store the returned key or Location header

#### Accepted

**Code:** 202

**Klass:** 2xx success

**Erp:** Request queued for asynchronous processing

**Retry:** No

**Action:** Poll the status URL or wait for the callback

#### No Content

**Code:** 204

**Klass:** 2xx success

**Erp:** Update or delete succeeded with no body

**Retry:** Not needed

**Action:** Treat as success, re-read if the new state is needed

#### Moved Permanently

**Code:** 301

**Klass:** 3xx redirect

**Erp:** Endpoint moved, often http to https or a tenant migration

**Retry:** Yes, at the new URL

**Action:** Update the configured base URL

#### Not Modified

**Code:** 304

**Klass:** 3xx redirect

**Erp:** Conditional GET with ETag found no change

**Retry:** Not needed

**Action:** Use the cached copy

#### Bad Request

**Code:** 400

**Klass:** 4xx client

**Erp:** Malformed JSON, bad filter syntax or invalid field value

**Retry:** No

**Action:** Fix the payload or query, do not resend unchanged

#### Unauthorized

**Code:** 401

**Klass:** 4xx client

**Erp:** Token missing, expired or invalid

**Retry:** Once, after refreshing the token

**Action:** Refresh credentials, then retry one time

#### Forbidden

**Code:** 403

**Klass:** 4xx client

**Erp:** Authenticated but the ERP role or scope lacks permission

**Retry:** No

**Action:** Stop and request the right role, never loop

#### Not Found

**Code:** 404

**Klass:** 4xx client

**Erp:** Wrong URL, wrong company or tenant, or record does not exist

**Retry:** No

**Action:** Verify the key and company context

#### Method Not Allowed

**Code:** 405

**Klass:** 4xx client

**Erp:** Entity set is read only or the verb is not exposed

**Retry:** No

**Action:** Check the API documentation for allowed verbs

#### Request Timeout

**Code:** 408

**Klass:** 4xx client

**Erp:** Server gave up waiting for the request

**Retry:** Yes for reads

**Action:** Retry with backoff

#### Conflict

**Code:** 409

**Klass:** 4xx client

**Erp:** Duplicate key, locked record or state conflict

**Retry:** No, re-read first

**Action:** Fetch current state, decide, then resubmit

#### Gone

**Code:** 410

**Klass:** 4xx client

**Erp:** Endpoint or API version retired

**Retry:** No

**Action:** Migrate to the supported API version

#### Precondition Failed

**Code:** 412

**Klass:** 4xx client

**Erp:** If-Match ETag no longer matches, record changed by someone else

**Retry:** No, re-read first

**Action:** Reload the record and reapply the change

#### Payload Too Large

**Code:** 413

**Klass:** 4xx client

**Erp:** Batch or attachment exceeds the gateway limit

**Retry:** No

**Action:** Split into smaller batches

#### Unsupported Media Type

**Code:** 415

**Klass:** 4xx client

**Erp:** Missing or wrong Content-Type header

**Retry:** No

**Action:** Send application/json or the type the API requires

#### Unprocessable Content

**Code:** 422

**Klass:** 4xx client

**Erp:** Syntax valid but a business rule failed, such as a closed period

**Retry:** No

**Action:** Read the error body, correct the data

#### Locked

**Code:** 423

**Klass:** 4xx client

**Erp:** Record locked by another user or process

**Retry:** Yes, a few times

**Action:** Retry with backoff, then escalate

#### Precondition Required

**Code:** 428

**Klass:** 4xx client

**Erp:** API requires If-Match for updates

**Retry:** No

**Action:** Read the record, send its ETag

#### Too Many Requests

**Code:** 429

**Klass:** 4xx client

**Erp:** Rate limit or API capacity reached

**Retry:** Yes, after the wait

**Action:** Honor Retry-After, lower concurrency

#### Internal Server Error

**Code:** 500

**Klass:** 5xx server

**Erp:** Unhandled error in the ERP service or a customization

**Retry:** Yes for reads, careful for writes

**Action:** Retry with backoff, log the correlation ID

#### Not Implemented

**Code:** 501

**Klass:** 5xx server

**Erp:** Operation not supported by this ERP version

**Retry:** No

**Action:** Use a different endpoint

#### Bad Gateway

**Code:** 502

**Klass:** 5xx server

**Erp:** Gateway could not reach the ERP application server

**Retry:** Yes

**Action:** Retry with backoff

#### Service Unavailable

**Code:** 503

**Klass:** 5xx server

**Erp:** Maintenance window, restart or overload

**Retry:** Yes, after Retry-After if sent

**Action:** Back off, pause the agent queue

#### Gateway Timeout

**Code:** 504

**Klass:** 5xx server

**Erp:** Query ran longer than the gateway allows

**Retry:** Reads only, with a smaller query

**Action:** Narrow filters or page the request

**Notes:** Retry guidance is general practice. Write calls should only be retried when the endpoint supports an idempotency key or when you confirmed the first attempt did not commit. Individual ERPs may use these codes slightly differently.

## Content

**Intro:** When an AI agent or integration calls an ERP API, the status code decides whether it should retry, fix its request or stop and ask a human. This table lists the codes you meet in practice and what they usually mean on ERP REST and OData endpoints.

**Sections:**

#### How to use the table

**Body:** Search by code or by a word from the error message. Read the ERP meaning first, because the same code can mean different things in different systems. Then check the retry column before writing any retry loop. The last column gives the behavior we recommend for an agent: stop, refresh, back off or re-read. Export the table to Excel to paste it into your integration design document or into the error-handling section of an agent runbook.

#### Retry rules that prevent damage

**Body:** Retrying is safe when repeating the call has no extra effect. GET requests are safe. POST that creates a record is not safe unless the API supports an idempotency key. Never loop on 401 or 403, because repeating a denied call only fills the audit log and may lock the service account. For 429 and 503, honor the Retry-After header when present and reduce concurrency instead of only waiting.

**Bullets:**

- Cap retries, three to five attempts is typical
- Use exponential backoff with random jitter
- Retry only idempotent calls unless a key is supported
- Log the correlation or request ID from the response
- Escalate to a person after the cap is reached

#### Conflict codes are not errors to hide

**Body:** 409, 412 and 423 tell you the ERP state changed or is held by someone else. An agent that blindly resends can overwrite a planner's change. The correct response is to re-read the record, compare, and either reapply the change deliberately or hand the decision to a person. 422 usually carries a business rule message such as a closed posting period; surface that message to the user instead of rewording the payload at random.

#### Common mistakes

**Body:** Teams often treat every 5xx as retryable, including a timeout on a write that actually committed, which creates duplicate orders. Others treat 404 as a network issue when the real cause is a wrong company or tenant in the URL. Finally, many agents discard the response body on error, throwing away the ERP message that explains the fix. Always keep the body in the log.

**Cta:** Netray builds agents that read and, with approval, write back to ERPs with sensible retry and escalation rules. If you want error handling designed for your ERP, we can review your integration.

**Faq:**

#### Should an AI agent retry a 500 error?

**Answer:** For a read, yes, with backoff and a retry cap. For a write, only after confirming the first attempt did not commit or when the endpoint supports an idempotency key. A 500 can occur after the ERP already saved the record, so blind retries can duplicate it.

#### What is the difference between 401 and 403 in an ERP API?

**Answer:** 401 means the caller is not authenticated, usually an expired or missing token, so refreshing the token once is reasonable. 403 means the caller is known but the ERP role or scope does not allow the action, so retrying cannot help and a role change is needed.

#### Why do I get 429 from my ERP API?

**Answer:** You exceeded a rate or capacity limit, often a per-user or per-tenant request quota. Wait for the Retry-After period if given, reduce parallel calls, batch requests and cache reference data so the agent stops polling for unchanged records.

#### Is 409 Conflict the same as a duplicate record?

**Answer:** Often, but not always. It can also mean a locked record or a state conflict such as updating a closed order. Read the response body, re-read the current record, and decide whether to update, skip or ask a person.

## Search terms

http status codes erp api, http 409 conflict erp, http 429 retry after, http status code retry or not, rest api error codes cheat sheet, odata error status codes, agent api error handling, http status codes reference table

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
