Exporteo Help
Search…
Liquid variables
Exporteo makes use of the Liquid template language to transform orders to a desired output format.
The base variable is the order object, or the orders list if you are processing orders in bulk. The order object has the same properties as orders returned by Shopify REST API: https://shopify.dev/docs/admin-api/rest/reference/orders/order
Experteo has the ability to pull additional data related to the processed order when you reference a specific property in the output template.
  • order metafields order.metafields
  • fulfillment orders order.fulfillment_orders
  • customer metafields order.customer.metafields
  • transactions orders.transactions

Billing Address

The mailing address associated with the payment method. This address is an optional field that won't be available on orders that do not require a payment method. It has the following properties:
  • order.billing_address.address1: The street address of the billing address.
  • order.billing_address.address2: An optional additional field for the street address of the billing address.
  • order.billing_address.city: The city, town, or village of the billing address.
  • order.billing_address.company: The company of the person associated with the billing address.
  • order.billing_address.country: The name of the country of the billing address.
  • order.billing_address.country_code: The two-letter code (ISO 3166-1 format) for the country of the billing address.
  • order.billing_address.first_name: The first name of the person associated with the payment method.
  • order.billing_address.last_name: The last name of the person associated with the payment method.
  • order.billing_address.latitude: The latitude of the billing address.
  • order.billing_address.longitude: The longitude of the billing address.
  • order.billing_address.name: The full name of the person associated with the payment method.
  • order.billing_address.phone: The phone number at the billing address.
  • order.billing_address.province: The name of the region (province, state, prefecture, …) of the billing address.
  • order.billing_address.province_code: The two-letter abbreviation of the region of the billing address.
  • order.billing_address.zip: The postal code (zip, postcode, Eircode, …) of the billing address.

Discount codes

order.discount_codes contains a list of discounts applied to the order. Each discount object includes the following properties:
  • amount: The amount that's deducted from the order total. When you create an order, this value is the percentage or monetary amount to deduct. After the order is created, this property returns the calculated amount.
  • code: When the associated discount application is of type code, this property returns the discount code that was entered at checkout. Otherwise this property returns the title of the discount that was applied.
  • type: The type of discount:
    • fixed_amount: Applies amount as a unit of the store's currency. For example, if amount is 30 and the store's currency is USD, then 30 USD is deducted from the order total when the discount is applied.
    • percentage: Applies a discount of amount as a percentage of the order total.
    • shipping: Applies a free shipping discount on orders that have a shipping rate less than or equal to amount. For example, if amount is 30, then the discount will give the customer free shipping for any shipping rate that is less than or equal to $30.
Currently it's possible to apply only one discount code in Shopify orders. Even though order.discount_codes is a list, you can assume that there will be at most one discount code. Here is a code snippet that returns a discount value or 0 if there was no discount :
1
Discount: {{ order.discount_codes[0].amount | default: 0 | money }}
Copied!

Note Attributes

order.note_attributes are custom form fields that let you collect additional information from your customers on the cart page. They appear in the Additional Details section of an order details page. order.node_attributes is a list of objects that consist of name and value , for example:
1
"note_attributes": [
2
{
3
"name": "Pickup Date",
4
"value": "05/06/2021"
5
},
6
{
7
"name": "Pickup Time",
8
"value": "4:30 PM"
9
},
10
]
Copied!
To get an attribute value by name, you can use the following Liquid expression:
1
{{ order.note_attributes | where: "name", "Delivery Date" | map: "value" | first }}
Copied!

Line Items

