Happening now | Office Hours: Customizing Your Theme With Moeed | Ask your questions now!
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

source_name vs sales channel

source_name vs sales channel

sarah-flint
Visitor
1 0 0

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".

 

sarahflint_0-1664213326247.png

sarahflint_1-1664213365890.png

 

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


 

Reply 1 (1)

KB77
Shopify Staff
59 6 11

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