# Introduction > Guides and reference for getting paid with mobile money, from your dashboard or your own code. ## Documentation Guides and reference for getting paid with MTN Mobile Money and Airtel Money: from your dashboard, your own code, or an AI app. [Start the quickstart](https://morzepay.com/docs/quickstart) [API reference](https://morzepay.com/docs/api) [QuickstartTake your first test payment in about ten minutes.](https://morzepay.com/docs/quickstart) [Get paid without codePayment pages and invoices your customers pay from their phone.](https://morzepay.com/docs/payment-pages) [API referenceCollect payments, send payouts and run wallets from your own app.](https://morzepay.com/docs/api) [WebhooksHear about every payment the moment it completes or fails.](https://morzepay.com/docs/api/webhooks) [Use with AIInvoice customers and chase payments from Claude or ChatGPT.](https://morzepay.com/docs/ai) [omni by MorzepayYour customers pay in two taps at every Morzepay checkout.](https://morzepay.com/docs/omni) ### More to read [Core conceptsBusinesses, wallets, test and live, and how money moves.](https://morzepay.com/docs/concepts)[Going liveVerify your business so you can take real money.](https://morzepay.com/docs/going-live)[FeesWhat each kind of payment costs, and who pays it.](https://morzepay.com/docs/fees)[Test modeSandbox wallets and the test phone numbers.](https://morzepay.com/docs/api/testing)[Create an API keyMake a key for your server and limit what it can do.](https://morzepay.com/docs/api/keys)[SupportHow to reach us, and what to send.](https://morzepay.com/docs/support) Source: https://morzepay.com/docs --- # Platform overview > What Morzepay does, who it is for, and the pieces you will use. Morzepay is a payments platform for businesses in Uganda. You take payments with MTN Mobile Money and Airtel Money, keep the money in wallets, and pay it out to any mobile money number. You can do all of it from the dashboard, from your own code through the API, or by asking an AI app. ### What you can use - **[Payment pages](https://morzepay.com/docs/payment-pages)**: a link anyone can open to pay you. Share it on WhatsApp or Instagram, or print its QR code. - **[Invoices](https://morzepay.com/docs/invoices)**: bill a customer by email or SMS. They pay on a hosted page and get a receipt. - **[Wallets](https://morzepay.com/docs/concepts#money-lives-in-wallets)**: every payment lands in a wallet. Give each branch, project or customer of yours its own wallet and balance. - **[Payouts and transfers](https://morzepay.com/docs/api/create-payout)**: send money from a wallet to any MTN or Airtel number, or move it between your wallets instantly. - **[The API](https://morzepay.com/docs/api)**: collect payments, send payouts and create invoices and checkout pages from your own app, with [webhooks](https://morzepay.com/docs/api/webhooks) to tell you when things change. - **[AI apps](https://morzepay.com/docs/ai)**: connect Claude, ChatGPT or Cursor and run your billing by asking. - **[omni by Morzepay](https://morzepay.com/docs/omni)**: your customers save their details once and pay in two taps at every Morzepay checkout. ### Who it is for #### Businesses that want to get paid Shops, schools, clinics, SACCOs, freelancers and online sellers. You don’t need a developer: create a payment page or an invoice in the dashboard and share the link. Your customer approves the payment on their phone with their PIN, and you see it straight away. #### Developers building on top Point-of-sale systems, marketplaces, school and SACCO software, savings and lending apps. Give each of your own customers a sub-wallet with its own balance, collect into it, and let them withdraw to their phone. The API is JSON over HTTPS, with test keys that never touch real money. ### Where it works | | | | Networks | MTN Mobile Money and Airtel Money, Uganda | | Currency | Ugandan shillings (UGX), in whole shillings | | Payment size | UGX 500 to UGX 5,000,000 per mobile money payment | | Time zone | Dates and times are East Africa Time (UTC+03:00) | ### How a payment works - You ask for the payment From a payment page, an invoice, or an API call. Morzepay sends a prompt to your customer’s phone. - Your customer approves it They enter their mobile money PIN. Nothing moves until they do. - The network confirms Once MTN or Airtel confirms, the money is in your wallet, your customer gets a receipt and we tell your server with a [webhook](https://morzepay.com/docs/api/webhooks). ### Next steps [Read the core conceptsThe few ideas that explain most of Morzepay.](https://morzepay.com/docs/concepts)[Take a test paymentThe quickstart takes about ten minutes.](https://morzepay.com/docs/quickstart) Source: https://morzepay.com/docs/overview --- # Core concepts > Businesses, wallets, test and live, and how money moves. Four ideas explain most of Morzepay: everything belongs to a business, money lives in wallets, every business has a test side and a live side, and a payment is only final when the network confirms it. ### Everything belongs to a business When you sign up, you create a business. Its wallets, payments, invoices, API keys and team all belong to it. You can belong to more than one business (your own and a client’s, say) and switch between them in the dashboard. Businesses never share money, data or keys. Each person in a business has a role: **Owner**, **Admin**, **Developer** or **Viewer**. See [Team and roles](https://morzepay.com/docs/team). ### Money lives in wallets Every payment you take lands in a wallet, and every payout or transfer comes out of one. A wallet has a balance, a history and its own settings, such as who pays the collection fee. | Kind | What it is for | | Main wallet | Your business’s own money. You create main wallets in the dashboard, for example one per branch. | | Sub-wallet | A wallet under a main wallet, usually one for each of your customers: a shop on your point-of-sale system, a member of your savings app. You create them with the API. | Money moves into a wallet through collections and incoming transfers, and out through payouts and outgoing transfers. A wallet can never go below zero: if it can’t cover a payout and its fee, the payout is refused and nothing is sent. ### Test and live Every business has two separate sides. Switch between them with the **Test / Live** toggle in the dashboard; Morzepay remembers the one you used last. | | Test | Live | | Money | Sandbox money. Nothing real moves. | Real money on MTN and Airtel. | | API keys | mp_test_… | mp_live_… | | Available | From the moment you sign up | After your business is verified | | Phone numbers | Any number, plus test numbers that decline or wait | Real numbers only | Wallets, payments, invoices and keys on one side are invisible to the other. Every object in the API has `livemode` so you can always tell which side it came from. ### A payment is final when the network says so Mobile money is not instant: your customer has to see the prompt and enter their PIN, and the network has to confirm. So every payment goes through statuses: | Status | What it means | | pending | Created, not yet accepted by the network. | | processing | With the network. For a collection, the prompt is on your customer’s phone. | | success | Done. The wallet balance has changed. | | failed | It didn’t happen. Any money held for it is back in the wallet. | | review | The network reported something unexpected, and our team is checking it. No money is credited until it is resolved. | Never hand over goods just because a customer was sent back to your website. Wait for the `success` status, from a [webhook](https://morzepay.com/docs/api/webhooks) or by checking the payment. ### Amounts are whole shillings You send amounts as whole UGX numbers: `5000`, not `"5000"` or `5000.5`. Morzepay returns money as text with two decimals, such as `"10363.00"`, because network fees can have fractions. See [Fees](https://morzepay.com/docs/fees) for what each kind of payment costs. ### Next steps - [Take your first test payment](https://morzepay.com/docs/quickstart) - [See what each payment costs](https://morzepay.com/docs/fees) - [Invite people to your team](https://morzepay.com/docs/team) Source: https://morzepay.com/docs/concepts --- # Quickstart > Take your first test payment in about ten minutes. You will create a test API key, ask a test phone number for UGX 10,000, and watch the payment arrive in your wallet. Test mode uses sandbox money, so nothing real moves and you don’t need to verify your business first. You need a Morzepay account and a terminal with `curl`. Prefer not to code? Make a [payment page](https://morzepay.com/docs/payment-pages) instead: it takes a minute. - Create your account Go to [the dashboard](https://morzepay.com/app) and sign up with your email. Confirm your email address, and you’re in your new business on the **Home** page. - Switch to Test Make sure the toggle at the top of the dashboard says **Test**. Everything you do now uses sandbox money. - Create a test API key Go to **Developers** and click **Create API key**. Name it `quickstart`, tick **Request payments**, **See wallets and balances** and **See transactions**, then confirm with your password or two-factor code. The key is shown only once. Copy it now. Keep keys on your server and never put them in a website or a mobile app. Put it in your terminal: Terminal ```bash export MORZEPAY_KEY="mp_test_..." ``` - Find your wallet Every business starts with a main wallet. List your wallets and copy the `id`: Terminal ```bash curl "https://morzepay.com/v1/wallets" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` - Ask for a payment Ask a phone number for UGX 10,000. In test mode the payment succeeds straight away, with the same fees as live: Terminal ```bash curl -X POST "https://morzepay.com/v1/deposits" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: quickstart-0001" \ -d '{ "wallet_id": "wal_...", "msisdn": "0771234567", "amount": 10000, "reference": "quickstart-0001" }' ``` The answer is the new transaction, with its `id` and `status`. - Check that it arrived Look up the transaction, or open **Activity** in the dashboard: Terminal ```bash curl "https://morzepay.com/v1/transactions/txn_..." \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` The status is `success` and `net` shows what reached your wallet after the fee. Your payment works. ### Try the other outcomes Real customers decline, run out of balance or take a minute to answer. Use the [test numbers](https://morzepay.com/docs/api/testing) to see each case before you go live: `+256700000002` declines, `+256700000003` waits about a minute and then succeeds. ### Next steps [Get told when payments finishSet up a webhook so your server doesn’t have to keep asking.](https://morzepay.com/docs/api/webhooks)[Use a hosted checkoutSend customers to a Morzepay page that handles the prompt and the receipt.](https://morzepay.com/docs/api/create-checkout)[Go liveVerify your business to take real money.](https://morzepay.com/docs/going-live)[Read the API introductionErrors, retries, pagination and limits.](https://morzepay.com/docs/api) Source: https://morzepay.com/docs/quickstart --- # Going live > Verify your business so you can take real money. To take real money, we need to know who you are. You verify your business once, under **Go live** in the dashboard. Only the business owner can fill it in and submit it; admins can follow its progress. While you wait, everything keeps working in test mode. ### What you need First choose your account type. What we ask for depends on it: | Account type | For | You provide | | Individual | Freelancers and people selling on their own | Your LinkedIn profile, your National ID and NIN, a verified phone number and a quick live check | | Sole proprietorship | A registered business with one owner | Business name, registration number and address; the business registration certificate; proof of registration (URSB search report or trading licence); the owner’s National ID, phone and live check | | Company | A limited company | Registered name, registration number, TIN and address; the certificate of incorporation; the memorandum and articles of association; at least one director’s National ID, phone and live check | ### Verify your business - Choose the account type Open **Go live** and pick Individual, Sole proprietorship or Company. - Add the business details Fill in the details exactly as they appear on your registration documents, and upload the documents. Clear photos or PDFs work best. - Add the people For each person, enter their full name as on the ID and their NIN, and upload both sides of the ID. We text a 6-digit code to their phone to confirm it. Then they take a quick live check: they open the link we show (on this device or their phone) and turn their head as the camera asks, to show they are the person on the ID. - Submit for review Confirm your email address first, if you haven’t. When every item on the checklist is ticked, click submit. We review it and email you. If something needs fixing, we tell you what, and you can resubmit. The live-check link works for five minutes and needs no login, so it can be opened on a phone. If it runs out, start a new one. ### When you’re verified - The **Live** side of the dashboard opens, with its own wallets. - You can create live API keys (`mp_live_…`). - Payment pages and invoices you create in live mode take real money. #### Payout limits Live payouts are limited over any rolling 7 days, according to your account type. To see how much you have left, [quote a payout](https://morzepay.com/docs/api/create-quote): the answer includes `weekly_limit_remaining`. A payout that would go over the limit is refused with `WEEKLY_LIMIT_REACHED`, and nothing is sent. If you need a higher limit, [email us](mailto:support@morzepay.com). #### Live keys that send payouts need an IP allowlist A live key with permission to send payouts only works from the server addresses you list on it. It’s a second lock: even if the key leaked, nobody could use it from elsewhere. See [Create an API key](https://morzepay.com/docs/api/keys). ### Changing your details later Once you’re verified, changes to your business details are sent to us for review before they take effect. You can see and cancel a pending change under **Profile**. Source: https://morzepay.com/docs/going-live --- # Payment pages > A link anyone can open to pay you with mobile money. A payment page is a link anyone can open to pay you with MTN Mobile Money or Airtel Money. You don’t need a website: share the link on WhatsApp, Instagram or by SMS, or print its QR code at your counter. Your customer enters their number, approves the prompt with their PIN, and gets a receipt. ### Create a payment page - Open Checkout In the dashboard, go to **Checkout** and click **Create payment page**. Check the Test / Live toggle first: a page made in test mode only takes sandbox money. - Say what it’s for In **What are people paying for?**, write what your customer will see, such as Term 3 school fees or Weekly vegetable box. Add a description if it helps. - Set the price Choose **Fixed price** and enter the amount, or **Customer chooses** to let people type their own amount, with an optional minimum. Letting people choose is good for donations, fees and top-ups. - Choose the details Pick the wallet it pays into, who pays the mobile money fee, and the link type. Optionally ask for the customer’s name or email, and give a web address to send them to after paying. - Share it Click **Create payment page**. Copy the link or download the QR code and share it wherever your customers are. ### The settings | Setting | What it does | | Price | Fixed price: everyone pays the same amount. Customer chooses: the customer types the amount, at least the minimum you set. | | Pay into | The wallet the money lands in. Use a different wallet for each branch or purpose to keep them apart. | | Mobile money fee paid by | You: the customer pays the price and your wallet receives the price minus the fee. Customer: the fee is added on top, so your wallet receives about the full price. See Fees. | | Link type | Many payments: the same link keeps working for everyone, until you turn it off. One payment: the link closes after it is paid once, or when it expires (after 1 hour, 24 hours, 3 days or 7 days). | | Ask for name or email | Makes those fields required. Asking for the email means the customer always gets a receipt. | | After payment, send them to | A page on your website to show once they’ve paid. Leave it empty to show Morzepay’s confirmation. | ### What your customer sees The page shows your business name, what they’re paying for and the amount. They enter their MTN or Airtel number (the network is detected automatically), tap **Pay** and approve the prompt on their phone. If the prompt doesn’t show up, the page tells them how to approve it from the network menu: `*165#` for MTN, `*185#` for Airtel. When the payment goes through, they see a confirmation and can download a receipt. If a payment fails, for example because their balance is too low, they can try again on the same page, including with a different number. Customers who use [omni](https://morzepay.com/docs/omni) don’t type their number at all: their saved number is already selected. ### Turn a page off Open the page in **Checkout** and click **Deactivate**. The link stops taking payments straight away, and people who open it see that it has expired. You can activate it again later. ### See what a page collected Each page in **Checkout** shows how many payments it took and how much it collected. Open it to see every payment, who paid and their receipt. ### Create pages from your code Payment pages are checkout sessions with `reusable` set to `true`. To make a page for each order in your shop, use the API: [POST`/v1/checkout/sessions`](https://morzepay.com/docs/api/create-checkout) Source: https://morzepay.com/docs/payment-pages --- # Invoices > Bill a customer, send it by email or SMS, and get paid on a hosted page. An invoice asks one customer to pay a set amount by a due date. You create it, Morzepay gives it a number and a payment link, and emails or texts it to your customer. They pay on a hosted page with mobile money, and both of you get a receipt. ### Create and send an invoice - Start a new invoice In the dashboard, go to **Invoices** and click **New invoice**. - Add the customer Enter their name. Add an email address to email the invoice, and a phone number to text it and to fill in the payment page for them. - Add the lines Add what you’re charging for, with a quantity and a unit price for each line. Add VAT or another tax as a percentage if you charge one. The total must be between UGX 500 and UGX 5,000,000. - Check the details Set the due date, the wallet it pays into and who pays the mobile money fee. Add a memo or footer if you like. - Send it Save it as a draft to finish later, or send it now by email, SMS or both. Sending gives the invoice its number and payment link. ### Invoice statuses | Status | What it means | What you can do | | draft | Being prepared. It has no number and can’t be paid yet. | Edit, delete, send | | open | Sent and waiting for payment. Its content is fixed. | Resend, record a payment, void, mark uncollectible | | paid | Paid on the hosted page, or marked paid by you. | Download the receipt | | void | Cancelled. Kept for your records; the payment page says it was cancelled. | Nothing | | uncollectible | Written off, but the customer can still pay it. | Void, record a payment | An open invoice is **past due** after its due date. The **Past due** tab shows them all, so you know whom to remind. To change an invoice that has been sent, void it and create a new one. That way the number your customer has always matches what they were asked to pay. ### Remind a customer Open the invoice and send it again. Your customer gets the same link, so it doesn’t matter which message they use to pay. ### Record cash or bank payments If a customer pays you outside Morzepay, open the invoice and mark it paid, with a note such as Cash at the shop. The invoice becomes `paid` and a receipt is issued, which you can email them. Your wallet balance doesn’t change, because the money didn’t come through Morzepay. ### Numbering and branding Under **Invoices → Settings**, choose a prefix of 2 to 10 letters or digits. Invoices are then numbered like `NILE-0001` and receipts like `NILE-R0001`; test invoices have `TEST-` in front. You can also set the support email and phone shown on invoices (replies to invoice emails go to that email), a default footer, and the default number of days until an invoice is due (14 unless you change it). ### If a customer pays twice Sometimes a customer pays an invoice that was already paid or voided, for example from an old message. The money still lands in your wallet and the payment shows in **Activity**. If you use webhooks, you also get an `invoice.overpaid` event. Refund the customer with a payout. ### Create invoices from your code or an AI app - From your system: [POST`/v1/invoices`](https://morzepay.com/docs/api/create-invoice) - By asking: “Invoice Kampala Coffee House UGX 180,000 for the machine service and email it.” See [Use with AI](https://morzepay.com/docs/ai). Source: https://morzepay.com/docs/invoices --- # Receipts > Numbered receipts for every payment, sent automatically. Every payment on a payment page or an invoice gets a numbered receipt automatically. Your customer can open it, download it as a PDF, or get it by email. You can also make a receipt for any payment you collected through the API. ### What a receipt shows - Your business name and contact details - A receipt number, such as `NILE-R0001`, and the invoice number if there is one - The amount paid, how it was paid (for example MTN Mobile Money) and the network’s reference - Who paid and when ### When receipts are sent | How they paid | Receipt | | A payment page or invoice | Made as soon as the payment succeeds. Emailed to the payer if we have their email address. | | An invoice you marked paid | Made when you mark it paid. Emailed if you choose to. | | An API collection | Made the first time you ask for it, from the dashboard or the API. | ### Get a receipt from the dashboard - Open the payment Go to **Activity** and click the payment. - Get the receipt Click **Get receipt**. Morzepay makes it the first time and keeps the same number afterwards. - Share it Open it, download the PDF, or email it to the payer or any other address. ### Receipt links Each receipt has its own private link and PDF link. Anyone with the link can open it without logging in, so share it only with the payer. ### From your code - [GET`/v1/transactions/{transaction_id}/receipt`](https://morzepay.com/docs/api/transaction-receipt) makes or fetches the receipt for a payment. - [GET`/v1/receipts/{receipt_id}`](https://morzepay.com/docs/api/get-receipt) fetches a receipt you already have. Source: https://morzepay.com/docs/receipts --- # omni by Morzepay > Your customers save their details once and pay in two taps at every Morzepay checkout. omni lets your customers save their mobile money numbers, name and email once, and use them at every business that takes payments on Morzepay’s payment pages, checkouts and invoices. The next time they pay, anywhere on Morzepay, their number is already there: they pick it, tap **Pay** and approve with their PIN. It is on for every business. There’s nothing to set up. ### What your customers see - They pay once, as usual The first time, they type their number and approve the prompt like any payment. - They choose to save it After paying, they see **Save with omni**. One tap saves their number and details. Saving is optional: nothing is saved unless they choose to. - Next time, it’s two taps At any Morzepay checkout, even a different business, they see “Hi Kato” with their saved numbers. They pick one, tap Pay and enter their PIN. ### Several numbers A customer can save more than one number, such as their MTN and their Airtel. If a payment fails because one number doesn’t have enough balance, they can switch to their other saved number in one tap and finish paying, without starting again. ### How omni keeps numbers safe - **Proof that the number is theirs.** A number is saved only after a successful real payment from it (approving the PIN proves it’s theirs) or a code texted to it. When a number is saved, we text it to say so, so nobody can quietly save someone else’s number. - **Masked everywhere.** Checkout pages only ever show the middle of a number hidden, like `077•••456`. - **Their PIN, always.** omni fills in the number. Every payment is still approved with the customer’s mobile money PIN on their own phone. - **Not you?** On a shared phone, one tap forgets the device. ### The omni page for your customers At [morzepay.com/omni](https://morzepay.com/omni), a customer signs in with a code sent to their main number. There they can see every payment made with their saved numbers on Morzepay pages, with receipts; add numbers and choose their main one; update their name and receipt email; sign out devices; or delete omni completely. ### What you see Your dashboard’s Home page has two cards for omni: | Card | What it counts | | Payments recovered | Payments that failed first and then went through when the customer tried again, for example with another number. | | Paid with omni | The share of payments on your Morzepay pages made with saved details. | ### Privacy omni details belong to your customer, not to any one business. A business sees the payments made to it, as with any payment, but can’t browse a customer’s saved numbers or their payments elsewhere. The full details are in section 8 of our [Privacy Policy](https://morzepay.com/privacy). Source: https://morzepay.com/docs/omni --- # Fees > What collections, payouts and transfers cost, and who pays. You pay a fee when money moves in or out of Morzepay. There are no monthly fees and nothing to pay to sign up or to use test mode. The exact prices for your business are listed in the dashboard under **Profile → Your fees**; this page explains how each one works. ### The fees at a glance | Kind | Standard price | Who pays | | Collections: payment pages, invoices, checkouts and API collections | 3.5% of what the customer pays, all-in | You or your customer, as you choose | | Payouts to MTN or Airtel numbers | A flat amount per amount band, from UGX 800 | The wallet sending the payout | | Transfers between your own wallets | UGX 200 per transfer | The wallet sending the money | Your own price list may differ from the standard one. What you see under **Profile → Your fees** is what you are charged, in test mode too. ### Collections: you choose who pays Every wallet has a setting for who pays the collection fee, and you can change it for a single payment page, invoice or API request. | Setting | Your customer is asked for | Your wallet receives | | You pay (wallet) | The price, e.g. UGX 10,000 | The price minus the fee, e.g. UGX 9,650 | | Customer pays (customer) | The price plus the fee, e.g. UGX 10,363 | About the full price, e.g. UGX 10,000 | When the customer pays the fee, the payment page shows them the total before they approve it, so there are no surprises. ### Payouts: held first, settled after Before a payout is sent, Morzepay sets aside the amount plus an estimate of the fee, with a small safety margin. If the wallet can’t cover that, the payout is refused and nothing is sent. Once the network confirms the payout, the real fee is charged and anything left of the estimate goes back to the wallet. If the payout fails, everything set aside goes back. To see the numbers before you send, use [Quote fees](https://morzepay.com/docs/api/create-quote): it shows the estimated fee, the amount that will be held and whether the wallet has enough. ### Transfers between wallets Moving money between two of your wallets is instant and costs UGX 200, paid by the sending wallet on top of the amount. If you run a platform, you can add your own fee to a transfer; it goes to a wallet you choose. See [Transfer between wallets](https://morzepay.com/docs/api/create-transfer). ### Where fees show up - Every payment in **Activity** shows its fee and what reached the wallet. - In the API, `fee_estimated` is known when a payment is created, and `fee` is the final fee once it succeeds. `net` is the change to the wallet. - Receipts show the amount the customer paid. Source: https://morzepay.com/docs/fees --- # Team and roles > Invite people and choose what each one can do. Invite the people you work with to your business, and give each one only the access they need. Everyone signs in with their own account, and everything they do is recorded against their name. ### Roles | Role | Can | | Owner | Everything, including verifying the business, changing anyone’s role and making admins. There is one owner: the person who created the business. | | Admin | Run the business day to day: create wallets, send payouts and transfers, create invoices and payment pages, manage API keys and webhooks, and invite developers and viewers. | | Developer | Create and revoke API keys, set up webhooks and see everything. Can’t move money or create invoices from the dashboard. | | Viewer | See balances, payments, invoices and reports. Can’t change anything. | Give your accountant **Viewer** and the person building your integration **Developer**. Keep **Admin** for people who should be able to send money. ### Invite someone - Open Team In the dashboard, go to **Team**. Owners and admins can invite. - Send the invitation Enter their email address and choose a role. Only the owner can invite an admin. - They accept They get an email with a link. They sign in or create an account, and join your business with the role you chose. You can revoke an invitation until it’s accepted. ### Change a role or remove someone - Only the owner can change roles. - Owners and admins can remove members, but an admin can’t remove another admin, and nobody can remove the owner. - Anyone can leave a business they’ve joined. When someone leaves or is removed, they lose access at once. Any AI apps they connected to the business are disconnected too. API keys belong to the business, not the person, so revoke any key they had access to if you no longer trust it. ### Several businesses One account can belong to several businesses, with a different role in each. Switch between them from the business menu in the dashboard. Source: https://morzepay.com/docs/team --- # Security > Two-factor authentication, sessions and protecting your account. Your Morzepay account can move money, so it is protected by more than a password. This page covers what we do, and what you can do, to keep it safe. ### Two-factor authentication With two-factor authentication on, signing in needs a code as well as your password. Set it up under **Security** in the dashboard. You can use: | Method | How it works | | Authenticator app | An app such as Google Authenticator or Microsoft Authenticator shows a new 6-digit code every 30 seconds. This is the safest choice. | | Email codes | We email you a code each time you sign in. | When you set it up, save your **recovery codes** somewhere safe, away from your phone. Each one works once, if you lose access to your authenticator. You can make a new set at any time, which cancels the old ones. Replacing your phone? You can pause two-factor authentication for a few days instead of turning it off, and it comes back on by itself. ### Confirming important actions Anything that moves money or grants access, such as sending a payout, creating an API key or changing your webhook, asks you to confirm with your two-factor code, or with your password if two-factor authentication is off. A code can’t be used twice. ### Sessions Under **Security** you can see where you’re signed in. If you see a device you don’t recognise, sign out of all other sessions and change your password. ### API keys - Give each key only the permissions it needs, and limit it to the wallets it needs. - Keep keys on your server, in environment variables. Never put them in a website, a mobile app or a code repository. - Live keys that can send payouts only work from the IP addresses you list. - If a key may have leaked, revoke it under **Developers** straight away. Requests with it are refused from that moment. See [Create an API key](https://morzepay.com/docs/api/keys). ### Webhooks Check the signature on every webhook before you act on it, so nobody can pretend to be Morzepay. See [Verify signatures](https://morzepay.com/docs/api/verify-webhooks). ### Phishing We will never ask for your password, your two-factor codes or your API keys by email, phone or WhatsApp. Morzepay pages are always on `morzepay.com`. If something looks wrong, [tell us](mailto:support@morzepay.com). ### Report a security issue If you’ve found a vulnerability in Morzepay, email [support@morzepay.com](mailto:support@morzepay.com) with the details. Please give us a chance to fix it before telling anyone else. Source: https://morzepay.com/docs/security --- # API introduction > Base URL, authentication, responses, errors, pagination and limits. The Morzepay API lets you collect mobile money, send payouts, run wallets for your own customers, and create invoices and checkout pages from your own code. It is a REST API: you send JSON over HTTPS, and every answer is JSON. ### Base URL Base URL ```text https://morzepay.com/v1 ``` The same URL serves test and live. Your API key decides which one a request uses. ### Authentication Every request needs an API key, sent as a bearer token: Header ```http Authorization: Bearer mp_test_3f9a1c0b2e7d_9b1c... ``` Create keys under **Developers** in the dashboard. See [Create an API key](https://morzepay.com/docs/api/keys). A key belongs to one business and works only on its test side (`mp_test_…`) or its live side (`mp_live_…`). Keys made before the rename start with `tp_`; they keep working. Anyone who has a key can use it. Keep keys on your server. Never put one in a website, a mobile app, a public repository or a forum post. If a key leaks, revoke it in the dashboard at once. #### Permissions Each key can only do what you allowed when you created it. A request without the needed permission returns `403 INSUFFICIENT_SCOPE`. | Permission | Allows | | wallets:read | List wallets, see balances, quote fees | | wallets:write | Create sub-wallets | | deposits:write | Collect payments | | payouts:write | Send payouts | | transfers:write | Move money between wallets | | transactions:read | See transactions and receipts | | msisdn:validate | Look up the name on a phone number | | invoices:read, invoices:write | See invoices; create, send and change them | | checkout:read, checkout:write | See checkout sessions; create and expire them | ### Requests Send `POST` bodies as JSON, with this header: Header ```http Content-Type: application/json ``` Amounts are whole Ugandan shillings as numbers: `5000`, not `"5000"` or `5000.5`. Phone numbers can be written `+256771234567`, `256771234567` or `0771234567`; we always return them as `+256…`. ### Responses A successful answer: Success ```json { "success": true, "data": { "id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "balance": "48500.00", "…": "…" } } ``` An error: Error ```json { "success": false, "error": { "code": "INSUFFICIENT_FUNDS", "message": "The wallet cannot cover the payout plus the estimated mobile money fee.", "details": { "available": "3000.00", "required": "5800.00" } }, "request_id": "req_6f1d0c2b9a8e7d6c5b4a" } ``` | Field | Type | In | Meaning | | success | boolean | both | true or false. | | data | object | success | The result: one object, or a list (see Pagination). | | error.code | string | error | What went wrong. Codes don’t change, so match on them. | | error.message | string | error | A sentence for people. It can change; don’t match on it. | | error.details | object | error | Extra facts, such as field for a validation error. | | request_id | string | error | Send it to support when you report a problem. Every response also has it in the X-Request-Id header. | Money is returned as text with two decimals, such as `"10363.00"`, because network fees can include fractions. Dates are ISO 8601 in East Africa Time, such as `2026-10-04T14:20:11+03:00`. Every object has `livemode`. ### Errors | Status | Code | Meaning | | 400 | INVALID_JSON | The body isn’t valid JSON, or isn’t a JSON object. | | 401 | UNAUTHENTICATED, KEY_REVOKED | The key is missing, wrong, revoked or expired. | | 402 | INSUFFICIENT_FUNDS | The wallet can’t cover the amount and fees. Nothing was sent. | | 403 | INSUFFICIENT_SCOPE | The key doesn’t have the permission this needs. | | 403 | IP_NOT_ALLOWED | The request came from an address not on the key’s allowlist. | | 403 | LIVE_NOT_ENABLED | Your business isn’t verified for live payments yet. | | 403 | BUSINESS_SUSPENDED | The business account is suspended. Contact support. | | 403 | WEEKLY_LIMIT_REACHED | The payout would go over your 7-day limit. details.remaining shows what’s left. | | 404 | NOT_FOUND, WALLET_NOT_FOUND | It doesn’t exist, or this key can’t see it. | | 409 | DUPLICATE_REFERENCE | You already used this reference. The existing transaction_id is in details. | | 409 | WALLET_NOT_ACTIVE | The wallet is frozen. | | 409 | IDEMPOTENCY_IN_PROGRESS | A request with the same Idempotency-Key is still running. Wait and retry. | | 422 | VALIDATION_ERROR | A field is missing or wrong. details.field names it. | | 422 | MODE_MISMATCH | You mixed test and live, such as a live key and a test wallet. | | 422 | IDEMPOTENCY_MISMATCH, INVALID_IDEMPOTENCY_KEY | The Idempotency-Key was used with a different body, or isn’t 8–80 letters, digits, - or _. | | 429 | RATE_LIMITED, MSISDN_RATE_LIMITED | Too many requests. Wait details.retry_after_seconds. | | 500 | SERVER_ERROR | Something failed on our side. Retry with the same Idempotency-Key. | ### Pagination List endpoints return a page of results, newest first: A list ```json { "success": true, "data": { "items": [ "…" ], "has_more": true } } ``` | Parameter | Type | Meaning | | limit | integer | How many items a page holds, 1 to 100. The default is 25 (50 for wallets). | | starting_after | string | The id of the last item you have. You get the items after it. | To get every page, repeat the request with `starting_after` set to the last item’s `id` while `has_more` is `true`. ### Idempotency Networks fail. To retry a `POST` safely, send an `Idempotency-Key` header: Header ```http Idempotency-Key: order-77812 ``` - Use a new value, 8 to 80 letters, digits, `-` or `_`, for each thing you want to do. Your order id works well. - If you send the same key and body again, you get the first answer back with an `Idempotent-Replayed: true` header. Money is never moved twice. - The same key with a different body returns `422 IDEMPOTENCY_MISMATCH`. - Keys are remembered for 24 hours. Errors from our side (5xx) and `429` aren’t stored, so you can retry them. Money-moving requests also need your own unique `reference`, 8 to 36 characters. A second request with the same reference returns `409 DUPLICATE_REFERENCE`, which protects you even without an idempotency key. ### Rate limits Each API key can make **120 requests a minute**. Past that, the API answers `429 RATE_LIMITED` with a `Retry-After` header. Separately, the mobile networks allow at most **5 payment requests per phone number every 10 minutes**. A sixth returns `429 MSISDN_RATE_LIMITED` with `details.retry_after_seconds`. Show your customer when they can try again, rather than retrying in a loop. Phone number lookups are limited to 30 a minute per key. ### Versioning The API version is `v1`, and it is part of every path. We may add endpoints, fields and webhook events to `v1` without notice, so ignore fields you don’t know. A change that could break your code comes in a new version, announced in the [changelog](https://changelog.morzepay.com), and `v1` keeps working for a period we state in the announcement. Source: https://morzepay.com/docs/api --- # Create an API key > Make a key for your server and limit what it can do. An API key lets your server act for one business, on its test side or its live side. You choose what each key may do, which wallets it may touch and, optionally, which server addresses may use it. Owners, admins and developers can create keys. - Choose test or live In the dashboard, set the toggle at the top to **Test** or **Live**. The key you create belongs to that side: `mp_test_…` or `mp_live_…`. Live keys are available once your business is [verified](https://morzepay.com/docs/going-live). - Open Developers Go to **Developers** and click **Create API key**. - Name it In **Name**, say where the key will be used, such as `POS production server` or `staging`. You’ll thank yourself when you need to revoke one. - Choose what it can do Tick only the permissions this server needs. A shop that only takes payments needs **Request payments** and **See transactions**, not **Send payouts**. See the [list of permissions](https://morzepay.com/docs/api#permissions). - Limit it, if you can Under **Limit to wallets**, pick the wallets the key may use. Choosing a main wallet includes its sub-wallets. Leave it empty for every wallet. Other wallets look as if they don’t exist to this key. Under **Allowed server IPs**, list your servers’ addresses, one per line. Ranges such as `41.210.0.0/24` work too. This is **required for live keys that send payouts**. - Confirm and copy Confirm with your two-factor code or password and click **Create API key**. The key is shown only now. Copy it into your server’s environment variables or a secret store before you close the window. If you lose it, create a new one. ### Check that the key works Put the key in an environment variable and list your wallets: Terminal ```bash export MORZEPAY_KEY="mp_test_..." curl "https://morzepay.com/v1/wallets" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` The answer starts with `"success": true`. If you get `401 UNAUTHENTICATED`, check that you copied the whole key. A `403 INSUFFICIENT_SCOPE` means the key works but lacks `wallets:read`. ### Revoke a key Under **Developers → API keys**, click **Revoke** on the key’s row. Requests with it are refused from then on with `401 KEY_REVOKED`. The table also shows when and from which address each key was last used, which helps you spot a key you no longer need. ### Keys for AI apps AI apps you connect with the sign-in window appear in the same list, marked **AI app**, with **Disconnect** instead of Revoke. See [Use with AI](https://morzepay.com/docs/ai). ### Good habits - One key per server or service, so you can revoke one without touching the others. - Separate test and live keys in separate environments, so test code can never move real money. - Never put a key in code that runs in a browser or a mobile app. Anyone can read it there. Source: https://morzepay.com/docs/api/keys --- # Test mode > Sandbox wallets and the test phone numbers. Test mode is a full copy of Morzepay that uses sandbox money. Build and try everything there first: it uses the same API, the same fees and the same webhooks as live, and nothing you do can move real money. ### How test mode works - Test keys (`mp_test_…`) only see test wallets, and live keys only see live wallets. - Wallets, transactions, references, invoices and checkout sessions are fully separate, so the same `reference` can exist in both. - Every object, and every webhook, has `livemode: false`. - Fees are the same as live: the ones under **Profile → Your fees**. - Test invoices are numbered `TEST-…`. They and their receipts are really emailed, so use your own address while you try things out. ### Test phone numbers Use these numbers to make the sandbox behave like a real customer: | Number | What happens | | +256700000002 | The customer declines a collection, or the payout fails. Money held for a payout goes back to the wallet. | | +256700000003 | Stays processing for about 60 seconds, then succeeds. Use it to test waiting, polling and webhooks. | | +256700000004 | Not a registered mobile money number: refused straight away, and fails a phone number lookup. | | Any other valid number | Succeeds straight away. | The rule of 5 payment requests per number every 10 minutes applies in test mode too, so you can test how you handle `MSISDN_RATE_LIMITED`. Test traffic never counts against your live limits. ### Put money in a test wallet Test wallets start empty. To test payouts and transfers, first collect a payment into the wallet from any ordinary test number, for example UGX 100,000 from `0771234567`. ### Before you go live - You handle `success`, `failed` and a slow `processing` for collections and payouts. - Your webhook endpoint checks signatures and ignores events it has seen before. - You retry safely with an `Idempotency-Key`, and handle `DUPLICATE_REFERENCE`. - You show customers a clear message for `MSISDN_RATE_LIMITED` and `INSUFFICIENT_FUNDS`. - Your live key with payout permission has an IP allowlist. Source: https://morzepay.com/docs/api/testing --- # List wallets `GET https://morzepay.com/v1/wallets` GET`/v1/wallets` Returns your wallets and sub-wallets, newest first. Use `external_ref` to find the wallet you made for one of your own customers. Permission`wallets:read` ### Query parameters `external_ref`string Only the wallet with this reference of yours. `parent_wallet_id`string Only the sub-wallets under this main wallet. `limit`integerdefault: 50 How many wallets to return, 1 to 100. `starting_after`string An `id` from the previous page. Returns the items after it. ### Returns A list of [wallets](https://morzepay.com/docs/api/get-wallet). A key limited to some wallets only sees those. ## Example request ```bash curl "https://morzepay.com/v1/wallets?external_ref=shop-0192" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "items": [ { "id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "livemode": true, "kind": "sub", "parent_wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "name": "Nakasero Pharmacy", "external_ref": "shop-0192", "currency": "UGX", "balance": "48500.00", "deposit_fee_bearer": "customer", "status": "active", "created_at": "2026-10-04T14:20:11+03:00" } ], "has_more": false } } ``` Source: https://morzepay.com/docs/api/list-wallets --- # Create a sub-wallet `POST https://morzepay.com/v1/wallets` POST`/v1/wallets` Creates a sub-wallet under one of your main wallets, usually one for each of your own customers. Main wallets are created in the dashboard. Permission`wallets:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Body JSON, with `Content-Type: application/json`. `parent_wallet_id`stringrequired The main wallet this one sits under. `name`stringrequired 2–120 characters, such as your customer’s name. `external_ref`string Your own id for this customer. Unique in your business, so you can find the wallet later with [List wallets](https://morzepay.com/docs/api/list-wallets). `deposit_fee_bearer`string Who pays the collection fee on payments into this wallet: `wallet` or `customer`. Defaults to the main wallet’s setting. ### Returns The new wallet, with a balance of `0.00`. ### Errors | Status | Code | When | | 409 | DUPLICATE_EXTERNAL_REF | Another wallet already uses this external_ref. | | 422 | INVALID_PARENT | The parent isn’t a main wallet. | | 404 | WALLET_NOT_FOUND | The parent doesn’t exist, or the key can’t see it. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/wallets" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: create-shop-0192" \ -d '{ "parent_wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "name": "Nakasero Pharmacy", "external_ref": "shop-0192", "deposit_fee_bearer": "customer" }' ``` ## Example response (201) ```json { "success": true, "data": { "id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "livemode": true, "kind": "sub", "parent_wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "name": "Nakasero Pharmacy", "external_ref": "shop-0192", "currency": "UGX", "balance": "0.00", "deposit_fee_bearer": "customer", "status": "active", "created_at": "2026-10-04T14:20:11+03:00" } } ``` Source: https://morzepay.com/docs/api/create-wallet --- # Get a wallet `GET https://morzepay.com/v1/wallets/{wallet_id}` GET`/v1/wallets/{wallet_id}` Returns one wallet with its current balance. Permission`wallets:read` ### Path parameters `wallet_id`stringrequired The wallet, such as `wal_Zq4Hn8YtV2kPm6RbX3cLw9`. ### Returns A wallet. `id`string Starts with `wal_`. `kind`string `main` or `sub`. `parent_wallet_id`string | null For a sub-wallet, its main wallet. `balance`string What the wallet holds now, in UGX with two decimals. `external_ref`string | null Your own id for it. `deposit_fee_bearer`string `wallet` or `customer`. `status`string `active`, or `frozen` if it can’t move money. ## Example request ```bash curl "https://morzepay.com/v1/wallets/wal_Zq4Hn8YtV2kPm6RbX3cLw9" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "livemode": true, "kind": "sub", "parent_wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "name": "Nakasero Pharmacy", "external_ref": "shop-0192", "currency": "UGX", "balance": "48500.00", "deposit_fee_bearer": "customer", "status": "active", "created_at": "2026-10-04T14:20:11+03:00" } } ``` Source: https://morzepay.com/docs/api/get-wallet --- # List wallet transactions `GET https://morzepay.com/v1/wallets/{wallet_id}/transactions` GET`/v1/wallets/{wallet_id}/transactions` Returns a wallet’s transactions, newest first: collections, payouts, transfers in and out, and fees you received. Permission`transactions:read` ### Path parameters `wallet_id`stringrequired The wallet, such as `wal_Zq4Hn8YtV2kPm6RbX3cLw9`. ### Query parameters `limit`integerdefault: 25 How many items to return, 1 to 100. `starting_after`string A transaction `id` from the previous page. Returns older transactions. ### Returns A list of [transactions](https://morzepay.com/docs/api/get-transaction). ## Example request ```bash curl "https://morzepay.com/v1/wallets/wal_Zq4Hn8YtV2kPm6RbX3cLw9/transactions?limit=25" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "items": [ { "id": "txn_Rk3Lp9WmQ2vX7bN4cTz8Hd", "livemode": true, "type": "deposit", "status": "success", "wallet_id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "currency": "UGX", "amount": "10000.00", "net": "10000.00", "reference": "order-77812", "description": "Order 77812", "created_at": "2026-10-04T14:07:22+03:00", "completed_at": "2026-10-04T14:07:51+03:00", "msisdn": "+256771234567", "provider": "MTN_UGANDA", "provider_transaction_id": "29876543210", "fee": "363.00", "fee_estimated": "363.00", "failure_reason": null, "customer_charged": "10363.00", "fee_bearer": "customer", "metadata": { "order_id": "77812" } }, { "id": "txn_Tn6Bq3WkP8rV2mX9cLd4Jh", "livemode": true, "type": "transfer_out", "status": "success", "wallet_id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "currency": "UGX", "amount": "50000.00", "net": "-50700.00", "reference": "p2p-90311", "description": "Send 50k to John", "created_at": "2026-10-04T16:11:40+03:00", "completed_at": "2026-10-04T16:11:40+03:00", "counterparty_wallet_id": "wal_Pt7Kc2NxW9mQ4vR8bLd3Hy", "fee": "200.00", "merchant_fee": "500.00", "metadata": null } ], "has_more": true } } ``` Source: https://morzepay.com/docs/api/wallet-transactions --- # Quote fees `POST https://morzepay.com/v1/quotes` POST`/v1/quotes` Shows what a collection, payout or transfer will cost before you make it, and whether the wallet can cover it. Nothing is created. Permission`wallets:read` ### Body JSON, with `Content-Type: application/json`. `type`stringrequired `deposit`, `payout` or `transfer`. `wallet_id`stringrequired The wallet that would receive the collection, or send the payout or transfer. `amount`integerrequired Whole UGX. `msisdn`string Payouts: the recipient’s number, for the exact fee on their network. `fee_bearer`string Collections: `wallet` or `customer`. Defaults to the wallet’s setting. `fee`integer Transfers: your own fee, to see the total. ### Returns The numbers for that kind of payment: | type | Fields | | deposit | customer_charged, fee_percent, fees, estimated_net | | payout | estimated_fees, amount_held, wallet_balance, sufficient_funds, weekly_limit_remaining (live only) | | transfer | transfer_fee, merchant_fee, total_debited, wallet_balance, sufficient_funds | ## Example request ```bash curl -X POST "https://morzepay.com/v1/quotes" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "payout", "wallet_id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "amount": 20000, "msisdn": "+256771234567" }' ``` ## Example response (200) ```json { "success": true, "data": { "type": "payout", "amount": "20000.00", "estimated_fees": "1100.00", "amount_held": "21100.00", "wallet_balance": "48500.00", "sufficient_funds": true, "weekly_limit_remaining": "1850000.00" } } ``` Source: https://morzepay.com/docs/api/create-quote --- # Collect a payment `POST https://morzepay.com/v1/deposits` POST`/v1/deposits` Asks a customer to pay. Morzepay sends a prompt to their phone; the wallet is credited only after they approve it with their PIN and the network confirms. The answer comes back straight away with `status: "processing"`. Wait for the `deposit.succeeded` or `deposit.failed` [webhook](https://morzepay.com/docs/api/webhooks), or check the [transaction](https://morzepay.com/docs/api/get-transaction). Permission`deposits:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Body JSON, with `Content-Type: application/json`. `wallet_id`stringrequired The wallet to credit. `msisdn`stringrequired The payer’s number. `+256771234567`, `256771234567` and `0771234567` all work. `amount`integerrequired Whole UGX, from 500 to 5,000,000. `reference`stringrequired Your own unique reference, 8–36 characters, such as your order id. Using it twice returns `409 DUPLICATE_REFERENCE`. `fee_bearer`string `wallet`: the customer is asked for `amount`, and the wallet receives it minus the fee. `customer`: the fee is added to what the customer is asked for. Defaults to the wallet’s setting. `description`string Up to 100 characters. Shown in your dashboard. `metadata`object Up to 20 keys of your own, with simple values. Returned on the object and in webhooks. ### Returns A transaction with `type: "deposit"`. `customer_charged` is what the customer is asked for. `fee_estimated` is known now; `fee` and `net` are set when it succeeds. ### Errors | Status | Code | When | | 409 | DUPLICATE_REFERENCE | You already used this reference. details.transaction_id is the first one. | | 409 | WALLET_NOT_ACTIVE | The wallet is frozen. | | 422 | VALIDATION_ERROR | A field is wrong, such as an amount outside 500–5,000,000 or a number that isn’t MTN or Airtel. | | 429 | MSISDN_RATE_LIMITED | This number already had 5 payment requests in 10 minutes. Wait details.retry_after_seconds. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ### Statuses | Status | Meaning | | processing | The prompt is on the customer’s phone. | | success | Paid. The wallet has net more. | | failed | Declined, timed out or cancelled. See failure_reason. | | review | The network reported something unexpected, such as a different amount. Our team is checking it, and nothing is credited until it’s resolved. | Rather not build the payment screen yourself? A [checkout session](https://morzepay.com/docs/api/create-checkout) gives you a hosted page that handles the prompt, waiting, retries and the receipt. ## Example request ```bash curl -X POST "https://morzepay.com/v1/deposits" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order-77812" \ -d '{ "wallet_id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "msisdn": "+256771234567", "amount": 10000, "reference": "order-77812", "fee_bearer": "customer", "description": "Order 77812", "metadata": { "order_id": "77812" } }' ``` ## Example response (201) ```json { "success": true, "data": { "id": "txn_Rk3Lp9WmQ2vX7bN4cTz8Hd", "livemode": true, "type": "deposit", "status": "processing", "wallet_id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "currency": "UGX", "amount": "10000.00", "net": null, "reference": "order-77812", "description": "Order 77812", "created_at": "2026-10-04T14:07:22+03:00", "completed_at": null, "msisdn": "+256771234567", "provider": "MTN_UGANDA", "provider_transaction_id": null, "fee": null, "fee_estimated": "363.00", "failure_reason": null, "customer_charged": "10363.00", "fee_bearer": "customer", "metadata": { "order_id": "77812" } } } ``` Source: https://morzepay.com/docs/api/create-deposit --- # Send a payout `POST https://morzepay.com/v1/payouts` POST`/v1/payouts` Sends money from a wallet to an MTN or Airtel number. The wallet pays the network fee. Before sending, Morzepay holds the amount plus an estimated fee with a small margin (`amount_held`). When the payout succeeds, the real fee is charged and the rest of the hold goes back. If it fails, the whole hold goes back. Permission`payouts:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Body JSON, with `Content-Type: application/json`. `wallet_id`stringrequired The wallet, such as `wal_Zq4Hn8YtV2kPm6RbX3cLw9`. `msisdn`stringrequired The recipient’s number. `amount`integerrequired Whole UGX, from 500 to 5,000,000. `reference`stringrequired Your own unique reference, 8–36 characters, such as your order id. Using it twice returns `409 DUPLICATE_REFERENCE`. `description`string Up to 100 characters. Shown in your dashboard. `metadata`object Up to 20 keys of your own, with simple values. Returned on the object and in webhooks. ### Returns A transaction with `type: "payout"` and `amount_held`. ### Errors | Status | Code | When | | 402 | INSUFFICIENT_FUNDS | The wallet can’t cover the amount plus the estimated fee. Nothing was sent. | | 403 | IP_NOT_ALLOWED | Live keys that send payouts only work from their allowed IPs. | | 403 | WEEKLY_LIMIT_REACHED | This would go over your 7-day live payout limit. details.remaining shows what’s left. | | 409 | DUPLICATE_REFERENCE | You already used this reference. | | 429 | MSISDN_RATE_LIMITED | Too many payment requests to this number in 10 minutes. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). A payout is never marked failed just because the network is slow. If the outcome is unclear, it stays `processing` until the network confirms, and moves to `review` after 24 hours. Don’t send it again with a new reference while it’s processing. ## Example request ```bash curl -X POST "https://morzepay.com/v1/payouts" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: withdraw-5521" \ -d '{ "wallet_id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "msisdn": "+256701234567", "amount": 20000, "reference": "withdraw-5521", "description": "Shop withdrawal" }' ``` ## Example response (201) ```json { "success": true, "data": { "id": "txn_Wp2Kd7XnQ9mR4tB8vLc3Fs", "livemode": true, "type": "payout", "status": "processing", "wallet_id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "currency": "UGX", "amount": "20000.00", "net": null, "reference": "withdraw-5521", "description": "Shop withdrawal", "created_at": "2026-10-04T15:02:10+03:00", "completed_at": null, "msisdn": "+256701234567", "provider": "AIRTEL_UGANDA", "provider_transaction_id": null, "fee": null, "fee_estimated": "1100.00", "failure_reason": null, "amount_held": "21100.00", "metadata": null } } ``` Source: https://morzepay.com/docs/api/create-payout --- # Transfer between wallets `POST https://morzepay.com/v1/transfers` POST`/v1/transfers` Moves money between two wallets in your business, instantly. The sending wallet pays the UGX 200 transfer fee on top of the amount, plus any fee you add for yourself. Permission`transfers:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Body JSON, with `Content-Type: application/json`. `from_wallet_id`stringrequired The wallet to take the money from. `to_wallet_id`stringrequired The wallet to put it in. `amount`integerrequired Whole UGX, from 1 to 50,000,000. `reference`stringrequired Your own unique reference, 8–36 characters, such as your order id. Using it twice returns `409 DUPLICATE_REFERENCE`. `fee`integer Your own fee, charged to the sender on top of `amount`. For example, a 1% fee on a peer-to-peer transfer. `fee_wallet_id`string Where your fee goes. Defaults to the sender’s main wallet. `description`string Up to 100 characters. Shown in your dashboard. `metadata`object Up to 20 keys of your own, with simple values. Returned on the object and in webhooks. ### Returns The sender’s `transfer_out` transaction, already `success`. `fee` is the transfer fee and `merchant_fee` your own fee; `net` is the total taken from the sender. The receiver gets a matching `transfer_in`, and your fee wallet a `fee_in`. ### Errors | Status | Code | When | | 402 | INSUFFICIENT_FUNDS | The sender can’t cover the amount and fees. | | 409 | DUPLICATE_REFERENCE | You already used this reference. | | 422 | MODE_MISMATCH | One wallet is test and the other live. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/transfers" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: p2p-90311" \ -d '{ "from_wallet_id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "to_wallet_id": "wal_Pt7Kc2NxW9mQ4vR8bLd3Hy", "amount": 50000, "fee": 500, "reference": "p2p-90311", "description": "Send 50k to John" }' ``` ## Example response (201) ```json { "success": true, "data": { "id": "txn_Tn6Bq3WkP8rV2mX9cLd4Jh", "livemode": true, "type": "transfer_out", "status": "success", "wallet_id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "currency": "UGX", "amount": "50000.00", "net": "-50700.00", "reference": "p2p-90311", "description": "Send 50k to John", "created_at": "2026-10-04T16:11:40+03:00", "completed_at": "2026-10-04T16:11:40+03:00", "counterparty_wallet_id": "wal_Pt7Kc2NxW9mQ4vR8bLd3Hy", "fee": "200.00", "merchant_fee": "500.00", "metadata": null } } ``` Source: https://morzepay.com/docs/api/create-transfer --- # Verify a phone number `POST https://morzepay.com/v1/msisdn/validate` POST`/v1/msisdn/validate` Looks up the name registered on a mobile money number, so your customer can check who they’re paying, or you can check a payout recipient before you send. MTN and Airtel Uganda. Permission`msisdn:validate` ### Body JSON, with `Content-Type: application/json`. `msisdn`stringrequired The phone number. `+256771234567`, `256771234567` and `0771234567` all work. MTN and Airtel Uganda. ### Returns `valid` is `true` when the number is a registered mobile money account, with `customer_name`. When it isn’t, `message` says why. ### Errors | Status | Code | When | | 429 | RATE_LIMITED | More than 30 lookups in a minute with this key. | | 503 | PROVIDER_UNAVAILABLE | Lookups are briefly unavailable. Try again shortly. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/msisdn/validate" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -d '{ "msisdn": "0771234567" }' ``` ## Example response (200) ```json { "success": true, "data": { "msisdn": "+256771234567", "valid": true, "customer_name": "JOHN DOE", "provider": "MTN_UGANDA", "message": null } } ``` Source: https://morzepay.com/docs/api/validate-number --- # Get a transaction `GET https://morzepay.com/v1/transactions/{transaction_id}` GET`/v1/transactions/{transaction_id}` Returns one transaction. If you can’t receive webhooks, use this to check on a payment: every 10 to 30 seconds is plenty. Permission`transactions:read` ### Path parameters `transaction_id`stringrequired The transaction, such as `txn_Rk3Lp9WmQ2vX7bN4cTz8Hd`. ### Returns A transaction. The fields depend on its `type`: `type`string `deposit`, `payout`, `transfer_out`, `transfer_in` or `fee_in`. `status`string `pending`, `processing`, `success`, `failed` or `review`. `amount`string The amount asked for or sent. `net`string | null The final change to the wallet’s balance: positive for money in, negative for money out. Set when it succeeds. `fee_estimated`string Collections and payouts: the fee as estimated when it was created. `fee`string | null The final fee. Collections and payouts: once it succeeds. Transfers: the transfer fee. `customer_charged`string Collections: what the customer was asked to pay. `amount_held`string Payouts: what was set aside before sending. `provider`string `MTN_UGANDA` or `AIRTEL_UGANDA`. `provider_transaction_id`string | null The network’s own reference, also on the customer’s SMS. `failure_reason`string | null Why it failed or is in review. `counterparty_wallet_id`string Transfers: the other wallet. ## Example request ```bash curl "https://morzepay.com/v1/transactions/txn_Rk3Lp9WmQ2vX7bN4cTz8Hd" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "txn_Rk3Lp9WmQ2vX7bN4cTz8Hd", "livemode": true, "type": "deposit", "status": "success", "wallet_id": "wal_Zq4Hn8YtV2kPm6RbX3cLw9", "currency": "UGX", "amount": "10000.00", "net": "10000.00", "reference": "order-77812", "description": "Order 77812", "created_at": "2026-10-04T14:07:22+03:00", "completed_at": "2026-10-04T14:07:51+03:00", "msisdn": "+256771234567", "provider": "MTN_UGANDA", "provider_transaction_id": "29876543210", "fee": "363.00", "fee_estimated": "363.00", "failure_reason": null, "customer_charged": "10363.00", "fee_bearer": "customer", "metadata": { "order_id": "77812" } } } ``` Source: https://morzepay.com/docs/api/get-transaction --- # Create an invoice `POST https://morzepay.com/v1/invoices` POST`/v1/invoices` Creates an invoice. By default it’s a draft: finalize it to give it a number and a payment link, or send it straight away with `send: true`. Your customer pays on the hosted page with MTN Mobile Money or Airtel Money and gets a receipt. Permission`invoices:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Body JSON, with `Content-Type: application/json`. `customer`objectrequired Who you are billing. Show child attributes `name`stringrequired The customer’s name. `email`string Needed to email the invoice and the receipt. `phone`string Needed to text the invoice. It also fills in the payment page. `address`string Printed on the invoice. `items`arrayrequired Up to 50 lines. Show child attributes `description`stringrequired What the line is for. `quantity`integerrequired How many. `unit_amount`integerrequired The price of one, in whole UGX. `tax_percent`number Tax on the subtotal, such as `18` for VAT. Rounded to the nearest shilling. `due_date`string A date such as `2026-11-30`. Or use `days_until_due`. `days_until_due`integer Days from today. Defaults to your invoice settings (14 days unless you changed it). `wallet_id`string Where payments land. Defaults to your main wallet. `fee_bearer`string `wallet` or `customer`. With `customer`, the collection fee is added on the payment page and the wallet receives the full total. `memo`string A note on the invoice, up to 1,000 characters. `footer`string Small print at the bottom, up to 500 characters. `reference`string Your own unique id for the invoice, up to 64 characters. `metadata`object Up to 20 keys of your own, with simple values. Returned on the object and in webhooks. `finalize`boolean `true` gives it a number and payment link now. `send`boolean `true` finalizes it and sends it. `send_via`arraydefault: ["email"] `["email"]`, `["sms"]` or both. ### Returns The invoice. Once finalized, `hosted_invoice_url` is the payment link: share it anywhere. `invoice_pdf` downloads the PDF without a key. With `send`, `delivery` says what was sent. ### Errors | Status | Code | When | | 422 | INVALID_TOTAL | The total must be between UGX 500 and UGX 5,000,000 to be paid with mobile money. | | 422 | NO_CUSTOMER_EMAIL | You asked to email it, but there’s no customer.email. | | 422 | NO_CUSTOMER_PHONE | You asked to text it, but there’s no customer.phone. | | 409 | DUPLICATE_REFERENCE | Another invoice already has this reference. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/invoices" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: inv-order-1001" \ -d '{ "customer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "0772418905" }, "items": [ { "description": "Website design (5 pages)", "quantity": 1, "unit_amount": 450000 }, { "description": "Hosting, 12 months", "quantity": 2, "unit_amount": 75000 } ], "tax_percent": 18, "days_until_due": 14, "reference": "order-1001", "send": true }' ``` ## Example response (201) ```json { "success": true, "data": { "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "object": "invoice", "livemode": true, "number": "NILE-0001", "status": "open", "past_due": false, "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "currency": "UGX", "customer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "+256772418905", "address": null }, "lines": [ { "description": "Website design (5 pages)", "quantity": 1, "unit_amount": "450000.00", "amount": "450000.00" }, { "description": "Hosting, 12 months", "quantity": 2, "unit_amount": "75000.00", "amount": "150000.00" } ], "subtotal": "600000.00", "tax_percent": 18, "tax": "108000.00", "total": "708000.00", "amount_paid": "0.00", "amount_due": "708000.00", "fee_bearer": "wallet", "due_date": "2026-10-18", "memo": null, "footer": null, "reference": "order-1001", "metadata": null, "hosted_invoice_url": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715", "invoice_pdf": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715/pdf", "receipt_id": null, "receipt_url": null, "transaction_id": null, "paid_out_of_band": false, "created_at": "2026-10-04T10:00:12+03:00", "finalized_at": "2026-10-04T10:00:12+03:00", "sent_at": "2026-10-04T10:00:13+03:00", "paid_at": null, "voided_at": null, "delivery": { "email": true, "sms": null } } } ``` Source: https://morzepay.com/docs/api/create-invoice --- # List invoices `GET https://morzepay.com/v1/invoices` GET`/v1/invoices` Returns your invoices, newest first. Permission`invoices:read` ### Query parameters `status`string `draft`, `open`, `paid`, `void` or `uncollectible`. `customer_email`string Only invoices for this email address. `reference`string The invoice with this reference of yours. `limit`integerdefault: 25 How many items to return, 1 to 100. `starting_after`string An `id` from the previous page. Returns the items after it. ### Returns A list of invoices. ## Example request ```bash curl "https://morzepay.com/v1/invoices?status=open&limit=25" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "items": [ { "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "object": "invoice", "livemode": true, "number": "NILE-0001", "status": "open", "past_due": false, "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "currency": "UGX", "customer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "+256772418905", "address": null }, "lines": [ { "description": "Website design (5 pages)", "quantity": 1, "unit_amount": "450000.00", "amount": "450000.00" }, { "description": "Hosting, 12 months", "quantity": 2, "unit_amount": "75000.00", "amount": "150000.00" } ], "subtotal": "600000.00", "tax_percent": 18, "tax": "108000.00", "total": "708000.00", "amount_paid": "0.00", "amount_due": "708000.00", "fee_bearer": "wallet", "due_date": "2026-10-18", "memo": null, "footer": null, "reference": "order-1001", "metadata": null, "hosted_invoice_url": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715", "invoice_pdf": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715/pdf", "receipt_id": null, "receipt_url": null, "transaction_id": null, "paid_out_of_band": false, "created_at": "2026-10-04T10:00:12+03:00", "finalized_at": "2026-10-04T10:00:12+03:00", "sent_at": "2026-10-04T10:00:13+03:00", "paid_at": null, "voided_at": null } ], "has_more": true } } ``` Source: https://morzepay.com/docs/api/list-invoices --- # Get an invoice `GET https://morzepay.com/v1/invoices/{invoice_id}` GET`/v1/invoices/{invoice_id}` Returns one invoice, with `payments`: each attempt to pay it on the hosted page, with its status, payer and transaction. Permission`invoices:read` ### Path parameters `invoice_id`stringrequired The invoice, such as `inv_UfwyBh1W4Jfa6iG2u2AVT3`. ### Returns The invoice. `past_due` is `true` for open invoices after their due date. When paid, `receipt_url` links to the receipt. ### Statuses | Status | Meaning | | draft | Being prepared. No number, no payment link. | | open | Finalized and waiting for payment. Its content is fixed. | | paid | Paid on the hosted page, or recorded as paid. Final. | | void | Cancelled. Final. | | uncollectible | Written off, but it can still be paid. | ## Example request ```bash curl "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "object": "invoice", "livemode": true, "number": "NILE-0001", "status": "open", "past_due": false, "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "currency": "UGX", "customer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "+256772418905", "address": null }, "lines": [ { "description": "Website design (5 pages)", "quantity": 1, "unit_amount": "450000.00", "amount": "450000.00" }, { "description": "Hosting, 12 months", "quantity": 2, "unit_amount": "75000.00", "amount": "150000.00" } ], "subtotal": "600000.00", "tax_percent": 18, "tax": "108000.00", "total": "708000.00", "amount_paid": "0.00", "amount_due": "708000.00", "fee_bearer": "wallet", "due_date": "2026-10-18", "memo": null, "footer": null, "reference": "order-1001", "metadata": null, "hosted_invoice_url": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715", "invoice_pdf": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715/pdf", "receipt_id": null, "receipt_url": null, "transaction_id": null, "paid_out_of_band": false, "created_at": "2026-10-04T10:00:12+03:00", "finalized_at": "2026-10-04T10:00:12+03:00", "sent_at": "2026-10-04T10:00:13+03:00", "paid_at": null, "voided_at": null, "payments": [] } } ``` Source: https://morzepay.com/docs/api/get-invoice --- # Update a draft `POST https://morzepay.com/v1/invoices/{invoice_id}` POST`/v1/invoices/{invoice_id}` Changes a draft. Send only the fields you want to change; they take the same values as in [Create an invoice](https://morzepay.com/docs/api/create-invoice). Once an invoice is finalized, only `metadata` can change: to change anything else, void it and create a new one. Permission`invoices:write` ### Path parameters `invoice_id`stringrequired The invoice, such as `inv_UfwyBh1W4Jfa6iG2u2AVT3`. ### Body JSON, with `Content-Type: application/json`. `customer`object Replaces the customer. Show child attributes `name`stringrequired The customer’s name. `email`string Needed to email the invoice and the receipt. `phone`string Needed to text the invoice. It also fills in the payment page. `address`string Printed on the invoice. `items`array Replaces all the lines. Show child attributes `description`stringrequired What the line is for. `quantity`integerrequired How many. `unit_amount`integerrequired The price of one, in whole UGX. `tax_percent`number `due_date`string `days_until_due`integer `wallet_id`string `fee_bearer`string `memo`string `footer`string `reference`string `metadata`object Up to 20 keys of your own, with simple values. Returned on the object and in webhooks. ### Returns The updated invoice. ### Errors | Status | Code | When | | 409 | INVOICE_NOT_DRAFT | Only drafts can be edited (except metadata). | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -d '{ "memo": "Thank you for your business.", "days_until_due": 30 }' ``` ## Example response (200) ```json { "success": true, "data": { "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "object": "invoice", "livemode": true, "number": null, "status": "draft", "past_due": false, "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "currency": "UGX", "customer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "+256772418905", "address": null }, "lines": [ { "description": "Website design (5 pages)", "quantity": 1, "unit_amount": "450000.00", "amount": "450000.00" }, { "description": "Hosting, 12 months", "quantity": 2, "unit_amount": "75000.00", "amount": "150000.00" } ], "subtotal": "600000.00", "tax_percent": 18, "tax": "108000.00", "total": "708000.00", "amount_paid": "0.00", "amount_due": "708000.00", "fee_bearer": "wallet", "due_date": "2026-11-03", "memo": "Thank you for your business.", "footer": null, "reference": "order-1001", "metadata": null, "hosted_invoice_url": null, "invoice_pdf": null, "receipt_id": null, "receipt_url": null, "transaction_id": null, "paid_out_of_band": false, "created_at": "2026-10-04T10:00:12+03:00", "finalized_at": null, "sent_at": null, "paid_at": null, "voided_at": null } } ``` Source: https://morzepay.com/docs/api/update-invoice --- # Finalize an invoice `POST https://morzepay.com/v1/invoices/{invoice_id}/finalize` POST`/v1/invoices/{invoice_id}/finalize` Gives a draft its number and payment link, and opens it for payment. Its content is then fixed. The total must be between UGX 500 and UGX 5,000,000. Permission`invoices:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Path parameters `invoice_id`stringrequired The invoice, such as `inv_UfwyBh1W4Jfa6iG2u2AVT3`. ### Returns The invoice, now `open`, with `number`, `hosted_invoice_url` and `invoice_pdf`. ### Errors | Status | Code | When | | 409 | INVOICE_NOT_DRAFT | It’s already finalized. | | 422 | INVALID_TOTAL | The total is outside UGX 500–5,000,000. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3/finalize" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "object": "invoice", "livemode": true, "number": "NILE-0001", "status": "open", "past_due": false, "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "currency": "UGX", "customer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "+256772418905", "address": null }, "lines": [ { "description": "Website design (5 pages)", "quantity": 1, "unit_amount": "450000.00", "amount": "450000.00" }, { "description": "Hosting, 12 months", "quantity": 2, "unit_amount": "75000.00", "amount": "150000.00" } ], "subtotal": "600000.00", "tax_percent": 18, "tax": "108000.00", "total": "708000.00", "amount_paid": "0.00", "amount_due": "708000.00", "fee_bearer": "wallet", "due_date": "2026-10-18", "memo": null, "footer": null, "reference": "order-1001", "metadata": null, "hosted_invoice_url": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715", "invoice_pdf": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715/pdf", "receipt_id": null, "receipt_url": null, "transaction_id": null, "paid_out_of_band": false, "created_at": "2026-10-04T10:00:12+03:00", "finalized_at": "2026-10-04T10:00:12+03:00", "sent_at": null, "paid_at": null, "voided_at": null } } ``` Source: https://morzepay.com/docs/api/finalize-invoice --- # Send an invoice `POST https://morzepay.com/v1/invoices/{invoice_id}/send` POST`/v1/invoices/{invoice_id}/send` Emails the invoice as a PDF with a pay button, texts the payment link, or both. Drafts are finalized first. Send it again to remind your customer: they get the same link. Permission`invoices:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Path parameters `invoice_id`stringrequired The invoice, such as `inv_UfwyBh1W4Jfa6iG2u2AVT3`. ### Body JSON, with `Content-Type: application/json`. `via`arraydefault: ["email"] `["email"]`, `["sms"]` or both. ### Returns The invoice, with `delivery`: `true` for each way it was sent. ### Errors | Status | Code | When | | 409 | INVOICE_NOT_OPEN | It’s already paid or void. Paid invoices have a receipt instead. | | 422 | NO_CUSTOMER_EMAIL | No email address to send it to. | | 422 | NO_CUSTOMER_PHONE | No phone number to text it to. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3/send" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -d '{ "via": [ "email", "sms" ] }' ``` ## Example response (200) ```json { "success": true, "data": { "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "object": "invoice", "livemode": true, "number": "NILE-0001", "status": "open", "past_due": false, "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "currency": "UGX", "customer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "+256772418905", "address": null }, "lines": [ { "description": "Website design (5 pages)", "quantity": 1, "unit_amount": "450000.00", "amount": "450000.00" }, { "description": "Hosting, 12 months", "quantity": 2, "unit_amount": "75000.00", "amount": "150000.00" } ], "subtotal": "600000.00", "tax_percent": 18, "tax": "108000.00", "total": "708000.00", "amount_paid": "0.00", "amount_due": "708000.00", "fee_bearer": "wallet", "due_date": "2026-10-18", "memo": null, "footer": null, "reference": "order-1001", "metadata": null, "hosted_invoice_url": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715", "invoice_pdf": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715/pdf", "receipt_id": null, "receipt_url": null, "transaction_id": null, "paid_out_of_band": false, "created_at": "2026-10-04T10:00:12+03:00", "finalized_at": "2026-10-04T10:00:12+03:00", "sent_at": "2026-10-04T10:00:13+03:00", "paid_at": null, "voided_at": null, "delivery": { "email": true, "sms": true } } } ``` Source: https://morzepay.com/docs/api/send-invoice --- # Record an outside payment `POST https://morzepay.com/v1/invoices/{invoice_id}/pay` POST`/v1/invoices/{invoice_id}/pay` Records a payment you received outside Morzepay, such as cash or a bank transfer. The invoice becomes `paid` and a receipt is issued. Your wallet balance doesn’t change. Customers pay open invoices themselves on `hosted_invoice_url`; you don’t call this for those. Permission`invoices:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Path parameters `invoice_id`stringrequired The invoice, such as `inv_UfwyBh1W4Jfa6iG2u2AVT3`. ### Body JSON, with `Content-Type: application/json`. `paid_out_of_band`booleanrequired Must be `true`. `note`string How it was paid, up to 255 characters, such as `Cash at the shop`. `email_receipt`boolean `true` emails the receipt to the customer. ### Returns The paid invoice, with `receipt_id`, `receipt_url` and `payments`. ### Errors | Status | Code | When | | 409 | INVALID_INVOICE_STATUS | It isn’t open or uncollectible. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3/pay" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: cash-nile-0001" \ -d '{ "paid_out_of_band": true, "note": "Cash at the shop", "email_receipt": true }' ``` ## Example response (200) ```json { "success": true, "data": { "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "object": "invoice", "livemode": true, "number": "NILE-0001", "status": "paid", "past_due": false, "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "currency": "UGX", "customer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "+256772418905", "address": null }, "lines": [ { "description": "Website design (5 pages)", "quantity": 1, "unit_amount": "450000.00", "amount": "450000.00" }, { "description": "Hosting, 12 months", "quantity": 2, "unit_amount": "75000.00", "amount": "150000.00" } ], "subtotal": "600000.00", "tax_percent": 18, "tax": "108000.00", "total": "708000.00", "amount_paid": "708000.00", "amount_due": "0.00", "fee_bearer": "wallet", "due_date": "2026-10-18", "memo": null, "footer": null, "reference": "order-1001", "metadata": null, "hosted_invoice_url": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715", "invoice_pdf": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715/pdf", "receipt_id": "rcpt_WDL1pxuSr3cCcrFL1im2Th", "receipt_url": "https://morzepay.com/r/5c0e0f50a1b2c3d4e5f60718293a4b5c", "transaction_id": null, "paid_out_of_band": true, "created_at": "2026-10-04T10:00:12+03:00", "finalized_at": "2026-10-04T10:00:12+03:00", "sent_at": "2026-10-04T10:00:13+03:00", "paid_at": "2026-10-06T11:24:05+03:00", "voided_at": null, "payments": [] } } ``` Source: https://morzepay.com/docs/api/pay-invoice --- # Void an invoice `POST https://morzepay.com/v1/invoices/{invoice_id}/void` POST`/v1/invoices/{invoice_id}/void` Cancels an open or uncollectible invoice. It’s kept for your records, and its payment page tells the customer it was cancelled. This can’t be undone. Permission`invoices:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Path parameters `invoice_id`stringrequired The invoice, such as `inv_UfwyBh1W4Jfa6iG2u2AVT3`. ### Returns The invoice, now `void`. ### Errors | Status | Code | When | | 409 | INVALID_INVOICE_STATUS | It’s a draft (delete it instead), or already paid or void. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3/void" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "object": "invoice", "livemode": true, "number": "NILE-0001", "status": "void", "past_due": false, "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "currency": "UGX", "customer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "+256772418905", "address": null }, "lines": [ { "description": "Website design (5 pages)", "quantity": 1, "unit_amount": "450000.00", "amount": "450000.00" }, { "description": "Hosting, 12 months", "quantity": 2, "unit_amount": "75000.00", "amount": "150000.00" } ], "subtotal": "600000.00", "tax_percent": 18, "tax": "108000.00", "total": "708000.00", "amount_paid": "0.00", "amount_due": "708000.00", "fee_bearer": "wallet", "due_date": "2026-10-18", "memo": null, "footer": null, "reference": "order-1001", "metadata": null, "hosted_invoice_url": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715", "invoice_pdf": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715/pdf", "receipt_id": null, "receipt_url": null, "transaction_id": null, "paid_out_of_band": false, "created_at": "2026-10-04T10:00:12+03:00", "finalized_at": "2026-10-04T10:00:12+03:00", "sent_at": "2026-10-04T10:00:13+03:00", "paid_at": null, "voided_at": "2026-10-07T08:15:00+03:00" } } ``` Source: https://morzepay.com/docs/api/void-invoice --- # Mark uncollectible `POST https://morzepay.com/v1/invoices/{invoice_id}/mark_uncollectible` POST`/v1/invoices/{invoice_id}/mark_uncollectible` Writes off an open invoice you don’t expect to be paid. The customer can still pay it, and you can still void it. Permission`invoices:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Path parameters `invoice_id`stringrequired The invoice, such as `inv_UfwyBh1W4Jfa6iG2u2AVT3`. ### Returns The invoice, now `uncollectible`. ### Errors | Status | Code | When | | 409 | INVALID_INVOICE_STATUS | It isn’t open. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3/mark_uncollectible" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "object": "invoice", "livemode": true, "number": "NILE-0001", "status": "uncollectible", "past_due": true, "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "currency": "UGX", "customer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "+256772418905", "address": null }, "lines": [ { "description": "Website design (5 pages)", "quantity": 1, "unit_amount": "450000.00", "amount": "450000.00" }, { "description": "Hosting, 12 months", "quantity": 2, "unit_amount": "75000.00", "amount": "150000.00" } ], "subtotal": "600000.00", "tax_percent": 18, "tax": "108000.00", "total": "708000.00", "amount_paid": "0.00", "amount_due": "708000.00", "fee_bearer": "wallet", "due_date": "2026-10-18", "memo": null, "footer": null, "reference": "order-1001", "metadata": null, "hosted_invoice_url": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715", "invoice_pdf": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715/pdf", "receipt_id": null, "receipt_url": null, "transaction_id": null, "paid_out_of_band": false, "created_at": "2026-10-04T10:00:12+03:00", "finalized_at": "2026-10-04T10:00:12+03:00", "sent_at": "2026-10-04T10:00:13+03:00", "paid_at": null, "voided_at": null } } ``` Source: https://morzepay.com/docs/api/mark-uncollectible --- # Delete a draft `DELETE https://morzepay.com/v1/invoices/{invoice_id}` DELETE`/v1/invoices/{invoice_id}` Deletes a draft for good. Finalized invoices can’t be deleted: void them instead. Permission`invoices:write` ### Path parameters `invoice_id`stringrequired The invoice, such as `inv_UfwyBh1W4Jfa6iG2u2AVT3`. ### Returns Confirmation that it was deleted. ### Errors | Status | Code | When | | 409 | INVOICE_NOT_DRAFT | It has been finalized. Void it instead. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X DELETE "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "object": "invoice", "deleted": true } } ``` Source: https://morzepay.com/docs/api/delete-invoice --- # Download the PDF `GET https://morzepay.com/v1/invoices/{invoice_id}/pdf` GET`/v1/invoices/{invoice_id}/pdf` Downloads a finalized invoice as a PDF. The answer is the file itself, with `Content-Type: application/pdf`. To give the PDF to someone without a key, share the invoice’s `invoice_pdf` link instead. Permission`invoices:read` ### Path parameters `invoice_id`stringrequired The invoice, such as `inv_UfwyBh1W4Jfa6iG2u2AVT3`. ### Returns The PDF file. ## Example request ```bash curl "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3/pdf" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -o NILE-0001.pdf ``` ## Example response (200) ```json %PDF-1.4 (binary file: application/pdf) ``` Source: https://morzepay.com/docs/api/invoice-pdf --- # Create a checkout session `POST https://morzepay.com/v1/checkout/sessions` POST`/v1/checkout/sessions` Creates a hosted payment page for an order. Send your customer to its `url`; the page asks for their number, sends the prompt, waits, lets them retry and gives them a receipt. When they’ve paid, we send them to your `success_url`. With `reusable: true` it becomes a [payment page](https://morzepay.com/docs/payment-pages) that takes any number of payments until you expire it. Permission`checkout:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Body JSON, with `Content-Type: application/json`. `line_items`array What they’re paying for, like invoice lines. Give these or `amount`. Show child attributes `description`stringrequired What the line is for. `quantity`integerrequired How many. `unit_amount`integerrequired The price of one, in whole UGX. `amount`integer A single amount in UGX, instead of `line_items`. Needs `title`. `title`string What’s being paid for. Required with `amount`; defaults to the first line. `description`string Text under the title. `success_url`string Where to send the customer after paying. `{CHECKOUT_SESSION_ID}` is replaced with the session id. `cancel_url`string Shown as a back arrow on the page. `reference`string Your order id. Returned on the session and in webhooks. `customer`object Fills in the page for them. Show child attributes `name`string `email`string `phone`string `require_email`boolean Make the email field required, so they always get a receipt. `require_name`boolean Make the name field required. `allow_custom_amount`boolean Let the customer type the amount, for donations, fees and top-ups. `min_amount`integer The lowest amount they may type. `reusable`booleandefault: false `true`: a link that takes any number of payments until you expire it. `false`: one payment, then `complete`. `expires_in_minutes`integerdefault: 1440 One-time sessions only. 30 to 10,080. `wallet_id`string Where payments land. Defaults to your main wallet. `fee_bearer`string `wallet` or `customer`. `metadata`object Up to 20 keys of your own, with simple values. Returned on the object and in webhooks. ### Returns The checkout session, with its `url`. ### Errors | Status | Code | When | | 422 | VALIDATION_ERROR | For example, neither line_items nor amount, or a total outside UGX 500–5,000,000. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). Don’t ship an order just because the customer arrived at your `success_url`: anyone can open that address. Confirm with the `checkout.session.completed` webhook, or by [getting the session](https://morzepay.com/docs/api/get-checkout) and checking that its status is `complete`. ## Example request ```bash curl -X POST "https://morzepay.com/v1/checkout/sessions" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order-77812" \ -d '{ "title": "Order #77812", "line_items": [ { "description": "Rolex combo", "quantity": 2, "unit_amount": 7000 } ], "reference": "order-77812", "success_url": "https://yourshop.ug/thanks?session={CHECKOUT_SESSION_ID}", "cancel_url": "https://yourshop.ug/cart" }' ``` ## Example response (201) ```json { "success": true, "data": { "id": "cs_J9WN4dg0YnY6VjMMwq0kL1", "object": "checkout.session", "livemode": true, "status": "open", "reusable": false, "url": "https://morzepay.com/c/83513594a9ee455aacf23ca24eeff21b", "title": "Order #77812", "description": null, "line_items": [ { "description": "Rolex combo", "quantity": 2, "unit_amount": "7000.00", "amount": "14000.00" } ], "amount_total": "14000.00", "allow_custom_amount": false, "min_amount": null, "currency": "UGX", "fee_bearer": "wallet", "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "require_email": false, "require_name": false, "success_url": "https://yourshop.ug/thanks?session={CHECKOUT_SESSION_ID}", "cancel_url": "https://yourshop.ug/cart", "reference": "order-77812", "customer": { "name": null, "email": null, "phone": null }, "metadata": null, "payments_count": 0, "amount_collected": "0.00", "transaction_id": null, "receipt_id": null, "receipt_url": null, "expires_at": "2026-10-29T09:00:23+03:00", "completed_at": null, "created_at": "2026-10-28T09:00:23+03:00" } } ``` Source: https://morzepay.com/docs/api/create-checkout --- # List checkout sessions `GET https://morzepay.com/v1/checkout/sessions` GET`/v1/checkout/sessions` Returns your checkout sessions and payment pages, newest first. Permission`checkout:read` ### Query parameters `status`string `open`, `complete` or `expired`. `reference`string Only sessions with this reference of yours. `limit`integerdefault: 25 How many items to return, 1 to 100. `starting_after`string An `id` from the previous page. Returns the items after it. ### Returns A list of checkout sessions. ## Example request ```bash curl "https://morzepay.com/v1/checkout/sessions?status=complete&reference=order-77812" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "items": [ { "id": "cs_J9WN4dg0YnY6VjMMwq0kL1", "object": "checkout.session", "livemode": true, "status": "complete", "reusable": false, "url": "https://morzepay.com/c/83513594a9ee455aacf23ca24eeff21b", "title": "Order #77812", "description": null, "line_items": [ { "description": "Rolex combo", "quantity": 2, "unit_amount": "7000.00", "amount": "14000.00" } ], "amount_total": "14000.00", "allow_custom_amount": false, "min_amount": null, "currency": "UGX", "fee_bearer": "wallet", "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "require_email": false, "require_name": false, "success_url": "https://yourshop.ug/thanks?session={CHECKOUT_SESSION_ID}", "cancel_url": "https://yourshop.ug/cart", "reference": "order-77812", "customer": { "name": null, "email": null, "phone": null }, "metadata": null, "payments_count": 1, "amount_collected": "14000.00", "transaction_id": "txn_Rk3Lp9WmQ2vX7bN4cTz8Hd", "receipt_id": "rcpt_Gm4Tk8Wq2Nz6Lc3Vb7Xd9P", "receipt_url": "https://morzepay.com/r/9a8b7c6d5e4f30211a2b3c4d5e6f7a8b", "expires_at": "2026-10-29T09:00:23+03:00", "completed_at": "2026-10-28T09:03:40+03:00", "created_at": "2026-10-28T09:00:23+03:00" } ], "has_more": false } } ``` Source: https://morzepay.com/docs/api/list-checkouts --- # Get a checkout session `GET https://morzepay.com/v1/checkout/sessions/{session_id}` GET`/v1/checkout/sessions/{session_id}` Returns one checkout session, with `payments`: every attempt to pay it. Permission`checkout:read` ### Path parameters `session_id`stringrequired The checkout session, such as `cs_J9WN4dg0YnY6VjMMwq0kL1`. ### Returns The session. `status` is `open`, `complete` (paid: see `transaction_id` and `receipt_url`) or `expired`. For payment pages, `payments_count` and `amount_collected` add up every payment. ## Example request ```bash curl "https://morzepay.com/v1/checkout/sessions/cs_J9WN4dg0YnY6VjMMwq0kL1" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "cs_J9WN4dg0YnY6VjMMwq0kL1", "object": "checkout.session", "livemode": true, "status": "complete", "reusable": false, "url": "https://morzepay.com/c/83513594a9ee455aacf23ca24eeff21b", "title": "Order #77812", "description": null, "line_items": [ { "description": "Rolex combo", "quantity": 2, "unit_amount": "7000.00", "amount": "14000.00" } ], "amount_total": "14000.00", "allow_custom_amount": false, "min_amount": null, "currency": "UGX", "fee_bearer": "wallet", "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "require_email": false, "require_name": false, "success_url": "https://yourshop.ug/thanks?session={CHECKOUT_SESSION_ID}", "cancel_url": "https://yourshop.ug/cart", "reference": "order-77812", "customer": { "name": null, "email": null, "phone": null }, "metadata": null, "payments_count": 1, "amount_collected": "14000.00", "transaction_id": "txn_Rk3Lp9WmQ2vX7bN4cTz8Hd", "receipt_id": "rcpt_Gm4Tk8Wq2Nz6Lc3Vb7Xd9P", "receipt_url": "https://morzepay.com/r/9a8b7c6d5e4f30211a2b3c4d5e6f7a8b", "expires_at": "2026-10-29T09:00:23+03:00", "completed_at": "2026-10-28T09:03:40+03:00", "created_at": "2026-10-28T09:00:23+03:00", "payments": [ { "id": "bpay_Hq8Nw3Lk2Vx7Rt4Bm9Pc6D", "object": "payment", "status": "success", "amount": "14000.00", "customer_charged": "14000.00", "payer": { "name": "John Okello", "email": null, "phone": "+256771234567" }, "transaction_id": "txn_Rk3Lp9WmQ2vX7bN4cTz8Hd", "receipt_id": "rcpt_Gm4Tk8Wq2Nz6Lc3Vb7Xd9P", "receipt_url": "https://morzepay.com/r/9a8b7c6d5e4f30211a2b3c4d5e6f7a8b", "failure_reason": null, "created_at": "2026-10-28T09:03:12+03:00", "settled_at": "2026-10-28T09:03:40+03:00" } ] } } ``` Source: https://morzepay.com/docs/api/get-checkout --- # Expire a checkout session `POST https://morzepay.com/v1/checkout/sessions/{session_id}/expire` POST`/v1/checkout/sessions/{session_id}/expire` Stops a checkout session or payment page from taking payments. Anyone who opens it sees that it has expired. Permission`checkout:write` ### Headers `Idempotency-Key`stringheader 8–80 letters, digits, `-` or `_`. Lets you retry safely: the same key and body return the first answer and never move money twice. See [Idempotency](https://morzepay.com/docs/api#idempotency). ### Path parameters `session_id`stringrequired The checkout session, such as `cs_J9WN4dg0YnY6VjMMwq0kL1`. ### Returns The session, now `expired`. ### Errors | Status | Code | When | | 409 | CHECKOUT_NOT_OPEN | It was already paid or expired. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl -X POST "https://morzepay.com/v1/checkout/sessions/cs_J9WN4dg0YnY6VjMMwq0kL1/expire" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "cs_J9WN4dg0YnY6VjMMwq0kL1", "object": "checkout.session", "livemode": true, "status": "expired", "reusable": false, "url": "https://morzepay.com/c/83513594a9ee455aacf23ca24eeff21b", "title": "Order #77812", "description": null, "line_items": [ { "description": "Rolex combo", "quantity": 2, "unit_amount": "7000.00", "amount": "14000.00" } ], "amount_total": "14000.00", "allow_custom_amount": false, "min_amount": null, "currency": "UGX", "fee_bearer": "wallet", "wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w", "require_email": false, "require_name": false, "success_url": "https://yourshop.ug/thanks?session={CHECKOUT_SESSION_ID}", "cancel_url": "https://yourshop.ug/cart", "reference": "order-77812", "customer": { "name": null, "email": null, "phone": null }, "metadata": null, "payments_count": 0, "amount_collected": "0.00", "transaction_id": null, "receipt_id": null, "receipt_url": null, "expires_at": "2026-10-29T09:00:23+03:00", "completed_at": null, "created_at": "2026-10-28T09:00:23+03:00" } } ``` Source: https://morzepay.com/docs/api/expire-checkout --- # Get a receipt `GET https://morzepay.com/v1/receipts/{receipt_id}` GET`/v1/receipts/{receipt_id}` Returns a receipt. Every payment on an invoice or checkout page gets one automatically. Each has a private `url` and `pdf` you can give your customer. Permission`transactions:read` ### Path parameters `receipt_id`stringrequired The receipt, such as `rcpt_WDL1pxuSr3cCcrFL1im2Th`. ### Returns The receipt. ## Example request ```bash curl "https://morzepay.com/v1/receipts/rcpt_WDL1pxuSr3cCcrFL1im2Th" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "rcpt_WDL1pxuSr3cCcrFL1im2Th", "object": "receipt", "livemode": true, "number": "NILE-R0001", "amount_paid": "733679.00", "fee": "25679.00", "currency": "UGX", "payment_method": "MTN Mobile Money", "payer": { "name": "Sarah Namuli", "email": "sarah@example.com", "phone": "+256772418905" }, "provider_transaction_id": "29876549876", "transaction_id": "txn_Qm2Hc7Vx4Lp9Wb3Nk8Rt6Z", "invoice_id": "inv_UfwyBh1W4Jfa6iG2u2AVT3", "invoice_number": "NILE-0001", "description": "Invoice NILE-0001", "url": "https://morzepay.com/r/5c0e0f50a1b2c3d4e5f60718293a4b5c", "pdf": "https://morzepay.com/r/5c0e0f50a1b2c3d4e5f60718293a4b5c/pdf", "paid_at": "2026-10-06T11:24:05+03:00", "emailed_at": "2026-10-06T11:24:07+03:00" } } ``` Source: https://morzepay.com/docs/api/get-receipt --- # Download a receipt PDF `GET https://morzepay.com/v1/receipts/{receipt_id}/pdf` GET`/v1/receipts/{receipt_id}/pdf` Downloads a receipt as a PDF. The answer is the file itself, with `Content-Type: application/pdf`. Permission`transactions:read` ### Path parameters `receipt_id`stringrequired The receipt, such as `rcpt_WDL1pxuSr3cCcrFL1im2Th`. ### Returns The PDF file. ## Example request ```bash curl "https://morzepay.com/v1/receipts/rcpt_WDL1pxuSr3cCcrFL1im2Th/pdf" \ -H "Authorization: Bearer $MORZEPAY_KEY" \ -o NILE-R0001.pdf ``` ## Example response (200) ```json %PDF-1.4 (binary file: application/pdf) ``` Source: https://morzepay.com/docs/api/receipt-pdf --- # Receipt for a transaction `GET https://morzepay.com/v1/transactions/{transaction_id}/receipt` GET`/v1/transactions/{transaction_id}/receipt` Returns the receipt for a successful collection, and creates it the first time you ask. Use it to give a receipt for payments you collected with [Collect a payment](https://morzepay.com/docs/api/create-deposit). Permission`transactions:read` ### Path parameters `transaction_id`stringrequired The transaction, such as `txn_Rk3Lp9WmQ2vX7bN4cTz8Hd`. ### Returns The receipt. Asking again returns the same receipt and number. ### Errors | Status | Code | When | | 409 | NO_RECEIPT | Receipts are for successful collections only. | The common codes, such as `UNAUTHENTICATED` and `RATE_LIMITED`, can come from any endpoint. See [Errors](https://morzepay.com/docs/api#errors). ## Example request ```bash curl "https://morzepay.com/v1/transactions/txn_Rk3Lp9WmQ2vX7bN4cTz8Hd/receipt" \ -H "Authorization: Bearer $MORZEPAY_KEY" ``` ## Example response (200) ```json { "success": true, "data": { "id": "rcpt_WDL1pxuSr3cCcrFL1im2Th", "object": "receipt", "livemode": true, "number": "NILE-R0002", "amount_paid": "10363.00", "fee": "363.00", "currency": "UGX", "payment_method": "MTN Mobile Money", "payer": { "name": null, "email": null, "phone": "+256771234567" }, "provider_transaction_id": "29876549876", "transaction_id": "txn_Rk3Lp9WmQ2vX7bN4cTz8Hd", "invoice_id": null, "invoice_number": null, "description": "Order 77812", "url": "https://morzepay.com/r/5c0e0f50a1b2c3d4e5f60718293a4b5c", "pdf": "https://morzepay.com/r/5c0e0f50a1b2c3d4e5f60718293a4b5c/pdf", "paid_at": "2026-10-06T11:24:05+03:00", "emailed_at": null } } ``` Source: https://morzepay.com/docs/api/transaction-receipt --- # Webhooks > Get a signed message the moment a payment, payout or invoice changes. A webhook is a message Morzepay sends to your server when something happens, such as a payment succeeding. With webhooks you don’t have to keep asking whether a payment is done: we tell you the moment it is. ### Set up your endpoint - Make a URL on your server Add a route that accepts `POST` requests with a JSON body, such as `https://yourapp.com/webhooks/morzepay`. It must be a public `https://` address. - Add it in the dashboard Go to **Developers → Payment notifications**, enter the URL and save. One URL gets both test and live events, so check `livemode` in each event before you act on it. - Store the signing secret The first time you save, you get a signing secret starting with `whsec_`. It’s shown only once. Put it in your server’s environment variables: you need it to [verify signatures](https://morzepay.com/docs/api/verify-webhooks). - Send a test event Click **Send test event**. We send a `ping` event and show exactly what your server answered. ### What we send Webhook request ```http POST /webhooks/morzepay HTTP/1.1 Content-Type: application/json Morzepay-Event: deposit.succeeded Morzepay-Delivery: evt_Mx8Qp3VnK7rT2bWc9LhZ4d Morzepay-Signature: t=1791127650,v1=5e8f0c7a... { "id": "evt_Mx8Qp3VnK7rT2bWc9LhZ4d", "event": "deposit.succeeded", "created_at": "2026-10-04T14:07:51+03:00", "data": { "id": "txn_Rk3Lp9WmQ2vX7bN4cTz8Hd", "livemode": true, "type": "deposit", "status": "success", "amount": "10000.00", "net": "10000.00", "reference": "order-77812", "metadata": { "order_id": "77812" } } } ``` `data` is the same object the API returns: a transaction, an invoice or a checkout session. ### Events | Event | When | | deposit.succeeded | A customer paid and the wallet was credited. | | deposit.failed | A collection was declined, timed out or cancelled. | | payout.succeeded | The recipient was paid. fee holds the real fee. | | payout.failed | A payout failed. Everything held for it is back in the wallet. | | transfer.succeeded | A wallet-to-wallet transfer completed. | | transaction.review | A transaction needs a manual check. Its final status follows. | | invoice.finalized | An invoice got its number and can be paid. | | invoice.sent | An invoice was emailed or texted. | | invoice.paid | An invoice was paid on its hosted page (with payment) or marked paid. | | invoice.payment_failed | A payment attempt on an invoice failed. The invoice stays open. | | invoice.overpaid | A payment arrived for an invoice that was already paid or voided. Refund it with a payout. | | invoice.voided, invoice.marked_uncollectible | You changed an invoice’s status. | | checkout.session.completed | A checkout session or payment page was paid (with payment). Sent for every payment on a reusable link. | | checkout.session.expired | A session expired or was deactivated. | | ping | A test event you sent from the dashboard. | Payments on invoices and checkout pages also send the usual `deposit.succeeded` for the underlying transaction. Its `metadata` holds the `invoice_id` or `checkout_session_id`, so you can handle all payments in one place if you prefer. ### Answer quickly Reply with any `2xx` status within 10 seconds. Do the slow work, like sending emails or updating stock, after you’ve replied. ### Retries If your server doesn’t answer with a `2xx` in time, we try again after 1 minute, 5 minutes, 15 minutes, 1 hour, 2 hours, 6 hours, 12 hours and 24 hours. The dashboard shows every delivery, its attempts and your server’s last answer. - **The same event can arrive more than once.** Store each event’s `id` and ignore ones you’ve already handled. - **Events can arrive out of order.** Use the `status` in `data`, not the order of arrival. - **We don’t follow redirects.** Give the final URL. ### Trust, but check Always [verify the signature](https://morzepay.com/docs/api/verify-webhooks) before acting on a webhook. For high-value actions, such as releasing goods, also confirm the payment with [GET`/v1/transactions/{transaction_id}`](https://morzepay.com/docs/api/get-transaction). Source: https://morzepay.com/docs/api/webhooks --- # Verify signatures > Check that a webhook really came from Morzepay. Anyone can send a request to your webhook URL. The signature proves a webhook really came from Morzepay and wasn’t changed on the way. Check it on every webhook, before you do anything with it. ### How the signature works Every webhook has a `Morzepay-Signature` header: Header ```http Morzepay-Signature: t=1791127650,v1=5e8f0c7a9b... ``` - `t` is when we signed it, in Unix seconds. - `v1` is an HMAC-SHA256 of `t + "." + raw_body`, made with your signing secret, as hexadecimal. To check it, make the same HMAC yourself and compare it with `v1` in constant time. Also reject timestamps more than 5 minutes old, so an old webhook can’t be replayed. Use the **raw body** exactly as received, before any JSON parsing. Parsing and re-encoding changes the bytes, and the signature won’t match. ### Code ```php Source: https://morzepay.com/docs/api/verify-webhooks --- # Morzepay in AI apps > Run your billing from Claude, ChatGPT, Cursor and any app that supports MCP. Morzepay has a built-in [MCP](https://modelcontextprotocol.io) server, so AI apps can work with your account. Create and send invoices, find out who owes you, record cash payments, send receipts and make payment links, just by asking, from Claude, ChatGPT, Cursor or any app that supports MCP. ### The address Add this as a connector in your AI app: MCP server URL ```text https://morzepay.com/mcp ``` That’s all you need. When you add it, your AI app opens a Morzepay window. Sign in, choose the business, choose **Live** or **Test**, tick what the app may do and confirm with your two-factor code or password. You land back in your AI app, ready to go. ### Things you can ask - “Invoice Kampala Coffee House for the espresso machine service, UGX 180,000, and two grinder burrs at 45,000 each, plus 18% VAT. Show me the draft.” - “Looks good, email it to them.” - “Who owes me money? List everything past due, oldest first.” - “Resend the reminder for NILE-0012 by SMS.” - “Ntinda Bakery paid NILE-0009 in cash today. Mark it paid and email them the receipt.” - “Make a payment link for Term 3 school fees where parents type the amount, minimum 10,000.” - “How much have invoices brought in this month?” New invoices are saved as drafts unless you ask the AI to send them, and most AI apps ask you to approve each action before it runs. Read what the AI is about to send before you approve it. ### Connect your app [ClaudeOn the web, desktop and mobile, and for whole teams.](https://morzepay.com/docs/ai/claude)[ChatGPTWith Developer mode.](https://morzepay.com/docs/ai/chatgpt)[Claude Code, Cursor and VS CodeFrom your code editor.](https://morzepay.com/docs/ai/developer-tools)[With an API keyFor scripts, automations and your own agents.](https://morzepay.com/docs/ai/api-key) ### What it can’t do AI connections can’t send payouts, move money between wallets or see your API keys, whatever you tick. See [Permissions and safety](https://morzepay.com/docs/ai/safety). Source: https://morzepay.com/docs/ai --- # Claude > Add Morzepay to Claude on the web, desktop and mobile. Morzepay works on claude.ai, the Claude desktop app and the Claude mobile apps. Connect once on the web and it’s available everywhere you use Claude. ### Free, Pro and Max plans - Add the connector In Claude, go to **Customize → Connectors** and click **Add custom connector**. - Enter the address Name it `Morzepay` and enter this as the server URL. Leave the OAuth client ID and secret empty. Server URL ```text https://morzepay.com/mcp ``` - Connect Click **Add**, then **Connect**. Sign in to Morzepay in the window that opens, choose the business and Live or Test, and tick what Claude may do. - Turn it on in a chat In a chat, click **+** → **Connectors** and make sure Morzepay is on. Then ask away. ### Team and Enterprise plans An owner adds Morzepay once for everyone: - Add it for the organization Go to **Organization settings → Connectors → Add → Custom** (choose **Web** if asked), enter `https://morzepay.com/mcp` and click **Add**. - Each person connects Each person goes to **Customize → Connectors**, finds Morzepay and clicks **Connect** to sign in with their own Morzepay account. Everyone only gets the businesses they belong to in Morzepay, with what they chose when they connected. Connect twice, once in Test and once in Live, to try things out on test data first. Each connection is tied to the mode you chose. Source: https://morzepay.com/docs/ai/claude --- # ChatGPT > Add Morzepay to ChatGPT with Developer mode. ChatGPT connects to MCP servers through Developer mode. Which plans can use it, and whether actions that change things (like sending an invoice) are allowed, depends on your ChatGPT plan and workspace settings. - Turn on Developer mode Go to **Settings → Apps & Connectors → Advanced settings** and turn on **Developer mode**. In a Business or Enterprise workspace, an admin may need to allow it first. - Create the connector Back in **Apps & Connectors**, click **Create**. Name it `Morzepay`, enter the URL below and choose **OAuth** for authentication. URL ```text https://morzepay.com/mcp ``` - Sign in Click **Create** and sign in to Morzepay when asked. Choose the business, Live or Test, and what ChatGPT may do. - Use it in a chat In a new chat, click **+** → **More** and pick Morzepay. ChatGPT’s menus change from time to time. If a step looks different, look for **Connectors** or **Apps** in Settings: the URL and sign-in are the same. Source: https://morzepay.com/docs/ai/chatgpt --- # Claude Code, Cursor and VS Code > Use Morzepay from your code editor. Use Morzepay from the AI in your code editor: ask it to create test invoices while you build, look up a transaction, or check what a payment link collected. Each of these tools signs in to Morzepay in your browser the first time you use it. ### Claude Code Terminal ```bash claude mcp add --transport http morzepay https://morzepay.com/mcp ``` Then run `/mcp` inside Claude Code and choose Morzepay to sign in. ### Cursor Add this to `~/.cursor/mcp.json`: ~/.cursor/mcp.json ```json { "mcpServers": { "morzepay": { "url": "https://morzepay.com/mcp" } } } ``` ### VS Code Add this to `.vscode/mcp.json` in your project: .vscode/mcp.json ```json { "servers": { "morzepay": { "type": "http", "url": "https://morzepay.com/mcp" } } } ``` ### Any other app Any AI app that supports remote MCP servers works the same way: give it the URL, and it opens the Morzepay sign-in. If it can’t open a sign-in window, [connect with an API key](https://morzepay.com/docs/ai/api-key). Source: https://morzepay.com/docs/ai/developer-tools --- # Connect with an API key > For scripts, automations and your own agents. Some tools can’t open a sign-in window: scripts, automation platforms, your own agents, or a Claude organization that uses request headers. For those, send an API key with each request instead. ### Create a key for the AI Under **Developers**, [create an API key](https://morzepay.com/docs/api/keys) with only the permissions the AI needs, for example: - `invoices:read` and `invoices:write` for invoices and receipts - `checkout:read` and `checkout:write` for payment links - `transactions:read` to look up payments and receipts - `wallets:read` to list wallets A test key (`mp_test_…`) uses your test data, and a live key uses live data. ### Send it with each request Request ```http POST https://morzepay.com/mcp Authorization: Bearer mp_live_3f9a1c0b2e7d_9b1c... ``` In tools that read an MCP config file: mcp.json ```json { "mcpServers": { "morzepay": { "url": "https://morzepay.com/mcp", "headers": { "Authorization": "Bearer mp_test_..." } } } } ``` Keep the key secret: anyone who has it can use those permissions. Don’t paste it into a chat, and don’t commit config files that contain it. Source: https://morzepay.com/docs/ai/api-key --- # What the AI can do > Every tool, and the permission it needs. These are the tools Morzepay gives an AI app. The app only sees the tools allowed by the permissions you granted when you connected. Amounts are whole Ugandan shillings. | Tool | What it does | Permission | | get_account | Which business and mode (live or test) the connection uses, and what it may do. | Any | | list_invoices, get_invoice | Find invoices by status, customer, number or reference; get one with its payment link and PDF. | invoices:read | | get_invoice_summary | What’s outstanding, past due and paid this month, with the overdue invoices. | invoices:read | | search_customers | Customers you’ve invoiced before, with their saved email, phone and address. | invoices:read | | create_invoice | Create an invoice as a draft (the default), finalize it, or send it by email and/or SMS. | invoices:write | | update_invoice, finalize_invoice | Edit a draft; give it its number and payment link. | invoices:write | | send_invoice | Email the PDF with a pay button and/or text the link. Also used for reminders. | invoices:write | | mark_invoice_paid | Record a cash or bank payment and issue a receipt. | invoices:write | | void_invoice, delete_draft_invoice | Cancel an open invoice; delete a draft. | invoices:write | | list_receipts, get_receipt | Find receipts; get one with its link and PDF, or create the receipt for a mobile money collection. | transactions:read | | email_receipt | Email a receipt to the payer or another address. | invoices:write | | create_payment_link | A hosted page with a fixed price, line items, or an amount the payer types. Reusable or one-time. | checkout:write | | list_payment_links, get_payment_link | Links with how many payments each took and how much it collected. | checkout:read | | deactivate_payment_link | Stop a link from taking payments. | checkout:write | | list_wallets | Wallets and sub-wallets with balances, so invoices and links can pay into a specific one. | wallets:read | Source: https://morzepay.com/docs/ai/tools --- # Permissions and safety > What AI apps can and cannot do with your account. An AI app connected to Morzepay acts for you, so it gets limits that a person signing in doesn’t need. ### What AI apps can’t do **No money can leave.** AI connections can’t send payouts, move money between wallets or see your API keys, whatever permissions you tick. The worst a mistaken AI can do is send an invoice or a receipt you didn’t mean to send. ### One business, one mode Each connection is tied to the business and to Live or Test as you chose them on the sign-in screen. To use both, connect twice. Connecting to live data needs a confirmed email address and a verified business. ### Test mode still sends email Test invoices and receipts are really emailed (numbered `TEST-…`), but can only be paid with sandbox money. Use your own address while you try things out. ### See and remove connections Connected apps appear under **Developers → API keys**, marked **AI app**, with who connected them and when. Click **Disconnect** and the app loses access at once. Connections also end when the person who made them leaves the business. Every action is recorded against the connection that made it. ### Prompt injection AI apps can be tricked by instructions hidden in documents, emails or web pages they read. Keep your AI app’s approval prompts on for actions that send or cancel things, read each action before you approve it, and only connect AI apps you trust. Source: https://morzepay.com/docs/ai/safety --- # Support > How to reach us, and what to send so we can help quickly. Email [support@morzepay.com](mailto:support@morzepay.com) about anything: payments, payouts, invoices, the API, your account or verification. Use the email address you sign in with, so we can find your account. ### What to send us The more of this is in your first message, the sooner we can help. #### About a payment or payout - The transaction id (`txn_…`) or your `reference` - Whether it was test or live - The phone number’s last 3 digits, the amount and roughly when - The network’s reference from the customer’s SMS, if you have it #### About an API error - The `request_id` from the error, or the `X-Request-Id` header - The endpoint and what you sent, **without your API key** - The error `code` and `message` #### About an invoice or payment page - The invoice number (such as `NILE-0012`) or the link #### About your account - Your business name, and the email address of the account Never send us your password, two-factor codes or API keys. We will never ask for them. ### What we help with - Payments, payouts and transfers that failed, are stuck in `processing` or `review`, or look wrong - Verification and going live - Fees, payout limits and receipts - How a Morzepay feature or endpoint works - Security concerns about your account ### Before you write - A collection that’s `processing` is waiting for your customer to approve it. They can approve from the network menu: `*165#` for MTN, `*185#` for Airtel. - Try your request with a [test key and the test numbers](https://morzepay.com/docs/api/testing): most integration problems show up there. - Search these docs with Ctrl K. ### Stay up to date New features and changes are in the [changelog](https://changelog.morzepay.com) and on our [blog](https://morzepay.com/blog). Source: https://morzepay.com/docs/support ---