PryvPay Docs
Get API keys

API reference (v1)

Base URL: your deployment's PUBLIC_BASE_URL. JSON in and out.

  • Auth: Authorization: Bearer sk_test_… (secret key, server-side only). Basic auth with the key as username also works.
  • Modes: test keys use the testnet; live keys use mainnet. Objects carry livemode.
  • Idempotency: send Idempotency-Key on POSTs. The same key and body replays the stored response (header idempotent-replayed: true). The same key with a different body returns 409.
  • Pagination: limit (1–100) and starting_after=<id>. Responses look like { object: "list", data, has_more }.
  • Errors: { "error": { "type", "code", "message", "param?" } }. Statuses: 400 / 401 / 402 (account past due, or plan_limit_reached: monthly order cap used) / 403 / 404 / 409 / 429 / 5xx.
  • Rate limits: per key and per IP (default 300/min).

Money rules: amount is in fiat minor units (cents: 2500 = 25.00). amount_token is in token base units (6 decimals for USDC/USDT). Merchants always receive 100%; our fees are invoiced separately.

Payments

MethodPathNotes
POST/v1/paymentsamount, currency (USD|KES), optional order_id, description, success_url, cancel_url, token (USDC|USDT), metadata (string map). Returns id, checkout_url, expires_at (rate locked for 15 min).
GET/v1/payments/:id
GET/v1/paymentsFilters: status, order_id.
POST/v1/payments/:id/cancelOnly created / pending_approval.

Statuses: created → pending_approval (buyer asked to approve on their phone) → submitted → paid \| expired \| cancelled \| failed; later refunded / partially_refunded. Only the blockchain watcher sets paid.

Flags:

FlagMeaning
underpaidLess than amount_token arrived; not paid yet.
overpaidPaid, plus extra (refund the difference).
duplicatePaid again after already being paid.
duplicate_orderAnother payment for the same order_id was also paid.
latePaid after expiry or cancellation; the money is in your wallet.

kind is one of checkout, link, subscription or invoice.

Checkout sessions (Stripe-style)

MethodPathNotes
POST/v1/checkout/sessionsSame body as POST /v1/payments (JSON or form-encoded). Returns { id, object: "checkout.session", url, payment_status, amount_total, currency, expires_at, explorer_url }.
GET/v1/checkout/sessions/:idpayment_status: unpaid → paid (or expired / cancelled).

Browser side: <script src="https://pryvpay.co/checkout.js" data-key="pk_…"> then Checkout.open({ sessionId, onSuccess, onCancel }). This opens a modal on desktop (framing is allowed only from your registered site domain) and the full-page checkout on mobile. pay.js / Pay.checkout keep working too.

Each payment includes explorer_url (block-explorer link for tx_hash) when the network has an explorer configured.

Refunds

Refunds are sent from your own wallet, so each refund needs your approval in the dashboard. You approve with your passkey wallet, or send from your external wallet.

MethodPathNotes
POST/v1/refundspayment, optional amount_token (base units; default = everything still refundable), reason. Returns status: pending_approval and approval_url.
GET/v1/refunds/:idpending_approval → submitted → sent (confirmed on-chain) | cancelled.
GET/v1/refundsFilter: payment.

Buyers can ask for a refund from their wallet receipt. You get a refund.requested webhook and the request appears in Dashboard → Refunds, with a one-click Refund buyer button (the buyer's paying wallet and exact amount are filled in).

MethodPathNotes
POST/v1/payment_linksamount, currency, description. Returns a shareable url (/l/…). Each visit creates a fresh payment.
GET/v1/payment_links
POST/v1/payment_links/:id/deactivate

Subscriptions

MethodPathNotes
POST/v1/subscriptionsamount, currency, interval (day|week|month|year), optional description, customer_reference, token, success_url, cancel_url, metadata. Returns approval_url: send the buyer there.
GET/v1/subscriptions/:id, /v1/subscriptionsStatuses: pending → active | past_due → cancelled.
POST/v1/subscriptions/:id/cancelStops future charges immediately. Buyers cancel on-chain from their wallet.

How it works: the buyer's wallet approves a capped amount per period once (cap, which includes a 10% exchange-rate buffer). Our scheduler charges each period at the live rate, paid buyer → merchant directly. Failed charges retry after 1, 2 and 4 days, then stay past_due. Before the first charge, enable automatic charges once in Dashboard → Subscriptions.

Account

MethodPathNotes
GET/v1/merchantYour settings.
GET/v1/webhook_deliveriesRecent deliveries.
POST/v1/webhook_deliveries/:id/resend
GET/v1/invoicesSaaS plan and order-credit invoices (our fees; never a percentage of payments).

Checkout & wallet (public; used by the hosted pages and the buyer's wallet)

MethodPathNotes
GET/checkout/:idHosted checkout (strict CSP, no third-party scripts).
GET/v1/checkout/:idPublic payment data + wallet calls. No metadata or buyer PII.
GET/v1/checkout/:id/statusJSON, or SSE with Accept: text/event-stream.
POST/v1/checkout/:id/login{method:"passkey"} returns WebAuthn options; {handle} sends an approval request to the buyer's phone.
POST/v1/checkout/:id/approve-request{handle}: email, phone or @username → request appears in the buyer's wallet (plus a push notification). Returns approval_id.
POST/v1/checkout/:id/approval-code{approval_id, code}: the 6-digit code the wallet shows after the buyer approves. The signed payment is only sent once this matches (5 tries, valid 5 minutes).
POST/v1/checkout/:id/token, /requote, /precheck, /submittedToken switch, fresh quote, sanctions/balance precheck, tx report (informational).
POST/v1/wallet/otp, /v1/wallet/register/options, /v1/wallet/registerVerified phone/email + passkey → smart wallet.
POST/v1/wallet/login/options, /v1/wallet/loginPasskey login.
GET/v1/wallet/me, /balance, /history, /approvals, /subscriptions, /devices, /guardiansBuyer session.
GET/v1/resolve/:handlePhone/username → address (for Send).
POST/v1/wallet/userops/prepare, /v1/wallet/userops/:hash/submitServer prepares + sponsors gas; the passkey signs on the device; server submits.
POST/v1/wallet/devices/link/options, /v1/wallet/devices/linkAdd a device (approved from an existing device).
POST/v1/wallet/recovery/options, /v1/wallet/recovery, /v1/wallet/recovery/:id/executeGuardian / backup-key recovery.
POST/v1/wallet/topupOpens the licensed partner's top-up.
GET/v1/wallet/purchasesStore receipts (store, order, amount, tx + explorer link).
POST/v1/wallet/purchases/:id/refund-request{ message? }: notifies the merchant with the buyer's paying wallet.
GET/v1/wallet/signersOn-chain owners (passkeys + recovery-phrase key).
GET/v1/wallet/cash-links, /v1/wallet/cash-links/by-tx/:txCash links sent by this wallet.
GET/v1/cash-links/:idPublic: amount, token, status of a cash link.
POST/v1/cash-links/:id/claim{ to, signature }: relays a claim signed with the link's key (the signature fixes the recipient).

Admin (Authorization: Bearer $ADMIN_TOKEN; the admin UI is at /admin)

POST|GET /admin/merchants, PATCH /admin/merchants/:id, POST /admin/merchants/:id/rotate-keys, GET /admin/payments?status=&flag=, GET /admin/transfers?match_status=unmatched, GET|POST /admin/blocklist, DELETE /admin/blocklist/:id, POST /admin/webhook_deliveries/:id/resend, GET /admin/audit, GET /admin/health.

Questions? Email [email protected].