Assigning a new order (checkout) when creating to an existing customer

dmizrahidmizrahi Member Posts: 5

According to the eCom API documentation if I want to create an order through the checkout endpoint I should provide a customer object. To me it seems as if for every order a new customer needs to be created this way. Is it possible to add a new order to an existing customer. And if so how do I do that?

Thank you for your time.

4 comments

  • LeahLeah Moderator, Lightspeed Staff Posts: 205 moderator

    Hi @dmizrahi The unique identifier for a customer is their email, so if you include the email address of an existing customer in the customer payload, the customer will be attached to the order. You will still need to add all the address details in order for the checkout to validate. You can enter shipping/billing details that differ from the customer's default details if you need to, the customer will still be attached to the order and the customer's details will not be permanently modified.

    API Support
    Lightspeed HQ
  • dmizrahidmizrahi Member Posts: 5

    He @Leah,

    Thank you for the response. If I add an existing email address the validation still mentions it's already used by an existing user. On top of that I still need to add a customer firstname lastname password phone according to the validation endpoint. I am using the "register" mode instead of "guest". Am I doing something wrong? And is it possible to only use a mobile phone number or am I required to use a normal phone number?

  • dmizrahidmizrahi Member Posts: 5

    @Leah any input?

  • LeahLeah Moderator, Lightspeed Staff Posts: 205 moderator

    Hi @dmizrahi ,

    Here are some clarifications:

    The "register" mode is to register a new customer when creating the sale, this is why you are getting a validation error when trying to use an existing email, since the customer is already registered. This is also the reason that the validation requires a password, since you are creating a new account for that email address.


    The "guest" mode lets you create a checkout and order without creating a new account for the customer's email. If you use an email that is already associated with an existing customer in this mode, you won't have a validation issue, the system will just attach that customer to the order in the back office.


    If you want, you can also omit the "mode" field altogether. This would be the easiest route if you are never planning to register new customers.


    In all cases, you will need to include the customer firstname, lastname, and phone fields in order for the checkout to validate. You can put the customer's mobile number in the main 'phone' field and leave the other blank, but you are not able to submit only the 'mobile' field, the 'phone' field is required.

    API Support
    Lightspeed HQ
Sign In or Register to comment.