Where can I find the REST API field order.source_name in the graphql API?

Solved
Lull
Excursionist
24 1 3

Hi,

 

Where can I find order.source_name from the REST API in the graphql API?
Is it to be found at order.publication.name - although the values are not the same (the REST value is e.g. web/pos, and the graphql value is e.g. "Online store"), or can a better match be found?

 

Thanks,

-Louise

0 Likes
hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 135

This is an accepted solution.

Hey @Lull ,

 

The closest match to the `order.source_name` field in the GraphQL Admin API right now is the fields of `order.publication.name` or `order.publication.app.title`, which will give you the name of the Sales Channel that the order will be completed from (e.g Online Store, POS, a 3rd party channel like Facebook, etc.) https://shopify.dev/docs/admin-api/graphql/reference/object/publication?api[version]=2020-04

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Lull
Excursionist
24 1 3

Hi Hassain,

 

Thank you for the answer (I missed the notification in my inbox until now).

 

-Louise

0 Likes
Lull
Excursionist
24 1 3

I just found out that publication is null for orders that originate from draft orders. Shouldn't the publication indicate this instead of being null?

0 Likes
hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 135

Hi @Lull ,

 

I believe the idea here is that the Publication property should represent the sales channel or marketplace where products are published to. Since Draft Orders are neither channels nor marketplaces and are not public and have no products published to them, they would not be considered a Publication and therefore would be set as null. 

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes