POST/v1/quote
What a design (or a ready product, by SKU) costs, priced by PrintWisp.
What it does
For a shop whose own cart takes the design (the WooCommerce plugin): send the design and the sig the designer gave the page. PrintWisp checks the design is printable and prices it as it is -- the pages of a book, the options chosen -- always with PrintWisp's own price, whatever the store's Price comes from says. The price is frozen as a hand-off, in the shop's cart: charge unit_price per copy and report the order with the handoff on its line, so what is paid is what PrintWisp quoted.
A READY product (sold as ready: a stocked item, no designer): send {sku, qty} (or {variant, qty} with the variant's code) and no design. The answer is type: "ready" with the store's unit_price, the variant, its barcode, available (false when a product that stops selling at 0 has fewer than qty left, with a message) and stock. Nothing is frozen: report the order with {sku, qty} on the line.
Send the key: Authorization: Bearer sk_test_… or sk_live_….
curl -X POST "https://printwisp.com/v1/quote" \
-H "Authorization: Bearer $PRINTWISP_KEY" \
-H "Content-Type: application/json" \
-d '{"design":"dsn_5c2a9e01b7d4f638","sig":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","qty":1}'
# 200
{
"handoff": "hnd_6e4b1a9c3d7f2058",
"handoff_sig": "9b1c…",
"design": "dsn_5c2a9e01b7d4f638",
"unit_price": "585.00",
"currency": "AUD",
"qty": 1,
"sku": "pl-hc-10x10",
"pages": 40,
"product": "pl-hc-10x10",
"product_name": "Premium Lay-flat 10x10in Square",
"choices": { "Cover finish": "Matte Lamination" }
}<?php
$ch = curl_init('https://printwisp.com/v1/quote');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'design' => 'dsn_5c2a9e01b7d4f638',
'sig' => 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
'qty' => 1
]),
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('PRINTWISP_KEY'), 'Content-Type: application/json'],
]);
$answer = json_decode(curl_exec($ch), true);// Node (your server). The key never reaches a browser.
const r = await fetch('https://printwisp.com/v1/quote', {
method: 'POST',
headers: { Authorization: 'Bearer ' + process.env.PRINTWISP_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
design: 'dsn_5c2a9e01b7d4f638',
sig: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
qty: 1
}),
});
const answer = await r.json();import os, requests
r = requests.post(
"https://printwisp.com/v1/quote",
json={
"design": "dsn_5c2a9e01b7d4f638",
"sig": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"qty": 1
},
headers={"Authorization": f"Bearer {os.environ['PRINTWISP_KEY']}"},
)
answer = r.json()Parameters
| Parameter | Type | Description |
|---|---|---|
design | string | With sig, for a personalised product. |
sig | string | The designer's signature for the design. |
sku | string | A ready product's variant SKU, instead of design + sig. |
variant | string | Or the variant's code. |
qty | integer |
Response
200 application/json. Priced and frozen.
{
"handoff": "hnd_6e4b1a9c3d7f2058",
"handoff_sig": "9b1c…",
"design": "dsn_5c2a9e01b7d4f638",
"unit_price": "585.00",
"currency": "AUD",
"qty": 1,
"sku": "pl-hc-10x10",
"pages": 40,
"product": "pl-hc-10x10",
"product_name": "Premium Lay-flat 10x10in Square",
"choices": { "Cover finish": "Matte Lamination" }
}Errors
| HTTP | error | message |
|---|---|---|
| 401 | unauthorized | Send Authorization: Bearer <secret key>. Keys are made in PrintWisp, on your store's Overview → API keys. |
| 404 | design_not_found | No design dsn_5c2a9e01b7d4f638. |
| 404 | sku_not_found | No ready product with the SKU FR-OAK-A3-BLK. |
| 422 | bad_design | Send the design and the signature the designer gave you. |
| 422 | not_sold | This design is not linked to a product the shop sells. |
| 422 | cannot_price | The design cannot be printed yet: Page 3: a photograph is below the resolution floor. |
| 422 | invalid_quote | qty must be a whole number, 1 or more. |
| 422 | not_offered | The store web-au does not offer FR-OAK-A3-BLK. Offer it on the Products tab of that store. |