Stedi X12 API

The X12 API from Stedi — 1 operation(s) for x12.

OpenAPI Specification

stedi-x12-api-openapi.yml Raw ↑
components:
  schemas:
    AccessDeniedExceptionResponseContent:
      description: The server response for authorization failure.
      properties:
        code:
          type: string
        message:
          type: string
      required:
      - message
      type: object
    BadRequestExceptionResponseContent:
      description: The server cannot process the request due to an apparent client error.
      properties:
        code:
          type: string
        message:
          type: string
      required:
      - message
      type: object
    CoreCharacterSet:
      description: 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.
      enum:
      - Basic
      - Extended
      - ExtendedHipaa
      type: string
    ExceptionCause:
      properties:
        message:
          type: string
        name:
          type: string
        stack:
          type: string
      type: object
    GatewayTimeoutExceptionResponseContent:
      description: The server was acting as a gateway or proxy and did not receive a timely response from the upstream
        server.
      properties:
        code:
          type: string
        message:
          type: string
      required:
      - message
      type: object
    GenerateEdiRequestContent:
      properties:
        characterSet:
          $ref: '#/components/schemas/CoreCharacterSet'
        filename:
          description: 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.
          maxLength: 300
          minLength: 1
          pattern: ^([a-zA-Z0-9.*'()!_-]+)$
          type: string
        interchangeAuthorization:
          $ref: '#/components/schemas/X12InterchangeAuthorization'
        interchangeUsageIndicatorOverride:
          $ref: '#/components/schemas/X12UsageIndicator'
        overrides:
          $ref: '#/components/schemas/InterchangeOverrides'
        repairOptions:
          $ref: '#/components/schemas/RepairOptions'
        transactionGroups:
          description: Contains one or more EDI functional groups, each containing the data for one or more EDI
            transactions. You can override the Application IDs (GS-02 and GS-03) for each group individually. The
            outbound transaction setting for each group must be configured to use the same connection. If you need
            to send transactions to different connections, you must call the endpoint multiple times.
          items:
            $ref: '#/components/schemas/TransactionGroup'
          minItems: 1
          type: array
      required:
      - transactionGroups
      type: object
    GenerateEdiResponseContent:
      properties:
        artifactId:
          description: An ID for the generated EDI file.
          type: string
        edi:
          description: The EDI Stedi generated from the JSON transaction data.
          type: string
        fileExecutionId:
          description: 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.
          type: string
        metadata:
          $ref: '#/components/schemas/Metadata'
      required:
      - artifactId
      - fileExecutionId
      - metadata
      type: object
    InterchangeMetadata:
      description: Metadata for a single interchange within the EDI file.
      properties:
        functionalGroupControlNumbers:
          description: A list of functional group control numbers within an interchange.
          items:
            maximum: 999999999
            minimum: 0
            type: number
          minItems: 1
          type: array
        interchangeControlNumber:
          maximum: 999999999
          minimum: 0
          type: number
      required:
      - functionalGroupControlNumbers
      - interchangeControlNumber
      type: object
    InterchangeOverrides:
      properties:
        acknowledgmentRequestedCode:
          $ref: '#/components/schemas/X12AcknowledgmentRequestedCode'
        delimiters:
          $ref: '#/components/schemas/X12Delimiters'
        interchangeControlVersionNumberCode:
          description: 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.
          maxLength: 5
          minLength: 5
          type: string
        interchangeUsageIndicator:
          $ref: '#/components/schemas/X12UsageIndicator'
      type: object
    Metadata:
      description: Metadata about the generated EDI file.
      properties:
        interchangeMetadata:
          description: A list of interchange metadata for all interchanges in the EDI file.
          items:
            $ref: '#/components/schemas/InterchangeMetadata'
          minItems: 1
          type: array
      required:
      - interchangeMetadata
      type: object
    RepairOptions:
      description: Options for repairing EDI data during generation to ensure it meets X12 requirements
      properties:
        removeDiacritical:
          description: Whether to remove diacritical marks from characters
          type: boolean
        replaceConfusable:
          description: Whether to replace characters that are visually similar but technically different
          type: boolean
        replaceNonBasicCharacters:
          description: Whether to replace non-basic characters with their basic equivalents
          type: boolean
        replaceStediCanonicalDelimitersConflicts:
          description: Whether to replace characters that conflict with Stedi canonical delimiters
          type: boolean
        trimTrailingSpaces:
          description: Whether to trim trailing spaces from data elements
          type: boolean
        trimTrailingZeroes:
          description: Whether to trim trailing zeros from numeric data elements
          type: boolean
        uppercase:
          description: Whether to convert text to uppercase
          type: boolean
      type: object
    ResourceNotFoundExceptionResponseContent:
      description: The server response when the specified resource cannot be found after an API request passes authentication
        and authorization.
      properties:
        code:
          type: string
        message:
          type: string
      required:
      - message
      type: object
    ResourceUnderChangeExceptionResponseContent:
      properties:
        message:
          type: string
      required:
      - message
      type: object
    ServiceExceptionResponseContent:
      properties:
        exceptionCause:
          $ref: '#/components/schemas/ExceptionCause'
        message:
          type: string
      required:
      - message
      type: object
    ServiceUnavailableExceptionResponseContent:
      description: The server cannot handle the request due to technical reasons.
      properties:
        code:
          type: string
        message:
          type: string
      required:
      - message
      type: object
    ThrottlingExceptionResponseContent:
      description: The server response when usage plan or account-level throttling limits exceeded.
      properties:
        code:
          type: string
        message:
          type: string
      required:
      - message
      type: object
    TransactionGroup:
      description: A transaction group contains data for one or more EDI transactions in [Guide JSON](https://www.stedi.com/docs/edi-platform/operate/transform-json/guide-json)
        format.
      properties:
        overrides:
          $ref: '#/components/schemas/TransactionGroupOverrides'
        transactionSettingId:
          description: A unique ID outbound transaction setting Stedi should use to determine the correct guide
            for validation and generation. To find this ID, go to the partnership and use the **Transaction Setting
            ID** field for the outbound transaction setting.
          maxLength: 50
          pattern: ^([a-zA-Z0-9_-]+)$
          type: string
        transactions:
          description: This payload contains the transaction data. It must conform to the JSON Schema for the guide
            associated with each transaction setting (Guide JSON format).
          items: {}
          minItems: 1
          type: array
      required:
      - transactionSettingId
      - transactions
      type: object
    TransactionGroupOverrides:
      description: Customize the Application IDs for you or your trading partner.
      properties:
        localApplicationId:
          description: Set the [GS-02](https://www.stedi.com/edi/x12/segment/GS#GS-02) element to a custom value.
            If not set, Stedi uses the Application ID for the local profile associated with the partnership.
          maxLength: 15
          minLength: 2
          type: string
        partnerApplicationId:
          description: Set the [GS-03](https://www.stedi.com/edi/x12/segment/GS#GS-03) element to a custom value.
            If not set, Stedi uses the Application ID for the partner profile associated with the partnership.
          maxLength: 15
          minLength: 2
          type: string
      type: object
    UnauthorizedExceptionResponseContent:
      description: The server response when the authorizer failed to authenticate the caller.
      properties:
        code:
          type: string
        message:
          type: string
      required:
      - message
      type: object
    UnprocessableEntityExceptionResponseContent:
      description: The request parameters do not match a previous request with the same idempotency key.
      properties:
        code:
          type: string
        message:
          type: string
      required:
      - message
      type: object
    X12AcknowledgmentRequestedCode:
      description: 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)`.
      enum:
      - '0'
      - '1'
      - '2'
      - '3'
      type: string
    X12AuthorizationInformationQualifier:
      description: Identifies the type of information in the Authorization Information (`ISA-01`). Default is `00
        - No Authorization Information Present`.
      enum:
      - '00'
      - '01'
      - '02'
      - '03'
      - '04'
      - '05'
      - '06'
      - '07'
      - 08
      type: string
    X12Delimiters:
      properties:
        composite:
          description: The component element separator character.
          pattern: ^[\W|_]{1}$
          type: string
        element:
          description: The data element separator character.
          pattern: ^[\W|_]{1}$
          type: string
        repetition:
          description: The repetition separator character.
          pattern: ^[\W|_]{1}$
          type: string
        segment:
          description: The segment terminator character.
          pattern: ^[\W|_]{1}$
          type: string
      required:
      - composite
      - element
      - repetition
      - segment
      type: object
    X12InterchangeAuthorization:
      description: Set values for [ISA header](https://www.stedi.com/edi/x12/segment/ISA) elements (ISA-01 to ISA-04).
      properties:
        authorizationInformation:
          description: 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`.
          maxLength: 10
          pattern: ^.*[^ ].*$
          type: string
        authorizationInformationQualifier:
          $ref: '#/components/schemas/X12AuthorizationInformationQualifier'
        securityInformation:
          description: The security information referenced by the `securityInformationQualifier` (`ISA-04`). Typically,
            this is a password.
          maxLength: 10
          pattern: ^.*[^ ].*$
          type: string
        securityInformationQualifier:
          $ref: '#/components/schemas/X12SecurityInformationQualifier'
      type: object
    X12SecurityInformationQualifier:
      description: Identifies the type of information in the Security Information (ISA-03). Default is `00 - No
        Security Information Present`.
      enum:
      - '00'
      - '01'
      type: string
    X12UsageIndicator:
      description: 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)`.
      enum:
      - I
      - T
      - P
      type: string
  securitySchemes:
    httpApiKeyAuth:
      description: A [Stedi API Key](https://www.stedi.com/app/settings/api-keys) for authentication.
      in: header
      name: Authorization
      type: apiKey
info:
  contact:
    email: healthcare@stedi.com
  license:
    name: Proprietary
    url: https://stedi.com
  title: Stedi Healthcare Claims Claim acknowledgments X12 API
  version: '2025-03-07'
openapi: 3.0.3
paths:
  /x12/partnerships/{partnershipId}/generate-edi:
    post:
      description: This endpoint generates and delivers fully-formed EDI files to your trading partners.
      operationId: GenerateEdi
      parameters:
      - description: 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**.
        examples:
          GenerateEdi_example1:
            description: ''
            summary: Generate EDI
            value: ACME_BSW
        in: path
        name: partnershipId
        required: true
        schema:
          description: 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**.
          maxLength: 81
          minLength: 1
          pattern: ^([a-zA-Z0-9._-]+)$
          type: string
      - description: 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).
        in: header
        name: Idempotency-Key
        schema:
          description: 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).
          type: string
      requestBody:
        content:
          application/json:
            examples:
              GenerateEdi_example1:
                description: ''
                summary: Generate EDI
                value:
                  filename: my-output-file.edi
                  overrides:
                    acknowledgmentRequestedCode: '1'
                    interchangeUsageIndicator: T
                  transactionGroups:
                  - overrides:
                      localApplicationId: customLocal
                      partnerApplicationId: customPartner
                    transactionSettingId: some-setting-id
                    transactions:
                    - detail:
                        baseline_item_data_PO1_loop:
                        - baseline_item_data_PO1: {}
                      heading:
                        beginning_segment_for_purchase_order_BEG:
                          date_05: '2023-08-11'
                          purchase_order_number_03: XXXXX
                          purchase_order_type_code_02: XX
                          transaction_set_purpose_code_01: XX
                        transaction_set_header_ST:
                          transaction_set_control_number_02: 1
                          transaction_set_identifier_code_01: '850'
                      summary:
                        transaction_set_trailer_SE:
                          number_of_included_segments_01: 4
                          transaction_set_control_number_02: 1
            schema:
              $ref: '#/components/schemas/GenerateEdiRequestContent'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                GenerateEdi_example1:
                  description: ''
                  summary: Generate EDI
                  value:
                    artifactId: f75168e4-e682-4410-bfec-b5b1541c7f21.x12
                    edi: ISA*00*          *00*          *14*ANOTHERMERCH   *ZZ*THISISME       *230828*0900*^*00801*000000002*1*P*>~GS*PO*ANOTHERMERCH*THISISME*20230828*090020*000000002*X*008010~ST*850*0001~BEG*XX*XX*XXXXX**20230811~PO1~SE*4*0001~GE*1*000000002~IEA*1*000000002~
                    fileExecutionId: f75168e4-e682-4410-bfec-b5b1541c7f21
                    metadata:
                      interchangeMetadata:
                      - functionalGroupControlNumbers:
                        - 2
                        interchangeControlNumber: 2
              schema:
                $ref: '#/components/schemas/GenerateEdiResponseContent'
          description: GenerateEdi 200 response
          headers:
            idempotent-replayed:
              schema:
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponseContent'
          description: BadRequestException 400 response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponseContent'
          description: UnauthorizedException 401 response
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessDeniedExceptionResponseContent'
          description: AccessDeniedException 403 response
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundExceptionResponseContent'
          description: ResourceNotFoundException 404 response
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceUnderChangeExceptionResponseContent'
          description: ResourceUnderChangeException 409 response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityExceptionResponseContent'
          description: UnprocessableEntityException 422 response
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingExceptionResponseContent'
          description: ThrottlingException 429 response
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceExceptionResponseContent'
          description: ServiceException 500 response
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableExceptionResponseContent'
          description: ServiceUnavailableException 503 response
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayTimeoutExceptionResponseContent'
          description: GatewayTimeoutException 504 response
      tags:
      - X12
security:
- httpApiKeyAuth: []
servers:
- description: Production
  url: https://core.us.stedi.com/2023-08-01
tags:
- name: X12
x-stedi:
  lifecycle: general_availability
  product: claims
  public: true