Base URL https://prymalab.net/wp-json/prymalab/v1/. JSON in, JSON out. Authenticate with your API key from the partner dashboard.
Create a key under Partner dashboard → API & webhooks. Send it on every request as a bearer token. Keys start with plk_ and can be revoked at any time.
curl https://prymalab.net/wp-json/prymalab/v1/me \
-H "Authorization: Bearer plk_your_key_here"
{ "partner_id": 12, "company": "Acme Research", "brand": "Acme", "platform": "woocommerce",
"webhook_url": "https://acme.com/hooks/prymalab", "billing": "prepay",
"balance": { "amount": 1240.50, "currency": "USD", "auto_pay": true, "low_at": 250, "is_low": false,
"topup_url": "https://prymalab.net/my-account/partner/billing/#plp-topup" },
"statuses": ["received","processing","fulfilled","complete","on_hold","cancelled"] }
A partner account has one owner and any number of team members, each with their own PrymaLab sign-in. The owner (or any admin on the account) invites an email address under Partner dashboard → Team; the invitee accepts from the email, signing in or creating an account with that same address, and the account appears in their dashboard. Someone who is on several partner accounts, an agency running its clients' stores for instance, switches between them with the account selector in the dashboard sidebar; nothing is shared between accounts.
| Role | Can |
|---|---|
| Admin | Everything the owner sees: orders, billing and balance, API keys, store connection, team. |
| Staff | Orders, tracking, price list and COAs. No billing, API keys or team. |
Admins create and revoke API keys like the owner; each key records who created it. Keys belong to the partner account, not to the person, so a key an agency created keeps working after they are removed until it is revoked. Invoices always go to the owner's address; members with notifications on also receive shipped-order and balance emails. Members can open and pay the account's invoices and top-ups from their own sign-in.
An agency that runs stores for many brands gets one parent account with sub-accounts underneath, so onboarding a client never depends on the client doing anything. PrymaLab enables this on the agency's account; from then on Partner dashboard → Sub-accounts (and the endpoints below) create a client account in one step: company, brand on labels, platform, store URL, an optional client email that gets its own sign-in, and where its invoices are paid from. Every sub-account has its own partner id, API keys, webhook secrets, store connection and order board, so orders stay attributed to the right client. Owners and admins of the agency are admins on every sub-account and switch between them with the account selector; agency staff are staff there.
Adding admins who onboard clients. You do not have to be the only person creating sub-accounts. On the Sub-accounts page, beside Create a sub-account, an Add an admin who can onboard clients card invites a colleague straight to the Admin role. Once they accept the emailed invitation they can create sub-accounts, issue client API keys, fund accounts and invite more admins, exactly as you can; give Staff to anyone who should only see orders. The same people are listed under Team, where you can change a role or remove access later.
Money works two ways per sub-account. pay_from: "parent" (the default): the client's invoices are paid from the agency's balance the moment an order lands, and the agency gets the low-balance emails and balance.low events. pay_from: "own": the agency moves funds into the sub-account with Fund (or the endpoint below) and the client's invoices draw on that; the sub-account then has its own alert level. Cancelled orders credit back whichever balance paid. A sub-account without its own webhook URL sends its events to the agency's URL; every payload carries partner_id (the sub-account) and parent_id.
GET /subaccounts # all sub-accounts with balances, open orders and unpaid invoices
POST /subaccounts # create one
POST /subaccounts/{id} # update: company, brand, platform, store_url, webhook_url, pay_from, status (active|paused), low_at, auto_pay
GET /subaccounts/{id} # one sub-account with its ledger
POST /subaccounts/{id}/fund # { "amount": 500 } moves funds from your balance (negative moves them back)
POST /subaccounts/{id}/keys # { "label": "Storefront" } issues an API key for the sub-account
GET /subaccounts/{id}/artwork # the label artwork on a sub-account: id, name, kind, url, uploaded_at
POST /subaccounts/{id}/artwork # multipart: files[] (PNG, JPG, WebP, PDF, ZIP) + kind (label|vial|box|insert|logo|other)
DELETE /subaccounts/{id}/artwork/{att} # remove one file (att = its id from the listing)
DELETE /subaccounts/{id}/artwork?all=1 # remove every file on the sub-account (add &kind=label to clear one kind only)
GET / POST / DELETE /artwork, DELETE /artwork/{att} # the same four for your own account (or the sub-account named in X-PrymaLab-Account)
Uploading a file whose name already exists on the account replaces the old copy in place, so refreshing a design is one POST per file and needs no delete pass. An account holds up to 400 files, 25 MB each.
curl -X POST https://prymalab.net/wp-json/prymalab/v1/subaccounts \
-H "Authorization: Bearer plk_your_agency_key" -H "Content-Type: application/json" \
-d '{ "company": "Acme Peptides", "brand": "Acme", "platform": "shopify", "store_url": "https://acme.example",
"contact_email": "ops@acme.example", "pay_from": "parent" }'
{ "ok": true,
"account": { "partner_id": 41, "company": "Acme Peptides", "brand": "Acme", "platform": "shopify", "status": "active",
"pay_from": "parent", "has_login": true, "balance": { "amount": 0, … }, "orders": { "received": 0, … }, "due": { "count": 0, "total": 0 } },
"api_key": "plk_…", // shown once: plug it into the client's storefront
"login_email": "ops@acme.example" }
Your own agency key can also act as any of your sub-accounts on the order, catalog, /me and /balance endpoints by sending X-PrymaLab-Account: 41, which saves storing one key per client. Orders created that way belong to the sub-account. Pausing a sub-account (status: "paused") stops its keys and store webhooks without deleting anything.
Keep parent keys out of client stores. A key created on the agency (parent) account acts as the agency, and with X-PrymaLab-Account it can act on any sub-account, so it must never be pasted into a single client's storefront. Give each client the key issued the moment its sub-account is created, or a fresh one from POST /subaccounts/{id}/keys (or New key on the Sub-accounts page); that key only ever sees that client's orders. The parent account does not need a key of its own to run the agency.
POST /orders. Idempotent on external_id: sending the same ID twice returns the existing order with "duplicate": true and HTTP 200 instead of 201.
curl -X POST https://prymalab.net/wp-json/prymalab/v1/orders \
-H "Authorization: Bearer plk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"external_id": "1042",
"order_number": "#1042",
"customer": { "name": "Jordan Lee", "email": "jordan@example.com", "phone": "+1 555 010 0100" },
"ship_to": { "name": "Jordan Lee", "address_1": "12 Main St", "address_2": "Apt 4",
"city": "Lexington", "state": "KY", "postcode": "40507", "country": "US" },
"items": [
{ "sku": "BC5", "name": "BPC-157 5mg", "quantity": 2, "price": 34.99 },
{ "sku": "TB5", "name": "TB-500 5mg", "quantity": 1, "price": 49.99 }
],
"shipping_speed": "two_day",
"notes": "Leave at front desk"
}'
Response 201 Created:
{ "duplicate": false,
"order": { "id": 318, "external_id": "1042", "order_number": "#1042", "status": "received",
"status_label": "Received", "carrier": "", "tracking_number": "", "tracking_url": "",
"items": [ { "sku": "BC5", "name": "BPC-157 5mg", "quantity": 2, "lot": "" }, ... ],
"shipped_at": null, "updated_at": "2026-09-03 14:02:11" } }
| Field | Required | Notes |
|---|---|---|
external_id | yes | Your order ID. Used for de-duplication and shown in your dashboard. |
order_number | no | Display number if different from the ID. |
customer | no | name, email, phone. Used for the packing slip only. |
ship_to | yes | address_1, city and postcode required; state required where the country uses state or province codes (US, CA, AU ...). country is the ISO two-letter code and defaults to US; we ship anywhere prymalab.net itself ships, and GET /countries lists those countries with the estimate zone and whether a state code is needed. An order for a country we do not ship to is refused with 422 no_shipping. Outside the US and its territories the recipient's phone number is required (ship_to.phone or customer.phone), because the carrier and customs contact them: an order without one is refused with 422 no_phone. Pens and nasal sprays ship only to street addresses in the 50 US states and DC; an order sending them anywhere else (another country, a US territory, APO/FPO/DPO or a PO box) is refused with 422 cold_pack_destination. |
items[] | yes | sku (our catalog number, preferred) or name; quantity; price (your retail price per unit, optional; it is also the customs value on parcels leaving the US). |
shipping_speed | no | standard, two_day, overnight or cold_chain (see Shipping speeds). Left out: your account's default speed from Brand and settings, or standard. Anything else is refused with 422 bad_speed. |
shipping_method | no | Free text, e.g. your store's shipping method title. When shipping_speed is left out we read the speed from it ("2-Day", "UPS 2nd Day Air", "Next Day", "Overnight", "Cold chain"); your default speed is the floor. |
notes | no | Shown to the picker. |
GET /orders?status=fulfilled&since=2026-09-01&page=1&per_page=50
GET /orders/318
The single-order response adds an events array with every status change, timestamp and note.
POST /orders/318/cancel
{ "reason": "Customer changed their mind" }
Allowed while the order is received, processing or on_hold. Returns 409 once shipped.
We buy labels from USPS, UPS and FedEx (DHL Express for some international parcels) and pick the service that meets the speed on the order. Invoices paid by 2 PM Eastern ship the same business day; transit starts when the parcel is handed to the carrier. Shipping is billed at carrier cost: the order invoice carries the estimate below and is settled to the label's actual cost when it is bought.
shipping_speed | Transit | Services we buy (US) | Estimate US | Canada | Elsewhere |
|---|---|---|---|---|---|
standard Standard | 2 to 5 business days | the cheapest service that arrives in time: UPS Ground, USPS Ground Advantage or USPS Priority Mail | $12.00 | $30.00 | $45.00 |
two_day 2-Day | 2 business days | UPS 2nd Day Air or FedEx 2Day, whichever is cheaper | $20.00 | $60.00 | $90.00 |
overnight Overnight | next business day | the cheapest next-day service: UPS Next Day Air Saver, FedEx Standard Overnight, UPS Next Day Air or FedEx Priority Overnight | $55.00 | $60.00 | $90.00 |
cold_chain Cold-chain overnight | next business day, insulated bubble mailer with gel packs | the cheapest next-day service (UPS Next Day Air Saver or FedEx Standard Overnight) in the "Cold chain - insulated bubble mailer + gel packs" package | $75.00 | $60.00 | $90.00 |
Pens and nasal sprays ship cold-packed. Any order with a pen or nasal spray goes in an insulated bubble mailer with gel packs (the whole parcel) by 2-Day at the least: a standard order is raised to two_day when it arrives, overnight and cold_chain stay as sent, and a change to a slower speed is refused with 422 cold_pack_min. The cold pack (insulated mailer and gel packs) adds $5.00 per parcel, on every cold_chain order as well. Cold-packed parcels go to street addresses in the 50 states and DC only; an order sending pens or sprays anywhere else is refused with 422 cold_pack_destination. Vials, kits and capsules ship at any speed without a cold pack. Estimates are flat for the speed and destination however many items the parcel holds, and the label's actual cost settles the difference.
US territories, military mail and PO boxes. Puerto Rico, Guam, the US Virgin Islands, American Samoa, the Northern Mariana Islands, APO/FPO/DPO addresses and PO boxes ship by USPS (Priority Mail, or Priority Mail Express for a faster speed) at the US estimates; GET /countries marks the territories usps_only. UPS and FedEx do not deliver to these addresses. Alaska and Hawaii are US addresses with no surcharge beyond the label itself.
Outside the US. Standard ships UPS Worldwide Expedited and faster speeds UPS Worldwide Saver or DHL Express, door to door with tracking (we no longer use USPS First-Class International). Every parcel carries a commercial invoice with the description, HS code, country of origin and value of each item, sent to the carrier with the label; the customs value is the item price you send, or what you paid us when you send none. Shipments are DAP: the recipient pays duties, import taxes and any broker fee on delivery, and customs may ask them for an ID or tax number. The recipient's phone number is required (422 no_phone). We do not ship to Cuba, Iran, North Korea, Syria, Russia or Belarus, or to Crimea, Sevastopol, Donetsk or Luhansk.
Lost, damaged or held. A parcel lost in transit, or damaged on arrival with photos sent within 7 days of delivery, is reshipped free and we file the carrier claim. A parcel refused, seized by customs or left unclaimed abroad is not refunded. One that comes back to us intact is credited for the products, and both labels are billed at cost.
GET /shipping # speeds, carriers, estimates and your account's default_speed
POST /orders/318/speed # { "shipping_speed": "overnight" } while the order is received, processing or on hold
A speed can be set per order (shipping_speed on POST /orders, the manual order form, or your store's shipping method), changed on an order that has not shipped, or set as the default for the account under Brand and settings (an agency's default applies to its sub-accounts unless they set their own). Changing the speed on an unpaid order re-issues the invoice with the new estimate; on a paid order the difference is settled from the label. Order payloads carry shipping_speed and shipping_speed_label.
Every order creates an invoice on your PrymaLab account for the white-label cost, payable with any payment method on prymalab.net. Prepay accounts ship once the order invoice is paid; net-terms accounts are invoiced but never held. An invoice that stays open is chased by email automatically (the day after it is issued, then every two days) until it is paid, cancelled or waived. Every order object carries a payment block:
"partner_cost": 57.00,
"shipping_charge": 12.00, "shipping_estimate": 12.00, "carrier_cost": 0,
"payment": {
"status": "unpaid", // unpaid | paid | partial | none | terms | terms_due
"amount_due": 69.00,
"amount_paid": 0,
"pay_url": "https://prymalab.net/checkout/order-pay/4821/?pay_for_order=true&key=wc_order_…",
"shipping": { "estimate": 12.00, "billed": 12.00, "carrier_cost": 0, "settled": false },
"invoices": [ { "id": 4821, "type": "order", "amount": 69.00, "status": "unpaid",
"paid_at": null, "created_at": "2026-09-05 10:02:11" } ]
}
Shipping is billed at carrier cost, in the US and abroad. The order invoice carries shipping_estimate for the destination zone (US, Canada or everywhere else; the current amounts are in GET /countries); when the label is bought, carrier_cost is set, shipping.settled flips to true and the difference is settled: a shortfall is a shipping invoice (paid from the prepaid balance automatically when that is on), an overpayment is a shipping_credit ledger entry. pay_url is the WooCommerce pay-for-order page for the oldest unpaid invoice; it works signed in or not. partial means the order invoice is paid and only a carrier or extra charge is open; holds_shipment says whether that still holds the parcel (an open shipping invoice does on prepay accounts, an extra manual charge does not). Invoice type is order (product cost, holds the shipment on prepay accounts), shipping (carrier at cost, issued when the label is bought; holds the parcel on prepay accounts until paid) or manual (an extra charge agreed with your account contact). Each invoice also carries method once paid: the gateway name, Prepaid balance, or the offline method your account contact recorded. When payment clears you receive an order.paid webhook and the block flips to paid. Cancelling an unshipped order cancels its unpaid invoice.
An account can carry a balance. With auto_pay on (the default), every invoice is paid from the balance the moment it is issued, so the order goes straight to picking and the order.received webhook already shows "payment": { "status": "paid" }. If the balance cannot cover an invoice, the invoice stays open with its pay_url, the account gets a low-balance email, and the next top-up settles open invoices oldest first. Funds are added under Partner dashboard → Billing & balance with any payment method on prymalab.net; PrymaLab can also credit a wire by hand. Funds are non-refundable once they are credited to the account (terms).
GET /balance?limit=50
{ "partner_id": 12,
"balance": { "amount": 1240.50, "currency": "USD", "auto_pay": true, "low_at": 250, "is_low": false, "topup_url": "…" },
"due": { "count": 0, "total": 0 },
"ledger": [
{ "id": 88, "type": "charge", "amount": -57.00, "balance_after": 1240.50, "order_id": 318, "invoice_id": 4821,
"note": "Order #1042 (invoice #4821)", "created_at": "2026-09-12 14:02:11" },
{ "id": 87, "type": "topup", "amount": 1000.00, "balance_after": 1297.50, "order_id": null, "invoice_id": 4790,
"note": "Top-up paid via Pay by Bank (receipt #4790)", "created_at": "2026-09-11 09:15:40" } ] }
Ledger type is topup, charge (an invoice paid from the balance), reversal (an order cancelled before shipping, credited back), shipping_credit (shipping estimate above the label's real cost, credited back), refund (a top-up reversed, for example a payment that was returned) or adjustment (recorded by PrymaLab, wires included). Two webhook events accompany the balance: balance.credited whenever funds land, and balance.low when the balance drops under low_at or cannot cover a new invoice (repeated every few days while it stays low). Both carry the same balance block as /me, so a dashboard that manages several partner accounts can show each balance and remind its clients to top up.
{ "event": "balance.low", "partner_id": 12,
"balance": { "amount": 84.10, "currency": "USD", "auto_pay": true, "low_at": 250, "is_low": true, "topup_url": "…" },
"needed": 112.00, // the invoice that could not be paid, or null
"sent_at": "2026-09-12T18:40:05+00:00" }
GET /catalog
Returns your white-label price list for vials, nasal sprays, pens, and capsules and SARMs with all three volume tiers, plus the effective date. Use the sku values here in your orders: vials, nasal sprays (for example BC10-NS) and pens (RT15-PEN) each have a catalogue number. Capsules have none, so send the product name exactly as listed.
Wholesale kits. The kits section lists ten-vial kits under the PrymaLab label, one per vial row, catalogue number <vial sku>-KIT (SM5-KIT is ten Semaglutide 5 mg vials). A kit is billed at ten times the per-vial price for the tier the order reaches, and counts ten units toward that tier, so stock orders price exactly like dropship orders. Order a kit by its -KIT number; a line that only says "kit" in its name is also billed as ten vials, but is labeled with your artwork like any other line and marked for the lab to check.
For stores that mirror the prymalab.net catalogue. GET /catalog above is the price list; these endpoints are the products themselves (what is on the site, with images and text), the lot certificates, the public results, the safety data sheets and the lab-testing menu. All read-only, same API key. Pricing and variations on your own store are yours; nothing here tells you what to charge.
GET /products?status=published&since=2026-10-01T00:00:00Z&page=1&per_page=100&fields=full
GET /products/{id}
GET /countries # where we ship, with the shipping estimate zones
status is published (default), removed (taken off the site: drafts, private, trashed) or all. since returns products modified after that time, so a nightly sync is one call. fields=basic leaves out the text, images, certificate and sheet. Lab-testing products, kits and virtual products are not included.
{ "total": 239, "page": 1, "per_page": 100, "pages": 3, "generated": "2026-10-13T09:00:00+00:00",
"products": [ {
"id": 2838, "sku": "PL-BPC157-5MG-VIAL", "catalog_sku": "BC5", "name": "BPC-157 5MG", "slug": "bpc-157-5mg",
"permalink": "https://prymalab.net/product/bpc-157-5mg/", "type": "simple", "form": "vial", "status": "published",
"stock_status": "instock", "date_created": "2025-11-02T14:10:00+00:00", "date_modified": "2026-10-03T18:22:41+00:00",
"image": "https://prymalab.net/wp-content/uploads/…/bpc-157-5mg.png", "images": [ … ], "categories": [ { "id": 31, "name": "Peptides", "slug": "peptides" } ],
"short_description": "…", "description_html": "<p>…</p>", "variations": [],
"lot": { "number": "PL-26-00009", "lot": "PL-2609-009", "purity": "99.42", "tested_at": "2026-09-19", "conclusion": "Conforms",
"urls": { "certificate": "https://prymalab.net/testing/certificate/PL-26-00009/", "branded": "https://prymalab.net/testing/certificate/PL-26-00009/?b=4-…",
"branded_pdf": "…/testing/certificate/PL-26-00009/?b=4-…&download=pdf", "branded_png": "…&download=png",
"report": "…/testing/result/PL-26-00009/", "verify": "…/testing/verify/?t=PL-26-00009", "pdf": "…-certificate.pdf", "page_1": "…", "page_2": "…" } },
"sds": { "code": "PL-SDS-012", "compound": "BPC-157", "form": "vial", "signal_word": "", "urls": { "sheet": "…/testing/sds/bpc-157-vial/", "pdf": "…" } }
} ] }
GET /testing/lots # the current published lot certificate of every product (add &all=1 for older lots, &product_id=, &since=, &full=1 for the peak table and method)
GET /testing/lots/{number-or-lot} # one certificate in full: compound, dates, purity, identity, water, endotoxin, sterility, every test row, peaks, method
GET /testing/results?page=1&s= # the public results list shown under Testing › Results
GET /testing/verify?t=PL-26-00009&k=… # the same check as Testing › Verify: t is the certificate number, k the key printed on it (both required)
GET /testing/sds # every safety data sheet: code, compound, form, products, sheet and PDF links (&product_id= narrows)
GET /testing/sds/{code-or-slug} # one sheet with all 16 sections as JSON
GET /testing/catalog # the lab-testing menu: test, group, price, add-ons, product page
Your brand on the certificates. Every certificate carries a urls.branded link that renders it under the brand you set in Dashboard → Lots & COAs → Certificates under your brand (your name, logo, colours and product names, no PrymaLab logo); link to it, open it in a frame, or print it to PDF from there. urls.branded_pdf and urls.branded_png open the same branded page and start its PDF or PNG download straight away (the file is built in the visitor's browser, exactly as the page's own Download buttons build it); urls.pdf, page_1 and page_2 are PrymaLab's edition. In /testing/results and /testing/verify, every lot certificate also carries certificate_url, branded_url and the same urls block, so a successful check needs no second request; report_url / url still point to PrymaLab's public results page. The logo comes from the brand settings; if you have not uploaded one there, an image in your label artwork tagged Logo or with "logo" in its file name is used. The number, key, QR code, lot, dates, method, results and the line "tested by PrymaLab Analytical" are the same on both versions, because the test is the same. Safety data sheets name PrymaLab LLC as the supplier in section 1, as the regulation requires of the party that issues the sheet; distribute them as they are, or issue your own sheet under your name from the JSON.
Being told when something changes. Tick Also send catalogue and testing events under API & webhooks and your webhook URL also receives product.created (a product published on prymalab.net), product.updated (its text, images or stock changed; one event per product, sent two minutes after the last save), product.removed (taken off the site), pricelist.updated (a new price list; fetch /catalog) and certificate.published (a new lot certificate; the payload is the certificate block above). Same signature as the order events.
{ "event": "product.removed", "partner_id": 4,
"product": { "id": 2990, "sku": "PL-XYZ-10MG-VIAL", "catalog_sku": "XY10", "name": "XYZ 10MG", "slug": "xyz-10mg", "form": "vial", "status": "removed", … },
"sent_at": "2026-10-13T09:02:11+00:00" }
Set an HTTPS URL in the dashboard. We POST on every status change, plus order.paid when an invoice is paid, balance.credited / balance.low for the prepaid balance and, when you opt in, the catalogue events above, and retry with backoff for 24 hours. Every payload carries event, partner_id and sent_at. Verify the signature: HMAC-SHA256 of the raw request body using your signing secret, hex encoded, in X-PrymaLab-Signature.
POST https://your-store.example/hooks/prymalab
X-PrymaLab-Event: order.fulfilled
X-PrymaLab-Signature: 3f1a… (hex HMAC-SHA256 of body)
X-PrymaLab-Delivery: 9021
{ "event": "order.fulfilled",
"order": { "id": 318, "external_id": "1042", "order_number": "#1042", "status": "fulfilled",
"carrier": "USPS", "tracking_number": "9400 1000 0000 0000 0000 00",
"tracking_url": "https://tools.usps.com/go/TrackConfirmAction?tLabels=9400...",
"items": [ { "sku": "BC5", "name": "BPC-157 5mg", "quantity": 2, "lot": "PL-2609-114" } ],
"shipped_at": "2026-09-03 16:40:02" },
"sent_at": "2026-09-03T20:40:05+00:00" }
PHP verification:
$body = file_get_contents('php://input');
$ok = hash_equals(hash_hmac('sha256', $body, $secret), $_SERVER['HTTP_X_PRYMALAB_SIGNATURE'] ?? '');
Node verification:
const sig = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
const ok = crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(req.headers['x-prymalab-signature'] || ''));
No code needed. In your store go to WooCommerce → Settings → Advanced → Webhooks, add a webhook with topic Order updated, delivery URL https://prymalab.net/wp-json/prymalab/v1/webhooks/woocommerce/{your_partner_id}, and set the secret to the inbound secret from your dashboard. We create the order when yours reaches processing or completed (paid). Orders still waiting for payment, pending, on-hold (WooCommerce's status for bank transfer, check and payment review) or failed, stay in your store: nothing is created here and nothing is charged until you mark them Processing, and the Inbound log says so for each one. If an order we already have goes back to an unpaid status before we start packing it, we put ours on hold, void its invoice and credit any prepaid-balance payment back; marking it Processing again releases it with a fresh invoice. cancelled or refunded cancels ours if we have not shipped. Duplicate deliveries are safe. Use the topic Order updated, not Order created: Order created fires once, at checkout, before a bank transfer is paid.
How requests are verified. When you save the webhook, WooCommerce sends one unsigned activation ping (form body webhook_id=N, user agent WooCommerce/x Hookshot). We answer it 200 {"ok":true,"ping":true} so the webhook activates. Every real delivery must carry X-WC-Webhook-Signature: base64 of HMAC-SHA256 over the raw request body, keyed with your inbound secret, which WooCommerce computes on its own from the Secret field. A delivery without that header is answered 401 unsigned; one whose signature does not match is answered 401 bad_signature. Both are recorded with the reason under API & webhooks → Inbound log in your dashboard, together with every accepted delivery.
To receive tracking back into WooCommerce, point your outbound webhook at a small endpoint that adds a note or tracking meta to the order. A reference receiver plugin is available in the partner dashboard under API & webhooks: install it on your store, paste the signing secret, and it writes carrier, tracking and lot numbers onto the matching order and marks it completed when shipped.
No code needed. In your partner dashboard open API & webhooks → Connect a Shopify store. In the Shopify Dev Dashboard (dev.shopify.com, the organization that owns your store) create an app, release a version with the scopes read_orders, read_fulfillments, write_fulfillments, read_merchant_managed_fulfillment_orders and write_merchant_managed_fulfillment_orders, install it on your store, and paste the app's Client ID and Client secret plus the store's myshopify.com domain. We obtain Admin API access tokens from Shopify with the client credentials grant (POST /admin/oauth/access_token, grant_type=client_credentials); they last 24 hours and we renew them before they expire, so nothing on your side rotates. Save verifies the connection; Create webhooks registers orders/create, orders/updated and orders/cancelled on your store pointing at https://prymalab.net/wp-json/prymalab/v1/webhooks/shopify/{your_partner_id}, and Shopify signs those deliveries with your Client secret. A legacy custom app created in the Shopify admin before 1 January 2026 still works: choose Legacy custom app and paste its permanent shpat_ Admin API access token and API secret key.
We create the order once financial_status is paid (an unpaid order, for example a bank deposit or manual payment, is picked up later by orders/updated and costs nothing until then); if one we already have goes back to pending or voided before we pack it, ours goes on hold and any balance payment is credited back until Shopify marks it paid again. We cancel it if you cancel on Shopify before we ship, and ignore duplicates. When we mark the order Fulfilled we create a Shopify fulfillment for the open fulfillment orders with the carrier, tracking number and tracking URL and set notify_customer, so Shopify sends your customer its shipping confirmation. If Shopify rejects the call (token revoked, order already fulfilled) the failure is written to the order timeline and retried hourly for 12 hours.
| Status | Meaning | Webhook event |
|---|---|---|
received | Order arrived from your store or the API. Not yet picked. | order.received |
processing | Being labeled, packed and QC checked. | order.processing |
fulfilled | Shipped. Tracking number attached. | order.fulfilled |
complete | Delivered or closed. | order.complete |
on_hold | Waiting on something, for example your customer's payment. See the note. | order.on_hold |
cancelled | Cancelled before shipping. | order.cancelled |
| HTTP | Code | Why |
|---|---|---|
| 401 | unauthorized | Missing, revoked or wrong API key. |
| 400 | bad_json | Body is not valid JSON. |
| 422 | no_items / no_address / no_state / no_postcode / bad_country / no_shipping | Order is missing items, the address is incomplete, the country code is unknown, or it is a country we do not ship to. |
| 422 | bad_speed | shipping_speed is not one of standard, two_day, overnight, cold_chain. |
| 404 | not_found | Order does not exist or belongs to another partner. |
| 409 | shipped | Cancel or speed change requested after shipment. |
| 403 | forbidden | Dashboard call by a team member whose role does not allow it. |
Rate limit: 600 requests per minute per key. Questions: michael@prymalab.net.