Overview
Shoppex custom manual gateways (Settings → Payments → Manual) support payment instructions or buyer redirects with template variables such as{{amount}}, {{currency}}, and {{invoice_id}}.
There is no built-in inbound IPN URL on manual gateways today. When your own payment provider confirms a transfer, your server should call the Developer API to complete the invoice.
This pattern works for storefront and payment-link invoices, not only for
POST /dev/v1/payments. Use POST /dev/v1/invoices/{uniqid}/complete.End-to-end flow
- Buyer starts manual checkout → invoice moves to
PENDING_PAYMENT/ awaiting merchant confirmation. - Shoppex can notify you with
order:manual_payment_pending(configure under Settings → Webhooks). - Your external gateway sends its own webhook when money arrives.
- Your adapter calls
POST /dev/v1/invoices/{uniqid}/completewith your Shoppex API key. - Shoppex runs the normal completion pipeline (delivery, emails,
order:paid).
Prerequisites
| Requirement | Details |
|---|---|
| API key | Dashboard → Settings → Developer API. Scope: invoices.write (or *). |
| Invoice status | PENDING or PENDING_PAYMENT |
| Invoice ID | UUID from checkout URL (/invoice/{uniqid}) or order:manual_payment_pending payload (data.uniqid) |
Complete an invoice (minimal)
200 with updated invoice data or { "message": "Invoice completed successfully." }.
Common errors:
| HTTP | Meaning |
|---|---|
401 | Invalid or missing API key |
404 | Invoice not found for your shop |
422 | Invoice already COMPLETED, or status is not completable |
Idempotency-Key header so retries after network drops do not double-apply side effects.
Listen for order:manual_payment_pending
Register a shop webhook (Settings → Webhooks) for order:manual_payment_pending. When a buyer submits manual payment instructions, Shoppex POSTs a signed payload to your URL.
Extract the invoice UUID from data.uniqid and store it with your gateway’s pending-payment record if needed.
Verify signatures with X-Shoppex-Signature-V2 — see Webhooks.
Cloudflare Worker adapter (copy-paste)
This worker receives a generic JSON webhook from your payment provider, optionally checks a shared secret, then completes the Shoppex invoice. Worker secrets (Wrangler):SHOPPEX_API_KEY— yourshx_*key withinvoices.writePROVIDER_WEBHOOK_SECRET— shared secret your gateway sends (header or HMAC); omit checks only in local dev
worker.ts
{{invoice_id}} in your manual gateway redirect URL or instructions so the provider echoes it back.
Redirect manual gateway example
Redirect URL in dashboard:reference comes back on the provider webhook, map it to invoice_id in the worker above.
Security checklist
- Verify provider signatures or shared secrets before calling Shoppex.
- Optionally re-fetch the invoice with
GET /dev/v1/invoices/{uniqid}and comparetotal/currencyto the provider amount before completing. - Keep
shx_*keys server-side only. - Use
Idempotency-Keyon every completion call. - Return
200to your provider only after Shoppex accepts the completion (or the invoice is already completed).
Manual confirmation in the dashboard
If you do not automate completion, open the invoice in the dashboard when status is Awaiting Manual Confirmation, then Confirm Payment → Process Invoice. The Dev APIcomplete call runs the same backend pipeline.
Related docs
Payments guide
Hosted checkout and Developer API overview
Webhooks
Verify
order:manual_payment_pending and order:paidDeveloper API
Full API reference including
POST /dev/v1/invoices/{uniqid}/completePayment gateways
Connect Stripe, PayPal, Cash App, and manual methods