regulatoryOperating Fee and procesingFee not recognized outside Shopify GraphiQL explorer

Solved

regulatoryOperating Fee and procesingFee not recognized outside Shopify GraphiQL explorer

jjcastillot
Excursionist
27 1 8

Hi, currently I'm working on pulling Subscription transactions data from a Shopify App using the Admin API - GraphQL. The thing is, when I test the query in the GraphiQL explorer, it works perfectly:

 

query appSubscription {
  app(id: "XXXXXXXXXX") {
    id
  }
  transactions(
    createdAtMin:"2023-08-01T00:00:00.000000Z"
    createdAtMax:"2023-08-15T00:00:00.000000Z"
    types:[APP_SUBSCRIPTION_SALE]
    ) {
    edges {
      cursor
      node {
        id
        createdAt
        ... on AppSubscriptionSale {
          shop {
            name
            myshopifyDomain
          }
          grossAmount {
            amount
          }
          netAmount {
            amount
          }
          processingFee {
            amount
          }
          shopifyFee {
            amount
          }
          regulatoryOperatingFee {
            amount
          }
        }
      }
    }
  }
}

This query gives me the desired results for each transaction. The problem is, whenever I try to execute the query in Postman or any Python Script, I obtain the following error (And you can check these fields exist for AppSubscriptionSale):

{
    "errors": [
        {
            "message": "Field 'processingFee' doesn't exist on type 'AppSubscriptionSale'",
            "locations": [
                {
                    "line": 51,
                    "column": 11
                }
            ],
            "path": [
                "query appSubscription",
                "transactions",
                "edges",
                "node",
                "... on AppSubscriptionSale",
                "processingFee"
            ],
            "extensions": {
                "code": "undefinedField",
                "typeName": "AppSubscriptionSale",
                "fieldName": "processingFee"
            }
        },
        {
            "message": "Field 'regulatoryOperatingFee' doesn't exist on type 'AppSubscriptionSale'",
            "locations": [
                {
                    "line": 63,
                    "column": 11
                }
            ],
            "path": [
                "query appSubscription",
                "transactions",
                "edges",
                "node",
                "... on AppSubscriptionSale",
                "regulatoryOperatingFee"
            ],
            "extensions": {
                "code": "undefinedField",
                "typeName": "AppSubscriptionSale",
                "fieldName": "regulatoryOperatingFee"
            }
        }
    ]
}

Basically, outside Shopify GraphiQL Explorer, these 2 fields "processingFee" and "regulatoryOperatingFee" are not being recognized. Once I comment or delete these fields from the query in Postman or Python, it works fine, but I'm not being able to retrieve those 2 fields for each transaction.

 

I suppose my API URL and token are OK because I'm able to make requests using the API.

 

Do you know why is this happening? 

 

Thanks for your help and support.

Accepted Solutions (2)

SBD_
Shopify Staff
1829 271 415

This is an accepted solution.

Hey @jjcastillot 

 

Looks like this field is only available on the unstable version of the API - can you confirm Postman and Python script are using unstable?

Scott | Developer Advocate @ Shopify 

View solution in original post

jjcastillot
Excursionist
27 1 8

This is an accepted solution.

I managed to solve it, thanks a lot for your help. I'm using GraphQL Partners API, so the only thing I had to do was to change the API URL this way:

 

Instead of: https://partners.shopify.com/{partner_app_id}/api/2023-07/graphql.json

I used: https://partners.shopify.com/{partner_app_id}/api/unstable/graphql.json

 

And this allowed me to use the unstable version. Now it's working.

 

Thanks a lot for your help.

 

View solution in original post

Replies 3 (3)

SBD_
Shopify Staff
1829 271 415

This is an accepted solution.

Hey @jjcastillot 

 

Looks like this field is only available on the unstable version of the API - can you confirm Postman and Python script are using unstable?

Scott | Developer Advocate @ Shopify 

jjcastillot
Excursionist
27 1 8

Hi, and thanks for reaching out. Could you elaborate more on this? How can I check this on Postman or my Python Script?

 

jjcastillot
Excursionist
27 1 8

This is an accepted solution.

I managed to solve it, thanks a lot for your help. I'm using GraphQL Partners API, so the only thing I had to do was to change the API URL this way:

 

Instead of: https://partners.shopify.com/{partner_app_id}/api/2023-07/graphql.json

I used: https://partners.shopify.com/{partner_app_id}/api/unstable/graphql.json

 

And this allowed me to use the unstable version. Now it's working.

 

Thanks a lot for your help.