Syncor

Mapping profiles

Shaping the body your endpoint receives.

Shaping the body with a mapping profile

Without a mapping profile you receive the standard body shown for each event on Events. A mapping profile on the subscription changes that:

  • Canonical keeps the standard body. You can still wrap it in a property, for example {"data": {...}}.
  • Field map builds your own body: you choose the output keys for the order fields and for each line array, and where each value comes from (an event field, a fixed value or a default). You can choose whether a missing value is sent as null or left out. Field maps can produce JSON, CSV or both.
  • JSON wrapper. An optional property name that wraps the complete JSON body once, after mapping and before signing. The signature always covers the body exactly as sent.

Catalog batches always use the standard JSON body. A canonical mapping profile may only wrap it in a property.

Building a field map

In the developer portal, open Mapping Profiles and choose New mapping profile. Choose the event type, Field map as the mapping type and the output formats. Then add the root output fields: each has an output key and takes its value from a source field of the event, a literal value or a default.

Editing a field map mapping profile for invoice.available: the profile settings, a JSON wrapper property of data, and root output fields for the invoice number and date

A line item array builds one entry per line of the event. This profile sends each invoice line as an items entry, with the line's itemNumber as item_number:

The line item arrays section of a mapping profile: an items array whose line fields map lineNumber to line_number and itemNumber to item_number

Choose the profile on a subscription for the same event type to use it.

Checking a profile

Save the profile, then use Preview in the developer portal to see the exact body your endpoint will receive, and Validate to check the mapping. Preview renders the event's sample payload through the profile:

The Preview of a mapping profile: the invoice sample rendered as JSON, wrapped in data, with an items array

A retry or replay builds the body with the subscription's current mapping profile, so a fix to the profile applies to deliveries you retry afterwards. Catalog batch parts are the exception: they are sent byte for byte the same every time.