Collect a payment
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, or check the transaction.
deposits:writeHeaders#
Idempotency-Keystringheader8–80 letters, digits, - or _. Lets you retry safely: the same key and body return the first answer and never move money twice. See Idempotency.
Body#
JSON, with Content-Type: application/json.
wallet_idstringrequiredThe wallet to credit.
msisdnstringrequiredThe payer’s number. +256771234567, 256771234567 and 0771234567 all work.
amountintegerrequiredWhole UGX, from 500 to 5,000,000.
referencestringrequiredYour own unique reference, 8–36 characters, such as your order id. Using it twice returns 409 DUPLICATE_REFERENCE.
fee_bearerstringwallet: 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.
descriptionstringUp to 100 characters. Shown in your dashboard.
metadataobjectUp 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.
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 gives you a hosted page that handles the prompt, waiting, retries and the receipt.