Create order via API - Could not add product to cart

SethSeth Member Posts: 5

We try to create an order via the API for pothelm.nl. It is for product with variantid: 105889589. The API responses with: “Could not add product to cart”.

Usually this means that the product (or variant) is out of stock, and thus not orderable via the frontend of the webshop.

However, we are able to order this product (variant L) via the frontend:

https://www.pothelm.nl/nl/redbike-rk-300-duitse-motorhelm-matzwart.html?id=105889589

Our call:

https://pastebin.com/tvnBiERj

Did we overlook something?

3 comments

  • SethSeth Member Posts: 5

    We are still experiencing this issue, did anyone look into this by chance?

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator
    edited June 2019

    Hi @Seth,

    UPDATED:

    Sorry for the delay in answering your question.

    What I can see is that you are making use of a required custom field. I've tested this in my own environment and was getting the same result. What you can do is to add the custom field to the checkout: https://developers.lightspeedhq.com/ecom/endpoints/checkout/#post-add-a-product

    I hope this will help to solve this issue.


    Kind Regard,

    Post edited by LucienVersendaal on
  • josfabrejosfabre Member Posts: 3

    Hi guys,

    I'm new to Lightspeed and trying to understand the API.

    I want to create a configurator app that can in the end add a product to a cart and jump to the website to do the checkout via the site. I can read products from the API, but how would I add a products to a cart and then finish that flow on the website?

    Should this be done through the api? or a post to the website? We have this url on the website /cart/add/{variant_id}/ but them I'm supposed to supply those custom fields, but I don't know how..

Sign In or Register to comment.