> ## 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.

# Create an edi documents

> Create an edi documents

### Request body

`CreateEdiDocumentRequest`

<ParamField body="direction" type="string,null">
  `inbound` or `outbound`.
</ParamField>

<ParamField body="document_type" type="string" required />

<ParamField body="partner" type="string,null" />

<ParamField body="payload" type="string,null" />

<ParamField body="reference" type="string,null" />

### Responses

<ResponseField name="201" type="EdiDocumentResponse" />

<ResponseField name="400" type="ErrorBody" />

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.stateset.com/api/v1/edi-documents' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "direction": null,
    "document_type": "string",
    "partner": null,
    "payload": null,
    "reference": null
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "created_at": "string",
    "direction": "string",
    "document_type": "string",
    "error_message": null,
    "id": "string",
    "partner": null,
    "reference": null,
    "status": "string"
  }
  ```
</ResponseExample>
