API endpoint for draft invoices - with line items


I need to create a bunch of invoices in Sage200c each month, roughly 3000 of them, complete with line items. Currently this is being done targetting Sage 50 using a third party middleware (WebXl Order Importer) and the invoices are then printed to PDF and sent from there. The plan is to do the same kind of thing but with Sage 200c. The API has an endpoint for the bottom line of an invoice to be posted to the sales ledger but there is no line items on it and those can't really be printed (because there is nothing much on them). In the user interface it is possible to create draft invoices with line items on them which can then be printed and posted to create the transaction - but there is apparently no way to create draft invoices from the API.

I don't really understand why this is missing from the API (the desktop client can do it - does the client not call the API?) but it is really important to this process - and I can't see how it can be useful to create transactions with no line items from another system.

Can an endpoint for draft invoices be created in the API to support this kind of integration?

  • 0

    It can easily be done using the SDK - see this thread on the developers forum (login required) or this page in developer help.

  • 0 in reply to Geoff Turner

    Forgot to add: no, the desktop client doesn't use the "Sage 200 API", it uses the Sage 200 Objects. In Sage 200 terms, what is now called the API is a fairly recent addition, and of no use the majority of Sage 200 sites as it requires the Sage 200 server to have an external web interface.  And for good reason, most Sage 200 on-premise sites don't want their data to be exposed to the web in any way!

  • 0 in reply to Geoff Turner

    I am using the desktop client to the 200c version - so a hosted back end and marketed as "cloud" which of course just means it is on someone else's server. I will try and get access to read those links - I am a bit new to this. The documentation I have been using is here https://developer.columbus.sage.com/docs#/uk/sage200/accounts/v1/sales_invoices and it would appear from talking to the developer support people that this isn't an endpoint for actual invoices, just creating the sales ledger transaction - which seems a bit odd. Apparently I have to create sales orders https://api.columbus.sage.com/uk/sage200/accounts/v1/sop_orders which can have lines collection for the items on it and if they are non-stock items then the sales orders can be invoiced without doing the dispatch process - this might be the solution for us.

    When logging on to the desktop client it does look like it is doing the same oauth process that the API does - it pops up an embedded internet explorer page for the login, but I haven't poked about with wireshark or anything to find out what exactly it is doing after that.

  • 0 in reply to Alan Bell

    Based on your description of the login process, I think you're using the online (azure-hosted) version rather than the on-premise version.  Unfortunately the splash screen now says "Sage 200cloud" even for the on-premise version - blame the marketing dept!

    Although sales orders (SOP module) and sales invoices (Invoicing module) use the same underlying tables, it does look as if the API has no end-points specifically for invoices. So all you could do with the API would be to create a sales order; the user would then have to process it (allocate, despatch, invoice) using the client.

    Whereas using the SDK you can automatically create, print and (if required) post the invoice yourself.

  • 0 in reply to Geoff Turner

    yes, that is the one. They wanted to move stuff to the cloud, so I was a little surprised that the start point was to download a windows binary!

    Think we are going to go with creating sop_orders using non-stock items so there is no dispatch process to do. Current headache is creating products which have a required field for warehouse_holdings when I can't create a warehouse_holding because it has a required field of product id. Not sure how many other people have attempted to use this API to be honest!

  • 0 in reply to Alan Bell

    Has anybody managed to create invoices this way?

Reply Children
No Data