Redirect to cart or checkout

Hello,

I'm implementing a native app and i need to redirect to the cart view or checkout view after the products are selected.

I need to do this on the server side and return a url to the app to show. I'm reading fullfilment api and OMS api.

  • On the fullfilment api I have to create a order(after simulating it), but really it would be just a cart. Is correct to create an order if it's just a cart?
  • On the OMS api it's only posible to update carts but not create and redirect to them.

Thanks in advance VTEX community!

Hello Tomas,

Follows documention where the cart can be building though the API:

https://documenter.getpostman.com/view/18468/checkout/6Z2QYJM#d7c0debb-1d91-8cb2-e324-26058b9ae7e5

Hi Edson, thank you for your fast response. I read that docs, but that endpoint only allows updates. Not creation and it's not possible to open a website with that info. Or it's not clarified on the documentation

Tomas,

It's possible too building the url. Here is one example:

www.yourdomain.com.br/checkout/cart/add?sku=750565&qty=1&seller=1≻=1

Where:

Sku= your Sku id

qty = sku quantity

Seller = usually equal 1

sc = your sales channel id

Regards

In this case I have to make one request per each sku to add. That would make the expirience on the checkout very slow. Is there a way to add many skus and redirect ?

Tomas,

Here is another example with 2 skus:

http://www.yourdomain.com.br/checkout/cart/add?sku=750565&qty=1&seller=1≻=1&sku=41076&qty=2&seller=1≻=1

You can add as many skus as you want.

Thank you again Edson.

I just made this request. It's posible there is something wrong with this store?

http://www.stockcenter.com.ar/checkout/cart/add?sku=2067504&qty=1&seller=1&sku=2039064&qty=2&seller=1

<h2>Lo sentimos, ha ocurrido un error al procesar su solicitud.</h2>

<p>ID de la Operación: f5efdd24-5a73-4bfe-9779-da7a2da68175</p>

Missed to add parameter sc=2 :

The sc=2 parameter represents stockcenter store within your admin:

stock

http://www.stockcenter.com.ar/checkout/cart/add?sku=2067504&qty=1&seller=1≻=2&sku=2039064&qty=2&seller=1≻=2

Edson, Thank you very much for the fast responses and the detail on each one!

Everything is working with the sc=2 and seller=2

Use always sc=2 and seller=1.