Ready to Learn?Ex Libris products all provide open APIs

Tech Blog


Creating an invoice using APIs

Tamar Fuches on September 26th, 2018

The October 2018 Alma release includes several new APIs for creating a new invoice in Alma.
The purpose of this blog is to describe in details the required steps for creating a new invoice using APIs. In general, creating an invoice using APIs is parallel to creating an invoice manually in the Alma UI: first you create the invoice, then add invoice lines, and then process the invoice (in Alma UI this is the "Save and continue" action, for moving the invoice forward in the workflow). Each of these steps has a parallel API:

1. Create an invoice:
POST /almaws/v1/acq/invoices
An invoice body payload is required. For example:


The response will include the invoice id (in "id" field). This id should be used in subsequent queries regarding the invoice.
Note that "creation form" is set to "API".

2. Add invoice lines:
The following API adds a single invoice line. This means that you should submit it multiple times - according to the number of invoice lines.
POST /almaws/v1/acq/invoices/{invoice id}/lines

Payload of the invoice line body is required. For example:


3. Process invoice:
You should submit this API after creating the invoice and all its lines. This API is parallel to the "Save and continue" action in the Alma UI, and will process the invoice: The invoice will move forward in the workflow, or, if there are issues - will be sent to "review" with the relevant alerts.
POST /almaws/v1/acq/invoices/{invoice id}?op=process_invoice
An empty invoice object should be sent as a payload: The response will include the invoice with an updated status, and alerts (if exist).