Docs
Endpoints · Connect

POST/v1/provision

PrintWisp's Shopify app sets a new shop up, with no sign-in.

What it does

Called only by PrintWisp's own Shopify app, the first time it opens in a shop with no PrintWisp link. PrintWisp confirms the request by calling the app back (at a host it already trusts) with state; the app says yes only for a check value it made for that shop moments before. The shop gets its own organisation (billed through Shopify), a draft store, the connection and starter products -- or, already connected, the same organisation with fresh keys. One shop, one organisation; a second call is answered the same way. The answer is the same as POST /v1/connect.

No key: it is public. Any method but POST answers 405 method_not_allowed: “POST only.”

POST /v1/provisionCopy
curl -X POST "https://printwisp.com/v1/provision" \
  -H "Content-Type: application/json"
<?php
$ch = curl_init('https://printwisp.com/v1/provision');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => json_encode(null),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
]);
$answer = json_decode(curl_exec($ch), true);
// Node
const r = await fetch('https://printwisp.com/v1/provision', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
});
const answer = await r.json();
import requests

r = requests.post(
    "https://printwisp.com/v1/provision",
)
answer = r.json()

Parameters

ParameterTypeDescription
platform requiredstring
shop requiredstring
state requiredstringThe app's one-time check value (48 hex characters).
app requiredstring
shop_namestring
emailstring
currencystring

Response

200 application/json. The shop's keys and webhook secret, as POST /v1/connect answers.

Errors

HTTPerrormessage
400invalid_requestThat is not a Shopify shop address.
403unknown_appThat app address is not one PrintWisp trusts.
403not_confirmedPrintWisp's Shopify app did not confirm this request.
405method_not_allowedPOST only.
409busyPrintWisp is busy setting this shop up. Try again in a moment.
500provision_failedPrintWisp could not set this shop up just now. Try again in a minute.
{ "error": "invalid_request", "message": "That is not a Shopify shop address." }

← Every routeQuickstart →