Cannot complete a checkout without requiring payment

Solved
Highlighted
New Member
3 0 0

I am trying to complete a checkout without requiring payment. It is document in the Checkout API here: https://shopify.dev/docs/admin-api/rest/reference/sales-channels/checkout?api[version]=2020-04#compl...

 

I have successfully created a valid checkout using the checkout API. I then send the following request to complete the checkout:

 

Request:

POST: https://my-shopify-store.myshopify.com/admin/api/2020-04/checkouts/my-checkout-token/complete.json


Body:

 

{
}

 
At this point I am expecting an unpaid order to be created. However we get the following 422 response:

 

{
    "errors": {
        "base": [
            {
                "code": "missing_transactions",
                "message": "Cannot complete the checkout without any transactions.",
                "options": {}
            }
        ]
    }
}

 

This is slightly confusing as there should be no transaction as we do not require payment in order to create this checkout.

 

It would be great if anyone can shed some light on this.

 

Thanks,

 

Josh

0 Likes
Highlighted
Shopify Staff
Shopify Staff
587 72 130

This is an accepted solution.

Hey @jg_va,

 

You can complete a free checkout by sending the following POST request:

 

POST /admin/checkouts/#{checkout_token}/complete.json 

{
"checkout": {
"token": "#{checkout_token}",
"order": null
}
}

More details can be found in our Checkout API tutorial here.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

1 Like