Developers
REST API
GuidesErrorsLogin
Get API Keys
API Navigation
  • Overview
  • Quick start
  • Authentication
  • Collect a payment
  • Payment status
  • Refunds
  • Testing
  • Production
  • Security
API reference
  • Create API keys POST
  • List API keys GET
  • Get API key GET
  • Delete API key DEL
  • Collect with MTN POST
  • MTN payment status GET
  • Collect with Airtel POST
    Create and pay
  • Create order POST
  • Order fee POST
  • Pay order with card POST
  • Pay order with bank POST
  • Status and verify
  • Order status POST
  • Verify order POST
  • Cards and tokens
  • Save card POST
  • Tokenize charge GET
  • Refunds
  • Refund order POST
  • Lists and stats
  • List orders GET
  • Get order GET
  • List banks GET
  • Order stats GET
  • List transactions GET
  • Get transaction GET
  • Transaction statuses GET
Errors and limits
  1. Docs
  2. API reference
  3. Collect with MTN

Collect with MTN

Initiate an MTN Mobile Money collection. Documented samples use the production Bearer route.

OpenAPI SpecRun in Postman
Select Auth Method:
POST/payment/mtn-momo-payAPI
Authentication:Bearer token•Authorization: Bearer <token>(Bearer token for server-to-server API calls)
Security requirement: 403 CSRF Protection
Auth guide →

Direct server-to-server calls authenticated via Bearer tokens do not require CSRF headers. If you instead invoke mutation endpoints from a web browser using cookie-based sessions, you must include the following header:

X-Requested-With: XMLHttpRequest
Required Headers
Authorizationstring
Bearer <merchant_token>
Content-Typestring
application/json

Request Parameters

FieldTypeRequiredDescription
AuthorizationstringRequiredBearer <merchant_token>
Content-TypestringRequiredapplication/json
import axios from "axios";

const url = "https://payment-service-mh2d.onrender.com/api/payment/mtn-momo-pay";

const headers = {
    Authorization: `Bearer ${process.env.ZIBA_TOKEN}`,
    "Content-Type": "application/json",
};

const payload = {
  "amount": 1000,
  "currency": "RWF",
  "phoneNumber": "+250788000000",
  "description": "Illustrative order 1042",
  "idempotencyKey": "order-1042-mtn"
};

try {
  const response = await axios.post(url, payload, {
    headers,
    timeout: 15000,
  });
  console.log("Success:", response.status, response.data);
} catch (error) {
  console.error("Request failed:", error.response?.data || error.message);
}
Auth guide

Response fields

FieldTypePresenceDescription
transactionReferenceIdstringAlways returnedReference used to poll status.
orderIdstringAlways returnedZiba Pay order id.
statusstringAlways returnedExample responses may show lowercase pending while the order record uses PENDING. Poll until COMPLETED or FAILED.
idempotentReplaybooleanOptionalPresent and true when an existing idempotency key was reused.

Status codes

HTTP StatusMeaning
200Collection started successfully, or an idempotent replay.
400Validation failed, or phone number is the merchant's own number. { error: message }.
401Missing or invalid API key / Bearer token.
404Authenticated merchant user not found.
429More than 15 payment requests in a minute from this IP.
503MTN credentials missing or provider unavailable.
503MTN request-to-pay could not be submitted to upstream network.

Notes

  • Illustrative example. Identifiers in sample responses are not production records.
  • phoneNumber is the paying customer's MTN MSISDN. The customer does not need a Ziba Pay account. The merchant cannot collect from their own phone number.
  • POST /payment/mtn-momo-pay uses a Bearer token. The gateway API-key collect route still exists in the service for server jobs.
  • A new collection returns status "pending". Other statuses use the stored order enum.
  • Payment routes are limited to 15 requests per minute per IP, inside a global limit of 300 requests per 15 minutes.
  • After calling this endpoint, capture the transactionReferenceId and poll the MTN payment status endpoint until final status.

Related

MTN payment statusCollect with AirtelPayment status
Was this page helpful?

Let us know how we can make our API documentation better.

PreviousDelete API key
NextMTN payment status