> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accepts a typed ERP/Sync event and sends the matching order document from the…

> Document sent (or the original returned for a retried event_id)

### Request body

`ErpEvent`

**contract\_version** `string,null`

Select retail-v1: explicit dispatch/invoice facts, source identity, blocking compliance and atomic order-revision validation. Required for new events when the partner sets require\_retail\_v1. Requires Postgres.

**data** `object`

The overrides for the target set (see `Ack855Overrides`, `Asn856Overrides`, `Invoice810Overrides`).

**event\_id** `string` *required*

Caller-supplied unique id (1–128 letters, digits or `-_.:`). A retry with the same id returns the original document; a different payload under the same id is a 409.

**partner\_id** `string` *required*

**po\_number** `string` *required*

**source\_total\_amount** `string,null`

ERP invoice total, required by retail-v1 invoice.created and compared exactly with the generated 810 total (including supplied allowances).

**type** `string` *required*

`order.acknowledged` (→855), `fulfillment.created` (→856) or `invoice.created` (→810).

### Response

No response body. Document sent (or the original returned for a retried event\_id).

### Status codes

| Code | Meaning |
| - | - |
| `200` | Document sent (or the original returned for a retried event\_id) |
| `403` | Not this credential's partner |
| `404` | Unknown partner, or no accepted 850 for this PO |
| `409` | Order or partner policy changed, PO cancelled, nothing remaining, or event\_id reused with a different payload |
| `422` | Invalid event, required retail-v1 source facts missing, or blocked by outbound compliance |

### Using this contract

Read the [source OpenAPI document](/spec/edi.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request POST \
  --url 'https://api.edi.stateset.com/v1/erp/events' \
  --header "Authorization: Bearer $EDI_API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
  "contract_version": "string",
  "data": {},
  "event_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "partner_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "po_number": "ORD-10042",
  "source_total_amount": "49.00",
  "type": "standard"
}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.