[BUG] Origin order line variants not matching created subscription contract line variants

Topic summary

Subscription contracts are being created with line variants that don’t match the variants on the origin order. Example data shows an order with “Key Lime Pie” and “Pina Colada,” but the resulting contract contains two “Pina Colada” lines. A JSON payload and x-request-id were provided; the only immediate post-creation change was clearing the selling plan name.

Investigation updates:

  • Initial hypothesis from support: a variant value might be passed as int instead of big int, potentially altering the ID; considered uncommon and under review.
  • Follow-up from engineering: the referenced contract’s lines were updated by a subscription draft (id 114782535793), which replaced “Key Lime Pie” with “Pina Colada,” and this is expected behavior.

Open questions and next steps:

  • Reporter queried where an int vs big int mismatch could occur (cart vs contract creation) and noted they do not update variant IDs.
  • Shopify requests the exact draft input that triggered the change to investigate further if this isn’t intended.

Status: Ongoing. Current evidence points to a draft update (expected behavior) rather than a systemic bug, pending review of the draft payload.

Summarized with AI on January 14. AI used: gpt-5.

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!

1 Like

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.

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_1 , 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