Every screen in Pledexa runs on this same JSON API — anything the console does, your integration can do.
Sandbox — start here, no sign-up
Base URL: https://demo.pledexa-staging.workers.dev (the demo tenant — synthetic data, resets freely, every module on).
1. GET /api/auth/staff → pick a user · 2. POST /api/auth/login with the demo PIN 1100 → token · 3. Send x-staff-token on every mutating call. (A browser gets the same session as an HttpOnly pledexa_session cookie; to use that instead, add x-pledexa-csrf: 1 — without it the cookie is ignored, which is what stops another site spending your session.)
Server-to-server: mint a key in Settings → Partner API keys and send it as x-api-key instead — no login dance, same access, revocable any time.
Idempotency: pass an Idempotency-Key header on mutations — replays return the original response, applied exactly once. It is required for every card-payment mutation; reuse the same key when retrying that transaction.
Register your app — your own sandbox, in one call
The shared demo above is fine for a first look, but everyone shares it. Register and you get a private sandbox shop plus a pk_test_… key scoped to it. No approval, no sales call, nothing to install.
Or from a terminal:
curl -X POST https://ddpawn.pledexa.com/api/developers/apps -H 'content-type: application/json' -d '{"appName":"My App","developerName":"Me","email":"you@example.com"}'
Get listed in the app directory
Every shop's Settings has an Apps screen. A listed app states up front exactly which permissions it needs; the owner installs it in one click and Pledexa mints a key scoped to that grant alone — no role, no copy-a-key-by-hand, revocable from the same screen.
POST /api/apps from your sandbox host with your x-api-key:
{"name":"My App","summary":"What it does for the shop, in one line.","homepage":"https://…","scopes":["inventory:read"]}
Ask for the least you need: a listing may not request full access, and a shop can grant less than you asked for but never more. GET /api/apps is the public directory; your submission appears there once Pledexa has reviewed it.
Auth
GET | /api/auth/staff | List staff for the PIN pad (sandbox: public; real shops: needs an enrolled device’s x-device-token or a staff session) |
POST | /api/auth/login | { userId, pin, mfaCode? } → { token }, plus an HttpOnly pledexa_session cookie. Scripts send the token back as x-staff-token; a browser sends the cookie and must add x-pledexa-csrf: 1 |
GET | /api/auth/session | Who is signed in on this browser → { signedIn, user, device } (the console replacement for reading a token out of storage) |
Loans
POST | /api/loans | { principal, customer|customerId, items[], startDate? } → issue a pawn |
GET | /api/loans/:id | Current state: payoff, dates, items, events |
POST | /api/loans/:id/renew|redeem|partial | { asOf?, amount?, tender? } — money actions |
GET | /api/loans/:id/preview?action=renew|partial&amount= | Read-only quote of a renewal or partial: new due date, forfeit date, next period’s charges — nothing is written |
GET | /api/loans/:id/ticket | Printable pawn ticket (HTML) |
Counter
POST | /api/buys | { total, customer|customerId, items[] } → outright purchase |
POST | /api/sales | { itemId, price, tender, customerId? } → floor sale (firearms need form4473Ref) |
POST | /api/trades | { itemId, price, credit, tradeIn, customer|customerId } |
GET | /api/inventory?q=&status= | Search stock |
POST | /api/estimate | Gold melt + offer math |
Customers
GET | /api/customers?q= | Search |
POST | /api/customers | Create-or-find (dedupe by ID / name+DOB) |
POST | /api/customers/:id/flags | { flag: do_not_loan|watch|vip, on } |
PATCH | /api/customers/:id | { name?, dob?, phone?, email?, address?, reason? } → correct details (ID fields locked) |
Reports & data
GET | /api/reports/summary | Loan book + inventory + activity roll-ups |
GET | /api/reports/gl?format=csv | QuickBooks double-entry journal |
GET | /api/reports/comparison?date=&format=csv | One day by deal type, to lay beside the legacy end-of-day (manager) |
GET | /api/export/zip | EVERY record as CSV+JSON — no lock-in |
Conventions — JSON in/out · money is decimal dollars · dates are ISO · errors are { error, message? } with real status codes (401 sign-in, 403 blocked/compliance, 409 conflict, 422 missing fields) · compliance gates (OFAC, do-not-loan, 4473/NICS, MLA) fire on the API exactly as at the counter — your integration cannot skip them.
Production access to a real shop is granted by that shop's admin — by installing your listed app in Settings → Apps, or by minting you a key in Settings → Partner API keys. VERIFY: a sandbox is synthetic — never send real customer data to one.