order.line_items contains the list of order line items. Each line item has the following properties:
  • discount_allocations: An ordered list of amounts allocated by discount applications. Each discount allocation is associated to a particular discount application.
    • amount: The discount amount allocated to the line in the shop currency.
    • discount_application_index: The index of the associated discount application in the order's discount_applications list.
    • amount_set: The discount amount allocated to the line item in shop and presentment currencies.
  • duties: A list of duty objects, each containing information about a duty on the line item.
  • fulfillable_quantity: The amount available to fulfill, calculated as follows:
    quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity
  • fulfillment_service: The service provider that's fulfilling the item. Valid values: manual, or the name of the provider, such as amazon or shipwire.
  • fulfillment_status: How far along an order is in terms line items fulfilled. Valid values: null, fulfilled, partial, and not_eligible.
  • gift_card: Whether the item is a gift card. If true, then the item is not taxed or considered for shipping charges.
  • grams: The weight of the item in grams.
  • id: The ID of the line item.
  • name: The name of the product variant.
  • options_with_values: An array of selected values from the item's product options. Each option is a key-value pair with option.name as the option and option.value as the option value. Elements in line_item.options_with_values can be displayed using a for loop.
    1
    {% for option in line_item.options_with_values %}
    2
    {{ option.name }}: {{ option.value }}
    3
    {% endfor %}
    Copied!
  • origin_location: The location of the line item’s fulfillment origin.
    • id: The location ID of the line item’s fulfillment origin. Used by Shopify to calculate applicable taxes. This is not the ID of the location where the order was placed. You can use the FulfillmentOrder resource to determine the location an item will be sourced from.
    • country_code: The two-letter code (ISO 3166-1 format) for the country of the item's supplier.
    • province_code: The two-letter abbreviation for the region of the item's supplier.
    • name: The name of the item's supplier.
    • address1: The street address of the item's supplier.
    • address2: The suite number of the item's supplier.
    • city: The city of the item's supplier.
    • zip: The zip of the item's supplier.
  • price: The price of the item before discounts have been applied in the shop currency.
  • price_set: The price of the line item in shop and presentment currencies.
  • product_id: The ID of the product that the line item belongs to.
  • product.featured_image_url: The URL of the main image of the product.
  • product.product_type: The product type. A categorization for the product used for filtering and searching products.
  • product.tags: The list of product tags.
  • properties: An array of custom information for the item that has been added to the cart. Often used to provide product customization options.
  • quantity: The number of items that were purchased.
  • requires_shipping: Whether the item requires shipping.
  • sku: The item's SKU (stock keeping unit).
  • title: The title of the product.
  • variant_id: The ID of the product variant.
  • variant_title: The title of the product variant.
  • variant.barcode: The barcode of the product variant.
  • variant.harmonized_system_code: The harmonized system code of the item. Also known as the HS tariff code.
  • variant.compare_at_price: The compare at price of the product variant. The value is taken from current product data. If you are exporting historical orders, then the compare at price may not reflect the value that was present when an order was placed.
  • variant.cost: The unit cost of the product variant.
  • variant.country_code_of_origin: The two-letter code of the country of origin.
  • vendor: The name of the item's supplier.
  • taxable: Whether the item was taxable.
  • tax_lines: A list of tax line objects, each of which details a tax applied to the item.
    • title: The name of the tax.
    • price: The amount added to the order for this tax in the shop currency.
    • price_set: The amount added to the order for this tax in shop and presentment currencies.
    • rate: The tax rate applied to the order to calculate the tax price.
    • rate_percentage: The tax rate in percentage format.
  • tip_payment_gateway: The payment gateway used to tender the tip, such as shopify_payments. Present only on tips.
  • tip_payment_method: The payment method used to tender the tip, such as Visa. Present only on tips.
  • total_discount: The total amount of the discount allocated to the line item in the shop currency. This field must be explicitly set using draft orders, Shopify scripts, or the API. Instead of using this field, Shopify recommends using discount_allocations, which provides the same information.
  • total_discount_set: The total amount allocated to the line item in the presentment currency. Instead of using this field, Shopify recommends using discount_allocations, which provides the same information.
The best way to process line items is to use a for loop.
JSON
XML
1
{
2
"line_items": [
3
{%- for item in order.line_items %}
4
{
5
"product_id": {{ item.product_id | json }},
6
"variant_id": {{ item.variant_id | json }},
7
"sku": {{ item.sku | json }},
8
"title": {{ item.title | json }},
9
"price": {{ item.price | json }},
10
"quantity": {{ item.quantity | json }},
11
"total_price": {{item.price | times: item.quantity | round: 2}}
12
}
13
{%- if forloop.last == false -%},{% endif %}
14
{%- endfor %}
15
]
16
}
Copied!
1
<items>
2
{%- for item in order.line_items %}
3
<item>
4
<product_id>{{item.product_id}}</product_id>
5
<variant_id>{{item.variant_id}}</variant_id>
6
<sku>{{item.sku}}</sku>
7
<title>{{item.title}}</title>
8
<price>{{item.price}}</price>
9
<quantity>{{item.quantity}}</quantity>
10
<total_price>{{item.price | times: item.quantity | money }}</total_price>
11
</item>
12
{%- endfor %}
13
</items>
Copied!

