Run QistPay from your AI assistant
QistPay's MCP server lets Claude, ChatGPT and other Model Context Protocol clients read your branches, customers, orders, installments and reports, and record payments or create orders when you ask, using your existing QistPay login and role.
https://qistpay.org/mcp
No API keys
Sign in with your QistPay account through OAuth. Nothing to generate or paste.
Your role applies
The assistant sees and does only what your QistPay user is allowed to.
Deletes need a preview
Every delete shows what will be removed and needs a one-time confirmation token.
Fully audited
Changes made from chat show up in your QistPay activity history.
Quick start
You need a QistPay account. If you don't have one yet, register your business first.
Claude (claude.ai, Claude Desktop, Claude mobile)
- Open Settings → Connectors and choose Add custom connector. On Team and Enterprise plans, an owner may need to add it under organization settings first.
- Name it QistPay and paste the server URL
https://qistpay.org/mcp. Leave the OAuth client ID and secret empty; QistPay registers Claude automatically. - Click Connect. A QistPay window opens. Sign in, review the requested access and click Allow access.
- In a new chat, enable the QistPay connector from the tools menu and ask something like "List my QistPay branches."
ChatGPT
- Open Settings → Apps & Connectors. If you're adding a custom server, turn on developer mode under Advanced settings.
- Create a connector named QistPay with the URL
https://qistpay.org/mcpand authentication set to OAuth. - Sign in to QistPay when prompted and click Allow access.
- Select QistPay in a chat and start asking questions.
Other MCP clients
Any client that supports the Streamable HTTP transport with OAuth 2.1 (Authorization Code + PKCE and Dynamic Client Registration) can connect. Point it at https://qistpay.org/mcp; it discovers everything else from the metadata endpoints listed under Authentication.
Example prompts
| Ask | What happens |
|---|---|
| "Show me the dashboard for the Main Branch." | list_branches finds the branch, then get_branch_dashboard returns balance, collections and overdue figures. |
| "Search for customer Ali Raza and show his installments." | search_customers then get_order / search_installments. |
| "Which installments are overdue this month?" | search_installments with status=overdue and the current month. |
| "Record a Rs 5,000 payment on his next installment." | The assistant restates the payment, waits for your yes, then calls record_installment_payment. |
| "Create an order for a Samsung A15 with Rs 10,000 advance and 6 monthly installments." | Checks for an existing customer, asks for anything missing, restates every value, then calls create_order after you confirm. |
| "Preview what would be deleted if I delete this order." | preview_destructive_action shows the payments, ledger entries and stock that would be reversed. Nothing is deleted. |
| "Give me the invoice PDF for Sana Malik's iPhone order." | search_invoices then get_invoice, which returns a short-lived download link. |
| "Summarize this branch's last six months of recoveries." | get_branch_reports returns the same reports as the QistPay Reports page. |
Architecture
The assistant never gets direct access to your data. It calls named tools on QistPay's MCP endpoint, and each call is authenticated and checked against your access before anything runs.
- Transport: Streamable HTTP, JSON-RPC 2.0 at
POST https://qistpay.org/mcp. - Business isolation: a connection is tied to your user and your business, and can never reach another business's records.
- Same rules as the web app: an order created from chat updates stock, the installment schedule and the branch ledger exactly as it would in the browser.
Authentication
QistPay uses OAuth 2.1 with Authorization Code + PKCE (S256) and Dynamic Client Registration. AI clients register themselves, so there's no client ID or secret to manage.
- The client calls
/mcpwithout a token and gets401with aWWW-Authenticateheader pointing to the protected-resource metadata. - It reads the metadata, registers at
/oauth/register, and sends you to/oauth/authorize. - You sign in to QistPay. The consent screen shows which client is asking, the account you're signed in as, and the requested scopes. Click Allow access or Cancel.
- The client exchanges the code at
/oauth/tokenfor an access token and, if requested, a refresh token.
| Endpoint | URL |
|---|---|
| MCP server | https://qistpay.org/mcp |
| Protected resource metadata | https://qistpay.org/.well-known/oauth-protected-resource/mcp |
| Authorization server metadata | https://qistpay.org/.well-known/oauth-authorization-server |
| Dynamic client registration | https://qistpay.org/oauth/register |
| Authorization | https://qistpay.org/oauth/authorize |
| Token & refresh | https://qistpay.org/oauth/token |
| Revocation | https://qistpay.org/oauth/revoke |
| Credential | Lifetime |
|---|---|
Connection (with offline_access) | Stays signed in for up to 30 days of inactivity |
| Delete confirmation token | 5 minutes, single use |
| Invoice download link | A few minutes |
Scopes
Scopes limit what a connection can do. If a client doesn't ask for specific scopes, it gets the read-only defaults. Write and delete scopes are granted only when the client requests them, and they're listed on the consent screen.
| Scope | Allows | Default |
|---|---|---|
qistpay.profile.read | Who you are, your business, your permissions; delete previews | Yes |
qistpay.branches.read | List branches | Yes |
qistpay.operations.read | Customers, products, stock, orders, installments | Yes |
qistpay.finance.read | Dashboards, ledger, investors, reports, audit activity | Yes |
qistpay.invoices.read | Find and download order invoice PDFs | Yes |
offline_access | Refresh tokens, so you stay connected for up to 30 days | When requested |
qistpay.orders.write | Create and update orders and their status | No |
qistpay.orders.delete | Delete orders (with confirmation) | No |
qistpay.installments.write | Record payments, collect advances, add, edit, replace and roll installments | No |
qistpay.installments.delete | Delete installments and payments (with confirmation) | No |
qistpay.transactions.write | Manual ledger entries, investors and investor transactions | No |
qistpay.transactions.delete | Delete manual and investor transactions (with confirmation) | No |
qistpay.catalog.write | Create, update and delete customers and products; adjust stock | No |
qistpay.branches.write | Create, update and delete branches | No |
Permissions & branches
Every tool call has to pass two checks:
- OAuth scope: the connection was granted the tool's scope. Tools outside your scopes aren't even listed to the assistant.
- QistPay role: your user is currently allowed to do this in QistPay. This is checked on every call, so if an admin changes your role, it takes effect immediately.
Investor-role users only ever see their own investor record. Staff see only what their role allows in the web app.
Explicit branch selection
Branch-scoped tools always need a branch_id. The assistant calls list_branches first and passes the ID explicitly. It never relies on whichever branch you last opened in the browser, so it can't accidentally write to the wrong branch.
Write safety
1. Confirm before every change
Connected assistants are asked to treat every create, update or delete as a conversation:
- Ask for missing details one at a time instead of guessing.
- Search for an existing customer before creating a new one, and ask whether it's the same person.
- Restate the full request (branch, customer, product, prices, plan, dates) in plain language.
- In voice sessions, spell names letter by letter.
- Wait for your explicit "yes" before calling the tool.
2. Preview + one-time token for deletes
Delete tools don't run on request alone. The assistant first calls preview_destructive_action (orders, installments, payments, manual transactions) or preview_business_deletion (customers, products, branches, investor transactions). The preview shows exactly what will be removed or reversed and returns a confirmation_token that:
- expires after 5 minutes and works only once;
- works only for the exact action that was previewed;
- becomes invalid if the record changes after the preview.
3. Idempotency keys
Every write includes an idempotency_key. If the network drops and the assistant retries, QistPay returns the original result instead of recording the payment twice.
4. All-or-nothing changes
A payment updates the installment, the order balance and the branch ledger together, or not at all.
Your responsibility
Review every action before you approve it. AI assistants can misunderstand instructions, pick the wrong customer or order, or mistype an amount or date. Read the assistant's summary and any deletion preview carefully before saying yes.
Actions taken through a connection you authorized count as actions taken by you. QistPay is not responsible for data loss, incorrect records or financial discrepancies caused by actions performed through an MCP connection, including those caused by AI errors. See Section 7 of the Privacy Policy and Section 7 of the Terms of Service.
Good practice:
- Use a staff account with a limited role for day-to-day chat use, and keep admin connections for owners.
- Grant write scopes only if you need them. Read-only is the default.
- Check your activity history after bulk changes.
- Data the assistant reads is sent to your AI provider and handled under its privacy policy.
Activity history
QistPay keeps a record of activity made through MCP connections for security and support. Business changes appear on the Activity Logs page alongside changes made in the browser, and you can review them in chat with list_activity_logs.
Tool reference
Read never changes data. Write creates or changes records and needs an idempotency_key. Delete also needs a confirmation_token from a preview tool.
Account & branches
| Tool | Type | Description |
|---|---|---|
get_qistpay_context | Read | The connected user, business, permissions and branch-selection rule. |
list_branches | Read | Branches your business can operate on, with IDs to pass to other tools. |
get_branch_dashboard | Read | Live financial and collections dashboard for one branch. |
get_branch_reports | Read | Financial, installment, customer, product, cohort, investor and cost reports, the same as the Reports page. |
create_branch | Write | Add a branch. |
update_branch | Write | Rename a branch or change its phone, address or status. |
delete_branch | Delete | Delete a branch and everything in it. Needs preview_business_deletion. |
Customers
| Tool | Type | Description |
|---|---|---|
search_customers | Read | Search a branch's customers by name or phone, with portfolio totals. |
get_customer | Read | One customer with guarantors, tags and portfolio totals. |
create_customer | Write | Add a customer with optional CNIC, address, guarantors and tags. |
update_customer | Write | Edit customer details. |
delete_customer | Delete | Delete a customer. Needs preview_business_deletion. |
Products & inventory
| Tool | Type | Description |
|---|---|---|
search_products | Read | Search the catalog with per-variant stock for one branch. |
get_product | Read | A product, its variants, branch stock and recent movements. |
list_inventory_movements | Read | Stock changes in a branch, optionally for one variant. |
create_product | Write | Add a product with variants and opening stock. |
update_product | Write | Edit a product and its variants. |
adjust_inventory | Write | Stock in, stock out or set a variant's quantity in a branch. |
delete_product | Delete | Delete a product. Needs preview_business_deletion. |
Orders
| Tool | Type | Description |
|---|---|---|
search_orders | Read | Search and filter a branch's orders by text or status (active, completed, cancelled, overdue). |
get_order | Read | An order with customer, product, installment schedule and payments. |
create_order | Write | Create an order, its installment schedule, stock movement and ledger entries in one transaction. |
update_order | Write | Update an active order and rebuild its ledger, stock and unpaid schedule. |
update_order_status | Write | Change an order's status using QistPay's rules. |
collect_order_advance | Write | Record collection of an advance that was agreed but unpaid. |
delete_order | Delete | Reverse and delete an eligible order. Needs preview_destructive_action. |
Installments & payments
| Tool | Type | Description |
|---|---|---|
search_installments | Read | A branch's installments by status (pending, partially paid, paid, skipped, overdue) or month. |
get_installment | Read | One installment with its order and payment history. |
record_installment_payment | Write | Record a payment and update installment, order and ledger together. |
add_installment | Write | Append an installment to an order, optionally with a first payment. |
update_installment | Write | Change due date, amount, note or status. |
replace_installment | Write | Skip an unpaid installment and move what's left to the end of the schedule. |
roll_installment_balance | Write | Move an installment's remaining balance into another installment on the same order. |
delete_installment | Delete | Delete an installment and reverse its payments. Needs a preview. |
delete_installment_payment | Delete | Reverse a payment and its ledger credit. Needs a preview. |
Ledger & investors
| Tool | Type | Description |
|---|---|---|
list_transactions | Read | Branch ledger with date, type and category filters. |
get_transaction | Read | One ledger transaction. |
record_manual_transaction | Write | Add a manual credit or debit, such as rent or a cash injection. |
update_manual_transaction | Write | Edit a manual transaction and adjust the balance. |
delete_manual_transaction | Delete | Delete a manual transaction. Needs a preview. |
list_investors | Read | Investors with live capital and profit figures. |
get_investor | Read | An investor's stake and transaction history. |
create_investor | Write | Add an investor with a profit share and optional read-only login. |
update_investor | Write | Edit an investor. |
record_investor_transaction | Write | Record a deposit, withdrawal or profit payout. |
update_investor_transaction | Write | Edit an investor transaction. |
delete_investor_transaction | Delete | Delete an investor transaction. Needs preview_business_deletion. |
Invoices, audit & previews
| Tool | Type | Description |
|---|---|---|
search_invoices | Read | Find order invoices by invoice number, order ID, customer name or phone. |
get_invoice | Read | Render an invoice as a PDF and return a short-lived download link. |
list_activity_logs | Read | The business audit trail by branch, event or date range. |
preview_destructive_action | Read | Preview deleting an order, installment, payment or manual transaction and get a confirmation token. |
preview_business_deletion | Read | Preview deleting a customer, product, branch or investor transaction and get a confirmation token. |
Invoices
Every order has a PDF invoice, the same one as the Invoice button in QistPay. If several invoices match a customer, the assistant asks which one you want. Download links are private and expire after a few minutes.
Errors
When a request can't be completed, the assistant gets a short error code and a readable message so it can explain what went wrong.
| Code | Meaning |
|---|---|
scope_denied | The connection wasn't granted access for this action. Reconnect and allow it. |
permission_denied | Your QistPay role doesn't allow this action. |
invalid_arguments | A required detail is missing or invalid, or the record isn't in that branch. |
confirmation_invalid | The delete confirmation expired, was already used, or doesn't match. Preview again. |
deletion_blocked | This record can't be deleted under QistPay's rules. |
If you're signed out of the connection, your assistant will ask you to sign in to QistPay again.
Limits
- Fair use: connections are rate-limited to protect the service. Normal conversational use won't hit the limit.
- Page size: list and search tools return up to 50 results per page; ask the assistant for the next page.
- Currency: all amounts are in Pakistani rupees (PKR).
- Plan limits on your QistPay subscription apply to records created through MCP, just like in the browser.
Disconnecting
To stop an assistant from accessing QistPay, remove the QistPay connector in the assistant's settings (in Claude: Settings → Connectors → QistPay → Disconnect). To revoke all connections immediately, contact support@qistpay.org. Removing a staff user from your business also ends their connections.
FAQ
Does the AI provider get all my data?
No. The assistant only receives the results of the specific tools it calls during your conversation, limited by your scopes and role.
Can a staff member do more through chat than in the app?
No. Every call checks the same role permissions as the web app.
Can the assistant delete something by mistake?
Deletes need a preview and a one-time token, and the assistant is instructed to get your explicit confirmation first. You still need to read what you're approving. See Your responsibility.
Is there a cost?
The MCP connection is included with every QistPay plan. Your AI assistant's own subscription is separate.
Where do I get help?
Email support@qistpay.org or visit qistpay.org/support.