Examples:
The following examples demonstrate the different operations that can be executed on purchase orders using HTTP methods. Please note that none of the examples include the principleID and principleIDNS parameters that are required to successfully complete the operation. The purchase order service can return data in two possible formats.
| Format | Accept Header | Extension |
|---|---|---|
| Atom XML | application/atom+xml | .xml |
| Atom JSON | application/json | .json |
GET a collection of purchase orders:
Request:
https://acq.sd00.worldcat.org/purchaseorders/?startIndex=0&itemsPerPage=20&q=OPEN
XML Response:
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<id>info:OCLC/Platform/Service</id>
<title type="text">OCLC Platform Service Results</title>
<updated>2011-10-13T09:46:53.558Z</updated>
<os:totalResults>1</os:totalResults>
<os:startIndex>0</os:startIndex>
<os:itemsPerPage>20</os:itemsPerPage>
<entry xmlns:gd="http://schemas.google.com/g/2005">
<title type="text" />
<updated>2012-06-29T13:18:56.867Z</updated>
<gd:etag>2012-02-15T11:00:30.000-05: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>alibris Order - 1329321628</orderName>
<link href="https://acq.sd00.worldcat.org//purchaseorders/PO-2012-35/?inst=12880" />
<purchaseOrderNumber>PO-2012-35</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-02-15T11:00:30.000-05:00</lastUpdateTime>
<insertTime>2012-02-15T11:00:29.000-05:00</insertTime>
</purchaseOrder>
</content>
</entry>
...
</feed>
JSON Response:
{
"id": "info:OCLC/Platform/Service",
"title": "OCLC Platform Service Results",
"updated": "2011-11-30T15:06:22.465Z",
"entries": [
{
"title":"",
"content":{
"orderName":"alibris Order - 1329321628",
"link":{
"href":"https://acq.sd00.worldcat.org//purchaseorders/PO-2012-35/?inst=12880"
},
"purchaseOrderNumber":"PO-2012-35",
"orderNumberRange":"PO",
"vendor":{
"vendorId":"50f0ecab-9b4e-4da3-a1c4-e0343a189713",
"vendorName":"Alibris",
"localIdentifier":"LVN-2"
},
"currency":"USD",
"exchangeRate":1.000000,
"orderItemCount":0,
"taxCalculationMethod":"EXCLUDE_ADDITIONAL_COSTS",
"purchaseOrderState":"OPEN",
"totalOrderPrice":0.00,
"lastUpdateTime":1329321630000,
"insertTime":1329321629000,
"action":null,
"processing":null
},
"updated":"2012-06-29T13:21:27.093Z",
"extensions":[
{
"name":"gd:etag",
"attributes":{
"xmlns:gd":"http://schemas.google.com/g/2005"
},
"children":[
"2012-02-15T11:00:30.000-05:00"
]
}
]
},
....
"extensions": [
{
"name": "os:totalResults",
"attributes": {
"xmlns:os": "http://a9.com/-/spec/opensearch/1.1/"
},
"children": [
"548"
]
},
{
"name": "os:startIndex",
"attributes": {
"xmlns:os": "http://a9.com/-/spec/opensearch/1.1/"
},
"children": [
"0"
]
},
{
"name": "os:itemsPerPage",
"attributes": {
"xmlns:os": "http://a9.com/-/spec/opensearch/1.1/"
},
"children": [
"10"
]
}
]
}
GET a purchase order by ID:
Request:
https://acq.sd00.worldcat.org/purchaseorders/PO-2012-36
Response:
<?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:23:40.294Z</updated>
<gd:etag>2012-03-14T10:47:38.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>alibris Order - 1329321767</orderName>
<link href="https://acq.sd00.worldcat.org//purchaseorders/PO-2012-36/?inst=12880" />
<purchaseOrderNumber>PO-2012-36</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>
<orderDate>2012-03-14T10:47:38.000-04:00</orderDate>
<orderItemCount>2</orderItemCount>
<taxCalculationMethod>EXCLUDE_ADDITIONAL_COSTS</taxCalculationMethod>
<purchaseOrderState>SUBMITTED</purchaseOrderState>
<totalOrderPrice>105.75</totalOrderPrice>
<lastUpdateTime>2012-03-14T10:47:38.000-04:00</lastUpdateTime>
<insertTime>2012-02-15T11:02:48.000-05:00</insertTime>
</purchaseOrder>
</content>
</entry>
JSON Response:
{
"title":"",
"content":{
"orderName":"alibris Order - 1329321767",
"link":{
"href":"https://acq.sd00.worldcat.org//purchaseorders/PO-2012-36/?inst=12880"
},
"purchaseOrderNumber":"PO-2012-36",
"orderNumberRange":"PO",
"vendor":{
"vendorId":"50f0ecab-9b4e-4da3-a1c4-e0343a189713",
"vendorName":"Alibris",
"localIdentifier":"LVN-2"
},
"currency":"USD",
"exchangeRate":1.000000,
"orderDate":1331736458000,
"orderItemCount":2,
"taxCalculationMethod":"EXCLUDE_ADDITIONAL_COSTS",
"purchaseOrderState":"SUBMITTED",
"totalOrderPrice":105.75,
"lastUpdateTime":1331736458000,
"insertTime":1329321768000,
"action":null,
"processing":null
},
"updated":"2012-06-29T13:24:54.412Z",
"extensions":[
{
"name":"gd:etag",
"attributes":{
"xmlns:gd":"http://schemas.google.com/g/2005"
},
"children":[
"2012-03-14T10:47:38.000-04:00"
]
}
]
}
POST XML to create a new purchase orders:
Request:
https://acq.sd00.worldcat.org/purchaseorders/
XML Payload:
<?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>
Response:
<?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 Order1340977320</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>
PUT XML to update an existing purchase orders:
Request:
https://acq.sd00.worldcat.org/purchaseorders/PO-2012-132
XML Payload:
<?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>
Response:
<?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:48:47.565Z</updated>
<gd:etag>2012-06-29T09:48:47.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:48:47.000-04:00</lastUpdateTime>
<insertTime>2012-06-29T09:42:02.000-04:00</insertTime>
</purchaseOrder>
</content>
</entry>
DELETE a purchase order by ID:
Request:
https://acq.sd00.worldcat.org/purchaseorders/PO-2011-11
Response:
// Empty Response // HTTP Status 200 OK returned
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
Follow the OCLC Developer Network: