Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Request a new shipping rate for a subscription contract draft

Solved

Request a new shipping rate for a subscription contract draft

makasanas
Shopify Partner
22 0 3

Hello there,

We are following https://shopify.dev/apps/subscriptions/shipping-delivery#request-a-new-shipping-rate-for-a-subscript... this as a reference to get new shipping rate when customer changes their shipping address. 

We have followed the exact things mentioned in the document, but we always failed to get new shipping rates, It always returns null or some internal server error from Shopify.

Here is the query we are using 

 

{
      subscriptionDraft(id: "gid://shopify/SubscriptionDraft/3492610236") {
        shippingOptions(
          deliveryAddress: {
            address1: "5922 Ladd Road"
            address2: ""
            countryCode:US
            provinceCode:"MD"
            city: "Suitland"
            country: "United States"
            zip: "20746"
            province: "Maryland"
          }
        ) {
          __typename
          ... on SubscriptionShippingOptionResultSuccess {
            shippingOptions {
              title
              price {
                amount
                currencyCode
              }
            }
          }
          ... on SubscriptionShippingOptionResultFailure {
            message
          }
        }
      }
    }

 


And here is the response we get all the times 

 

[ { message:
     'Internal error. Looks like something went wrong on our end.\nRequest ID: 2e68a134-e7e6-4cca-b226-7ebbbeb6b9cd (include this in support requests).',
    extensions:
     { code: 'INTERNAL_SERVER_ERROR',
       requestId: '2e68a134-e7e6-4cca-b226-7ebbbeb6b9cd' } } ]

 

 
Or we get 

 

{ subscriptionDraft: { shippingOptions: null } } 

 


We have already seen that some other apps related to subscriptions are providing this feature, how do they achieve that.

So my question is how we can get the new shipping rate to update shipping address properly when some customer changes their shipping address. 
Is there any other way to do that or is something wrong that I am trying?


Accepted Solution (1)

Poulping
Shopify Staff
29 4 4

This is an accepted solution.

Hello makasanas,

It seems your app is missing a scope, either `read_shipping` or `write_shipping`.

You can find the list of scopes required for this functionality here: https://shopify.dev/apps/subscriptions/shipping-delivery#scopes

 

Thanks!

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Reply 1 (1)

Poulping
Shopify Staff
29 4 4

This is an accepted solution.

Hello makasanas,

It seems your app is missing a scope, either `read_shipping` or `write_shipping`.

You can find the list of scopes required for this functionality here: https://shopify.dev/apps/subscriptions/shipping-delivery#scopes

 

Thanks!

To learn more visit the Shopify Help Center or the Community Blog.