Adding/Updating a checkout containing archived product

New Member
2 0 1

I'm using Android Buy SDK.

When a checkout contains a product that is archived by the shop, adding another product to the checkout seems to fail.



// Kotlin

// `variantId` is a valid ID of a product, but the checkout contains a product that is already archived by the shop.
val input = listOf(Storefront.CheckoutLineItemInput(1, variantId))
val mutation = Storefront.mutation { rootQuery ->
    rootQuery.checkoutLineItemsAdd(input, checkoutId) { root ->
        root.checkoutUserErrors {

val mutateGraph = graphClient.mutateGraph(mutation)
mutateGraph.enqueue(object : GraphCallResultCallback<Storefront.Mutation> {
    override fun invoke(result: GraphCallResult<Storefront.Mutation>) {
        val success = result as? GraphCallResult.Success
        val data = success?.response?.data
        if (data != null) {
           { it.responseData }.toString()



This prints a message below, and the product of `variantId` is not added to the checkout.



04-27 23:24:08.615 D/SHOPIFY-DEBUG: [{message=Variant 無効です, code=INVALID, field=[lineItems, 0, variantId]}]



Updating any line items (checkoutLineItemsUpdate) also fails. But after the archived item is removed from the checkout, those operation completes successfully.

Is this behavior intended? If I want to update the cart, is it required to remove all items that are archived by the shop?

Shopify Expert
10296 146 1949

An archived product is not intended to be for sale, so seeing an error feels expected.


Archived: the product details are complete, but the product is no longer for sale. Archiving a product hides it from your admin and sales channels. You can find the archive button at the bottom of product details page.
I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.

★ ★
New Member
2 0 1

Adding a product that is already archived to a checkout seems to be reasonable. For example,



  • apple ... selling
  • banana ... archived
  • coffee … selling



  • apple … 1
  • coffee … 1

In the case above, it is clear that adding a banana to the checkout is forbidden.

On the other hand, in the case below,



  • apple … selling
  • banana … archived
  • coffee … selling



  • banana … 1 (this is added before bananas are archived)
  • coffe … 1


Adding an apple also fails even though the apple is not archived. I think it might be difficult for users to understand they get errors because the checkout contains a banana, not an apple.


Shopify Partner
23 6 5

This is an accepted solution.

I agree that this behaviour seems a bit less than ideal, it's awkward for a checkout to get into an error state without the user doing anything.

Would be nice if they dealt with it further on in the process like they do when line item quantity exceeds what's actually available (they reduce it automatically).

eg. "This product is no longer available and has been removed from your cart" 🤷‍