For discussing the development and integration of subscription-enabled shops using Shopify's Subscription APIs.
Hi -
We've started to notice that some subscription contracts are being created with incorrect variant ids that do not perfectly match the variant ids of the variants purchased on subscription in the origin order. Though we've just started noticing it, I don't think that actually means its a new issue.. we just added a monitor recently because of suspicions.
This is a tough bug for me to prove definitively via a post bc of course its possible possible that we changed the lines in between the time it was created and when I pulled the subscription contract data but I am certain that we did not. The only thing that we changed was to immediately clear the selling plan name on each line (that's why you can see there's an update roughly 14s after creation. Here's the latest example that I have:
{
"data": {
"subscriptionContract": {
"id": "gid:\/\/shopify\/SubscriptionContract\/9080864881",
"createdAt": "2023-09-29T21:09:39Z",
"updatedAt": "2023-09-29T21:09:53Z",
"originOrder": {
"id": "gid:\/\/shopify\/Order\/5136140828785",
"lineItems": {
"nodes": [
{
"product": {
"id": "gid:\/\/shopify\/Product\/6869010251889",
"title": "Key Lime Pie"
},
"variant": {
"id": "gid:\/\/shopify\/ProductVariant\/40213126152305",
"title": "Default Title"
}
},
{
"product": {
"id": "gid:\/\/shopify\/Product\/6867981369457",
"title": "Pina Colada"
},
"variant": {
"id": "gid:\/\/shopify\/ProductVariant\/40210920210545",
"title": "Default Title"
}
}
]
}
},
"lines": {
"edges": [
{
"node": {
"productId": "gid:\/\/shopify\/Product\/6867981369457",
"title": "Pina Colada",
"variantId": "gid:\/\/shopify\/ProductVariant\/40210920210545",
"variantTitle": null,
"sellingPlanId": "gid:\/\/shopify\/SellingPlan\/1113063537",
"sellingPlanName": null
}
},
{
"node": {
"productId": "gid:\/\/shopify\/Product\/6867981369457",
"title": "Pina Colada",
"variantId": "gid:\/\/shopify\/ProductVariant\/40210920210545",
"variantTitle": null,
"sellingPlanId": "gid:\/\/shopify\/SellingPlan\/1113063537",
"sellingPlanName": null
}
}
]
}
}
},
"extensions": {
"cost": {
"requestedQueryCost": 26,
"actualQueryCost": 13,
"throttleStatus": {
"maximumAvailable": 10000.0,
"currentlyAvailable": 9987,
"restoreRate": 500.0
}
}
}
}
x-request-id: b4540e1a-8d8b-4d0f-a59f-b62e8d97b0d1
This is obviously problematic and hugely important for Shopify to know/fix if it's widespread. If anybody has any idea what might be causing this I'd appreciate some help : )
Hi Brian,
Thanks for flagging this - I've reached out to our internal team to see what might be causing this issue and will report back asap!
Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog
Hi again Brian,
Our team are still looking into this - it's possible that somewhere the variant value is being sent as an int data type, and not big int which could result in the variant ID changing it's value. It doesn't appear to be a common issue but we're investigating further.
Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog
That's interesting. I'm curious where you're thinking it might be getting sent in as an int and not a big int? When it's added to cart? Or somewhere in Shopify's system that creates the subscription contract?
Again - we're not making any calls to update the line's variant id so I highly doubt that its a gql request passing the wrong data type (bc not data is being passes in that field at all).
Thanks for digging in
Hi @Brian_S, I noticed the lines of the contract you referenced were updated by the draft with id 114782535793, which replaced the "Key Lime Pie" line with "Pina Colada" as you reported it. This is an expected behaviour.
If you believe the issue still persists on Shopify's side, please reply with the draft's input that triggers it so we can look further.
Best,
Juan
To learn more visit the Shopify Help Center or the Community Blog.