Mobile Money Collection API

Collect payments via mobile money USSD prompt.

# Mobile Money Collection API

Send a USSD payment request to a payer's phone number for approval.

## Endpoint
- **Method**: POST
- **URL**: https://api.moolre.com/open/transact/payment

## Headers
| Header | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| X-API-USER | string | Yes | Your Moolre username. |
| X-API-PUBKEY | string | Yes | Your Public API Key. |

## Request Body
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| type | integer | Yes | Must be 1. |
| channel | string | Yes | 13=MTN, 6=Telecel, 7=AT. |
| currency | string | Yes | Currency code: GHS (Ghana Cedis) or NGN (Nigerian Naira). |
| payer | string | Yes | Customer's phone number. Use the local 0-prefixed format. |
| amount | string | Yes | Amount to collect. Must be greater than 0. |
| externalref | string | Yes | Unique reference for the payment. |
| otpcode | string | No | OTP code if required by the flow. |
| reference | string | No | Optional payment reference. |
| sessionid | string | No | USSD session ID if applicable. |
| accountnumber | string | Yes | Your Moolre Account Number. |
| skipotp | boolean | No | Sandbox only. Set true to skip OTP simulation; defaults to false. |

## Response (200 (OTP Required) OTP Required)
Payment requires phone number verification.

```json
{
  "status": 1,
  "code": "TP14",
  "message": "Please complete the verification process sent to you via SMS and try again.",
  "data": "all",
  "go": null
}
```

## Response (200 (Payment Request) Success)
Payment request initiated successfully.

```json
{
  "status": 1,
  "code": "TR099",
  "message": null,
  "data": "f25fc80e-791b-495b-8799-dcf87660457d",
  "go": null
}
```

## Response (400 Duplicate Reference)
The external reference must be unique.

```json
{
  "status": "0",
  "code": "TP13",
  "message": "External Reference is required and must be unique.",
  "data": "externalref",
  "go": null
}
```

Back to the Moolre AI documentation index