Sum tax lines

You can notice that each line item has a list of tax_lines. Use the following code snippet to calculate total tax and net price per line item:
1
<items>
2
{%- for item in order.line_items %}
3
<item>
4
{%- assign tax_amount = 0.0 -%}
5
{%- for tax_line in item.tax_lines -%}
6
{%- assign tax_amount = tax_amount | plus: tax_line.price -%}
7
{%- endfor %}
8
{%- assign total_price = item.price | times: item.quantity %}
9
{%- assign net_total_price = total_price | minus: tax_amount %}
10
<total_price>{{ total_price }}</total_price>
11
<net_price>{{ net_total_price }}<net_price>
12
</item>
13
{%- endfor %}
14
</items>
Copied!

Shipping Address

The mailing address to where the order will be shipped. This address is optional and will not be available on orders that do not require shipping. It has the following properties:
  • order.shipping_address.address1: The street address of the billing address.
  • order.shipping_address.address2: An optional additional field for the street address of the billing address.
  • order.shipping_address.city: The city, town, or village of the billing address.
  • order.shipping_address.company: The company of the person associated with the billing address.
  • order.shipping_address.country: The name of the country of the billing address.
  • order.shipping_address.country_code: The two-letter code (ISO 3166-1 format) for the country of the billing address.
  • order.shipping_address.first_name: The first name of the person associated with the payment method.
  • order.shipping_address.last_name: The last name of the person associated with the payment method.
  • order.shipping_address.latitude: The latitude of the billing address.
  • order.shipping_address.longitude: The longitude of the billing address.
  • order.shipping_address.name: The full name of the person associated with the payment method.
  • order.shipping_address.phone: The phone number at the billing address.
  • order.shipping_address.province: The name of the region (province, state, prefecture, …) of the billing address.
  • order.shipping_address.province_code: The two-letter abbreviation of the region of the billing address.
  • order.shipping_address.zip: The postal code (zip, postcode, Eircode, …) of the billing address.

Shipping Cost

  • order.total_shipping_price_set: The total shipping price of the order, excluding discounts and returns, in shop and presentment currencies. If order.taxes_included is set to true, then total_shipping_price_set includes taxes.
1
"total_shipping_price_set": {
2
"shop_money": {
3
"amount": "30.00",
4
"currency_code": "USD"
5
},
6
"presentment_money": {
7
"amount": "0.00",
8
"currency_code": "USD"
9
}
10
}
Copied!

Shipping Method

  • order.shipping_lines: An array of objects, each of which details a shipping method used. Each object has the following properties:
    • code: A reference to the shipping method.
    • discounted_price: The price of the shipping method after line-level discounts have been applied. Doesn't reflect cart-level or order-level discounts.
    • discounted_price_set: The price of the shipping method in both shop and presentment currencies after line-level discounts have been applied.
    • price: The price of this shipping method in the shop currency. Can't be negative.
    • price_set: The price of the shipping method in shop and presentment currencies.
    • source: The source of the shipping method.
    • title: The title of the shipping method.
    • tax_lines: A list of tax line objects, each of which details a tax applicable to this shipping line.
    • carrier_identifier: A reference to the carrier service that provided the rate. Present when the rate was computed by a third-party carrier service.
    • requested_fulfillment_service_id: A reference to the fulfillment service that is being requested for the shipping method. Present if the shipping method requires processing by a third party fulfillment service; null otherwise.
