For discussing the development and integration of subscription-enabled shops using Shopify's Subscription APIs.
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?
Solved! Go to the solution
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.
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.