app_id from order API

lesliewong
Shopify Partner
8 0 1

hello guys,

I am developing an app, and it need to extract all online orders for a customer. As there's no field such as "channel" in order API. I looked through the doc and found that "app_id", "source_name" seems to be a possible way to distinguish online & pos orders.

 

And the API can only filter by attribution_app_id. (user source_name=web but do not work) now. As I know, app_id is used to identify different apps, such as POS app, other app installed.

And here is my question, is "attribution_app_id" fixed for online store? I am considering to use attribution_app_id=xxxx to get all online orders but I dont know if it will be changed.

If that's fixed, I think it will solve my problem as well as many developer. As I can see from some outdated post, they also asking for a way to extract online store only. Thanks in advance.

 

Replies 9 (9)

Alex
Shopify Staff
1561 81 341

attribution_app_id and app_id are static identifiers, they are unique from API client to API client and do not change over time (including if an app is uninstalled/reinstalled).

Searching by attribution_app_id will filter the returned orders in the way you need it to (orders created only by an app in particular) reliably. The app ID of online store, for example, will always be 580111.

The only way this ID can change is if the developer of an app were to delete the app and create a new one with the same name for whatever reason, in which case a new API client is then created.

Alex | 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 the Shopify Help Center or the Shopify Blog

lesliewong
Shopify Partner
8 0 1

Oh, that's greate news. So I think this is a reliable filter to get only online orders through API. Thanks for your help! 🙂

Vikash_Jha
Shopify Partner
6 0 2

Hey Alex,

So does every app get a new app_id after installing on a store? or App Id "1" will remain "1" installed on any store?

Alex
Shopify Staff
1561 81 341

Hey Vikash,

The latter. As in an app with the ID of 1 will always be 1 across all installs.

Cheers.

Alex | 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 the Shopify Help Center or the Shopify Blog

Vikash_Jha
Shopify Partner
6 0 2

Hey Alex,

I tried pulling orders from two diferrent stores who have my sales channel app installed. I am confident that both the stores have received orders through my app. But, I don't see the app_id paramater to be identical for both the response.

I can provide you specific details if you need.

 

Thanks

 

Alex
Shopify Staff
1561 81 341

Hey Vikash,

An order's `id` property should be all I need (and a channel name if you can provide that).

Cheers.

Alex | 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 the Shopify Help Center or the Shopify Blog

Vikash_Jha
Shopify Partner
6 0 2

Hey Alex,

Sales channel name is 'Mobile App Creator - Mobile Apps Builder - Plobal Apps Mobile Application'

and Order Ids are what I am trying to pull. 

here are the two store on which i am trying with 

baby-online-nz.myshopify.com
baileys-blossoms.myshopify.com

 

you can check the revenue section of these stores to confirm that they have generated some revenue form this sales channel.

Thanks

 

Vikash_Jha
Shopify Partner
6 0 2

Hey Alex,

 

Were you able to find a solution?

 

Vikash

Alex
Shopify Staff
1561 81 341

Hey Vikash,

Every order on baby-online-nz.myshopify.com attributed to "Mobile App" (at least in the past 30 days) was attributed to a private app of the same name. The app_id of this private app matches that which shows on the order.

Each private app on each shop will always have a unique ID, as each private app is its own instance of an API client, so across shops the ID will be different in this case. If the orders were in fact processed by the sales channel, then the ID would be the same across shops since any one channel can be installed across many shops.

Cheers.

Alex | 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 the Shopify Help Center or the Shopify Blog