# Checkout using Checkout ID

**URL:** <https://forum.wixstudio.com/t/checkout-using-checkout-id/8892>\
**Category:** Ask the community\
**Created:** [December 2, 2022, 3:27am UTC](https://forum.wixstudio.com/t/checkout-using-checkout-id/8892 "2022-12-02T03:27:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paiysurv](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/paiysurv/32/3707_2.png) [@paiysurv](https://forum.wixstudio.com/u/paiysurv)\
**Post date:** [December 2, 2022, 3:27am UTC](https://forum.wixstudio.com/t/checkout-using-checkout-id/8892/1 "2022-12-02T03:27:07Z")

</div>

I have successfully recreated the cart page and I would like to prompt a user to checkout after obtain the checkout ID obtained from the current cart. Here is both the backend and frontend code that I used to retrieve the checkout Id. Any help would be appreciated.

```javascript

import { currentCart } from 'wix-ecom-backend';

export async function myCreateCheckoutFromCurrentCartFunction(options) {
 try {
 const checkoutId = await currentCart.createCheckoutFromCurrentCart(options);
   console.log('Success! Checkout created, checkoutId:', checkoutId);
   return checkoutId;} catch (error) {
   console.error(error);
   // Handle the error
  }
}
import { myCreateCheckoutFromCurrentCartFunction } from 'backend/my-backend-file';
  "subdivision": "US-NY"
myCreateCheckoutFromCurrentCartFunction(options)
  .then((checkoutId) => {
   console.log('Success! Checkout created, checkoutId:', checkoutId);
   return checkoutId;
 })
 .catch((error) => {
   console.error(error);
    // Handle the error
 });

```