1
"shipping_lines": [
2
{
3
"code": "INT.TP",
4
"price": "4.00",
5
"price_set": {
6
"shop_money": {
7
"amount": "4.00",
8
"currency_code": "USD"
9
},
10
"presentment_money": {
11
"amount": "3.17",
12
"currency_code": "EUR"
13
}
14
},
15
"discounted_price": "4.00",
16
"discounted_price_set": {
17
"shop_money": {
18
"amount": "4.00",
19
"currency_code": "USD"
20
},
21
"presentment_money": {
22
"amount": "3.17",
23
"currency_code": "EUR"
24
}
25
},
26
"source": "canada_post",
27
"title": "Small Packet International Air",
28
"tax_lines": [],
29
"carrier_identifier": "third_party_carrier_identifier",
30
"requested_fulfillment_service_id": "third_party_fulfillment_service_id"
31
}
32
]
Copied!
If you are sure that your orders won't be divided into multiple shipments, then you can simplify getting the shipping method to {{ order.shipping_lines[0].title }} .
You can use case/when instructions to map shipping method names to supplier-accepted codes.
1
<DeliveryCode>
2
{%- case order.shipping_lines[0].title -%}
3
{%- when "UPS Next Day Air" -%}
4
ZZ_US1D
5
{%- when "UPS 2 Day Air" -%}
6
ZZ_US2D
7
{%- when "UPS Ground" -%}
8
ZZ_USGN
9
{%- when "UPS Surepost" -%}
10
ZZ_USSL
11
{%- endcase -%}
12
</DeliveryCode>
Copied!

Status

Shopify includes 2 fields describing order status:
  • order.financial_status The status of payments associated with the order. Can only be set when the order is created. Possible values:
    • pending: The payments are pending. Payment might fail in this state. Check again to confirm whether the payments have been paid successfully.
    • authorized: The payments have been authorized.
    • partially_paid: The order have been partially paid.
    • paid: The payments have been paid.
    • partially_refunded: The payments have been partially refunded.
    • refunded: The payments have been refunded.
    • voided: The payments have been voided.
  • order.fulfillment_status The order's status in terms of fulfilled line items. Possible values:
    • fulfilled: Every line item in the order has been fulfilled.
    • null: None of the line items in the order have been fulfilled.
    • partial: At least one line item in the order has been fulfilled.
    • restocked: Every line item in the order has been restocked and the order canceled.

Totals

If you added an item filter, and selected the checkbox to exclude items not matching the filter, then you may need to calculate totals based on the filtered line items. For example, check out the code snippet to calculate total weight.
  • order.total_discounts The total discounts applied to the price of the order in the shop currency.
  • order.total_discounts_set The total discounts applied to the price of the order in shop and presentment currencies.
    • order.total_discounts_set.shop_money.amount
    • order.total_discounts_set.shop_money.currency
    • order.total_discounts_set.presentment_money.ammount
    • order.total_discounts_set.presentment_money.currency
  • order.total_line_items_price The sum of all line item prices in the shop currency.
  • order.total_line_items_price_set The total of all line item prices in shop and presentment currencies.
    • order.total_line_items_price_set.shop_money.amount
    • order.total_line_items_price_set.shop_money.currency
    • order.total_line_items_price_set.presentment_money.ammount
    • order.total_line_items_price_set.presentment_money.currency
  • order.total_outstanding The total outstanding amount of the order in the shop currency.
  • order.total_price The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency.
  • order.total_price_setThe total price of the order in shop and presentment currencies.
    • order.total_price_set.shop_money.amount
    • order.total_price_set.shop_money.currency
    • order.total_price_set.presentment_money.ammount
    • order.total_price_set.presentment_money.currency
  • order.total_shipping_price_set The total shipping price of the order, excluding discounts and returns, in shop and presentment currencies. If taxes_included is set to true, then order.total_shipping_price_set includes taxes.
  • order.total_tax The sum of all the taxes applied to the order in the shop currency
  • order.total_tax_set The total tax applied to the order in shop and presentment currencies.
    • order.total_tax_set.shop_money.amount
    • order.total_tax_set.shop_money.currency
    • order.total_tax_set.presentment_money.ammount
    • order.total_tax_set.presentment_money.currency
  • order.total_tip_received The sum of all the tips in the order in the shop currency.
  • order.total_weight The sum of all line item weights in grams.

Transactions

