POST/v1/catalogue
Offer products in the store, or stop offering them.
What it does
Send product codes and listed: true offers them in the key's store (with all their current sizes), false stops offering them. The same as ticking them on the store's Products tab in PrintWisp. Unknown codes come back in unknown and nothing is guessed. Send {"currency": "USD", "fx_rate": 0.66} instead (a connected shop's store only) and the store sells in that currency, its prices converted from the catalogue's at that rate (how many of it one of the catalogue's currency is; the catalogue's own currency needs none). The answer is the store with its currency and rate.
Send the key: Authorization: Bearer sk_test_… or sk_live_….
curl -X POST "https://printwisp.com/v1/catalogue" \
-H "Authorization: Bearer $PRINTWISP_KEY" \
-H "Content-Type: application/json" \
-d '{"codes":["layflat"],"listed":true}'
# 200
{ "changed": ["layflat"], "unknown": [] }<?php
$ch = curl_init('https://printwisp.com/v1/catalogue');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(['codes' => ['layflat'], 'listed' => 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/catalogue', {
method: 'POST',
headers: { Authorization: 'Bearer ' + process.env.PRINTWISP_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ codes: ['layflat'], listed: true }),
});
const answer = await r.json();import os, requests
r = requests.post(
"https://printwisp.com/v1/catalogue",
json={ "codes": ["layflat"], "listed": True },
headers={"Authorization": f"Bearer {os.environ['PRINTWISP_KEY']}"},
)
answer = r.json()Response
200 application/json. What changed, and any codes that are not products of this organisation.
Errors
| HTTP | error | message |
|---|---|---|
| 400 | invalid_request | Send {"codes": ["product-code", ...], "listed": true}. |
| 400 | no_store | This key belongs to no store: use a store's key. |
| 422 | invalid_request | PrintWisp cannot sell in JPY yet. |