Update Checkout stock lines Or cancel Checkout

Highlighted
Tourist
12 0 1

In the API of Shopify for Checkout: https://help.shopify.com/en/api/reference/sales-channels/checkout#update-2020-01

exists the option of update but wanted to know if that option can remove some of Checkout lines and trigger a Message saying for example that product X is out of stock if still wants to follow with the Order?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 167

Hey @HCorte,

 

You can't trigger a message, but when you create a checkout you'll see an error if there are stock issues, so you could pass that message onto customers.

 

 

{
    "errors": {
        "line_items": {
            "0": {
                "quantity": [
                    {
                        "code": "not_enough_in_stock",
                        "message": "Not enough items available. Only 500 left.",
                        "options": {
                            "remaining": 500
                        }
                    }
                ]
            }
        }
    }
}

On the other side, if a customer clicks through to a checkout URL and the stock is now unavailable, they'll see a message like this:

 

20-00-dmktv-vtio4

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes