This quick-start uses Postman to consume the EDI API, get Postman here.
In this tutorial we'll show how to validate one or more X12 transactions (ST/SE blocks).
Set the Headers
If you'd like to receive XML-encoded responses, set Accept to application/xml.
If you'd like to send XML-encoded requests, set Content-Type to application/xml.
Set the API key to the key that you generated in the developer portal (the one above is for evaluation purposes only).
Set the Body
The validate request model (API Reference) can be encoded either as JSON or XML (set the Content-Type header):
The ValidateEdi object consists of:
- The settings object (it is optional and can be passed as null)
- The transactions object which holds an array of transactions so you can validate one or more transactions in the same request
Each transaction derives from the base EdiMessage model and must be replaced with a concrete JSON/XML transaction (for example a purchase order or an invoice).
TIP: Copy a transaction from the Translate response like this:
TIP: Use one of the sample validation requests we have included in the API portal:
Set the body in Postman:
Hit the Send button
Use the following URL:
Inspect the response
The response is an array of ErrorContext objects, one for each transaction in the request. You can inspect the hasErrors property to determine if the transaction is valid. When hasErrors is true, then the transaction is invalid (you can correlate the ErrorContext to the original transaction in the request by order or control number) and the errors object contains the list of errors, one for each segment.