Endpoints
XML Request Format
Send HTTP PUT (or POST) requests with an XML body to https://inventoryupdate.abebooks.com:10027/. The server responds with an XML document containing the result of each book operation.
Request Elements
All inventory update requests follow XML standards and should include the standard XML header:
<?xml version="1.0" encoding="ISO-8859-1"?>The following is an example of an inventoryUpdateRequest with a TransactionType of "add" and a Quantity of "2":
<?xml version="1.0" encoding="ISO-8859-1"?>
<inventoryUpdateRequest version="1.0">
<action name="bookupdate">
<username>YOUR_CLIENT_PIN</username>
<password>YOUR_API_KEY</password>
</action>
<AbebookList>
<Abebook>
<transactionType>add</transactionType>
<vendorBookID>000001</vendorBookID>
<author>Wittgenstein, Ludwig</author>
<title>Tractatus Logico-Philosophicus</title>
<publisher>Dover Publications</publisher>
<subject>Philosophy Logic Linguistics</subject>
<price currency="USD">1234567.89</price>
<languageIsoCode>ENG</languageIsoCode>
<dustJacket>true</dustJacket>
<binding type="hard">Leather</binding>
<firstEdition>false</firstEdition>
<signed>false</signed>
<booksellerCatalogue>Philosophy</booksellerCatalogue>
<description>Clean and unmarked; with original intro.</description>
<bookCondition>Fine</bookCondition>
<size>8.4" x 5.4"</size>
<jacketCondition>Fine</jacketCondition>
<bookType>Ex-Library</bookType>
<isbn>0486404455</isbn>
<publishPlace>Toronto, Canada, ON</publishPlace>
<publishYear>1999</publishYear>
<edition>Reprint</edition>
<inscriptionType>Signed by previous owner.</inscriptionType>
<quantity amount="2" />
<shippingTemplateID>ST-0001</shippingTemplateID>
<weight unit="GRAMS">12.56</weight>
<pictureList>
<pictureURL>https://www.abebooks.com/images/123456_1.jpg</pictureURL>
<pictureURL>https://www.abebooks.com/images/123456_2.jpg</pictureURL>
</pictureList>
</Abebook>
</AbebookList>
</inventoryUpdateRequest>inventoryUpdateRequest Tag
This tag wraps the entire inventory update request. It has one attribute, version, and two child elements: action and AbebookList. Currently the only valid version is "1.0".
action Tag
This tag tells the inventory server which action to take and which user is performing it. The name attribute must be bookupdate.
How you supply credentials in the action element depends on how you authenticate the request:
- Signed requests: Send your client PIN as
usernameand omit the<password>element. See Signing Requests. - Legacy credentials: Send your client PIN as
usernameand your API key aspassword.
In both cases the username must identify a unique, valid vendor account. The examples on this page use legacy credentials.
AbebookList Tag
The AbebookList element must contain at least one Abebook element and can contain up to 100.
Abebook Tag
The Abebook tag contains all of the elements that describe a book. transactionType, vendorBookID and price are required. At least one of author, title or publisher is also required. The remaining elements are optional as described in the tag dictionary.
For a patch, only transactionType and vendorBookID are required, along with at least one field to change. See Partial Updates (patch).
Quantity Tag
Specifying the quantity of a book can be done with the quantity tag. This tag has two attributes: "amount" and "limit".
Specify a quantity of 2:
<quantity amount="2" />Specify unlimited quantity:
<quantity limit="1" />Note: On an add or update, setting
amount="0"deletes the listing, the same as adeletetransaction. On a patch,amount="0"sets the quantity to 0, which takes the listing off sale.
booksellerCatalogue Tag
The booksellerCatalogue tag places a book in one catalog. Its whole value, including any commas, is used as a single catalog name. To place a book in more than one catalog, use the booksellerCatalogueList tag, with one catalogueName child element for each catalog:
<booksellerCatalogueList>
<catalogueName>Philosophy, Logic</catalogueName>
<catalogueName>Rare</catalogueName>
</booksellerCatalogueList>Because each name is its own element, a name can contain commas. The example places the book in two catalogs: "Philosophy, Logic" and "Rare".
Note: If you rename a catalog in Manage Catalogs on the AbeBooks website, any commas in its name are removed when you save. Send the new name, without commas, in later requests.
- The list can contain up to 10 catalog names, each up to 100 characters.
- Leading and trailing spaces are removed from each name, and empty names are ignored.
- Names that differ only in case, such as "Rare" and "rare", count as one catalog. The first spelling is kept.
- On an add or update, a list with no catalog names places the book in no catalogs.
The book is rejected with code 606 if:
- The list contains more than 10 catalog names, or any name is longer than 100 characters.
booksellerCatalogueListappears more than once in the same Abebook element.- The book contains both
booksellerCatalogueandbooksellerCatalogueList, even ifbooksellerCatalogueis empty.
Deletes, and adds or updates with a quantity of 0, are not checked against these rules.
editionList Tag
To specify multiple edition types for a single listing, use the editionList tag containing one or more edition child elements:
<editionList>
<edition>Signed limited edition</edition>
<edition>Reprint</edition>
</editionList>You can use editionList instead of, or along with, the single edition tag. See the Keywords Reference for recognized edition values.
Partial Updates (patch)
An add or update replaces every field of a book, so you must send all of its information each time. A patch changes only the fields it contains and leaves every other field as it is. Use it to change a price or quantity without resending the whole book.
The following example changes only the price and quantity of an existing book:
<?xml version="1.0" encoding="ISO-8859-1"?>
<inventoryUpdateRequest version="1.0">
<action name="bookupdate">
<username>YOUR_CLIENT_PIN</username>
<password>YOUR_API_KEY</password>
</action>
<AbebookList>
<Abebook>
<transactionType>patch</transactionType>
<vendorBookID>STORMLIGHT-01</vendorBookID>
<price currency="CAD">79.99</price>
<quantity amount="2" />
</Abebook>
</AbebookList>
</inventoryUpdateRequest>A request can mix patches with adds, updates and deletes, up to the limit of 100 books per request.
Fields a Patch Can Set
A patch can contain transactionType, vendorBookID, and any of the following:
price, quantity, author, title, subject, description, publisher, publishPlace, publishYear, illustrator, size, bookType, languageIsoCode, isbn, weight, booksellerCatalogue, booksellerCatalogueList, shippingTemplateID
A patch can't change the other fields (such as binding, bookCondition, jacketCondition, printing, edition, dustJacket, firstEdition, signed and pictureList). To change them, send an update with all of the book's information.
Patch Rules
A patch that breaks any of these rules is rejected with code 606, and the book is left unchanged:
- It can't contain any element other than
transactionType,vendorBookIDand the fields listed above. - It must contain at least one field to set.
- Each field can appear only once and can't be empty or contain only whitespace. To clear a text field, send an update instead.
shippingTemplateIDrequirespriceandquantityin the same patch. If the patch doesn't includeweight, the book's current weight is used. If the book has no weight, the template's default weight applies, or the service default if the template doesn't set one. A book with a weight-based template always has a weight.quantitymust have anamount, or a recognizedlimitsuch aslimit="1"(unlimited).publishYearmust be a four-digit year.sizeandbookTypecan't exceed their maximum lengths (see the Tag Dictionary). An update moves values that are too long into the description, but a patch rejects them.booksellerCatalogueListmust name at least one catalog, and follows the same rules as on an add or update (see booksellerCatalogue Tag). To remove all of a book's catalogs, send an update instead.- A request can't contain both a patch and an add, update or delete for the same
vendorBookID. Send the patch in a separate request.
A patch is stricter than an add or update. Some invalid values that an update ignores cause a patch to be rejected with code 606:
languageIsoCodemust be a supported language. An update ignores a well-formed code that isn't supported.isbnmust be a valid ISBN.weightmust be greater than 0. An update ignores a weight of 0.
Price and shipping template checks return the same codes as an add or update. A price of 0 or less, or an invalid currency, returns code 604. A shippingTemplateID that doesn't match one of your published templates returns code 607. Other price or template problems, such as an incorrectly formatted price or a template the book doesn't qualify for, return code 606.
How a Patch Is Applied
- A field in the patch replaces that field's whole value.
- A
descriptionpatch replaces the entire description, including any text an update moved there from oversized fields. - A
booksellerCataloguepatch replaces all of the book's catalogs with that one catalog. AbooksellerCatalogueListpatch replaces them with the catalogs in the list. - On a patch,
<quantity amount="0" />sets the quantity to 0, which takes the listing off sale. A later patch with a quantity above 0 puts it back on sale. - Important: A patch applies only to existing books. If the
vendorBookIDisn't in your inventory, the patch still returns code 600 but has no effect. - The server submits a request's patches after its adds, updates and deletes, but the order in which they take effect isn't guaranteed, so a patch can't share a
vendorBookIDwith another transaction in the same request.
Patch Responses
An accepted patch returns code 600 with the message "Book patch accepted":
<Abebook>
<code>600</code>
<message>Book patch accepted</message>
<transactionType>patch</transactionType>
<vendorBookID>STORMLIGHT-01</vendorBookID>
</Abebook>If the server can't submit the request's patches, each patch in the request returns code 105 with the message "Failed to submit the patch; resend it". The request's adds, updates and deletes keep their own results. Resend only the patches.
If the server returns a request-level error (requestError, see Error Response Format) with code 105, nothing in the request was applied, including its patches. Resend the whole request.
The Inventory Update Response
Example Response
<?xml version="1.0" encoding="ISO-8859-1"?>
<inventoryUpdateResponse version="1.0">
<code>600</code>
<message lang="en">English Message</message>
<AbebookList>
<Abebook>
<code>600</code>
<message>Book added or updated</message>
<transactionType>ADD</transactionType>
<vendorBookID>8484848E8e8e8</vendorBookID>
</Abebook>
<Abebook>
<code>600</code>
<message>Book deleted</message>
<transactionType>DELETE</transactionType>
<vendorBookID>1212121</vendorBookID>
</Abebook>
</AbebookList>
</inventoryUpdateResponse>Error Response Format
<?xml version="1.0" encoding="ISO-8859-1"?>
<requestError version="1.0">
<code>501</code>
<message lang="en">English Error Message</message>
</requestError>Tag Dictionary
| Tag | Required (Add/Upd/Del) | Patch | Size | Notes |
|---|---|---|---|---|
<inventoryUpdateRequest> |
Yes/Yes/Yes | Yes | N/A | 1.0 is the only valid version. |
<action name> |
Yes/Yes/Yes | Yes | N/A | "bookupdate" is the only valid value. |
<username/> |
Yes/Yes/Yes | Yes | 30 | Vendor client PIN. |
<password/> |
Legacy only | Legacy only | 30 | API key. Required only for legacy credential requests; omit for signed requests. |
<transactionType/> |
Yes/Yes/Yes | Yes | N/A | ADD, UPDATE, DELETE or PATCH (case-insensitive). |
<vendorBookID/> |
Yes/Yes/Yes | Yes | 40 | Must be unique. |
<author/> |
Yes/Yes/No | Optional | 750 | On add/update, at least one of author, title, publisher required. |
<title/> |
Yes/Yes/No | Optional | 750 | See note on author. |
<publisher/> |
Yes/Yes/No | Optional | 750 | See note on author. |
<subject/> |
No/No/No | Optional | 2000 | KEYWORDS field. |
<price> |
Yes/Yes/No | Optional | 8.2 | Currency attribute is three-letter ISO code. Format: #.## |
<dustJacket/> |
No/No/No | Not allowed | Bool | TRUE/FALSE |
<binding> |
No/No/No | Not allowed | 30 | Type attribute: "hard" or "soft". |
<firstEdition/> |
No/No/No | Not allowed | Bool | TRUE/FALSE |
<signed/> |
No/No/No | Not allowed | Bool | TRUE/FALSE |
<booksellerCatalogue/> |
No/No/No | Optional | 500 | Longer values are shortened to 500 characters. Can't be combined with <booksellerCatalogueList> in the same book. See booksellerCatalogue Tag. |
<booksellerCatalogueList> |
No/No/No | Optional | N/A | Up to 10 <catalogueName> items. Can't be combined with <booksellerCatalogue/> in the same book. See booksellerCatalogue Tag. |
<catalogueName> |
No/No/No | Optional | 100 | One catalog name. Can contain commas. |
<description/> |
No/No/No | Optional | 4000 | |
<illustrator/> |
No/No/No | Optional | 254 | |
<bookCondition/> |
No/No/No | Not allowed | 30 | See Keywords Reference for values. |
<size/> |
No/No/No | Optional | 50 | |
<jacketCondition/> |
No/No/No | Not allowed | 30 | See Keywords Reference for values. |
<bookType/> |
No/No/No | Optional | 30 | See Keywords Reference for values. |
<isbn/> |
No/No/No | Optional | 15 | |
<publishPlace/> |
No/No/No | Optional | 50 | |
<publishYear/> |
No/No/No | Optional | 4 | |
<printing/> |
No/No/No | Not allowed | 20 | See Keywords Reference. |
<edition/> |
No/No/No | Not allowed | 40 | See Keywords Reference. Use <editionList> for multiples. |
<editionList> |
No/No/No | Not allowed | N/A | Contains multiple <edition> child elements. See Keywords Reference. |
<inscriptionType/> |
No/No/No | Not allowed | 50 | See Keywords Reference for values. |
<quantity/> |
No/No/No | Optional | 999 | Max 999. limit="1" for unlimited. On add/update, amount="0" deletes the listing; on a patch, it takes the listing off sale. |
<pictureList> |
No/No/No | Not allowed | N/A | Up to 20 <pictureURL> items. |
<pictureURL> |
No/No/No | Not allowed | 2000 | URLs from Amazon, eBay, etc. are blocked. |
<productionMethod/> |
No/No/No | Not allowed | N/A | "P" = printed on demand, "E" = eBook. |
<productType/> |
No/No/No | Not allowed | N/A | See Keywords Reference for values. |
<shippingTemplateID/> |
No/No/No | Optional | 40 | Must match a published Shipping Template ID. In a patch, requires price and quantity. |
<weight/> |
No/No/No | Optional | N/A | Unit: "GRAMS", "KILOGRAMS", "OUNCES", "POUNDS". Format: #.## |
<languageIsoCode/> |
No/No/No | Optional | 3 | 3-letter ISO code (e.g., "ENG", "DEU"). |