This functionality is available in a Stedi module. Contact us for details.

Once you configure fragments for a transaction type, you can use Stedi’s APIs to generate EDI files from fragments.

For example, if you enable fragments on the INS loop in an 834 Health Care Benefit Enrollment and Maintenance, you can send batches of INS loops to Stedi’s Stage Fragment API, and Stedi will securely store them until you’re ready to send the complete file.

Once you stage all the fragments, you call the Create Outbound Transaction API to combine the fragments together into a single EDI file and deliver it to your trading partner.

Find the Guide JSON Schema

Unless you’re using mappings, you must send fragments in Guide JSON, a JSON format that matches the JSON Schema of the guide associated with the outbound transaction setting.

To find the JSON Schema for a fragment:

  1. Navigate to the Trading partners page.
  2. Select the partnership.
  3. Click the name of the guide associated with the outbound transaction setting.
  4. Open the Actions menu and select View schema.
  5. Find the segment that you selected to split the file. The shape for that segment is the JSON Schema you must use when sending fragments to Stedi.

The following example shows the JSON Schema for the INS loop in an 834 Healthcare Benefit Enrollment and Maintenance transaction.

Find the mapping ID and schema

If you plan to use a mapping to transform fragments into Stedi’s Guide JSON format, you must send fragments to Stedi’s API in the mapping’s source JSON schema.

To find the mapping ID and schema:

  1. Go to the Mappings page and copy the ID field for the mapping you want to use.
  2. Click the mapping’s name to view its details.
  3. Click Test mapping. The test input JSON shape is the shape you must use when sending fragment data to the Stage Fragment API.

Stage fragments

Call the Stage Fragments API to store a fragment on Stedi until you are ready to generate an outbound EDI file.

Stedi stores fragments in groups, specified by the fragmentGroupID included in the path. You can call the API with the same fragmentGroupID as many times as needed until you have staged all of the fragments required for the transaction.

Data format

For each staging call, you can optionally specify a mapping that Stedi will use to transform the fragment from your system’s JSON format into Stedi’s Guide JSON format.

  • If you don’t use a mapping, the fragment must match the Guide JSON format for the specified guide.
  • If you use a mapping, the fragment must match the mapping’s source JSON schema.

Sample request and response

The following example shows a cURL request and response for staging a fragment without a mapping. The fragment contains iterations of the PO1 loop in an 850 Purchase Order.

Create outbound transaction

Call the Create Outbound Transaction API and Stedi combines all of the fragments matching the fragmentGroupId into a single, compliant EDI file and delivers it to your trading partner.

Once you call the Transaction API with a fragmentGroupId, that ID is locked, meaning that you cannot add new fragments to the group and you cannot call the API again with that ID. This feature prevents you from accidentally sending duplicate data to partners.

Data format

When calling the API with fragments, you provide a fragment wrapper for the transaction. The wrapper contains all of the transaction data except for the contents of the repeated loop segment where Stedi should insert the fragments. Instead, you leave an empty array in place of the loop contents - for example, member_level_detail_INS_loop: [].

You can optionally provide a mapping ID to transform the fragment wrapper from your system’s JSON format into Stedi’s Guide JSON format. If you don’t use a mapping, the fragment wrapper must match the Guide JSON format for the specified guide.

Sample request and response

The following example shows a cURL request and response to generate an 834 Benefit Enrollment and Maintenance. Notice that the member_level_detail_INS_loop is an empty array - this is where Stedi will insert the fragments from the specified fragment group.

Retrieve an outbound transaction with fragments

Call the Get Transaction endpoint to retrieve the full transaction, including the fragment data. Note that the full transaction, including fragments, can be very large.