GET/v1/products
The store's catalogue with codes, names, prices and options.
What it does
What the key's store offers: each product with its offered sizes (code, name, the store's price in its currency) and its options with their values' codes, so your server can map its own products to PrintWisp's without copying codes by hand. The size's code is what you send as profile. A key with no store lists nothing: use a store's key.
Send the key: Authorization: Bearer sk_test_… or sk_live_…. Any method but GET answers 405 method_not_allowed: “GET /v1/products only.”
curl "https://printwisp.com/v1/products" \
-H "Authorization: Bearer $PRINTWISP_KEY"
# 200
{
"store": { "code": "web-au", "name": "Harbour Prints AU", "currency": "AUD" },
"products": [
{
"code": "canvas",
"name": "Photo canvas",
"sizes": [
{
"code": "canvas-40x30",
"name": "40 × 30 cm",
"price": "89.00",
"currency": "AUD",
"packed_kg": 2.431,
"packed_kg_extra": 2.431
},
{
"code": "canvas-60x40",
"name": "60 × 40 cm",
"price": "149.00",
"currency": "AUD",
"packed_kg": 4.576,
"packed_kg_extra": 4.576
}
],
"options": [
{
"code": "edge",
"name": "Edge",
"values": [
{ "code": "mirror", "name": "Mirrored", "price_delta": "0.00" },
{ "code": "white", "name": "White", "price_delta": "0.00" }
]
}
]
}
]
}<?php
$ch = curl_init('https://printwisp.com/v1/products');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
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/products', {
headers: { Authorization: 'Bearer ' + process.env.PRINTWISP_KEY },
});
const answer = await r.json();import os, requests
r = requests.get(
"https://printwisp.com/v1/products",
headers={"Authorization": f"Bearer {os.environ['PRINTWISP_KEY']}"},
)
answer = r.json()Response
200 application/json. The store and its products. Money is a string with two decimals, as in GET /v1/orders; price is null for a size with no price. With a key that belongs to no store: store null, products empty, and a message.
{
"store": { "code": "web-au", "name": "Harbour Prints AU", "currency": "AUD" },
"products": [
{
"code": "canvas",
"name": "Photo canvas",
"sizes": [
{
"code": "canvas-40x30",
"name": "40 × 30 cm",
"price": "89.00",
"currency": "AUD",
"packed_kg": 2.431,
"packed_kg_extra": 2.431
},
{
"code": "canvas-60x40",
"name": "60 × 40 cm",
"price": "149.00",
"currency": "AUD",
"packed_kg": 4.576,
"packed_kg_extra": 4.576
}
],
"options": [
{
"code": "edge",
"name": "Edge",
"values": [
{ "code": "mirror", "name": "Mirrored", "price_delta": "0.00" },
{ "code": "white", "name": "White", "price_delta": "0.00" }
]
}
]
}
]
}Errors
| HTTP | error | message |
|---|---|---|
| 401 | unauthorized | Send Authorization: Bearer <secret key>. Keys are made in PrintWisp, on your store's Overview → API keys. |
| 405 | method_not_allowed | GET /v1/products only. |