Draft Orders
Support for downloading Draft Orders in FileMaker, modifying Draft Orders and marking Draft Orders as Complete in Shopify was added in the v2.3 update of fmEcommerce Link (Shopify Edition).
You will need to first edit your Shopify private app scopes to include read/write of draft orders before you start working with Draft Orders in the fmEcommerce Link (Shopify Edition) solution:
Downloading Draft Orders from Shopify
To download Draft Orders from Shopify navigate to the SETUP > Orders > Draft Orders tab:
From this screen you can download Draft Orders from Shopify by the following options:
- Date Range: enter a start/end date and click the Import Draft Orders by Date button to download Draft Orders from Shopify between these dates
- Since ID: to download Draft Orders from Shopify since a specified Shopify Draft Order ID click the Import Draft Orders Since ID button. You will be prompted to enter the Shopify Draft Order ID that you wish to download Draft Orders from: the most recent Shopify Draft Order ID that was already downloaded will appear in the dialog box which you can manually override with a different Shopify Draft Order ID.
- All Draft Orders: to download all Draft Orders from Shopify click the Import All Draft Orders button.
When downloading Draft Orders from Shopify the Get All Draft Orders script will check to see if a Draft Order with the same Shopify ID already exists and will skip over any Draft Orders that have already been downloaded so you will not end up with duplicate Draft Orders records.
Updating an Individual Draft Order from Shopify
To download the most recent version of a individual Draft Order from Shopify navigate to the Draft Order you wish to update and click the Update Draft Order from Shopify button:
The Draft Order will be updated with the most recent version from Shopify.
Uploading a Modified Draft Order to Shopify
To upload a modified Draft Order to Shopify navigate to the Draft Order you wish to update and make the necessary changes to the Draft Order. For example you might need to modify the Qty of an existing line item, delete a line item or add a new line item to the Draft Order. When adding a new line item you just click the Add Item button, then click the Details button for that line item to bring up the following window:
Enter the Shopify Variant ID in the field highlighted above and close the window and then click the Upload Draft Order to Shopify button. This will uploaded the modified version of the Draft Order to Shopify and the updated version of the Draft Order will then be downloaded from Shopify which will populate the price, tax etc fields.
Mark a Draft Order as Complete in Shopify
To mark a Draft Order as Complete in Shopify and transition it to an order navigate to the Draft Order you wish to update. For the Payment Pending checkbox tick this checkbox if you wish to make the resulting order unpaid and payment to be captured later. If you leave the Payment Pending checkbox unticked the resulting order will be marked as paid through either the default or specified gateway.
Click the Complete Draft Order button to update the Draft Order as Complete in Shopify.
You can get more information about the Draft Order API Endpoint on the Shopify developer site here.