Update Checkout not working on /api/2023-01/checkouts

Hi,

I am currently trying to edit a checkout through the Admin API in my private app, but I keep getting an error. For testing purposes, I wanted to first edit only the first and last name in the shipping address. Later on, I would like to edit the price of products (line items) in the checkout.

This is the endpoint: https://.myshopify.com/admin/api/2023-01/checkouts/.json

And this is the body of my PUT request:

{
    "checkout": {
        "email": "max.mustermann@mail.de",
        "token": "<TOKEN>",
        "shipping_address": {
            "first_name": "Max",
            "last_name": "Mustermann"
        }
    }
}

This is the response: 404

{
    "errors": "Not Found"
}

I am properly authenticated, otherwise I would have received a different error message.

For testing, I have enabled all the scopes listed here while installing my app in the shop: https://shopify.dev/docs/api/usage/access-scopes

And I followed the documentation here: Checkout - REST

What am I doing wrong? All other PUT requests to other endpoints work without any problems.

1 Like

Hi @ChadChad ,

The first potential reason that comes to mind without seeing any more specifics is that perhaps the checkout token didn’t come from a checkout that was created with a POST request from that same private app, but that it came from somewhere else such as being harvested from a checkout URL from a live browser session on the Online Store (whose URL’s don’t always end with a checkout token).

The checkout PUT endpoint is intended to only be used to modify checkouts that were created by that same app.

Hope you have a great day

2 Likes