File Formatter for JSON & XML

File Formatter for JSON & XML

To structure the data export, use the File Formatter for JSON and XML files.



To format the file, navigate to the set destination settings on the dashboard and select the format either JSON or XML. The File Formatter option will then be available. Refer to the help documentation for JSON and XML examples.


JSON example:


{ 
"header": { "dateCreated": "{{ "now" | date: "%Y-%m-%d %H:%M:%S" }}" },
"dataHeader": { "encodingTableCode": "E-Shop" },
"data": {
"orders": [{% for item in items %}
{
"delivery": {
"name": "{{ item[1]["Customer Name (Shipping)"] }}",
"streetAndNumber": "{{ item[1]["Shipping Address 1"] }}",
"city": "{{ item[1]["Shipping City"] }}",
"zip": "{{ item[1]["Shipping ZIP"] }}",
"phone1": "{{ item[1]["Shipping Address Phone"] }}"
},
"lineItems": [{% for line in item[1][nil] %}
{
"lineId": "{{ line["Product ID"] }}",
"itemCode": "{{ line["SKU"] }}",
"ean": "{{ line["SKU"] }}",
"quantity": {{ line["Quantity"] | times: 1 }},
"unitOfMeasure": "VNT",
"vatCode": 0,
"unitNetPrice": {{ line["Product Price"] | times: 1}},
"unitPriceVAT": {{ line["Product Price"] | times: 1.23 }},
"vatAmount": {{ line["Product Price"] | times: 0.23 }},
"netAmount": {{ line["Product Price"] | times: 1}}
}{% if forloop.last == false %},{% endif %}
{% endfor %}]
}{% if forloop.last == false %},{% endif %}
{% endfor %}]
}
}


XML example:


<Document>
<Data>
{% for item in items %}
<Order>
<DeliveryPlace>
<Name>{{ item[1]["Customer Name (Shipping)"] }}</Name>
<StreetAndNumber>{{ item[1]["Shipping Address 1"] }}</StreetAndNumber>
<City>{{ item[1]["Shipping City"] }}</City>
<ZIP>{{ item[1]["Shipping ZIP"] }}</ZIP>
<Phone1>{{ item[1]["Shipping Address Phone"] }}</Phone1>
</DeliveryPlace>
<Line>{% for line in item[1][nil] %}
<Line-Item>
<LineId>{{ line["Product ID"] }}</LineId>
<ItemCode>{{ line["SKU"] }}</ItemCode>
<EAN>{{ line["SKU"] }}</EAN>
<Quantity>{{ line["Quantity"] }}</Quantity>
<UnitOfMeasure>VNT</UnitOfMeasure>
<VATCode>0</VATCode>
<UnitNetPrice>{{ line["Product Price"] }}</UnitNetPrice>
<UnitPriceVAT>{{ line["Product Price"] | times: 1.23 }}</UnitPriceVAT>
<VATAmount>{{ line["Product Price"] | times: 0.23 }}</VATAmount>
<NetAmount>{{ line["Product Price"] }}</NetAmount>
</Line-Item>
{% endfor %}</Line>
</Order>
{% endfor %}
</Data>
</Document>


This format will export out the orders in Shopify according to the fields that are mentioned in the format. The fields mentioned must be the Field Name in the data file.

    • Related Articles

    • Setup your first Source

      Once you have installed app, you will see a welcome message. Click on + Create New Order Export to create a data file. The data file created will have some basic fields pre-filled for you. Click on Add Field to add more fields to the data file. You ...
    • Setting up Order Export Print Direct

      Export orders via Printer. Please install QZ Tray here. Both QZ Tray and export app must be opened at all times to use printing functionality. Once both have opened, click on Connect and a pop up will appear. Click on Allow and you can't use the ...
    • Export single or bulk orders through Shopify admin

      To export single or multiple orders, please follows these steps. 1. Navigate to your Orders page on your Shopify admin page. 2. Click on the order(s) that you wish to export. 3. To access the menu options, click on the three dots located on the ...
    • Add order number and date time format on email subject

      When exporting data to email, you can edit the email subject line to suit your preferences. You are also able to add the dynamic order number and date/time to the email subject. Add the order number to the email using the placeholder ...
    • How to export orders by using Google Sheet?

      In the syncX: Order Export App, create a new feed. Choose the Google Sheet template and click Add. Rename the feed Google Sheet orders using the pencil icon. Click Edit settings. In Export via, select Google Sheet and insert your Google Sheet URL and ...