Integrate Jamesinvoicing into any website. All requests must be over HTTPS. See the custom website integration guide for copy-paste PHP, Node.js, Python, and cURL examples.
Send your API key as a bearer token. Generate keys from API Keys in your dashboard.
Authorization: Bearer pch_live_xxxxxxxxxxxxxxxxxxxxxxxxxPOST /api/public/v1/auth — validate credentials. Returns { valid, merchant_id, environment, status }.GET /api/public/v1/ping — health check.// PHP
$ch = curl_init('https://jamesinvoicing.com/api/public/v1/auth');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer pch_live_xxxxxxxxxxxxxxxxxxxxxxxxx',
'Content-Type: application/json',
]);
$response = curl_exec($ch);Each request is signed with HMAC-SHA256 using your webhook_secret. Always verify the X-PCH-Signature header before processing.
// Verify the X-PCH-Signature header (HMAC-SHA256 of the raw body using your webhook secret)
const crypto = require('crypto');
const expected = crypto.createHmac('sha256', WEBHOOK_SECRET).update(rawBody).digest('hex');
if (expected !== req.headers['x-pch-signature']) return res.status(401).end();Plugin v2.0.2 calls these endpoints from WordPress. The browser must never call them with a secret key or supply a trusted payment status.
POST /api/public/v1/integration/orders — creates one invoice per platform order. Send an Idempotency-Key.GET /api/public/v1/integration/orders/:platform_order_id — reads the merchant-scoped order and invoice state.POST /api/public/v1/integration/sync — updates descriptive funnel context and returns server-derived payment state.POST /api/public/v1/integration/webhooks — registers the store's HTTPS callback and returns its signing secret once.Authorization: Bearer pch_live_xxxxxxxxxxxxxxxxxxxxxxxxx
Idempotency-Key: JI-WC-1-1042
X-JI-Platform: cartflows
X-JI-Site-Url: https://store.exampleSupported WordPress platform values are woocommerce, cartflows, woofunnels, launchflows and wpfunnels. The plugin always obtains the amount from the WooCommerce order total.
POST /orders accepts an optional return_url: the store's own thank-you page, which the buyer is sent back to after the payment is verified. It is only stored when its origin matches the calling store's X-JI-Site-Url, and it is never read from the browser, so a customer cannot change where the confirmed order lands.
POST /api/public/v1/integration/orders
{
"platform_order_id": "1017",
"platform_order_number": "1017",
"customer_email": "buyer@example.com",
"fiat_amount": 44.99,
"fiat_currency": "USD",
"return_url": "https://store.example/checkout/order-received/1017/?key=wc_order_x"
}401 — missing or invalid credentials403 — key is disabled or suspended429 — too many requests500 — server error, retry later