MARQIUS-WKHTMLTOPDF · DEVELOPER GUIDE
One Client. One trial. One clear way to pay.
Register each legal entity your SaaS makes documents for. Every Client gets a 30-day trial, then chooses its own $10/month or $500 lifetime Seat. Registration never charges a card.
Open your licence account →Read the Licence Agreement01 · START
Register a Client
A Client is the legal entity in whose name a document is issued. Use one stable, non-personal ID from your own system. The same ID, name and country return the same Client; restoring one never restarts its trial.
- Sign in and create an API key under API keys & developer guide. It is shown once. Keep it on your server.
- Send the legal name, two-letter country code and stable ID.
- Save the returned
idfor checkout and removal.
curl -X POST https://marqius.com/api/licence/entities \
-H "Authorization: Bearer $MARQIUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"externalId":"tenant-4711","legalName":"Acme Trading Ltd","country":"US"}'The response includes trialStartedAt, trialEndsAt and entitlement. Timestamps are Unix seconds. A new Client returns HTTP 201; a repeat returns 200. A different entity cannot take over that ID.
02 · PAY WHEN READY
Choose a plan for that Client
Save your billing name and address in your account first. Read the Licence Agreement, then create Checkout. Use offerVersion and profileRevision returned by GET /entities. Stripe shows the final amount and applicable tax before payment.
curl -X POST https://marqius.com/api/licence/entities/CLIENT_ID/checkout \
-H "Authorization: Bearer $MARQIUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"plan":"monthly","accepted":true,"offerVersion":"CURRENT_OFFER_VERSION","profileRevision":2}'Choose monthly for $10 per Client per month or lifetime for $500 per Client once, upgrades included. The response contains a Stripe url. Send the account owner there to pay. A Seat activates only after Stripe confirms payment through its verified webhook. Then call POST /entities/CLIENT_ID/refresh and read entitlement. A browser return URL is not payment proof.
Purchases are per legal entity. Each additional Client chooses its own plan and 30-day trial. Registration and usage reports do not automatically charge a card.
03 · MANAGE
Keep the Client list accurate
GET /entities returns up to 100 Clients. Pass nextCursor as ?after=... for the next page. DELETE /entities/CLIENT_ID archives a Client and requests cancellation of future monthly renewals at the end of the paid period. Lifetime purchases stay with that entity. Re-registering its original ID restores the record with its original trial and payment history.
API keys are account-wide. Revoke an exposed key in the account page. A revoked key stops working immediately. The limit is 100 requests per key per minute.
REPORTING CONTRACT
Daily usage reports
The server accepts opaque daily usage snapshots at POST /usage and shows the last 30 days at GET /usage. The current CLI release does not send them yet. We will connect --marqius-client, MARQIUS_CLIENT and the web service’s client field in the CLI release after this API and UI.
A report uses a server-side API key. It supplies a UTC day, stable installation ID, program version, licence label, PDF count and unique 64-character client codes. It never includes document contents, file names or clear Client IDs. Resending an installation/day only updates a snapshot when counts do not go backward. Reports support reconciliation and account visibility; they do not create a paid Seat. Use one API key across a fleet to deduplicate its opaque client codes.
{
"day":"2026-12-01",
"installation":"11111111-1111-4111-a111-111111111111",
"version":"0.12.2",
"licence":"trial",
"pdfs":1834,
"clients":2,
"client_codes":["<64-character lowercase hex code>","<another 64-character code>"]
}Only hash codes are stored with the report. These are pseudonymous, not guaranteed anonymous when source IDs are predictable. We keep raw daily reports for up to 13 months, then delete them; billing records may be kept longer where required.
REFERENCE
Endpoints
| Method | Path after /api/licence | Purpose |
|---|---|---|
| GET | /entities | List entities, offer version, billing profile revision and onboarding choice. |
| POST | /entities | Register or restore a Client and its one-time trial. |
| POST | /entities/:id/checkout | Get Stripe Checkout URL for monthly or lifetime. |
| POST | /entities/:id/refresh | Recheck verified payment and entitlement. |
| DELETE | /entities/:id | Archive and cancel future monthly renewal. |
| POST | /preferences | Save the customer-entity onboarding choice. |
| GET / POST | /api-keys | List or create keys from a signed-in browser session. |
| POST | /api-keys/:id/revoke | Revoke a key from a signed-in browser session. |
| GET / POST | /usage | Read summaries or submit a report with an API key. |
All requests use HTTPS at https://marqius.com/api/licence. Machine requests use Authorization: Bearer mqk_…. Browser account actions use the signed-in session. JSON errors include a readable error: 400 invalid input, 401 missing authentication, 403 disallowed access, 404 unknown Client, 409 conflict, 429 key limit and 503 temporary service trouble. Retry 429 and 503; resolve 409 before retrying Checkout.
Keep API keys on your server. Never put them in browser JavaScript, a public repository or a URL.
FAQ
Questions people ask
Does registering a Client charge me?
No. Each new Client starts a 30-day no-card trial. You choose a plan and complete Stripe Checkout when ready.
Who counts as a Client?
The legal entity in whose name the document is issued. A recipient of that entity’s invoice is not another Client.
When is a paid Seat active?
Only after Stripe confirms payment and the verified entitlement is refreshed. A Checkout URL or browser return is not payment confirmation.
Can I remove a Client?
Yes. Archiving cancels future monthly renewal at the end of the paid period. Restoring the same entity preserves its original trial and purchase history.
Ready to add your first Client?
Start with one legal entity and a 30-day trial. No card is required to register.
Open your account →