Skip to content

Books' sales

GET
/api/v1/books/sales
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.

range
string
default: 30d
Allowed values: 30d 90d 365d all

Done

Media typeapplication/json
object
range
required
string
Allowed values: 30d 90d 365d all
currency
required
string
totals
required
object
units
required
integer
>= -9007199254740991 <= 9007199254740991
revenue
required
integer
>= -9007199254740991 <= 9007199254740991
luluCost
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
margin
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
rows
required
Array<object>
object
bookId
required
string
title
required
string
kind
required
string
Allowed values: print ebook
listingId
required
string
productId
required
string
units
required
integer
>= -9007199254740991 <= 9007199254740991
revenue
required

In the workspace currency’s minor units, after refunds.

integer
>= -9007199254740991 <= 9007199254740991
refunds
required
integer
>= -9007199254740991 <= 9007199254740991
luluCost
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
margin
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
elsewhere
required
Array<object>
object
bookId
required
string
title
required
string
store
required
string
Allowed values: store lulu amazon ingramspark other
storeLabel
required
string
kind
required
string
Allowed values: print ebook
url
required
string | null
price
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
currency
required
string

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
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
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
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
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
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
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
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
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
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}