# What is the valid format for checkoutId in getCheckout()?

**URL:** <https://forum.wixstudio.com/t/what-is-the-valid-format-for-checkoutid-in-getcheckout/69607>\
**Category:** Ask the community\
**Tags:** wix-ecom-backend, code\
**Created:** [March 14, 2025, 6:31am UTC](https://forum.wixstudio.com/t/what-is-the-valid-format-for-checkoutid-in-getcheckout/69607 "2025-03-14T06:31:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user4439](https://avatars.discourse-cdn.com/v4/letter/u/f08c70/32.png) [@user4439](https://forum.wixstudio.com/u/user4439)\
**Post date:** [March 14, 2025, 6:31am UTC](https://forum.wixstudio.com/t/what-is-the-valid-format-for-checkoutid-in-getcheckout/69607/1 "2025-03-14T06:31:11Z")

</div>

In reference to this documentation: **getCheckout( ) : [Get Checkout | Velo](https://dev.wix.com/docs/velo/apis/wix-ecom-backend/checkout/get-checkout)**

I can’t retrieve the checkout details using getCheckout(), but I am able to create **checkoutId** from this function **createCheckoutFromCurrentCart( )** :

> **[Create Checkout From Current Cart | Velo](https://dev.wix.com/docs/velo/apis/wix-ecom-backend/current-cart/create-checkout-from-current-cart)**
>
> Creates a checkout from the current site visitor’s cart. The createCheckoutFromCurrentCart() function returns a Promise that resolves to the new checkout's ID when it's created.

```javascript

    //Create checkout from current cart

    myCreateCheckoutFromCurrentCartFunction(checkoutOptions)
        .then((checkoutId) => {
            console.log("Success! Checkout created, checkoutId:", checkoutId);
            //Get checkout details
            myGetCheckoutFunction(checkoutId)
                .then((checkout) => {
                    console.log("Success! Retrieved checkout:", checkout);
                    return checkout;
                })
                .catch((error) => {
                    console.error(error);
                    // Handle the error
                });
            return checkoutId;
        })
        .catch((error) => {
            console.error(error);
            // Handle the error
        });

```

---

<div class="post-metadata">

**Author:** ![amandam](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/amandam/32/79539_2.png) [@amandam](https://forum.wixstudio.com/u/amandam)\
**Post date:** [March 14, 2025, 1:46pm UTC](https://forum.wixstudio.com/t/what-is-the-valid-format-for-checkoutid-in-getcheckout/69607/2 "2025-03-14T13:46:10Z")

</div>

My suspicion here is that even though your promise for create checkout has returned, the checkout is not yet available immediately for the getCheckout function. I would test with a setTimeout here just to test that theory and see if it’s “not ready” yet.

Alternatively if you think you may be experiencing a bug, you can report through this flow [Wix Studio - How to report a bug](https://forum.wixstudio.com/t/wix-studio-how-to-report-a-bug/51007)

---

<div class="post-metadata">

**Author:** ![user4439](https://avatars.discourse-cdn.com/v4/letter/u/f08c70/32.png) [@user4439](https://forum.wixstudio.com/u/user4439)\
**Post date:** [March 17, 2025, 6:15am UTC](https://forum.wixstudio.com/t/what-is-the-valid-format-for-checkoutid-in-getcheckout/69607/3 "2025-03-17T06:15:32Z")

</div>

Hi, the **myGetCheckoutFunction** won’t render anything even after setting the timeout.

```javascript
 //Create checkout from current cart

    myCreateCheckoutFromCurrentCartFunction(checkoutOptions)
        .then((checkoutId) => {
            console.log("Raw checkoutID:", checkoutId);
            const finalCheckoutID = checkoutId.checkoutId;
            console.log("Success! Checkout created, extracted checkoutId:", finalCheckoutID);

            setTimeout(() => {
                 console.log("Calling myGetCheckoutFunction with checkoutId:", finalCheckoutID);
                // Get checkout details after waiting
           
                myGetCheckoutFunction(finalCheckoutID)
                    .then((checkout) => {
                        console.log("Success! Retrieved checkout:", checkout);
                        // Continue with checkout flow
                    })
                    .catch((error) => {
                        console.error("Failed to get checkout:", error);
                        // Handle the error
                    });
            }, 5000); // 5 second delay

          
            return checkoutId;
        })
        .catch((error) => {
            console.error(error);
            // Handle the error
        });

```
