POST
/
partnerships
/
{partnershipId}
/
transaction-groups
/
{transactionGroupId}
/
generate-edi
curl --request POST \
  --url https://core.us.stedi.com/2023-08-01/partnerships/{partnershipId}/transaction-groups/{transactionGroupId}/generate-edi \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "filename": "my-output-file.edi",
  "overrides": {
    "interchangeUsageIndicator": "T",
    "acknowledgmentRequestedCode": "1"
  }
}'
{
  "artifactId": "f75168e4-e682-4410-bfec-b5b1541c7f21.x12",
  "fileExecutionId": "f75168e4-e682-4410-bfec-b5b1541c7f21"
}
This is a BETA endpoint. We may make backwards incompatible changes.

When you call this endpoint, Stedi:

  1. Generates a single EDI file containing all transactions in the specified transaction group (transactionGroupId). This includes adding required envelope information (ISA and GS headers) and autogenerated control numbers.
  2. Delivers the EDI file to your trading partner through the connection specified in the transaction settings.

You can only call this endpoint with a given transactionGroupId once. Afterward, that transaction group is locked, and you must create a new transaction group to generate another file.

Stage transactions

You can use the Stage Transactions API to store one or more transactions in a transaction group on Stedi. When you’re ready to send all of the transactions in the group, you can call this endpoint to generate and deliver an EDI file to your trading partner.

Delivery attempts

Stedi attempts to deliver a file to all configured connections every 6 minutes for up to 3 total attempts. If it cannot deliver the file after the third attempt, it marks the file execution as FAILED and emits the file.failed.v2 event. Stedi displays each delivery attempt and the failure details on the Files page.

Customize generated files

You can change the timezone, time format, character set (which characters are allowed), and filename for generated files. Learn more.

Inbound processing

There is no equivalent endpoint for parsing EDI files into JSON. To parse inbound files, you or your partner can send EDI files to an SFTP/FTPS or AS2 connection, and Stedi sends the JSON payload to the configured Destination webhook.

This endpoint generates and delivers a fully-formed EDI file for a given transaction group. Transactions are staged in a group using the CreateTransactionGroup endpoint. Once a file has been generated for a given transaction group, the group can no longer be used.

Authorizations

Authorization
string
headerrequired

A Stedi API Key for authentication.

Headers

Idempotency-Key
string

A unique string to identify this request to the server. The key can be up to 255 characters. You can safely retry requests with the same idempotency key within 24 hours of making the first request. This prevents sending duplicate data to your trading partners in case of network errors or other intermittent failures. Learn more.

Path Parameters

partnershipId
string
required

A unique ID for this partnership within Stedi. You can find this ID on the Trading partners page under Partnership identifier.

Required string length: 1 - 81
transactionGroupId
string
required

A unique ID for a transaction group stored on Stedi. You can only call this endpoint with a given transactionGroupId once. Afterward, the transaction group is locked.

Body

application/json
filename
string

Set a custom name for the generated EDI file. Stedi overwrites files with the same name, so we recommend making the filename unique by including a timestamp or other identifier. If you do not specify a filename, Stedi autogenerates a unique name using an ID.

Required string length: 1 - 300
overrides
object
interchangeAuthorization
object

Set values for ISA header elements (ISA-01 to ISA-04).

Response

200 - application/json
artifactId
string
required

An ID for the generated EDI file.

fileExecutionId
string
required

A ID for the process Stedi uses to generate the EDI file. This ID appears on the details page for this file execution in the Stedi app. Internally, Stedi uses this ID to place the file in Stedi's outbound queue.

Was this page helpful?