Tech Blog

How to create an order via an API in your institution in 5 easy steps.

This blog will focus on creating an order via an API in your institution.
The developer network already discusses how to create an order using an API. See for example Create PO Line

Additionally, the developer network provides a generic sample input file for the Create PO Line API in both XML and JSON format.

However, this blog focuses on your institution and not a generic sample, so that you will have an example with, for example, your fund code, vendor codes, vendor account, reporting codes, etc.

ONE

Make sure you have an API key for read/write acquisitions. If you do not have one then log into the developer network and create one.
Set to sandbox or production as desired.

TWO

Identify an order in Alma similar to the one you want to create (POL type, fund, vendor, etc.)
Be sure to use sandbox or production depending on API key you will use.
In the example here we will use
1. POL-43637 which is an electronic one-time and in status sent
2. POL-44127 which is an physical one-time and in status closed

THREE

Do a GET on each order and save the XML in a local file for editing.
Here is the syntax (of course replace “01234567890” with your real API key):

https://api-eu.hosted.exlibrisgroup.com/almaws/v1/acq/po-lines/POL-43637?apikey=01234567890 
https://api-eu.hosted.exlibrisgroup.com/almaws/v1/acq/po-lines/POL-44127?apikey=01234567890 

FOUR

Edit the output from the GET above as follows to use as input for the POST to create the new orders.

Remove the following lines because they will get created automatically: 

  • POL number
  • POL status
  • PO number
  • MMSID
  • created date
  • status date
  • expected_receipt_date (relevant for POL type physical)

Remove the following sections because they will get created automatically: 

  • alerts
  • locations section (relevant for POL type physical) (will get created based on POL owner library)

Change the following so you will not have a match in an existing:

  • ISBN or ISSN
  • system control number

FIVE

Do a POST as follows:

https://api-eu.hosted.exlibrisgroup.com/almaws/v1/acq/po-lines?apikey=01234567890

In the Body choose application/xml and put in the edited output from the GET above.
Get response with POL number

See POL in Alma and see that it was created from the API

Leave a Reply