AI Toolkit
This guide takes a person or an AI agent from nothing to a proven PayMe integration: the procedure, the rules, the checks, the code and the test cases. It works in any language.
Choose your path
| Partner | Direct seller | |
|---|---|---|
| Who | A marketplace or platform that onboards other businesses and charges buyers on their behalf | A business selling on its own account |
| Credentials | Partner key and partner secret, from partners@payme.io, plus each seller's MPL and public key | Your MPL, plus your public key for Hosted Fields |
| Callback security | Check the signature on sale callbacks, then confirm by query | Confirm every callback by query: you have no secret to check a signature with |
| Extra steps | Seller onboarding, fees, balances and payouts | None |
| Start at | Integrate as a Partner | Integrate as a Direct Seller |
Why callback security differs: payme_signature is computed with partner credentials, so only a partner can check it. For both roles, a valid signature isn't proof of payment, and no callback body is ever trusted. Both end by asking PayMe what happened.
Start here as a partner
| You need | Who supplies it | Detail |
|---|---|---|
| Sandbox partner key and partner secret | PayMe, from partners@payme.io | Get Your Dedicated Test Account |
| A terminal on the sandbox account | PayMe | What to Ask PayMe First |
| The Default Callback URL | PayMe sets it to a public address you give it | What to Ask PayMe First and the tunnel recipe |
| Each seller's MPL and public key | Your create-seller call returns them |
Seller Onboarding |
To check that the sandbox account can complete the Sandbox Walk-through:
- Run the Readiness Preflight. Its read-only call shows that the credentials work.
- Onboard a test seller and pay once on the hosted page with a test card. A completed payment shows a terminal is connected. Error 420 means none is.
- Ask PayMe for what you can't set yourself, such as the Default Callback URL, subscriptions, and a test seller ready for a successful payout. The full list says which ones your scope needs.
What's here
| Section | What it holds |
|---|---|
| Start | Get Your Dedicated Test Account, What to Ask PayMe First, Rules for Agents |
| Partner and Seller | The full procedure for each role. AI agents can install these as skills: see Build with AI |
| Steps | The rules, traps and order for each part of the build, linking to the API reference for fields |
| Verify | Test cases and reference code, preflight, sandbox walk-through, go-live checklist and the proof report |
| Errors | One page per common error, such as error 420, and Troubleshooting by Symptom |
For an AI agent, the MCP server's plan_integration tool returns the steps for a role and a set of features, and explain_error returns the page for an error code. Every page also has a Markdown version: add .md to its address.
Install the skills
Skills are procedures your coding agent keeps and follows. The skills catalog lists them; each one is a page of these docs and links to the live pages it relies on.
npx skills add https://docs.payme.io/
That command asks which skills to install and where. An agent working alone can name them, so nothing asks. Set --agent to your own tool, such as Claude Code or Codex:
npx skills add https://docs.payme.io/ --skill <skill-name> --agent claude-code --yes
npx skills add https://docs.payme.io/ --skill <skill-name> --agent codex --yes
- Integrate as a Partner (
payme-partner-integration): Implement a complete PayMe partner (marketplace or platform) integration inside the user's existing codebase, in any language: seller onboarding, checkout with the hosted page, Hosted Fields or saved cards, authorize and capture, refunds and voids, subscriptions, callbacks confirmed by query, balances and payouts. Use when the user asks to integrate PayMe as a platform or marketplace, onboard sellers to PayMe, or take a fee on sellers' sales. Not for a single business selling on its own account: use payme-seller-integration for that. - Integrate as a Direct Seller (
payme-seller-integration): Implement a complete PayMe integration for a business selling on its own account, inside the user's existing codebase, in any language: checkout with the hosted page, Hosted Fields or saved cards, authorize and capture, refunds and voids, subscriptions, and callbacks confirmed by querying PayMe. Use when the user asks to integrate PayMe, add PayMe payments to a store, site or app, or accept payments with PayMe. Not for platforms that onboard other sellers: use payme-partner-integration for that.
Connect the MCP server
MCP server URL: https://docs.payme.io/mcp
It uses Streamable HTTP (MCP protocol 2026-07-28, and 2025-11-25 or earlier) and is read-only. Public docs need no key or sign-in.
It needs an MCP client, not a web fetch (a GET answers 405). A chat app generally needs a person to add this URL in its settings; a coding agent with a command line can often register it itself. Without that, read each page's Markdown version, or the normal page if your tool can't open it.
Adding a server may not give the current session its tools: in one Codex test a desktop chat didn't get them, while a new Codex CLI process did. If they don't appear, start a new session or process, then confirm by calling a tool such as list_products.
What the MCP server can do
For an integration, start with plan_integration: it lists the pages to follow for your role (partner, seller) and features (hosted-page, hosted-fields, saved-cards, authorize-capture, refunds, subscriptions, payouts). When PayMe returns an error code, explain_error gives the page that answers it.
| Tool | What it does |
|---|---|
search_docs |
Full-text search across the guide and API endpoint pages you can read. |
get_page |
Returns one documentation page — guide or API endpoint — as Markdown, with its prerequisites and related pages as links. |
list_products |
Lists the pages to read first and every documented product. |
list_pages |
Lists every page of one product — guides and API endpoints — in reading order, by category: the category id and title, page type ("guide" or "endpoint"), slug, title, description, summary when the page has one, method + path for an endpoint, and the absolute page URL to pass to get_page. |
list_endpoints |
Lists the API endpoints of one product, by category: method + path, title, and the category/slug to pass to get_endpoint. |
get_endpoint |
Returns one API endpoint: its full Markdown reference (method and URL per environment, prerequisites, the credentials it documents, parameters, request fields and example, code samples, every response) followed by its OpenAPI operation as compact JSON. |
get_openapi |
Each category (section) of an api-reference product has its own OpenAPI 3.1 file. |
plan_integration |
Lists the pages to follow for an integration, in reading order, for your role ("partner" or "seller") and the features you need. |
explain_error |
Returns the page that answers one PayMe error code, as Markdown: what it means and what to do. |
Reference code and test cases
The integration kit lists every file of the reference code and test cases, with its address relative to that folder. All of it carries the MIT licence.
Procedures
Start
- Get Your Dedicated Test Account: Every integration starts with a dedicated test account. A seller opens one from the dashboard (Switch to test account, then Create test account) or signs up at paid.co.il. A partner writes to partners@payme.io for a sandbox partner key, partner secret and a connected terminal. PayMe publishes no shared test credentials.
- What to Ask PayMe First: Before building, ask PayMe (partners@payme.io) whether a terminal is connected to the sandbox account, to set the Default Callback URL per environment, whether Hosted Fields sellers need 3D Secure, whether subscriptions are enabled, what seller_plan values apply, how partial capture behaves, and whether white-label onboarding can be enabled.
- Rules for Agents: Numbered rules with stable IDs for PayMe integrations. SEC secrets stay on the server. MON money is integer minor units. TRN success is status_code 0 in a 2xx response, and money calls with unknown outcomes are not retried. CB callback bodies are never trusted and are confirmed by query. TOK tokens are encrypted bearer credentials. WRK look up fields, sandbox first, claim only what was run.
Partner
- Integrate as a Partner: The procedure for a partner (marketplace or platform) integration: load the rules, inspect the project and keep three record files, interview the person in short rounds, plan and get approval, build in a fixed order, prove it with test cases and the sandbox, and report. Also published as the agent skill payme-partner-integration.
Seller
- Integrate as a Direct Seller: The procedure for a direct-seller integration, using one credential, the MPL: load the rules, inspect the project, ask the person a few questions, plan and get approval, build in a fixed order, prove it with test cases and the sandbox, and report. Callbacks are confirmed by query. Also published as the agent skill payme-seller-integration.
Steps
- Config and Transport: Build configuration and one PayMe client first. Choose the environment from config, keep credentials out of code, treat status_code 0 in a 2xx response as the only success, read a failure by its body (HTTP 500 with status_code 1 and an error code is a refusal), do not retry money calls with an unknown outcome, omit local callback URLs (error 21), keep two public URL settings, and use dd/mm/yyyy on seller and subscription dates but yyyy-mm-dd hh:mm:ss on query date filters.
- Money: PayMe amounts are integers in minor units. generate-sale rounds a decimal sale_price rather than refusing it, so 600.75 becomes 601 and charges 6.01, and 50.75 becomes 51 and fails with error 352. The default range is 500 to 4000000 per account. Convert only for display, and reject bad amounts before calling PayMe.
- Seller Onboarding: Partners onboard sellers through PayMe's white-label form or create-seller. In the sandbox seller_phone 0501234567 failed with error 25 and +972501234567 passed. Dates are dd/mm/yyyy. Store seller_payme_id and the public key, ignore seller_payme_secret, read state from get-sellers, and never block checkout on approval, which gates payouts only.
- Checkout: Every PayMe flow starts with generate-sale. Default to the hosted page, add Hosted Fields when the checkout must look native, use a saved token only when no buyer is present. Keep one open sale per order: a failed hosted sale stays payable, so reuse it, send your order ID as transaction_id, store payme_sale_id, fulfil only after a query confirms payment, and use sale_expiry_seconds to limit how long a payment page stays open.
- Callbacks (Partner): For partners, a sale callback's valid signature means only worth checking, because it covers credentials and two IDs, not status or amount. Confirm with get-transactions using the seller's MPL and match your own order. Subscription, seller and withdrawal-complete callbacks are unsigned, so re-read them. Delivered means below 400, 4xx is retried, and a failing domain can be skipped, so reconcile, including finished orders, and a failed sale can still complete.
- Callbacks (Direct Seller): A direct seller cannot check payme_signature, because it needs partner credentials. Treat every callback as a trigger: find your order by the payme_sale_id you stored, call get-transactions with your MPL and your order ID, check the rows, then apply PayMe's answer. Reply below 400 for recorded decisions, rate-limit lookups, and re-check on a schedule because callbacks can be skipped.
- Capture, Refund, Void: An authorization lasts 7 days and captures once; a second capture fails with error 305 and a late one with 516. A refund with no amount after a partial refund returns exactly the rest, and the sale stays partial-refund, so track the total. refund-sale on an uncaptured authorization voids it. Refund rows in get-transactions have the action Refund or Partial Refund; a void adds none. Partial capture's remainder is unconfirmed, so do not offer it yet.
- Saved Cards: Saved cards use a token. capture_buyer, Hosted Fields and capture-buyer-token give a buyer_key; POST /sellers/{mpl}/tokens gives a uuid sent as token, and it worked across a partner's sellers in the sandbox. Without buyer_is_permanent, a second charge failed with error 604. Encrypt tokens, never send them to a browser. A direct seller sends buyer_is_private: true and fetches the token with get-buyer-key after confirming the sale.
- Subscriptions: PayMe runs the subscription schedule, so never build a charging scheduler. Subscription callbacks are unsigned: re-read with get-subscriptions using the seller's MPL in the JSON body. Grant service for each increase in sub_iterations_completed, not per notification. Status 7 is failed-retry, so don't dun the buyer. Monthly start days must be 1 to 28, and a token used here must be permanent.
- Balances and Payouts: For partners, balances are in seller_wallets on get-sellers. wallet_releasable comes from release dates. A withdrawal can be refused because the seller is not validated (109) or is on an automatic plan (907). withdrawal-complete is unsigned and fires on commit, before the bank transfer, so re-read with get-withdrawals. market_fee reaches the platform separately, by default monthly.
- Implementation Traps: A checklist of traps found by independent review of a real PayMe integration: two payable sales for one order, concurrent capture or refund, unknown refund outcomes, reconcile clearing flags on empty answers, retried payouts or subscriptions, counting a void as a refund, and lenient number parsing. Check your code against each row before review.
Checklists and errors
Verify
- Test Cases and Reference Code: PayMe publishes language-neutral JSON test cases and TypeScript and browser reference code at /integration-kit/, listed in index.json, under the MIT licence. Port every case for your role into your own test suite and make it pass, whatever your language. Add tests for your own connecting code. The files ship with each docs release.
- Readiness Preflight: Run these before any sandbox step. Confirm credentials are set without printing them and are not placeholders, the config loads, a read-only query is accepted, the running server has the current settings, the public address answers from the internet, and PayMe has connected a terminal and, for partners, set the Default Callback URL.
- Sandbox Walk-through: Run each chosen flow against the PayMe sandbox and confirm final states with a query. Order: setup and forged callback, sellers (partner), open sales, pay them with test cards, confirm, then capture, void, partial refund and remainder, saved card reuse, subscription actions, payouts. Tick only what was run. Partners also need one real signed sale callback verified.
- Go-Live Checklist: Before going live with PayMe, switch base URL, credentials and Hosted Fields testMode together, keep secrets in a secrets manager, use a real HTTPS callback address, confirm a forged callback is rejected, remove simulators, reconcile on a schedule, watch authorizations near 7 days, and log session IDs. Partners also confirm the production Default Callback URL.
- Proof-of-Integration Report: A template for proving a PayMe integration works. Fill in evidence per area, including test cases ported, independent review, credentials accepted, forged callback unchanged and real signed callback for partners. List each flow actually run with its final state confirmed by query, the flows not run, findings, open questions and how many times a person stepped in.
Errors
- Troubleshooting by Symptom: Symptom-first troubleshooting for PayMe integrations. Every card failing on the hosted page points to no terminal (420). A paid subscription stuck at initial means the handler expects signatures. A real sale callback rejected means a wrong partner secret. No callbacks means an unreachable address, a local URL or a skipped domain. Tunnel 1033 and 502 mean tunnel or server down.
- Error 420: No Terminal Available: PayMe error 420 (Please try a different card or contact customer support). PayMe found no terminal that can process this card for this seller.
- Error 25: Invalid Phone Number: PayMe error 25 (Please verify phone number). A phone number was refused.
- Error 21: Invalid URL: PayMe error 21 (Please verify URL validity). PayMe refused a URL in the request, and the whole call fails.
- Error 790: Parameter Not Allowed on This Plan: PayMe error 790 (A parameter is missing or cannot be set on this plan). The seller's plan requires a field you left out, or refuses a field you sent.
- Error 174: Not Supported for This Seller Type: PayMe error 174 (Feature is not supported for this seller type). The account behind this seller ID can't perform the call.
- Error 114: Business Type Not Valid: PayMe error 114 (The selected business type is not valid for this business). The seller's business type doesn't fit its other details.
- Error 121: Invalid Business Code: PayMe error 121 (The business code is invalid, Please enter only numbers). seller_inc_code isn't a positive number.
- Error 352: Invalid Price: PayMe error 352 (Invalid price, out of min-max bounds). An amount is outside the allowed range.
- Error 305: Action Not Allowed in This Status: PayMe error 305 (Cannot perform action due to an incorrect status). The sale isn't in a status that allows this call.
- Error 163: Seller Inactive: PayMe error 163 (Account settings problem - please contact Customer Support). The seller exists but isn't active.
- Error 130: Seller Over Sale Limit: PayMe error 130 (Seller is over sale limit, unable to create new sales). The sale would take the seller over its processing limit. Complete any pending verification, then ask partners@payme.io to review the limit.
- Error 998: Too Many Requests or Duplicate Action: PayMe error 998 (Operation is not permitted). HTTP 429.
- Error 513: Duplicate Purchase: PayMe error 513 (Duplicate purchase attempt detected. Please wait one minute before retrying). A saved-card charge repeated the same seller, amount and currency within 60 seconds. The check is off unless PayMe turns it on, so most integrations never see this code.
- Error 516: Authorization Expired: PayMe error 516 (Sale authorization has been expired). The capture came more than 7 days after the authorization, so it can no longer be captured.
- Error 42: Number Must Be an Integer: PayMe error 42 (Number must be an integer). A value that must be whole had decimals.
- Error 109: Seller Not Validated: PayMe error 109 (Seller not validated). The seller hasn't been validated, so a withdrawal is refused.
- Error 10: Field Must Be Numeric: PayMe error 10 (Field must be numeric). A field that must be a number isn't.
- Error 304: Market Fee Out of Range: PayMe error 304 (Market fee is not in the allowed range). market_fee or market_fee_fixed isn't a number, or is negative.
- Error 308: Market Fee Above Maximum: PayMe error 308 (Market fee exceed allowed maximum of 60%). The fee, including any market_fee_fixed as a percent of the price, is above 60%.
- Error 116: Invalid Birth Date: PayMe error 116 (Invalid birthdate). seller_birthdate is unreadable, or the person is under 16.
- Error 118: Invalid ID Issue Date: PayMe error 118 (Invalid social ID issue date). seller_social_id_issued is unreadable or in the future.
- Error 200: Partner Key Not Found: PayMe error 200 (Merchant was not found). The payme_client_key or PayMe-Partner-Key matches no partner.
- Error 201: Partner Inactive: PayMe error 201 (Merchant is blocked). The partner account isn't active.
- Error 251: Seller Not Found: PayMe error 251 (Seller was not found). The seller_payme_id or seller_id matches no seller.
- Error 252: Currency Not Allowed: PayMe error 252 (Currency is not allowed for this seller). This seller can't use that currency.
- Error 604: Token Inactive: PayMe error 604 (Buyer inactive). The saved-card token can't be charged any more.
- Error 605: Token From Another Seller: PayMe error 605 (The buyer was not captured using the provided seller). The token doesn't belong to the seller in the request.
Set up a coding tool
The steps here and for chat apps come from each tool's own documentation. Menu names change, so follow your tool's documentation if a step looks different.
Claude Code
claude mcp add --transport http payme-docs https://docs.payme.io/mcp
Codex
codex mcp add payme-docs --url https://docs.payme.io/mcp
Cursor
Add to .cursor/mcp.json in your project, or ~/.cursor/mcp.json for every project:
{
"mcpServers": {
"payme-docs": {
"url": "https://docs.payme.io/mcp"
}
}
}
VS Code
Add to .vscode/mcp.json in your project:
{
"servers": {
"payme-docs": {
"type": "http",
"url": "https://docs.payme.io/mcp"
}
}
}
GitHub Copilot CLI
copilot mcp add --transport http payme-docs https://docs.payme.io/mcp
Gemini CLI
gemini mcp add --transport http payme-docs https://docs.payme.io/mcp
Grok Build
grok mcp add --transport http payme-docs https://docs.payme.io/mcp
Windsurf and Devin Desktop
Open the MCP config file from the Cascade panel and add:
{
"mcpServers": {
"payme-docs": {
"serverUrl": "https://docs.payme.io/mcp"
}
}
}
Set up a chat app
Claude (claude.ai and desktop app)
Go to Customize → Connectors, select + Add, then Add custom connector. Enter a name and the MCP server URL, and choose No sign in under Authentication. On Team and Enterprise plans, an Owner adds it under Organization settings → Connectors, then members select Connect under Customize → Connectors.
ChatGPT
Go to Plugins, select the plus button, then Add custom MCP server. Enter a name and the MCP server URL, choose No authentication, accept the risk warning and select Create as a plugin. Install the plugin, then pick it with @ in a new chat. Availability depends on your plan and workspace.
Gemini
On gemini.google.com, open Settings → Connected Apps. Under Custom apps, select Add a custom app and enter the MCP server URL. Google currently limits this to personal Google accounts, people aged 18 or over in the US, and English, with Keep Activity on.
Grok
Go to grok.com/connectors, select New Connector, then Custom, and enter the MCP server URL. Custom connectors need a paid plan. On Grok Business and Enterprise, a team admin adds the connector first.
Perplexity
Open Plugins (or Customize → Connectors), then select Add custom → Add MCP connector → Remote. Enter a name and the MCP server URL. Under Advanced, choose None for authentication and Streamable HTTP for the transport. In an organization, an admin must allow members to add custom connectors.
Mistral
Open Connectors, select + Add Connector, then the Custom MCP Connector tab. Enter a name without spaces and the MCP server URL, and choose No authentication. Adding one requires an administrator.
Machine-readable files
- llms.txt: an index of every page, written for AI tools
- Sitemap: every page address
- Accepting Payments full text: every Accepting Payments page in one file
- Marketplaces & Platforms full text: every Marketplaces & Platforms page in one file
- Payments — Hosted Payment Page OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Hosted Fields - JSAPI OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Direct API OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Point of Sale (POS) OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Post Sale Actions OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Apple Pay OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Google Pay OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — IL Direct Debit OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Tokenization OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Subscriptions OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Invoices OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Generate a Sale with 3D Secure OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Standalone 3D Secure service OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Merchants Management OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Buyers Management OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments — Query APIs OpenAPI spec: the section's OpenAPI document (also as YAML)
- Payments tool definitions: one function-calling tool per endpoint
- Payments full text: every Payments page in one file
- B2B Payments — Contracts OpenAPI spec: the section's OpenAPI document (also as YAML)
- B2B Payments — Wallets OpenAPI spec: the section's OpenAPI document (also as YAML)
- B2B Payments tool definitions: one function-calling tool per endpoint
- B2B Payments full text: every B2B Payments page in one file
- Keep — Seller API OpenAPI spec: the section's OpenAPI document (also as YAML)
- Keep — Partners API OpenAPI spec: the section's OpenAPI document (also as YAML)
- Keep tool definitions: one function-calling tool per endpoint
- Keep full text: every Keep page in one file
- Products and Customers — Authentication OpenAPI spec: the section's OpenAPI document (also as YAML)
- Products and Customers — Products OpenAPI spec: the section's OpenAPI document (also as YAML)
- Products and Customers — Customers OpenAPI spec: the section's OpenAPI document (also as YAML)
- Products and Customers tool definitions: one function-calling tool per endpoint
- Products and Customers full text: every Products and Customers page in one file
- AI Toolkit full text: every AI Toolkit page in one file
- All documentation, full text: every page in one file
- MCP server: Model Context Protocol over Streamable HTTP (MCP protocol 2026-07-28, and 2025-11-25 or earlier) — search the docs, read pages, endpoints and OpenAPI specs. It needs an MCP client, not a web fetch (a GET answers 405). A chat app generally needs a person to add this URL in its settings; a coding agent with a command line can often register it itself. Without that, read each page's Markdown version, or the normal page if your tool can't open it. Setup for each tool: the AI Toolkit page
- Skills catalog: installable agent skills, each one a page of these docs (
npx skills add https://docs.payme.io/) - Integration kit: every file of the reference code and test cases, with its address relative to this folder
- Search API: GET with
q=<query>; returns matching pages as JSON - CLI:
npx -p @payme-io/docs-cli payme-docs— with an API key, read, edit, add and manage these docs from a terminal, CI or an AI agent:geta page as an editable document, change it,update --dry-runto check, thenupdate(refused if someone else changed it meanwhile); usage: the package README (@payme-io/docs-clion npm). Without a key, read them through the Markdown URLs, MCP or the search API - Markdown: append
.mdto any page URL for that page as Markdown, or request the page URL withAccept: text/markdown - Source: append
.yamlto an endpoint page URL (a line that readsMETHOD path — summary) for its source YAML; guide pages have no YAML
Example prompts
- Using the payme-docs MCP server, list the Payments endpoints and tell me which ones my integration needs.
- Using the payme-docs MCP server, read the "Create a sale (hosted payment page)" endpoint and write a TypeScript function that calls it in the sandbox, with error handling.
- Using the payme-docs MCP server, read "Hosted Payment Page options" and turn it into a step-by-step checklist for my project.
Tips
- Try every call in the sandbox before you go live.
- Keep API keys and secrets on your server — never in browser or mobile code, and never in a prompt. See Authentication.
- Prefer the MCP server or the
.mdversion of a page over scraping its HTML: you get the full reference without the page layout.