# Pay with ment > Payments API for developers and AI agents: SBP payment links in RUB and crypto invoices in USDT, BTC, ETH, TON/GRAM, SOL and more (xRocket, CryptoBot) with signed webhooks. Base URL: https://api.ment-pay.top/v1 Docs: https://app.ment-pay.top/docs Agent guide: https://app.ment-pay.top/agents Cabinet: https://app.ment-pay.top/developers Checkout: https://pay.ment-pay.top/c/ ## Auth Header: Authorization: Bearer mp_live_... (live) or mp_test_... (test) Rate limit: 120 requests per minute per key. On 429 wait Retry-After seconds. ## Endpoints POST /payments Create a payment. Headers: Authorization, Content-Type: application/json, Idempotency-Key (optional). Body: amount number RUB 9.35..100000 (depends on fee_policy); crypto: amount in the selected asset (USDT/USDC from 0.1, BTC from 0.0001) (required) description string up to 255 chars (required) currency string RUB | USDT | USDC | BTC | ETH | GRAM | TON | SOL | BNB | TRX | LTC | XAUT | DOGE (default RUB) payment_method string sbp | crypto | crypto_address (default sbp) provider string auto | cryptobot | xrocket (laveshka only for crypto_address) merchant_name string up to 60 chars metadata object up to 4 KB, returned in webhook callback_url string http(s) URL for this payment expires_in number SBP 300..1800 sec, crypto 600..7200 sec network string TRX | TON | ETH | BSC (only for crypto_address, USDT) fee_policy string client_all | client_service | client_gateway | merchant | choice (choice = RUB only) client_gateway: payer covers 4.5% cashier, merchant covers service client_service: payer covers service, merchant covers cashier client_all: payer covers service + cashier, merchant gets full amount merchant: merchant covers everything, payer pays the nominal fee_bearer string legacy alias: client = client_gateway, merchant = merchant pay_asset string USDC — only with currency=USDT and provider=cryptobot; invoice in USDC, credit in USDT 1:1 Returns: payment, checkout_url, pay_amount, fee_bearer, fee_policy, fee_choices, pay_asset, gateway_amount, cashier_fee, sbp_url, pay_url, deposit_address, network, provider, asset For fee_policy=choice the provider invoice is not created yet; show checkout_url, the payer picks client_all or merchant, then POST /api/v1/checkout {paymentId, action:"select_fee", choice}. Same Idempotency-Key returns the same payment with header Idempotent-Replayed: true (200). GET /payments/{id} Payment status: pending | paid | expired | canceled. Response includes fee, net_amount, pay_amount, fee_bearer, metadata, paid_at, deposit_address. GET /payments?limit=25&offset=0&status=paid limit 1..100, offset >= 0, status optional. GET /balance Returns this key's own available/project_balance/key_balance maps (RUB, USDT and any credited crypto asset e.g. BTC/ETH/GRAM), main wallet ment_balance, and current volume-based commission tier. Each API key has a separate balance; autoWithdraw only moves the credited amount from the key balance to the main wallet. POST /withdraw Live key only. Transfers funds from project balance to owner's main MENT PAY wallet (0% fee). Headers: Authorization, Content-Type: application/json, Idempotency-Key (optional). Body: { asset: "RUB" | "USDT" | "BTC" | "ETH" | "GRAM" | ..., amount?: number, all?: boolean }. GET /withdraw List recent withdrawals from this project to MENT PAY wallet. POST /test/pay Test key only. Body: { "payment_id": "pay_..." }. Simulates payment.paid. ## Webhooks Events: payment.created, payment.paid, payment.expired. Headers: X-Ment-Event, X-Ment-Delivery, X-Ment-Timestamp, X-Ment-Signature. Signature: X-Ment-Signature: t=,v1= v1 = HMAC_SHA256(secret, `${t}.${rawBody}`) as hex. Verify the signature against the raw body before crediting. Secret and URL are set per project (API key) in the cabinet. Failed deliveries are retried automatically with backoff up to 24h; event id is stable, deduplicate by it. ## Agent rules 1. Use one Idempotency-Key per order attempt; reuse it on retries. 2. Never log or expose the API key; send it only in the Authorization header. 3. Take amount and currency from the order record, not from free-form user text. 4. Credit only on status "paid" (webhook or GET /payments/{id}), never on "pending". 5. Verify X-Ment-Signature before crediting. 6. On 429 wait Retry-After (60s) and back off; do not loop. 7. If a payment for the order is pending, check it before creating another. 8. Use mp_test_ keys with POST /test/pay for development. ## Errors 400 invalid_request | invalid_amount | unsupported_currency | unsupported_payment_method | invalid_callback_url | invalid_fee_policy | invalid_fee_bearer | unsupported_pay_asset 401 missing_api_key | invalid_api_key | wrong_key_mode 404 payment_not_found 409 payment_not_pending | payment_expired | payment_already_paid 429 rate_limited 500 internal_error Error shape: { "ok": false, "error": { "code": "...", "message": "...", "param": "..." } } ## Payment methods RUB: SBP QR, 9.35..100000 RUB (minimum depends on fee_policy), expires in 5..30 minutes. Crypto invoice: CryptoBot/xRocket pay_url in the requested asset. Supported: USDT, USDC, BTC, ETH, GRAM/TON, SOL, BNB, TRX, LTC, XAUT, DOGE. USDT via USDC: currency=USDT + pay_asset=USDC + provider=cryptobot; invoice in USDC, credit in USDT 1:1. USDT address: unique deposit address per payment, networks TRX (TRC-20), TON, ETH (ERC-20), BSC (BEP-20). Minimums: TRX 1 USDT, TON 0.1 USDT, ETH 1 USDT, BSC 1 USDT. Credit only the exact USDT amount in the stated network. ## Notes - LTC deposits are accepted, but Laveshka currently has no LTC to USDT swap pair. Do not promise LTC to USDT exchange. - MENT commission starts at 7% and decreases automatically with paid project volume down to a 5% minimum (0 RUB -> 7%, 50k RUB -> 6.5%, 200k RUB -> 6%, 500k RUB -> 5.5%, 1.5M+ RUB -> 5%). The applied rate is returned in fee, fee_pct, and net_amount. - SBP cashier adds 4.5%. fee_policy chooses who pays: client_gateway (payer covers cashier, merchant covers service), client_service (payer covers service, merchant covers cashier), client_all (payer covers both, merchant gets the full nominal), merchant (merchant covers both). fee_policy=choice shows the payer two buttons on checkout (with fee / without fee) and is RUB-only. - All responses are JSON. Use checkout_url for the ready payment page.