Skip to content

Price printing a book at Lulu

POST
/api/v1/books/{id}/print/quote
curl --request POST \
--url https://digize.com/api/v1/books/example/print/quote \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "quantity": 1, "place": { "street1": "example", "city": "example", "stateCode": "example", "postcode": "example", "countryCode": "example" }, "shippingLevel": "MAIL" }'

What copies of a book cost to print at Lulu with its spec and pages, and each way Lulu can ship them to an address, at the connected account’s prices; with the margin per copy against the book’s print price, a suggested print price from the printing cost, and a suggested ebook price from its length. Nothing is ordered. Free.

Needs the books:read permission.

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
quantity
integer
default: 1 >= 1 <= 10000
place
required
object
street1
required
string
>= 1 characters <= 30 characters
city
required
string
>= 1 characters <= 30 characters
stateCode
Any of:
string
<= 3 characters
postcode
required
string
>= 1 characters <= 64 characters
countryCode
required
string
>= 2 characters <= 2 characters
shippingLevel

Left out, the spec’s when Lulu offers it there, else the cheapest.

string
Allowed values: MAIL PRIORITY_MAIL GROUND_HD GROUND_BUS GROUND EXPEDITED EXPRESS

Done

Media typeapplication/json
object
podPackageId
required
string
pages
required
object
count
required
integer
>= -9007199254740991 <= 9007199254740991
estimated
required

True until a build counts the pages: estimated from the words the book’s shape plans.

boolean
words
required
integer
>= -9007199254740991 <= 9007199254740991
buildId
required

The build that counted them.

string | null
quantity
required
integer
>= -9007199254740991 <= 9007199254740991
level
required

The shipping level priced.

string
options
required
Array<object>
object
level
required
string
cost
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
currency
required
string
minDeliveryDate
required
string | null
maxDeliveryDate
required
string | null
traceable
required
boolean
lulu
required

Lulu’s price for the account, in cents of its currency.

object
currency
required
string
items
required
integer
>= -9007199254740991 <= 9007199254740991
unit
required

One copy’s printing, before tax.

integer
>= -9007199254740991 <= 9007199254740991
shipping
required
integer
>= -9007199254740991 <= 9007199254740991
fees
required
integer
>= -9007199254740991 <= 9007199254740991
tax
required
integer
>= -9007199254740991 <= 9007199254740991
total
required
integer
>= -9007199254740991 <= 9007199254740991
workspace
required
Any of:
object
currency
required
string
rate
required
number
unit
required
integer
>= -9007199254740991 <= 9007199254740991
fees
required
integer
>= -9007199254740991 <= 9007199254740991
shipping
required
integer
>= -9007199254740991 <= 9007199254740991
printPrice
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
margin
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
suggestedPrintPrice
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
suggestedEbookPrice
required
integer
>= -9007199254740991 <= 9007199254740991

Example generated

{
"podPackageId": "example",
"pages": {
"count": 1,
"estimated": true,
"words": 1,
"buildId": "example"
},
"quantity": 1,
"level": "example",
"options": [
{
"level": "example",
"cost": 1,
"currency": "example",
"minDeliveryDate": "example",
"maxDeliveryDate": "example",
"traceable": true
}
],
"lulu": {
"currency": "example",
"items": 1,
"unit": 1,
"shipping": 1,
"fees": 1,
"tax": 1,
"total": 1
},
"workspace": {
"currency": "example",
"rate": 1,
"unit": 1,
"fees": 1,
"shipping": 1
},
"printPrice": 1,
"margin": 1,
"suggestedPrintPrice": 1,
"suggestedEbookPrice": 1
}

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