eCom API doesn't create Order/Checkout

I make a POST call to the "/checkouts.json" endpoint containing all the required fields. The endpoint return a "201 Created" and the data of the created Order/Checkout.

But when I look in the eCom interface there are no orders that were created. Also fetching all the orders returns an empty list.

Does anyone have this issue or know how to solve it?

7 comments

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 881 moderator

    Hi @DevElopment ,

    Thank you for contacting us.

    When you've created a checkout, you'll get an checkout ID. Copy this checkout ID. When you go to the backoffice(interface) to Orders->Quotes click on a quote:

    Replace the ID with the copied ID above:

    Now you'll see you are in the checkout that you've just created.


    I hope this will help.

  • DevElopmentDevElopment Member Posts: 5

    He Lucien,

    This doesn't really help. First of all nothing gets created, no quote, no order nor a checkout. Besides that, working with orders in the way that you just described is not a workable solution if you are handling a large volume of orders.

    Is there a reason why nothing is shown in the eCom interface? And why does listing the orders result in an empty list? Even the orders that I entered in the interface by hand don't get shown when listing them.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 881 moderator

    Hi

    Can you send me the payload and response?

    When you create a checkout it will give you a checkoutID. You can retrieve this checkout by doing GET /checkouts/{checkoutID}.json

  • DevElopmentDevElopment Member Posts: 5

    The request body:

    {

       "mode":"guest",

       "customer":{

          "email":"[email protected]",

          "phone":"",

          "mobile":"",

          "firstname":"Test",

          "lastname":"Name",

          "type":"private"

       },

       "billing_address":{

          "name":"Test Name",

          "address1":"teststraat",

          "number":"23",

          "zipcode":"3012aa",

          "city":"Rotterdam",

          "country":"NL",

          "region":"Zuid-Holland"

       },

       "shipping_address":{

          "name":"Test Name",

          "address1":"teststraat",

          "number":"23",

          "zipcode":"3012aa",

          "city":"Rotterdam",

          "country":"NL",

          "region":"Zuid-Holland"

       },

       "terms":1,

       "notifications":false

    }


    The response body:

    {

       "id":241501723,

       "created_at":"2019-12-16T16:14:26+01:00",

       "updated_at":"2019-12-16T16:14:26+01:00",

       "order_id":null,

       "theme":null,

       "step":"shipment",

       "mode":"guest",

       "info":{

          "remote_ip":"35.204.96.128",

          "user_agent":"WebshopappApi",

          "referral_id":null

       },

       "customer":{

          "gender":null,

          "birthdate":null,

          "phone":null,

          "mobile":null,

          "national_id":null,

          "email":"[email protected]",

          "password":null,

          "firstname":"Test",

          "middlename":null,

          "lastname":"Name",

          "type":"private",

          "company":null,

          "vatnumber":null,

          "cocnumber":null,

          "sameaddress":true

       },

       "billing_address":{

          "name":"Test Name",

          "company":null,

          "address1":"teststraat",

          "address2":null,

          "number":23,

          "extension":null,

          "zipcode":"3012aa",

          "city":"Rotterdam",

          "region":"Zuid-Holland",

          "region_id":5744,

          "country":"nl"

       },

       "shipping_address":{

          "name":"Test Name",

          "company":null,

          "address1":"teststraat",

          "address2":null,

          "number":23,

          "extension":null,

          "zipcode":"3012aa",

          "city":"Rotterdam",

          "region":"Zuid-Holland",

          "region_id":5744,

          "country":"nl"

       },

       "quote":{

          "id":584533987,

          "price_incl":"0",

          "price_excl":"0",

          "additional_cost":false,

          "totals":{

             "sub_total":"0",

             "taxes":false,

             "grand_total":"0",

             "combined_taxes":false

          },

          "tax_override":false,

          "vat_shifted":false,

          "local_taxes_may_apply":false,

          "weight":0,

          "volume":0,

          "colli":0,

          "products":[


          ],

          "created_at":"2019-12-16T16:14:26+01:00",

          "updated_at":"2019-12-16T16:14:26+01:00"

       },

       "shipment_method":null,

       "payment_method":null,

       "discount":false,

       "comment":null,

       "newsletter":null,

       "terms":true,

       "notifications":false,

       "memo":null,

       "products":[


       ],

       "discount_code":null

    }

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 881 moderator
    edited December 2019

    Hi

    You're saying that "First of all nothing gets created, no quote, no order nor a checkout". The checkout is now created, it returns an checkoutID "241501723" after this you'll need to add products, a payment and a shipment to the checkout. After this you'll need to validate all this before you can convert this to an order.

    Please follow all the steps in our documentation: https://developers.lightspeedhq.com/ecom/endpoints/checkout/

  • DevElopmentDevElopment Member Posts: 5

    The API returns an empty list when I do a GET on /checkouts.json so it's not strange that I assume nothing gets created right? Besides, all the steps that you just pointed out are documented as seperate calls. The flow that you just described is not documented anywhere.

    Finally this is the link that describes all the steps :

    Also in this case it is not specified that all steps need to be performed before an Order is created.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 881 moderator

    Hi @DevElopment ,

    I've created a ticket so we can discuss it there, this because of privacy reasons.

Sign In or Register to comment.