Endpoints · Billing
POST/v1/billing
The shop chose a plan in its platform, or fees are now on its platform bill.
What it does
Send one of two things. subscription -- the shop chose or changed a plan in Shopify (plan is a PrintWisp plan code; status as Shopify gives it): the organisation moves onto Shopify billing and Stripe lets go of it, so it is never billed twice; the answer is the billing as GET /v1/billing gives it. An exempt organisation stays exempt. reported -- those fee ids are now on the shop's Shopify bill (ref is your usage record); the answer says how many were marked.
Send the key: Authorization: Bearer sk_test_… or sk_live_….
curl -X POST "https://printwisp.com/v1/billing" \
-H "Authorization: Bearer $PRINTWISP_KEY" \
-H "Content-Type: application/json" \
-d '{"reported":{"ids":[812],"ref":"gid://shopify/AppUsageRecord/5566778899"}}'
# 200
{ "marked": 1 }<?php
$ch = curl_init('https://printwisp.com/v1/billing');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(['reported' => ['ids' => [812], 'ref' => 'gid://shopify/AppUsageRecord/5566778899']]),
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/billing', {
method: 'POST',
headers: { Authorization: 'Bearer ' + process.env.PRINTWISP_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ reported: { ids: [812], ref: 'gid://shopify/AppUsageRecord/5566778899' } }),
});
const answer = await r.json();import os, requests
r = requests.post(
"https://printwisp.com/v1/billing",
json={ "reported": { "ids": [812], "ref": "gid://shopify/AppUsageRecord/5566778899" } },
headers={"Authorization": f"Bearer {os.environ['PRINTWISP_KEY']}"},
)
answer = r.json()Parameters
| Parameter | Type | Description |
|---|---|---|
subscription | object | |
reported | object |
Response
200 application/json. With reported: how many fees were marked. With subscription: the billing, as GET /v1/billing gives it.
Errors
| HTTP | error | message |
|---|---|---|
| 400 | invalid_request | Send {"subscription": {...}} or {"reported": {"ids": [...], "ref": "..."}}. |
| 401 | unauthorized | Send Authorization: Bearer <secret key>. Keys are made in PrintWisp, on your store's Overview → API keys. |
| 422 | invalid_request | Unknown plan: growth-2025 |