How to generate the abandoned cart link using the URL

Hey everyone, how’s it going? I’d like to know how I can build a URL that redirects to an abandoned cart using that cart’s ID. I ran some tests using the logic below and had no luck:

(https://www.carajas.com.br/checkout?orderFormId=**CARTID**#/cart)

Notes:

  1. I receive the abandoned cart ID via trigger
  2. If it’s not possible to generate the link this way, is there a feature in the API to generate this link?

Hey, how’s it going?

I took a look at the page What is the shared cart and comparing them I noticed that a / is missing after checkout.
Example.
https://www.{storename}.com/checkout/?orderFormId=31155bb8fd6944c99829c171aa8ed5c4#/cart

Url.
https://www.carajas.com.br/checkout?orderFormId=**IDDOCARRINHO**#/cart

From what I could tell, the abandoned cart trigger isn’t returning the OrderformId — do you know how I can get it to return that?

Here’s a screenshot of the request body:

Hi Sarah,

From what I remember, the trigger doesn’t send the orderFormId, but rather the data to build a new cart.
Check if the skuURL field appears.

Documentation.
https://help.vtex.com/pt/tutorial/configurar-carrinho-abandonado--tutorials_740

It doesn’t actually return the skuURL parameter, but it does return an empty htmlURL parameter and this one:
image

Ahhh yes, it’s the rclastcart!

How can I build this URL?

Hi.

You can use the following format:
https://www.carajas.com.br/checkout/cart/add?sku=3507&qty=1&seller=1&sc=1

It’s strange that qty is showing 1.0000. It should just be 1.
The value sc=1 means it’s commercial policy 1. It’s worth checking whether you use more than one policy.

Thank you so much, it worked just the way I needed it to! :slight_smile: