How do I export only new Shopify orders with a time offset to handle a buyer remorse period or post-purchase upsells?

Some merchants might want to export newly created orders only if the orders were placed after a certain amount of time has passed.

One reason for this is to handle a buyer remorse period, where customers can edit or cancel the order for up to a specific amount of time.

Another reason is if the merchant sends out post-purchase offers where a customer can add additional items to the order at a discounted price within a certain time period.

This way, the merchant doesn't accidentally process/fulfill canceled orders or use stale order data (if the line items changed).

In EZ Exporter, you can utilize the Filters and Custom Filters to handle these scenarios.

For example, you might want to run an automated export every 15 minutes of new orders created since the last successful export, but with a 1-hour offset.  To do this, you would set the following settings:

Filters

  • Order status: Open
  • Created: Since Yesterday

The options under Filters get sent to the Shopify API directly, so these settings would reduce the amount of data to request from the API and speed up the export.

Custom Filters

Data must match: all conditions

  • Created At is greater than or equal to {{ last_successful_run }} - 0.041666666666666664
  • Created At is less than {{ current_task_start_time }} - 0.041666666666666664

The Custom Filters happen on our end and will filter the data further.  You can only subtract days when dealing with date/time fields, but you can use a fraction of a day.  In the above example, to offset by 1 hour, you would divide 1 hour by 24 hours.

Please note that spaces matter here, so make sure there's a space before and after the "-" sign.  Precision also matters as Shopify date/time fields include the full timestamp with the seconds, so don't round the decimals when dividing.

You can click here to learn more about date/time filtering in the Custom Filters.

Here's a screenshot of what the settings will look like in the app:

Another thing to note is when exporting order data for fulfillment purposes, you might want to include the field called line_items.fulfillable_quantity (the remaining quantity to be fulfilled) which will reflect order edits.  If a customer edits an order and removes a line item or reduces the quantity, the line_items.quantity field in the Shopify API will remain unchanged, so it's important to be aware of this (more info here).

If you don't use a buyer remorse or post-purchase workflow and simply need to export new orders, this is a much simpler setup and you can follow our guide here.


Related Articles:


App: EZ Exporter

Tags: advanced features, shopify orders, order fulfillment, post-purchase upsells, buyer remorse period