Order XML feed
You can create an that contains the details of orders received in your ShopWired account by using the Order XML feed app.
The order feed has its own URL. You can provide this URL to any third-party service that needs access to your order information (such as a fulfilment company).
The order feed feature has access to:
- The order object
- The order product object
It can therefore output all information about an order, including custom fields. The order feed is built using and therefore supports logic code, allowing you to apply conditional statements, loops, and other Twig functionalities to customise the output of your feed.
To create a feed, install the order XML feed app:
- Navigate to Apps
- Locate the Order XML feed app
- Select
install this app
- Navigate to Feeds > Order feed
- Enter the code to generate the feed into the Content setting
Order XML feed URL and password protection
Order XML feed URL and password protection
To access the URL for your feed, navigate to Feeds > Feed URLs, locate the Order XML feed section and copy the URL displayed.
To password protect your feed, navigate to Feeds > Feed URLs, locate the Order XML feed section and select the password protect this feed setting. Use the username and password shown on the Feed URLs page in the Feed protection section.
Coding tips
Coding tips
- Consult the documentation for the order object and order product object for a list of the variables available
- Remember to close any
{% if %}
statements or{% for %}
cycles with{% endif %}
and{% endfor %}
- Any Twig errors in the code will result in an error generating the feed
- When updating the code for your feed if the code has an error, the feed will not regenerate and changes will not be reflected
- You can or an external AI such as ChatGPT for assistance in creating the code
- Or contact theme support
- Use order custom fields to modify output and include custom data in your feed
Example code
Example code
This simple order feed includes basic information such as the order reference, date, billing details, and the products in the order.
{% spaceless %}
<?xml version="1.0"?>
<rss version="2.0">
<channel>
{% for order in orders %}
<order>
<reference>{{ order.reference }}</reference>
<date>{{ order.date|date('Y-m-d H:i:s') }}</date>
<billing>
<name>{{ order.billing_name }}</name>
<email>{{ order.billing_email }}</email>
<phone>{{ order.billing_phone }}</phone>
<address>{{ order.billing_address1 }}, {{ order.billing_city }}, {{ order.billing_country }}</address>
</billing>
<products>
{% for product in order.products %}
<product>
<name>{{ product.name }}</name>
<sku>{{ product.sku }}</sku>
<quantity>{{ product.quantity }}</quantity>
<price>{{ product.price_including_vat }}</price>
</product>
{% endfor %}
</products>
</order>
{% endfor %}
</channel>
</rss>
{% endspaceless %}
This example is a more complex XML order feed and includes additional details such as order status, shipping information, payment method, and discounts applied.
{% spaceless %}
<?xml version="1.0"?>
<rss version="2.0">
<channel>
{% for order in orders %}
<order>
<reference>{{ order.reference }}</reference>
<date>{{ order.date|date('Y-m-d H:i:s') }}</date>
<status>{{ order.status }}</status>
<payment_method>{{ order.payment_method }}</payment_method>
<total>{{ order.total }}</total>
<discount_total>{{ order.discount_total }}</discount_total>
<billing>
<name>{{ order.billing_name }}</name>
<email>{{ order.billing_email }}</email>
<phone>{{ order.billing_phone }}</phone>
<address>
<line1>{{ order.billing_address1 }}</line1>
<city>{{ order.billing_city }}</city>
<province>{{ order.billing_province }}</province>
<country>{{ order.billing_country }}</country>
<postcode>{{ order.billing_postcode }}</postcode>
</address>
</billing>
<shipping>
<name>{{ order.shipping_name }}</name>
<company>{{ order.shipping_company }}</company>
<phone>{{ order.shipping_phone }}</phone>
<email>{{ order.shipping_email }}</email>
<address>
<line1>{{ order.shipping_address1 }}</line1>
<city>{{ order.shipping_city }}</city>
<province>{{ order.shipping_province }}</province>
<country>{{ order.shipping_country }}</country>
<postcode>{{ order.shipping_postcode }}</postcode>
</address>
</shipping>
<products>
{% for product in order.products %}
<product>
<name>{{ product.name }}</name>
<sku>{{ product.sku }}</sku>
<quantity>{{ product.quantity }}</quantity>
<price>{{ product.price_including_vat }}</price>
<total>{{ product.total }}</total>
{% if product.options %}
<options>
{% for option in product.options %}
<option>
<name>{{ option.name }}</name>
<value>{{ option.value }}</value>
</option>
{% endfor %}
</options>
{% endif %}
</product>
{% endfor %}
</products>
<shipping_rates>
{% for rate in order.shipping_rates %}
<rate>
<name>{{ rate.name }}</name>
<price>{{ currency_value(rate.price) }}</price>
</rate>
{% endfor %}
</shipping_rates>
<discounts>
{% for discount in order.discounts %}
<discount>
<name>{{ discount.name }}</name>
<value>{{ discount.price }}</value>
</discount>
{% endfor %}
</discounts>
</order>
{% endfor %}
</channel>
</rss>
{% endspaceless %}