Books' sales
GET
/api/v1/books/sales
const url = 'https://digize.com/api/v1/books/sales?range=30d';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://digize.com/api/v1/books/sales?range=30d' \ --header 'x-api-key: <x-api-key>'Copies of the workspace’s books sold through its own store over a range (30d, 90d, 365d or all), by book and format, with revenue after refunds, what Lulu charged to print and ship the store’s printed copies (in the workspace’s currency at today’s rate), and the margin; and the live listings at other stores, whose sales are in those stores’ own reports.
Needs the books:read permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”range
string
Responses
Section titled “Responses”Done
Media typeapplication/json
object
range
required
string
currency
required
string
totals
required
rows
required
Array<object>
object
bookId
required
string
title
required
string
kind
required
string
listingId
required
string
productId
required
string
units
required
integer
revenue
required
In the workspace currency’s minor units, after refunds.
integer
refunds
required
integer
Example
{ "range": "30d", "rows": [ { "kind": "print" } ], "elsewhere": [ { "store": "store", "kind": "print" } ]}What was sent isn’t valid (invalid).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}