Create Invoice through API

eCommercePROeCommercePRO Posts: 3Member

Hi,

I have a connection between a custom POS and Lightspeed eCom. I was wondering, is it possible to create the invoice through the API? I have set the invoice creation to manual in the eCom settings. When an order is placed, the eCom API calls the POS API where it creates an invoice. When successfully created, it updates the eCom invoice with the POS invoice number. After this I want to create the eCom invoice so the customer gets the invoice with the eCom and POS invoice number. This makes it easy to look up the order in the POS system when the customer has questions.

3 comments

  • Adrian SamuelAdrian Samuel moderator Posts: 545Moderator, Lightspeed Staff moderator

    Hey @eCommercePRO,

    An invoice is created when an order is created you can set up a webhook to have Lightspeed eCom to call your custom app URL via a POST. You will in that retrieve an invoiceID.

    From there you can process the relevant data i.e. the invoice number as you desire.

    You can read more about the order endpoint here:

    You can read more about webhooks here:


    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

  • eCommercePROeCommercePRO Posts: 3Member

    Hi Adrian,

    I am using webhooks right now. But I don't want the invoice to be created directly, since it wil directly will be send to the customer. So I changed it to manual, hoping that I can call the invoice create function through the API.

    Here is what happens now in a nutshell.

    A customer places an order.

    Via the Webhook our custom API is called

    In our system an internal invoice is created and a invoice number

    Through the eCom API this new number will be added to the MEMO field of the order and from there it will be printed on the invoice.

    So after that I only need to trigger this function through the API

    Factuur aanmaken = Create invoice

  • Adrian SamuelAdrian Samuel moderator Posts: 545Moderator, Lightspeed Staff moderator

    Hey @eCommercePRO,

    That's not an available method on the Invoice Endpoint I'm afraid. Nonetheless, the invoice endpoint can't be used to send a PDF to an email it will just give you JSON. Most of the information you'll have on the invoice is on the order endpoint anyhow so if you're going to create your own service you can use that

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

Sign In or Register to comment.