Skip to content

Sell a book in the store

POST
/api/v1/books/{id}/store
curl --request POST \
--url https://digize.com/api/v1/books/example/store \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "print": true, "ebook": true }'

Puts a book on sale in the workspace’s own store from its latest build, at its prices in its store details: the ebook as a digital product whose downloads are the EPUB and the interior PDF, and the print book as a physical product Lulu prints for each paid order and ships to the buyer (once Lulu has passed the build’s files). Run it again after a new build to update the products. Each becomes a live listing, which publishes the book. Needs commerce:write too.

Needs the books:write permission. It can’t be undone.

id
required
string
>= 1 characters <= 64 characters
Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
print
required

Sell the printed book.

boolean
ebook
required

Sell the ebook.

boolean

Example generated

{
"print": true,
"ebook": true
}

Done

Media typeapplication/json
object
data
required
Array<object>
object
id
required
string
bookId
required
string
store
required

store the workspace’s own, lulu the Lulu Bookstore, amazon (KDP), ingramspark, or other.

string
Allowed values: store lulu amazon ingramspark other
kind
required
string
Allowed values: print ebook
label
required

Another store’s own name.

string
storeLabel
required
string
url
required
string | null
externalId
required

Its ID there: an ASIN at Amazon, the ISBN at IngramSpark.

string | null
price
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
currency
required
string
status
required

live once readers can buy it there: the book is published.

string
Allowed values: draft live
productId
required
string | null
exportKey
required
string | null
checklist
required

The checklist steps ticked off.

Array<string>
steps
required

The store’s checklist.

Array<object>
object
id
required
string
title
required
string
detail
required
string
done
required
boolean
liveAt
required
Any of:
string format: date-time
createdAt
required
string format: date-time
updatedAt
required
string format: date-time

Example

{
"data": [
{
"store": "store",
"kind": "print",
"status": "draft"
}
]
}

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"
}
}

A request with the same Idempotency-Key is still running (conflict).

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 Idempotency-Key was used with a different request.

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"
}
}