# 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"
    }
  }
}
```
