POST/v1/customers/claim
Proof by mailbox: designs a guest emailed to this customer's verified address join their account.
What it does
Call it on every sign-in, with the signed-in customer's email, ONLY when your platform verified it (verified: true): Shopify customer accounts, a sign-in code. WooCommerce does not verify addresses, so a WooCommerce shop never claims; its customers join a design by opening its emailed link while signed in. A guest who pressed ✕ › Email me the link and typed that same address owns the mailbox the link went to: those designs (in the key's store) are listed under customer_ref from now on, tagged once in GET /v1/projects (note: "saved_by_email"). Idempotent. This and opening the emailed link while signed in are the only ways a guest's design joins an account; there is no merge call, because a browser is not a person (a shared computer's next user would inherit the last guest's designs).
Send the key: Authorization: Bearer sk_test_… or sk_live_…. Any method but POST answers 405 method_not_allowed: “POST /v1/customers/claim.”
curl -X POST "https://printwisp.com/v1/customers/claim" \
-H "Authorization: Bearer $PRINTWISP_KEY" \
-H "Content-Type: application/json" \
-d '{"customer_ref":"wp-user-12","email":"sarah.t@gmail.com","verified":true}'
# 200
{ "customer_ref": "wp-user-12", "claimed": 1 }<?php
$ch = curl_init('https://printwisp.com/v1/customers/claim');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(['customer_ref' => 'wp-user-12', 'email' => 'sarah.t@gmail.com', 'verified' => 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/customers/claim', {
method: 'POST',
headers: { Authorization: 'Bearer ' + process.env.PRINTWISP_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ customer_ref: 'wp-user-12', email: 'sarah.t@gmail.com', verified: true }),
});
const answer = await r.json();import os, requests
r = requests.post(
"https://printwisp.com/v1/customers/claim",
json={ "customer_ref": "wp-user-12", "email": "sarah.t@gmail.com", "verified": True },
headers={"Authorization": f"Bearer {os.environ['PRINTWISP_KEY']}"},
)
answer = r.json()Parameters
| Parameter | Type | Description |
|---|---|---|
customer_ref required | string | Your signed-in customer (never a guest ref). |
email required | string | Their verified email address. |
verified required | boolean | true: you verified that this customer owns the address (Shopify customer accounts, a sign-in code). Required. WooCommerce does not verify addresses: never claim there. |
Response
200 application/json. claimed: how many designs joined now (0 when they already had).
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 | POST /v1/customers/claim. |
| 422 | invalid_request | Send {"customer_ref": "<your signed-in customer>", "email": "<their verified address>"}. |
| 422 | invalid_request | customer_ref is a guest: only a signed-in customer with a verified address can claim designs. |
| 422 | invalid_request | Send "verified": true, and only when you have verified that this customer owns the address (WooCommerce does not verify addresses: do not claim there). |