Orders and reporting

Sale of products

An order is placed at the time of a valid purchase from the end-user.  This is for a product to be made available to the customer in all services and for reporting of sales to publishers. The bookstore calls this on behalf of the customer. If id is specified for an order id, the order is attached to this and can’t be changed. There are some variations in the data you need to send in depending on what type of DRM the book.

New Authentication & URLs introduced Q2 2024

Place an order

The get inventory service can give data on your entire catalogue or detailed information on one specific title. 

URL

https://api.bokbasen.io/dds/order/v1

https://api.dds.boknett.no/order

The token acquired from the Authentication Service. Example: Authorization: Boknett TGT-....

Header: Date is required. The timestamp the request was made. Must comply with RFC 1123 date formats. Example: Tue, 10 Jun 2014 16:23:42 GMT

Method

POST

Request
headers

Authorization

Required

The token acquired from the https://bokbasen.jira.com/wiki/spaces/api/pages/2994962433.

Audience: https://api.bokbasen.io/dds/

Example: Authorization: Bearer ....

Accept

Required

application/json (We recommend all new implementations to use this header, XML support will be phased out in the future)

Content-type

Required

application/json

JSON attributes

orderid

Required

Your store order ID. Used as transaction ID in DDS. Must be unique for a purchase.

resid

Required

The product ID in DDS. Unique name for e-/audio books found in the inventory service.

spd

Required

Price in Norwegian "øre"  (sold for) including VAT. Example NOK 189 = 18900

id

Required

DDS-ID for end-consumer

firstname

Optional*

First name of the person buying the book (Required for all books with SDRM, minimum length 2)

lastname

Optional*

First name of the person buying the book (Required for all books with SDRM, minimum length 2)

excerpt

Optional

Order is for excerpt instead of actual book (defaults to false)

Response
headers

Location

https://api.bokbasen.io/dds/content/v1/{fulfilmentId}

Response
body

Empty on success

Returns

201

Created

40x

On errors

Example (curl)

Successful creation of an order for a book that does not have social DRM

curl -i \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <token>" \ -d '{"orderid":"123456789","resid":"fab4599e-eb2e-445a-a7f9-4af12c052dec","spd":"18900","id":"gaf4599e-fg5e-445a-a7f9-6af14c052dec"}' \ https://api.bokbasen.io/dds/order/v1 HTTP/1.1 201 Created Date: Fri, 07 Aug 2015 13:04:47 GMT Location: https://api.bokbasen.io/dds/content/v1/0b1c4e50-bb00-46ea-bc24-27d1b32fb2a3

Successful creation of book with SDRM:

curl -i \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <token>" \ -d '{"orderid":"my-stores-order-id4","resid":"18C8075F-C8B9-4029-9747-7C7F2CFB5CFA","spd":"18900","firstname":"Ola","lastname":"Nordmann"}' \ "https://api.bokbasen.io/dds/order/v1" HTTP/1.1 201 Created Location: https://api.bokbasen.io/dds/content/v1/30311730-6bb0-43a1-809f-18735edec150

Example (curl) legacy example

Successful creation of an order for a book that does not have social DRM

curl -i \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Boknett TGT-20025-OIgkKTofLlCJQasKhiuigfGQ7p0PueBCBvp0IFkN7TeQ0lrdFS-login.boknett.no" \ -H "Date: Fri, 07 Aug 2015 12:54:00 GMT" \ -d '{"orderid":"123456789","resid":"fab4599e-eb2e-445a-a7f9-4af12c052dec","spd":"18900","id":"gaf4599e-fg5e-445a-a7f9-6af14c052dec"}' \ https://api.dds.boknett.no/order HTTP/1.1 201 Created Date: Fri, 07 Aug 2015 13:04:47 GMT Location: https://api.dds.boknett.no/content/0b1c4e50-bb00-46ea-bc24-27d1b32fb2a3

Successful creation of book with SDRM:

 

The returned location header points to the bought resource, for details on how to access the content see https://bokbasen.jira.com/wiki/spaces/api/pages/62291987