# XMPayment Merchant API > Automated Indonesian QRIS payment gateway with real-time settlement, balance management, and automated DANA payout. XMPayment provides a simple REST API for merchants to generate dynamic QRIS invoices, receive real-time webhook callbacks, query real-time balance breakdowns, and request automated payouts to DANA E-Wallet. ## Quick Reference - Base URL: https://xmpayment.my.id - Authentication: Header `Authorization: Bearer ` or `x-api-key: ` - Environments: - Sandbox (Test): API key starts with `xmp_test_` (supports instant mock simulation at checkout) - Live (Production): API key starts with `xmp_live_` (active after KYC approval) ## Core API Endpoints - [Create Transaction / Invoice](https://xmpayment.my.id/api/v1/create): `POST /api/v1/create` (alias: `/api/v1/invoices`) — Generate a dynamic QRIS payment with unique anti-collision code and checkout URL. - [Check Transaction Status](https://xmpayment.my.id/api/v1/status/:order_id): `GET /api/v1/status/:order_id` (alias: `/api/v1/invoices/:id`) — Query real-time transaction status (`PENDING`, `SETTLED`, `EXPIRED`, `CANCELLED`). - [Cancel Transaction](https://xmpayment.my.id/api/v1/cancel/:order_id): `POST /api/v1/cancel/:order_id` (alias: `/api/v1/invoices/:id/cancel`) — Proactively cancel pending invoice and release unique nominal slot. - [Check Merchant Balance (Live-Only)](https://xmpayment.my.id/api/v1/balance): `GET /api/v1/balance` (or `POST /api/v1/balance`) — Retrieve Saldo Tersedia (available), Saldo Diproses (settlement hold window), and Saldo Sedang Dicairkan (locked payout). - [Request Withdrawal / Payout to DANA (Live-Only)](https://xmpayment.my.id/api/v1/payout): `POST /api/v1/payout` (alias: `/api/v1/withdraw`) — Request automated/atomic payout to DANA E-Wallet with parameters `nama_akun_dana`, `nomor_dana`, `jumlah_pencairan`. ## Webhook Notifications - [Webhook Specification](https://xmpayment.my.id/llms-full.txt#webhook-notifications): HTTP POST dispatched automatically to merchant's configured endpoint. - Headers: `x-xmp-signature: sha256=`, `x-signature-key: `, `x-xmp-event: `, `x-xmp-delivery: ` - Events: `invoice.paid` (Status `SETTLED`), `invoice.expired`, `invoice.cancelled`, `test.ping` (Dashboard Test) - Security: Verification of `x-xmp-signature` using Webhook Secret is strictly the responsibility of the merchant backend to prevent fraudulent order fulfillment. - Acknowledgment: Endpoint must return HTTP status 200 with JSON `{"received": true}`. ## Full Specification for AI Agents - [llms-full.txt](https://xmpayment.my.id/llms-full.txt): Complete self-contained specification with exact schemas, signature verification code, and ready-to-use SDK snippets for Node.js/TypeScript, Python, PHP/Laravel, and cURL.