Questions/Tutorial about Partners API (Graphiql) - Total App Earnings

niki151
New Member
1 0 0

Hello Shopify Devs, 

Quick Introduction:
I'm new to the Partners API which is using Graphiql.
Till now I was using the REST API (with PHP) for building applications. This is my first time with Graphiql and from the docs, I do not understand how to work with it.

Description:
I have made a quick function in PHP to access the Partners API via curl and everything is working fine, but when I start building queries I do not know how to retrieve the data I want.
I have tested the functionality and it works fine with basic information - retrieving the API Key from Application with ID.

 

            $query = 
            '
            {
                  app(id: "gid://partners/App/12345") 
                  {
                    id
                    apiKey
                  }
                }
            ';

 

 

I have tried Graphiql Explorer,  but still, I cannot understand how to access the data I want (from Partners API).

 

What data I want to retrieve:
- TOTAL APP EARNINGS from Application ID filtered by Shop URL
In other words, I want to get this data:

niki151_0-1626779424827.png

 

Thanks in advance.

0 Likes