Discussing APIs and development related to customers, discounts, and order management.
Hello! I am working on a development project where we are pulling the .json data into another system. There is a field in the .json "source_name", which seems to most closely correlate to "Sales Channel" in the UI (and the same in the shopify reporting).
However, I am finding certain instances where the "source_name" in the .json does not correlate to "Sales Channel" in the UI/ reporting. In the UI this is shown as a "Draft Order". But in the .json it is listed as "web" which correlates to "Online Sales".
In this instance, this was a draft order that we sent an invoice to the customer and they created the payment on their end, vs our team processing the entire draft order.
I am wondering what the logic around "source_name" is or if there is a better way to pull the sales channel
Hi @sarah-flint
The source_name
of an order will change depending on how the order was completed. If the draft order is completed by an app, completed by the customer via checkout or completed directly in the admin the source_name
will vary.
If the draft order was completed by the customer following the Complete Purchase
option from the email invoice paying via the online checkout the source_name
will show as web
.
If you complete the Draft Order via an app like the one used to create the draft order, the source_name
will show as the app ID.
If you complete the Draft Order from the Draft Order section of the admin the source_name
will show as shopify_draft_order
.
I hope that helps in understanding the behaviour around the source_name field.
KB77 | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog