Personalized checkout and custom promotions with Shopify Scripts
I have exported order data to a CSV file from my Shopify store. Now, I have also extracted order data using the Shopify API. However, I am having trouble identifying the corresponding data or keywords in the API response for the following columns present in the exported CSV file from the Shopify store:
Solved! Go to the solution
This is an accepted solution.
Hey there,
With the REST API, there are multiple endpoints involved here:
Order API: tax_lines
I'm wondering about this myself, this might even be deprecated as it's not mentioned on their docs: https://help.shopify.com/en/manual/orders/export-orders#order-export-csv-structure
Order API: original_total_duties_set
Order API: billing_address.province
Order Transaction API: payment_id
Order API: payment_terms.payment_schedules.due_at
Order Transaction API: payment_id
Order Risk API: recommendation
Order API: can't get actual staff name, but you can get the record ID via the user_id field.
Not sure about this one, there's a location_id field though in the Order API.
Order API: device_id
Order API: refunds (you'll need to parse the list of refund transactions and add up the amounts)
Order Transaction API: payment_id
Order API: note_attributes, note, shipping_lines.title, total_discounts, shipping_lines (add up the price attribute)
Order API and Product Variant API: Get the variant_id from the line_items.variant_id field of the Order API. Use that ID and make a call to the Product Variant API to get the compare_at_price field.
This is an accepted solution.
This one's a bit tricky, you'll have to use multiple conditions. Basically the logic will be:
If the order's financial_status == 'paid', then the latest created_at value from the list of transactions coming from the Transactions API will essentially be the "paid at" date.
Note that it's important that the order's financial_status is paid, since if the order was refunded later, then the last transaction date will be the refund date.
There's a 'status' field and a 'kind' field in the transaction data as well, so you could use that further for the filtering: https://shopify.dev/docs/api/admin-rest/2023-04/resources/transaction
For example, an alternate logic would be something like:
Filter the list of transactions where 'status' == 'success' and ('kind' == 'sale' or 'kind' == 'capture'). The latest created_at from this list would then be the paid at date.
This is an accepted solution.
Hey there,
With the REST API, there are multiple endpoints involved here:
Order API: tax_lines
I'm wondering about this myself, this might even be deprecated as it's not mentioned on their docs: https://help.shopify.com/en/manual/orders/export-orders#order-export-csv-structure
Order API: original_total_duties_set
Order API: billing_address.province
Order Transaction API: payment_id
Order API: payment_terms.payment_schedules.due_at
Order Transaction API: payment_id
Order Risk API: recommendation
Order API: can't get actual staff name, but you can get the record ID via the user_id field.
Not sure about this one, there's a location_id field though in the Order API.
Order API: device_id
Order API: refunds (you'll need to parse the list of refund transactions and add up the amounts)
Order Transaction API: payment_id
Order API: note_attributes, note, shipping_lines.title, total_discounts, shipping_lines (add up the price attribute)
Order API and Product Variant API: Get the variant_id from the line_items.variant_id field of the Order API. Use that ID and make a call to the Product Variant API to get the compare_at_price field.
Thanks a lot!
I need one more help:
Which keyword corresponds to "paid_at" column?
This is an accepted solution.
This one's a bit tricky, you'll have to use multiple conditions. Basically the logic will be:
If the order's financial_status == 'paid', then the latest created_at value from the list of transactions coming from the Transactions API will essentially be the "paid at" date.
Note that it's important that the order's financial_status is paid, since if the order was refunded later, then the last transaction date will be the refund date.
There's a 'status' field and a 'kind' field in the transaction data as well, so you could use that further for the filtering: https://shopify.dev/docs/api/admin-rest/2023-04/resources/transaction
For example, an alternate logic would be something like:
Filter the list of transactions where 'status' == 'success' and ('kind' == 'sale' or 'kind' == 'capture'). The latest created_at from this list would then be the paid at date.
User | RANK |
---|---|
3 | |
2 | |
2 | |
2 | |
2 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023