Record a product, voucher, or course sale from an external storefront into Phorest using the Purchase API
domain: developer.phorest.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
POST to /third-party-api-server/api/business/{businessId}/branch/{branchId}/purchase with a unique number, the paying clientId, one or more items, and a single payments entry.
For a retail product sale (e.g., from WooCommerce or Shopify), check stock and pricing first via the Product API, then submit the sale as a purchase item so Phorest decrements inventory and includes it in reporting.
For a gift card/voucher sale, include voucher data on the purchase item instead of a product/service — Phorest auto-generates a serial number if one isn't supplied and requires a future expiry date.
Set outstandingBalancePayment to true (with staffId and price) to post the purchase against a client's credit account rather than taking payment immediately.
Handle the 201 response for a successful purchase, or the 400 response if the supplied payment doesn't cover the item total at Phorest's currently configured tax rates.
Known gotchas
Tax and discounts round HALF UP to the cent, and whether you should submit gross or net item prices depends on whether your salon's Phorest pricing is tax-inclusive or tax-exclusive — getting this wrong causes totals to mismatch.
Overpayment/underpayment on a purchase is evaluated using the tax rates currently configured in Phorest for the items, not the tax figures you send in the request — a purchase can be rejected even if your own tax math looks correct.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?