POST
/
partnerships
/
{partnershipId}
/
transaction-groups
/
{transactionGroupId}
/
transactions
/
{transactionSettingId}
curl --request POST \
  --url https://core.us.stedi.com/2023-08-01/partnerships/{partnershipId}/transaction-groups/{transactionGroupId}/transactions/{transactionSettingId} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "transaction": {
    "heading": {
      "transaction_set_header_ST": {
        "transaction_set_identifier_code_01": "850",
        "transaction_set_control_number_02": 1
      },
      "beginning_segment_for_purchase_order_BEG": {
        "transaction_set_purpose_code_01": "XX",
        "purchase_order_type_code_02": "XX",
        "purchase_order_number_03": "XXXXX",
        "date_05": "2023-08-11"
      }
    },
    "detail": {
      "baseline_item_data_PO1_loop": [
        {
          "baseline_item_data_PO1": {}
        }
      ]
    },
    "summary": {
      "transaction_set_trailer_SE": {
        "number_of_included_segments_01": 4,
        "transaction_set_control_number_02": 1
      }
    }
  }
}'
{
  "transactionGroupId": "tx-group-02-21-2024",
  "createdAt": "2024-02-21T00:00:00Z",
  "transactionId": "d3b3e3e3-3e3e-3e3e-3e3e-3e3e3e3e3e3e"
}

Stedi stores the transaction in the transaction group specified by the transactionGroupId. If a group with that ID does not exist, Stedi creates one.

When you’re ready to send all of the transactions in the group, call the Deliver Transaction Group endpoint with the transactionGroupId to generate and deliver a fully-formed EDI file to your trading partner.

Transaction data

You provide transaction data in Guide JSON format. The transaction data must be < 5MB.

All of the transactions you stage in a transaction group must use the same transaction settings. If you attempt to stage a transaction with different settings, Stedi returns an error.

Authorizations

Authorization
string
header
required

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
transactionSettingId
string
required

A unique ID for the outbound transaction setting Stedi should use to determine the correct guide for validation and generation. It must be attached to the partnership associated with the partnershipId. To find the transactionSettingsId, go to the partnership and use the Transaction Setting ID field for the outbound transaction setting.

transactionGroupId
string
required

A unique ID for a group of transactions on Stedi. Stedi creates a new transaction group if one does not exist with the specified ID.

Body

application/json
transaction
any
required

The data for an EDI transaction. If you are not using a mapping, this transaction data must be < 5MB and the shape should match the Guide JSON format for the specified outbound transaction setting. If you are using a mapping, this transaction data must be < 4MB and the shape must match the source schema for the specified mapping.

mappingId
string

Specify a mapping id to transform the transaction to Stedi's Guide JSON format.

groupOverrides
object

Customize the Application IDs for you or your trading partner.

Response

201
application/json
CreateTransactionGroup 201 response
transactionGroupId
string
required

The transaction group ID where you created and added the transaction.

createdAt
string
required

The time Stedi staged the transaction.

transactionId
string
required

A unique ID for the staged transaction Stedi created within the group.