order.transactions contains the list of transactions. Each transaction has the following properties:
Property
Description
amount
The amount of money included in the transaction. If you don't provide a value for `amount`, then it defaults to the total cost of the order (even if a previous transaction has been made towards it).
authorization
The authorization code associated with the transaction.
created_at
The date and time (ISO 8601 format) when the transaction was created.
currency
The three-letter code (ISO 4217 format) for the currency used for the payment.
device_id
The ID for the device.
error_code
A standardized error code, independent of the payment provider. Valid values:
  • incorrect_number
  • invalid_number
  • invalid_expiry_date
  • invalid_cvc
  • expired_card
  • incorrect_cvc
  • incorrect_zip
  • incorrect_address
  • card_declined
  • processing_error
  • call_issuer
  • pick_up_card
gateway
The name of the gateway the transaction was issued through. A list of gateways can be found on Shopify's payment gateways page.
id
The ID for the transaction.
kind
The transaction's type. Valid values:
  • authorization: Money that the customer has agreed to pay. The authorization period can be between 7 and 30 days (depending on your payment service) while a store waits for a payment to be captured.
  • capture: A transfer of money that was reserved during the authorization of a shop.
  • sale: The authorization and capture of a payment performed in one single step.
  • void: The cancellation of a pending authorization or capture.
  • refund: The partial or full return of captured money to the customer.
location_id
The ID of the physical location where the transaction was processed.
message
A string generated by the payment provider with additional information about why the transaction succeeded or failed.
order_id
The ID for the order that the transaction is associated with.
payment_details
Information about the credit card used for this transaction. It has the following properties:
  • avs_result_code: The response code from the address verification system. The code is a single letter; see this chart for the codes and their definitions.
  • credit_card_bin: The issuer identification number (IIN), formerly known as bank identification number (BIN) of the customer's credit card. This is made up of the first few digits of the credit card number.
  • credit_card_company: The name of the company that issued the customer's credit card.
  • credit_card_number: The customer's credit card number, with most of the leading digits redacted.
  • cvv_result_code: The response code from the credit card company indicating whether the customer entered the card security code, or card verification value, correctly. The code is a single letter or empty string; see this chart for the codes and their definitions.
parent_id
The ID of an associated transaction.
  • For capture transactions, the parent needs to be an authorization transaction.
  • For void transactions, the parent needs to be an authorization transaction.
  • For refund transactions, the parent needs to be a capture or sale transaction.
processed_at
The date and time (ISO 8601 format) when a transaction was processed. This value is the date that's used in the analytic reports. By default, it matches the created_at value. If you're importing transactions from an app or another platform, then you can set processed_at to a date and time in the past to match when the original transaction was processed.
receipt
A transaction receipt attached to the transaction by the gateway. The value of this field depends on which gateway the shop is using.
For example, if gateway is gift_card, then receipt contains gift_card_id and gift_card_last_characters.
source_name
The origin of the transaction. This is set by Shopify and can't be overridden. Example values: web, pos, iphone, and android.
status
The status of the transaction. Valid values: pending, failure, success, and error.
test
Whether the transaction is a test transaction.
user_id
The ID for the user who was logged into the Shopify POS device when the order was processed, if applicable.
The best way to output all transactions is to use a for loop.
JSON
XML
1
{
2
"transactions": [
3
{%- for transaction in order.transactions %}
4
{
5
"amount": {{ transaction.amount | json }},
6
"currency": {{ transaction.currency | json }},
7
"gateway": {{ transaction.gateway | json }},
8
"status": {{ transaction.status| json }}
9
}
10
{%- if forloop.last == false -%},{% endif %}
11
{%- endfor %}
12
]
13
}
Copied!
1
<transactions>
2
{%- for transaction in order.transactions %}
3
<transaction>
4
<amount>{{ transaction.amount }}</amount>
5
<currency>{{ transaction.currency }}</variant_id>
6
<gateway>{{ transaction.gateway }}</gateway>
7
<kind>{{ transaction.kind }}</kind>
8
<status>{{ transaction.status }}</status>
9
</transaction>
10
{%- endfor %}
11
</transactions>
Copied!
To get credit card details (company, masked number):
1
{%- assign payment_details = order.transactions | where: "kind","sale" | map: "payment_details" | first %}
2
{%- if payment_details %}
3
<creditCard>
4
<company>{{ payment_details.credit_card_company }}</company>
5
<number>{{ payment_details.credit_card_number }}</number>
6
</creditCard>
7
{%- endif %}
Copied!
Last modified 4d ago