Endpoints · Connect
POST/v1/login-link
A one-time link that signs the organisation's owner in to the PrintWisp portal.
What it does
Used by PrintWisp's own Shopify app for "Open in PrintWisp", so the merchant lands signed in to their own organisation instead of a sign-in page. The link signs in the organisation's active owner, opens to (a path under /app; anything else opens /app), lasts two minutes and works once. Never made for PrintWisp's master organisation or a platform user. A used or expired link signs nobody in.
Send the key: Authorization: Bearer sk_test_… or sk_live_…. Any method but POST answers 405 method_not_allowed: “POST /v1/login-link only.”
curl -X POST "https://printwisp.com/v1/login-link" \ -H "Authorization: Bearer $PRINTWISP_KEY" \ -H "Content-Type: application/json"
<?php
$ch = curl_init('https://printwisp.com/v1/login-link');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(null),
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/login-link', {
method: 'POST',
headers: { Authorization: 'Bearer ' + process.env.PRINTWISP_KEY, 'Content-Type': 'application/json' },
});
const answer = await r.json();import os, requests
r = requests.post(
"https://printwisp.com/v1/login-link",
headers={"Authorization": f"Bearer {os.environ['PRINTWISP_KEY']}"},
)
answer = r.json()Parameters
| Parameter | Type | Description |
|---|---|---|
to | string | Where the portal opens: a path starting with /app. |
Response
200 application/json. The link, to open in the merchant's browser within two minutes.
Errors
| HTTP | error | message |
|---|---|---|
| 401 | unauthorized | Send Authorization: Bearer <secret key>. Keys are made in PrintWisp, on your store's Overview → API keys. |
| 403 | not_allowed | Sign-in links are not made for this organisation. |
| 405 | method_not_allowed | POST /v1/login-link only. |
| 409 | no_owner | This organisation has no owner who can sign in yet. Sign in to PrintWisp, or choose "Forgot password" with your store's email. |