Overview
One integration issue that requires some special care is the management of special characters that are often present in ERP data such as product descriptions, contact names, phone numbers, and other fields. As indicated in the chart below from the JSON ECMA specification, special characters must be represented with escape sequences that encode the data so it can be interpreted properly by Pacejet or other RESTful APIs.
Examples
For example, if an ERP Contact Name field has the value “Robert Buyers “Bob” which is directly converted into JSON, and transmitted to the Pacejet API, a parsing error as shown below will occur due to the additional quotes in the name. The Pacejet API will return a standard HTTP 400 Bad Request code to indicate a problem and the shipment will not be accepted.
Fortunately, most programming languages contain libraries to automatically escape strings, so there is no need to handle the process manually. For example, JavaScript's JSON.stringify, PHP's json_encode, or Python's json.dumps. When strings are properly escaped, the Pacejet API will accept the data as shown below.