OCLC Developer Network

Purchase orders resource

Building a query:

To access a collection of purchase orders construct the URL in the following manner:

https://acq.sd00.worldcat.org/purchaseorders?{query}

To access information on a specific purchase order construct the URL in the following manner::

https://acq.sd00.worldcat.org/purchaseorders/{orderNumber}

where {query} or {orderNumber} provide information about the purchase order you are requesting information for.

 

Examples:

Below are some sample URLs and an explanation of what they are querying using different HTTP methods:

example uRLhttp methodnotes
https://acq.sd00.worldcat.org/purchaseorders?startIndex=0&itemsPerPage=20&q=OPENGETReturns a collection of purchase orders where the status is OPEN, the start index is set to 0, and 20 items are displayed per page.
https://acq.sd00.worldcat.org/purchaseorders/PO-2011-11GETReturns information about a specific purchase order with the ID PO-2011-11.
https://acq.sd00.worldcat.org/purchaseorders/PO-2011-11PUTWill update a purchase order with ID PO-2011-01 if properly structured XML is attached to the request.
https://acq.sd00.worldcat.org/purchaseorders/PO-2011-11DELETEWill delete a specific purchase order with ID PO-2011-11.
https://acq.sd00.worldcat.org/purchaseordersPOSTWill create a new purchase order if properly structured XML is attached to the request. 

 

XML structure for POST and PUT requests:

More information about the proper structure of XML made as part of POST and PUT requests can be found here:

Below are two XML payload examples for creating and updating a purchase order:

Creating a purchase order:

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <content type="application/xml">
    <purchaseOrder xmlns="http://worldcat.org/xmlschemas/purchase-order/PurchaseOrder-1.5" xmlns:ns2="http://worldcat.org/xmlschemas/common-types/Identity-1.2" xmlns:ns4="http://worldcat.org/xmlschemas/purchase-order/Resource-1.5" xmlns:ns3="http://worldcat.org/xmlschemas/purchase-order/PurchaseOrderItem-1.5" xmlns:ns5="http://worldcat.org/xmlschemas/purchase-order/CopyConfig-1.5" xmlns:ns6="http://worldcat.org/xmlschemas/purchase-order/Copy-1.5" xmlns:ns7="http://worldcat.org/xmlschemas/purchase-order/CopyReceipt-1.5" xmlns:ns8="http://worldcat.org/xmlschemas/purchase-order/PurchaseOrderSubmission-1.5">
       <orderName> Order Name </orderName>
       <orderNumberRange>default</orderNumberRange>
       <vendor>
         <vendorId>50f0ecab-9b4e-4da3-a1c4-e0343a189713</vendorId>
       </vendor>
       <currency>USD</currency>
       <exchangeRate>1.000000</exchangeRate>
     </purchaseOrder>
  </content>
</entry>

If the request is successful, the response will will return newly created Purchase Order (with generated Order Number). 

Updating a purchase order:

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
  <title type="text" />
  <updated>2012-06-29T13:42:03.128Z</updated>
  <gd:etag>2012-06-29T09:42:03.000-04:00</gd:etag>
  <content type="application/xml">
    <purchaseOrder xmlns="http://worldcat.org/xmlschemas/purchase-order/PurchaseOrder-1.5" xmlns:ns2="http://worldcat.org/xmlschemas/common-types/Identity-1.2" xmlns:ns4="http://worldcat.org/xmlschemas/purchase-order/Resource-1.5" xmlns:ns3="http://worldcat.org/xmlschemas/purchase-order/PurchaseOrderItem-1.5" xmlns:ns5="http://worldcat.org/xmlschemas/purchase-order/CopyConfig-1.5" xmlns:ns6="http://worldcat.org/xmlschemas/purchase-order/Copy-1.5" xmlns:ns7="http://worldcat.org/xmlschemas/purchase-order/CopyReceipt-1.5" xmlns:ns8="http://worldcat.org/xmlschemas/purchase-order/PurchaseOrderSubmission-1.5">
      <orderName> Dev Net - Test Order 2 1340977320</orderName>
      <link href="https://acq.sd00.worldcat.org//purchaseorders/PO-2012-132/?inst=12880" />
      <purchaseOrderNumber>PO-2012-132</purchaseOrderNumber>
      <orderNumberRange>PO</orderNumberRange>
      <vendor>
        <vendorId>50f0ecab-9b4e-4da3-a1c4-e0343a189713</vendorId>
        <vendorName>Alibris</vendorName>
        <localIdentifier>LVN-2</localIdentifier>
      </vendor>
      <currency>USD</currency>
      <exchangeRate>1.000000</exchangeRate>
      <orderItemCount>0</orderItemCount>
      <taxCalculationMethod>EXCLUDE_ADDITIONAL_COSTS</taxCalculationMethod>
      <purchaseOrderState>OPEN</purchaseOrderState>
      <totalOrderPrice>0.00</totalOrderPrice>
      <lastUpdateTime>2012-06-29T09:42:03.000-04:00</lastUpdateTime>
      <insertTime>2012-06-29T09:42:02.000-04:00</insertTime>
    </purchaseOrder>
  </content>
</entry>

 

Query options:

Below is a list of all the possible parameters that can be used as part of the purchase order resource, all of them are optional:

parameterdescription
qAvailable Queries are: 'OPEN' and 'SUBMITTED'. If none is provided, orders with both states will be returned.
startIndexWhat index item to start the collection at.
itemsPerPageHow many collection items to return per request.

Follow the OCLC Developer Network:

The OCLC Developer Network supports the use of OCLC Web Services—a set of tools and APIs that expose data and services for WorldCat and our member libraries and partner institutions or companies. learn more »

© 2010 OCLC Domestic and international trademarks and/or service marks of OCLC Online Computer Library Center, Inc. and its affiliates


Powered by Drupal, an open source content management system