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.”
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
| Parameter | Type | Description |
|---|---|---|
platform required | string | |
shop required | string | |
state required | string | The app's one-time check value (48 hex characters). |
app required | string | |
shop_name | string | |
email | string | |
currency | string |
Response
200 application/json. The shop's keys and webhook secret, as POST /v1/connect answers.
Errors
| HTTP | error | message |
|---|---|---|
| 400 | invalid_request | That is not a Shopify shop address. |
| 403 | unknown_app | That app address is not one PrintWisp trusts. |
| 403 | not_confirmed | PrintWisp's Shopify app did not confirm this request. |
| 405 | method_not_allowed | POST only. |
| 409 | busy | PrintWisp is busy setting this shop up. Try again in a moment. |
| 500 | provision_failed | PrintWisp could not set this shop up just now. Try again in a minute. |