How can I check app earnings via Shopify partner's API?

How can I check app earnings via Shopify partner's API?

ranawaqarahmad
Shopify Partner
13 0 4

I want to check specific app earnings through Shopify partner's API. The app earnings are shown in the partner's dashboard. Just want to know if there is a way to check that through the Shopify partner's API

Replies 5 (5)

Moira
Shopify Staff
2086 227 333

Hey @ranawaqarahmad,

 

Great question!

 

The Partner API provides access to data in the Partners Dashboard. Data includes transactions that impact your earnings, app events, and for participating partners, Experts Marketplace opportunities.

 

From the Partners Dashboard, navigate to Settings > Partner API clients, and then click Manage Partner API clients. The following earning permissions can be granted for each API client:

 

  • View financials: This permission is required to access Transaction resources. These resources represent all of the transactions that impact your Partner earnings.
  • Manage apps: This permission is required to access App resources, including all app-related events such as installs, uninstalls, and charges. This resource represents all of the public and private apps managed by your organization.

 

Are you not able to retrieve the information you need via this method?

Moira | Social Care @ 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

ranawaqarahmad
Shopify Partner
13 0 4

Hi.. @Moira, yes I have already granted these permissions but am unable to retrieve desired data. I'm using the graphiQL explorer for querying but am unable to retrieve the appSubscription detail. Right now the query I'm running is as follows that gives the type of event but I'm unable to retrieve further details like (the amount of app charge, and the name of the app charge).

 

app(id:"gid://partners/App/${APPID}"){
name
apiKey
id
events(first:100){
pageInfo{
hasNextPage
}
edges{
node{
type
shop{
id
name
myshopifyDomain
avatarUrl
}
__typename
occurredAt
}
}
}
}

 

If you have any idea or resource that would help me in this matter would be appreciated. Thanks. 

Moira
Shopify Staff
2086 227 333

Unfortunately, Shopify's Partner API does not provide a way to retrieve specific app earnings. While you can get information about app subscriptions, charges, and events, the API does not provide specific financial data or earnings related to a specific app.

 

The query you are running is correct for retrieving the events related to a specific app. However, the `type` field in the event node gives you the type of event (like `app_installed`, `app_uninstalled`, `app_upgraded`, etc.), not the financial details related to that event.

 

If you need specific financial data or earnings for your app, you would need to manually calculate it based on the app charges and subscriptions. However, even for this, the Partner API does not provide all the necessary details. For example, the `AppSubscription` object does not include the actual amount charged.

 

As a workaround, you might need to maintain your own database where you track each charge when it's created, and update it when the charge status changes. You can also use the Billing API to get details about the charges created by your app. However, this requires making an API call for each individual shop, and it only gives you the charges, not the actual payments.

 

For the most accurate financial data, you should rely on the financial reports provided by in your Partner Dashboard.

Moira | Social Care @ 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

ranawaqarahmad
Shopify Partner
13 0 4

Hi @Moira thanks for detailed explanation will look into it.

Moira
Shopify Staff
2086 227 333

Don't hesitate to reach back out if you require any further assistance!

All the best,

Moira | Social Care @ 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