CreateStarterMappingTemplate - AWS B2B Data Interchange

CreateStarterMappingTemplate

AWS B2B Data Interchange uses a mapping template in JSONata or XSLT format to transform a customer input file into a JSON or XML file that can be converted to EDI.

If you provide a sample EDI file with the same structure as the EDI files that you wish to generate, then the service can generate a mapping template. The starter template contains placeholder values which you can replace with JSONata or XSLT expressions to take data from your input file and insert it into the JSON or XML file that is used to generate the EDI.

If you do not provide a sample EDI file, then the service can generate a mapping template based on the EDI settings in the templateDetails parameter.

Currently, we only support generating a template that can generate the input to produce an Outbound X12 EDI file.

Request Syntax

{ "mappingType": "string", "outputSampleLocation": { "bucketName": "string", "key": "string" }, "templateDetails": { ... } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

mappingType

Specify the format for the mapping template: either JSONATA or XSLT.

Type: String

Valid Values: JSONATA | XSLT

Required: Yes

outputSampleLocation

Specify the location of the sample EDI file that is used to generate the mapping template.

Type: S3Location object

Required: No

templateDetails

Describes the details needed for generating the template. Specify the X12 transaction set and version for which the template is used: currently, we only support X12.

Type: TemplateDetails object

Note: This object is a Union. Only one member of this object can be specified or returned.

Required: Yes

Response Syntax

{ "mappingTemplate": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

mappingTemplate

Returns a string that represents the mapping template.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 400

InternalServerException

This exception is thrown when an error occurs in the AWS B2B Data Interchange service.

HTTP Status Code: 500

ResourceNotFoundException

Occurs when the requested resource does not exist, or cannot be found. In some cases, the resource exists in a region other than the region specified in the API call.

HTTP Status Code: 400

ValidationException

When you use Transformer APIs, TestConversion, or TestParsing, the service throws a validation exception if a rule is configured incorrectly. For example, a validation exception occurs when:

  • A rule references an element that doesn't exist in the selected transaction set

  • An element length rule specifies a minimum length less than 0

Note

If your custom validation rules are configured correctly but the EDI validation fails due to those rules, this is expected behavior and doesn't result in a ValidationException.

For all other API operations, a validation exception occurs when a Trading Partner object can't be validated against a request from another object. This can happen during:

  • Standard EDI validation

  • Custom validation rule evaluation, such as when:

    • Element lengths don't meet specified constraints

    • Code list validations contain invalid codes

    • Required elements are missing based on your element requirement rules

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: