How to retrieve checkout details?

Hi I’m following the documentation on getting the checkout details based on a “checkoutId” : https://dev.wix.com/docs/velo/apis/wix-ecom-backend/checkout/get-checkout

What I did was, since I’ve created a third party payment provider, the goal is to manually create an order since Wix doesnt recognize third party transactions. So, I’m doing work-arounds for this and createOrder() would be very useful, however, in order to properly use this, I need to generate the details from the checkout.

One of the parameters for getCheckout() is checkoutId, and I’m not sure how to retrieve this so I just used getCurrentCart() to generate checkoutId

So I passed the checkoutId from getCurrentCart() as parameter for getCheckout()
and I’ve already created a fallback error message in case getCheckout doesnt exist or something is missing. But it’s not logging any error messages whatsoever.

The issue is it won’t log the checkout details in the Monitoring Logs given this approach. Can someone help me? Thank you in advance.

As mentioned in the navigateToCheckoutPage() function:

Thanks but the link you provided isn’t working from my end, could you re-send me a working link of it? Thank you so much!

Looks like an issue on Wix’s end. It was working just a moment ago, and now upon refreshing it loaded once; and now it’s showing an error…

The link is correct, just seems to be a temporary issue on the documentation page. Dropping the link here once again:
https://dev.wix.com/docs/velo/apis/wix-ecom-frontend/navigate-to-checkout-page

1 Like

Update: I did a workaround for retrieving checkoutId:

createCheckoutFromCurrentCart()

I passed the checkoutId from this function to getCheckout() function and it still wouldn’t work,

I’m successfully retrieving the checkoutId by the way. But when it comes to using it as a parameter for getCheckout() it still wouldn’t generate the checkout details. I just wanna generate checkout details for assessment before creating order.

That is weird. If we go by the doc, passing the Checkout ID inside getCheckout() should yield the checkout object.

As an alternative approach, you might want to try fetching the Checkout ID from the onCheckoutCreated() event that fires when a new checkout is created.

If your code is correct and you think this might be a bug, I’d recommend reporting it to Wix Support.

1 Like