Skip to content

Order Line Item Resource

Introduction

Every order may have several line items.

Example URL

https://api.openpublishing.com/resource/v3/orders/[ID]/line_items/[LINE-ITEM-ID]

Allowed methods: GET, PUT, DELETE.

For creating an order POST an object to https://api.openpublishing.com/resource/v3/orders[ID]/line_items.

Search Filters

List orders:

https://api.openpublishing.com/resource/v3/orders/[ID]/line_items

external_identifier_type / external_identifier_value : Search for items with an external identifier set. The external identifier type is the category of the item, e.g. "klopotek" whereas the value is the id itself. If only external_identifier_type is specified, all items with the external identifier type set are returned. If you search for only external_identifier_value - the system will return all identifiers with the value, where the type is not set.

Fields

Image URL

image_url describes the location of an image to be displayed within the shopping cart.

Shop URL

If shop_url is set, the item within the shoppnig cart or a listing may be linked with a product detail page.

Handling

The field handling contains a subobject describing how the Open Publishing should handle finished orders.

bookshelf is a flag (values true or false) indicating if the product should be added to the bookshelf of the recipient of the order. The (logged in) business partner may download the digital asset after sucessfull completion of the purchase. If configured the asset mith be added to the bookshelf of the business partner permanently.

fulfillment is a flag (values true or false) which controls if a physical copy of the book should be deliverd to the customer. If a provider is set the consumer of the API may also specify a logistics partner, e.g. bod or cpi. If provider is set to null the the shop will pick a suitable provider.

VAT information

vat_calculation is a flag (values true orfalse) to define whether the VAT is automatically determined and calculated or whether the transmitted value vat_percentage (number) is used.

vat_from_gross is a flag (values true or false) that controls whether the net value is calculated from the VAT and the gross value or vice versa.

vat_percentage is the numeric VAT value expressed in percentage (is used only when vat_calculation=false).

vat_product is the product (values book, ebook, audiobook, software, shipment) used to determine the corresponding VAT (is used only when vat_calculation=true). If it is not specified, then the regular VAT is applied in the VAT calculation.

Shipping

is_shipping flag is a boolean indicating if item is a shipping (or postage and package) item. Shipping items are calculated in the backend according to weight, shipping prices etc and are therefore read-only.

External Identifiers

external_identifiers: List of external/foreign identifiers, e.g. the id of the business partner within Klopotek, Paypal or Amazon. The listed objects are dicts with the values type for the type of the identifier and value for the identifier itself.

Example JSON

{
   "_id": 21,
   "external_identifiers": []
   "gross": 1199,
   "gross_currency": "USD",
   "handling": {
      "bookshelf": false,
      "fulfillment": true,
      "provider": null
   },
   "image_url": "https://cdn.openpublishing.com/images/cover/9783638627177.jpg",
   "is_shipping": false,
   "net": 1199,
   "net_currency": "USD",
   "products":
      [
         {
            "ean": "9783638627177",
            "product": {
               "_id": 190,
               "title": "Faktoren ihres Erfolgs"
            }
         }
      ],
   "quantity": 1,
   "shop_url": "https://www.shopxyz.de/product/9783638627177",
   "title": "Buchkauf",
   "total_gross": 1199,
   "total_gross_currency": "USD",
   "total_net": 1199,
   "total_net_currency": "USD",
   "total_vat": 0,
   "total_vat_currency": "USD",
   "vat": 0,
   "vat_currency": "USD",
   "vat_percentage": 0,
   "vat_calculation": true,
   "vat_from_gross": false,
   "vat_product": "book",
}