How can I export prices in the customer's local currency from a Shopify order?
Most of the price/money fields are in the shop's currency by default (except refunds which are in the customer's currency), but the API also provides the "presentment" amount for certain price fields.
In EZ Exporter, we can pull these values in the customer's currency using the formulas below in the Calculated Fields section of the Data Settings.
Total Price in the Customer's Currency
get_attribute_value({{ total_price_set.presentment_money }}, "amount")
Subtotal Price in the Customer's Currency
get_attribute_value({{ subtotal_price_set.presentment_money }}, "amount")
Total Lineitems Price in the Customer's Currency
get_attribute_value({{ total_line_items_price_set.presentment_money }}, "amount")
Total Tax in the Customer's Currency
get_attribute_value({{ total_tax_set.presentment_money }}, "amount")
Total Discounts in the Customer's Currency
get_attribute_value({{ total_discounts_set.presentment_money }}, "amount")
Shipping Price in the Customer's Currency
get_attribute_value({{ total_shipping_price_set.presentment_money }}, "amount")
Lineitem Unit Price in the Customer's Currency
get_attribute_value(get_attribute_value({{ line_items.price_set }}, "presentment_money", recursive=False, return_raw_results=True), "amount")
Lineitem Total Price in the Customer's Currency
float(get_attribute_value(get_attribute_value({{ line_items.price_set }}, "presentment_money", recursive=False, return_raw_results=True), "amount")) * {{ line_items.quantity }}
Lineitem Tax Lines Total Price in the Customer's Currency
get_total([i.price_set.presentment_money.amount for i in load_json_data({{ line_items.tax_lines }})])
Lineitem Total Discount Amount in the Customer's Currency
get_total([i.amount_set.presentment_money.amount for i in load_json_data({{ line_items.discount_allocations }})])
Lineitem Total Discount Percentage in the Customer's Currency
(get_total([i.amount_set.presentment_money.amount for i in load_json_data({{ line_items.discount_allocations }})]) / (float(get_attribute_value(get_attribute_value({{ line_items.price_set }}, "presentment_money", recursive=False, return_raw_results=True), "amount")) * {{ line_items.quantity }})) * 100
Lineitem Refunded Subtotal in the Customer's Currency
get_total([{str(i.line_item_id): i.subtotal_set.presentment_money.amount} for i in load_json_data(flatten_list(get_attribute_value({{ refunds }}, "refund_line_items", recursive=False, return_raw_results=True)))], str({{ line_items.id }}))
Lineitem Refunded Total Tax in the Customer's Currency
get_total([{str(i.line_item_id): i.total_tax_set.presentment_money.amount} for i in load_json_data(flatten_list(get_attribute_value({{ refunds }}, "refund_line_items", recursive=False, return_raw_results=True)))], str({{ line_items.id }}))
To also export the currency that was displayed to the customer when the order was placed, simply select the field called presentment_currency.
Related Articles:
App: EZ Exporter