---
title: "POST /partnerships/{partnershipId}/transaction-groups/{transactionGroupId}/generate-edi"
method: POST
path: "/partnerships/{partnershipId}/transaction-groups/{transactionGroupId}/generate-edi"
---

# POST /partnerships/{partnershipId}/transaction-groups/{transactionGroupId}/generate-edi

`POST /partnerships/{partnershipId}/transaction-groups/{transactionGroupId}/generate-edi`

## Request

- Base URL: `https://core.us.stedi.com/2023-08-01`
- URL: `https://core.us.stedi.com/2023-08-01/partnerships/{partnershipId}/transaction-groups/{transactionGroupId}/generate-edi`
- Auth: API key in header `Authorization`

This endpoint generates and delivers a fully-formed EDI file containing the staged transactions in the specified transaction group.

## Path parameters

- `partnershipId` string, required: A unique ID for this partnership within Stedi. You can find this ID on the [Trading partners](https://www.stedi.com/app/core/partnerships) page under **Partnership identifier**.
- `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.

## 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](https://www.stedi.com/docs/api-reference/index#idempotency-keys).

## Request body

- GenerateTransactionGroupEdiRequestContent
  - `characterSet` 'Basic' | 'Extended' | 'ExtendedHipaa': When generating EDI, the character set determines the set of characters allowed in the EDI message. Characters outside of the specified set (after applying any repairs specified in RepairOptions) will result in an error.
  - `repairOptions` RepairOptions: Options for repairing EDI data during generation to ensure it meets X12 requirements
    - `trimTrailingSpaces` boolean: Whether to trim trailing spaces from data elements
    - `uppercase` boolean: Whether to convert text to uppercase
    - `replaceConfusable` boolean: Whether to replace characters that are visually similar but technically different
    - `removeDiacritical` boolean: Whether to remove diacritical marks from characters
    - `replaceNonBasicCharacters` boolean: Whether to replace non-basic characters with their basic equivalents
    - `replaceStediCanonicalDelimitersConflicts` boolean: Whether to replace characters that conflict with Stedi canonical delimiters
    - `trimTrailingZeroes` boolean: Whether to trim trailing zeros from numeric data elements
  - `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.
  - `overrides` InterchangeOverrides
    - `interchangeUsageIndicator` 'I' | 'T' | 'P': Set [ISA-15](https://www.stedi.com/edi/x12/segment/ISA#ISA-15) to a different value. If not set, the default value is `P (Production Data)`.
    - `acknowledgmentRequestedCode` '0' | '1' | '2' | '3': Set [ISA-14](https://www.stedi.com/edi/x12/segment/ISA#ISA-14) to a different value. If not set, the default value is `0 (No Interchange Acknowledgment Requested)`.
    - `interchangeControlVersionNumberCode` string: Set [ISA-12](https://www.stedi.com/edi/x12/segment/ISA#ISA-12) to a different value. This code indicates the version of the `ISA` header segments included in the EDI file. By default, Stedi sets `ISA-12` to to be the X12 release number of the guide associated with the transaction setting.
    - `delimiters` X12Delimiters
      - `element` string, required: The data element separator character.
      - `composite` string, required: The component element separator character.
      - `repetition` string, required: The repetition separator character.
      - `segment` string, required: The segment terminator character.
  - `interchangeAuthorization` X12InterchangeAuthorization: Set values for [ISA header](https://www.stedi.com/edi/x12/segment/ISA) elements (ISA-01 to ISA-04).
    - `authorizationInformationQualifier` '00' | '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08': Identifies the type of information in the Authorization Information (`ISA-01`). Default is `00 - No Authorization Information Present`.
    - `authorizationInformation` string: Information used for additional identification or authorization of the interchange sender or the data in the interchange (`ISA-02`). The type of information is set by the `authorizationInformationQualifier`.
    - `securityInformationQualifier` '00' | '01': Identifies the type of information in the Security Information (ISA-03). Default is `00 - No Security Information Present`.
    - `securityInformation` string: The security information referenced by the `securityInformationQualifier` (`ISA-04`). Typically, this is a password.
  - `transactionOrdering` 'CONTROL_NUMBER': Specify the order of the transactions in the generated X12 EDI file. By default, Stedi doesn't guarantee any particular order. Set to `CONTROL_NUMBER` to order transactions within a functional group by their control number, from lowest to highest. In X12 EDI, this is `ST02` (Transaction Set Control Number).

## Response `200`

GenerateTransactionGroupEdi 200 response

- GenerateTransactionGroupEdiResponseContent
  - `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 portal. Internally, Stedi uses this ID to place the file in Stedi's outbound queue.

## Other responses

- `400`: BadRequestException 400 response
- `401`: UnauthorizedException 401 response
- `403`: AccessDeniedException 403 response
- `404`: ResourceNotFoundException 404 response
- `409`: ResourceUnderChangeException 409 response
- `422`: UnprocessableEntityException 422 response
- `429`: ThrottlingException 429 response
- `500`: ServiceException 500 response
- `503`: ServiceUnavailableException 503 response
- `504`: GatewayTimeoutException 504 response

## Changes

- **2026-04-28** `7d72a1312904`: 3 info
  - added the new optional request property `repairOptions/replaceNonBasicCharacters`
  - added the new optional request property `repairOptions/replaceStediCanonicalDelimitersConflicts`
  - added the non-success response with the status `422`
- **2026-04-16** `e8b8d62c2e15`: 1 warning, 1 info
  - removed the optional property `cause` from the response with the `500` status
  - added the optional property `exceptionCause` to the response with the `500` status
- **2025-10-13** `057d587553be`: 3 info
  - added the new optional request property `transactionOrdering`
  - added the non-success response with the status `409`
  - added the optional property `code` to the response with the `400` status
- **2025-04-09** `f53f6e767533`: 2 info
  - added the new optional request property `characterSet`
  - added the new optional request property `repairOptions`
- **2025-01-06** `8eb8e4b497a4`: 1 info
  - added the new optional request property `overrides/delimiters`

[Operation history](https://skmtc.dev/stedi/apis/core/changes/partnerships/:partnershipId/transaction-groups/:transactionGroupId/generate-edi/post.md)

---

[API](https://skmtc.dev/stedi/apis/core.md) - [All operations](https://skmtc.dev/stedi/apis/core/llms.txt) - [OpenAPI document](https://skmtc.dev/stedi/apis/core/revisions/d9b141c8e007?raw)
