PHPackages                             chipdeals/momo-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. chipdeals/momo-api

ActiveLibrary[Payment Processing](/categories/payments)

chipdeals/momo-api
==================

Easy use mobile money api to access all Africa mobile wallets

1.4.1(2y ago)150MITPHP

Since Sep 16Pushed 2y agoCompare

[ Source](https://github.com/Chipdeals/mobile-money-api-laravel)[ Packagist](https://packagist.org/packages/chipdeals/momo-api)[ RSS](/packages/chipdeals-momo-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (14)Used By (0)

Mobile Money [Mobile Money Php](https://github.com/Chipdeals/mobile-money-api-laravel) documentation
====================================================================================================

[](#mobile-money-mobile-money-php-documentation)

[![PHP](https://camo.githubusercontent.com/f787363cc614677cc300e81a2fb2adcc38391eae27bbf19cb55b3a13bc7dea7b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d3433383533443f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/f787363cc614677cc300e81a2fb2adcc38391eae27bbf19cb55b3a13bc7dea7b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d3433383533443f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465) [![LARAVEL](https://camo.githubusercontent.com/46fdbb85206a11ea7211daceaeba71323a1edc56b06bc446001da0e79888d7fe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d3433383533443f7374796c653d666f722d7468652d6261646765266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/46fdbb85206a11ea7211daceaeba71323a1edc56b06bc446001da0e79888d7fe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d3433383533443f7374796c653d666f722d7468652d6261646765266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465) [![COMPOSER](https://camo.githubusercontent.com/3f53d3d7bfb08b617abd69bd772434d908aa5604f5f1400c4991c17a71a74513/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d3433383533443f7374796c653d666f722d7468652d6261646765266c6f676f3d636f6d706f736572266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/3f53d3d7bfb08b617abd69bd772434d908aa5604f5f1400c4991c17a71a74513/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d3433383533443f7374796c653d666f722d7468652d6261646765266c6f676f3d636f6d706f736572266c6f676f436f6c6f723d7768697465)

#### Other libraries documentations

[](#other-libraries-documentations)

- [**Mobile Money API REST**](https://github.com/Chipdeals/Momo-Api)
- [**Mobile Money Nodejs**](https://www.npmjs.com/package/@chipdeals/momo-api)
- [**Mobile Money Php**](https://github.com/Chipdeals/mobile-money-api-laravel)
- [**Mobile Money Javascript Widget**](https://github.com/Chipdeals/mobile-money-api-Javascript)

**Chipdeals-momo-api** is a Mobile Money API that allows you to build a quick, simple and excellent payment experience in your web and native app.This the official **Php laravel library**

You can **[request payment](#Collect-Money)** and **[send money](#Disburse-Money)** to any **mobile money wallet**

Requirements
============

[](#requirements)

*Laravel 8 or higher*

Installation
============

[](#installation)

```
composer require chipdeals/momo-api
```

Quick Start
===========

[](#quick-start)

**Initialize Chipdeals Momo API with your API Key ([*Get apikey here*](#Contact-us)) and start**

```
$momo = new \Chipdeals\MomoApi\Momo();
$momo->setApiKey("test_FOdigzgSopV8GZggZa89");

//Collect 500 XOF from the +22951010200 Mobile Money wallet.
$collection = $momo
  ->collect()
  ->amount(500)
  ->currency("XOF")
  ->from('22951010200')
  ->create();
print_r($collection->getArray());

//Send 2000 XOF to the +22951010200 Mobile Money wallet.
$deposit = $momo
  ->deposit()
  ->amount(2000)
  ->currency("XOF")
  ->to('22951010200')
  ->create();
print_r($deposit->getArray());

```

###### Quick check possible responses with [sandbox tests](#Sandbox-tests)

[](#quick-check-possible-responses-with-sandbox-tests)

Usage
=====

[](#usage)

The package needs to be configured with your **account's API key**, which is available in the when you get access to Chipdeals Sandbox.

[***You can get your apiKey here***](#Contact-us)

Collect Money
-------------

[](#collect-money)

[Collect limitation](#collect-limitation)

### Simple collection

[](#simple-collection)

For example to request 2000 XOF from the ***+22951010200*** Mobile Money wallet, the following code can be used

```
$momo = new \Chipdeals\MomoApi\Momo();
$momo->setApiKey("test_FOdigzgSopV8GZggZa89");

$collection = $momo
  ->collect()
  ->amount(2000) //Amount of the transaction
  ->currency("XOF") // Any valid currency
  ->from("22951010200") // Sender phone number with country code préfix
  ->isWaveAccount(false) //optional. Required only for wave operator
  ->useOtp(123456) //Required only for Orange Money Burkina. Get it from user after they generate it for your amount by doing: *144*4*6*montant#
  ->firstName("Iyam") // First name of the sender
  ->lastName("EVERICH") // Last name of the sender
  ->merchantOrderId("collection-test00001") //optional. If added we will check if it is uniq for your account
  ->create();

print_r($collection->getArray());
echo "" . $collection->getReference();

```

### Collect with a [webhook](#Webhook) to get response as soon as the payment is processed.

[](#collect-with-a-webhook-to-get-response-as-soon-as-the-payment-is-processed)

```
$collection = $momo
  ->collect()
  ->amount(2000) //Amount of the transaction
  ->currency("XOF") // Any valid currency
  ->from("22951010200") // Sender phone number with country code préfix
  ->firstName("Iyam") // First name of the sender
  ->lastName("EVERICH") // Last name of the sender
  ->webhook("https:// mydomain/payment-status") // Url where we will send you transaction data on progress
  ->create();

print_r($collection->getArray());
echo "" . $collection->getReference();

```

[*See webhook you get*](#Collectiton-state-changed-webhook-payload-sample)

Disburse Money
--------------

[](#disburse-money)

### Simple Disbursement

[](#simple-disbursement)

You can also send 2000 XOF to the ***+22951010200*** Mobile Money wallet, with the following code

```
$momo = new \Chipdeals\MomoApi\Momo();
$momo->setApiKey("test_FOdigzgSopV8GZggZa89");

$deposit = $momo
  ->deposit()
  ->amount(2000) //Amount of the transaction
  ->currency("XOF") // Any valid currency
  ->to('22951010200') // Recipient phone number with country code préfix
  ->isWaveAccount(false) //optional. Required only for CI wave operator
  ->merchantOrderId("deposit-test00001") //optional. If added we will check if it is uniq for your account
  ->create();

print_r($deposit->getArray());
echo "" . $deposit->getReference();

```

### Disburse with a [webhook](#Webhook) to get response as soon as the deposit is processed.

[](#disburse-with-a-webhook-to-get-response-as-soon-as-the-deposit-is-processed)

```
$deposit = $momo
  ->deposit()
  ->amount(2000) //Amount of the transaction
  ->currency("XOF") // Any valid currency
  ->to('22951010200') // Recipient phone number with country code préfix
  ->webhook("https:// mydomain/payment-status") // Url where we will send you transaction data on progress
  ->create();

print_r($deposit->getArray());
echo "" . $deposit->getReference();

```

[*See webhook you get*](#Disbursement-state-changed-webhook-payload-sample)

Get transaction status
----------------------

[](#get-transaction-status)

Get status of a transaction of reference `dd1e2d17-5c21-4964-b58d-198fd2aac150`

```
$momo = new \Chipdeals\MomoApi\Momo();
$momo->setApiKey("test_FOdigzgSopV8GZggZa89");

$reference = "ba32a171-cbea-45fd-8848-ac5b77580be3"
$transaction = $momo->getStatus($reference);

echo $transaction->getReference() . "";
echo $transaction->getMerchantOrderId() . "";
echo $transaction->getPhoneNumber() . "";
echo $transaction->getCountryCode() . "";
echo $transaction->getOperator() . "";
echo $transaction->getFirstName() . "";
echo $transaction->getLastName() . "";
echo $transaction->getOriginalCurrency() . "";
echo $transaction->getOriginalAmount() . "";
echo $transaction->getCurrency() . "";
echo $transaction->getAmount() . "";
echo $transaction->getStatus() . "";
echo $transaction->getStatusMessage() . "";
echo $transaction->getStatusCode() . "";
echo $transaction->getStartTimestampInSecond() . "";
echo $transaction->getEndTimestampInSecond() . "";
echo $transaction->checkIsCollection() . "";
echo $transaction->getOperatorReference() . "";
echo $transaction->getPaymentLink() . "";

echo "";
print_r($transaction->getArray());

```

 Collection transactionData Sample ```
Array
(
  [reference] => ba32a171-cbea-45fd-8848-ac5b77580be3 //reference of the transaction
  [merchantOrderId] => collection-test0001 //internal reference of the transaction
  [phoneNumber] => 22990630401 //sender phone number
  [currency] => XOF //currency
  [operator] => MTN //sender operator
  [firstName] => Iyam //sender firstName
  [lastName] => EVERICH //sender lastName
  [originalCurrency] => USD //currency you entered
  [originalAmount] => 2000 //amount you entered
  [amount] => 1251002 //amount in customer's local currency
  [status] => success //transaction status (success|pending|error)
  [statusMessage] => Successfully processed transaction //transaction status details are here
  [statusCode] => 200 //status of the payment (See Status Message Code section)
  [startTimestampInSecond] => 1668184816 //timestamp in second of the moment when the transaction started
  [endTimestampInSecond] => 0 //timestamp in second of the moment when the transaction is finished
  [operatorReference] => zprojtbtci //reference that operator sent to customer by sms
  [isCollection] => true
  [paymentLink] => https://pay.wave.com/c/cos-1ewpdr47212cd //payment link that allow you customers to finish the transaction. It is available for operators like Wave
)

```

 Disbursement transactionData Sample ```
Array
(
  [reference] => a0903015-a86d-46c3-98ce-bb36639d6d09 //reference of the transaction
  [phoneNumber] => 22990630401 //recipient phone number
  [currency] => XOF //currency
  [operator] => MTN //recipient operator
  [firstName] =>
  [lastName] =>
  [originalCurrency] => XOF //currency you entered
  [originalAmount] => 2000 //amount you entered
  [amount] => 2000 //amount in customer's local currency
  [status] => success //transaction status (success|pending|error)
  [statusMessage] => Successfully processed transaction //transaction status details are here
  [statusCode] => 200 //status of the disbursement (See Status Message Code section)
  [startTimestampInSecond] => 1668229766 //timestamp in second of the moment when the transaction started
  [endTimestampInSecond] => 0 //timestamp in second of the moment when the transaction is finished
  [operatorReference] => zprojtbkci //reference that operator sent to customer by sms
  [isCollection] => false
)

```

Get Your balance
----------------

[](#get-your-balance)

Get your Chipdeals account's balance

```
$momo = new \Chipdeals\MomoApi\Momo();
$momo->setApiKey("test_FOdigzgSopV8GZggZa89");

$balances =  $momo->getBalances();

foreach ($balances as $balanceKey => $balance) {
  echo $balance->getCountryCode() . "";
  echo $balance->getOperator() . "";
  echo $balance->getCurrency() . "";
  echo $balance->getAmount() . "";

  echo "";
  print_r($balance->getArray());
}

```

Balance sample:

```
Array
(
    [countryCode] => BJ
    [operator] => MTN
    [currency] => XOF
    [amount] => 19000
)

```

Webhook
=======

[](#webhook)

Webhooks are an important part of your payment integration. They allow Chipdeals notify you about events that happen on your account, such as a successful payment or a failed transaction.

A ***webhook URL*** is an endpoint on your server where you can receive notifications about such events. When an event occurs, we'll make a ***POST*** request to that endpoint, with a ***JSON body*** containing the details about the event, including the type of event and the data associated with it.

Structure of a webhook payload
------------------------------

[](#structure-of-a-webhook-payload)

All webhook payloads follow the same basic structure:

- an `event` field describing the type of event
- a `data` object. The contents of this object will vary depending on the event, but typically it will contain details of the event, including:
    - a `reference` containing the ID of the transaction
    - a `status` describing the status of the transaction. possible values are `success`, `pending` or `error`
    - a `statusMessageCode`, containing a specific code that identify an exact state of the transaction. [See all `statusMessageCode`](#Status-Message-Code)
    - a `statusMessage`, cantaining an human undertandable descrption of the exact state of the transaction
    - transaction details

[Here are some sample webhook payloads for transfers and payments](#Webhook-sample)

Implementing a webhook
----------------------

[](#implementing-a-webhook)

Creating a webhook endpoint on your server is the same as writing any other API endpoint, but there are a few important details to note:

**Responding to webhook requests**To acknowledge receipt of a webhook, your endpoint **must** return a `200` HTTP status code. Any other response codes, including `3xx` codes, will be treated as a failure. **We don't care about the response body or headers.**

Be sure to enable webhook retries on your dashboard. If we don't get a 200 status code (for example, if your server is unreachable), we'll retry the webhook call every 90 minutes for the next 36 hours.

More Info
=========

[](#more-info)

Collection and disburssement parametters
----------------------------------------

[](#collection-and-disburssement-parametters)

### - `phoneNumber` parameter

[](#--phonenumber-parameter)

You specify the `phoneNumber` of a collection with method `from(phoneNumber: sting)`

And for a disbursement you specify `phoneNumber` with method `to(phoneNumber: sting)`

Those methode are locking for a string containing the phone number of the money sender for collection and the money recipient for disbursement.

The PhoneNumber should respect this format:

`XXXOOOOOOOO`

where the three `X` represent the country phone préfix (`229` | `237` for example), and the `O` are the phone number in the country. The number of `O` can change with the country but the prefix should be 3.

### - `currency` parameter

[](#--currency-parameter)

You specify the currenct of a transaction with the method `currency(currency: string)`

The currency should be a string of 3 character.

If you add a currency that is not the currency localy used in the country of the phone number of the transaction, we will convert the amount of the transaction into local currency.

Our conversion rate evoluate like the market.

### - `amount` parameter

[](#--amount-parameter)

You specify the amount of a transaction with the method `amount(transactionAmount: number)`

It is a number.

We will check if the currency that you specify for the transaction is the local currency of the phone number's country and then we will convert the amount into local currency before perform the transaction with the customer

### - `firstName` and `lastName` parameters

[](#--firstname-and-lastname-parameters)

You respectively specify `firstName` and `lastName` with methods `firstName(senderFirstName: string)` and `lastName(senderLastName: string)`

Those parametters are required to perform secured collection request.

Disbursement doesn't need them.

If you make 3 request per day with unspesified `firstName` and | or `lastName` we will block the 4th and the other. We recommand you to specify `fisrtName` and `lastName` for all your collection request.

In sandbox test, you have no probleme with `firstName` and `lastName` specification, you can do as you like **But be careful for Live**

Status Message Code
-------------------

[](#status-message-code)

CodeRelative StatusMeaning200✔️ -- successTransaction successful201🕟 -- pendingData in validation202🕟 -- pendingTransaction pending203🕟 -- pendingData are validated, server is working204🕟 -- pendingWaiting for ussd push validation400❌ -- errorIncorrect data enter in the request401❌ -- errorParameters not complete402❌ -- errorPayment PhoneNumber is not correct403❌ -- errorDeposit PhoneNumber is not correct404❌ -- errorTimeout in USSD PUSH/ Cancel in USSD PUSH406❌ -- errorPayment phoneNumber got is not for mobile money wallet460❌ -- errorPayer’s payment account balance is low461❌ -- errorAn error occured while paying462❌ -- errorThis kind of transaction is not supported yet, processor not found5XX⛔️ -- errorAn unknow error occured on the api
Sandbox tests
-------------

[](#sandbox-tests)

You can use your `test apikey` or all users test apikey : `test_FOdigzgSopV8GZggZa89` to make sandbox requsts.

All valid phone number you used in sandbox will send you valid responses as it was the live mode.

For exemple, if you use the phone number `22951010581` you will get a response with status message code `201` (what means `pending` see more [here](#Status-Message-Code)). Some seconds laters, you will get status messages codes `202`, `203` and `200` (`200` means success).

It is the same thing for others phone number with a small exception to allow errors case handling by implementor.

Sandbox Phone number-&gt; final status message code22951010402402229510104034032295101040440422951010460460229510104614612295101046246222951010200200For **Live `apiKey`** and **Live Responses** requests **[Contact us](#Contact-us)**

Limitation
----------

[](#limitation)

### Unsecured collect limitation

[](#unsecured-collect-limitation)

When you are making a collection request, you have posibility to specify or not the payer's firstName and lastname. By not specifying `firstName` and `lastName`, you can make quick test.

But when `firstName` and `lastName` are not specified your collection request is not secured. And you are alowed to perform at most 3 unsecured collection resquest per day. More request will be just blocked.

You cannot perform unsecured collection request for more than 500 XOF.

Contact us
==========

[](#contact-us)

### Call us or write us to [get your apikey](#Contact-us) and start getting payment

[](#call-us-or-write-us-to-get-your-apikey-and-start-getting-payment)

E-mail: Website: Phone: +22990630401 Whatsapp: +22990630401

Copyright (C) 2022 Chipdeals Inc -

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~46 days

Total

13

Last Release

1008d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3792656dd88cf7f36c4b5bf2146defbf6c71109c96b9c9b43334e8c7ae10201a?d=identicon)[Chipdeals Inc](/maintainers/Chipdeals%20Inc)

---

Top Contributors

[![euler8100](https://avatars.githubusercontent.com/u/61932810?v=4)](https://github.com/euler8100 "euler8100 (25 commits)")

---

Tags

paymentmobile-moneyOrange Moneymtn momomomopayment\_apimoov-moneymomo-api

### Embed Badge

![Health badge](/badges/chipdeals-momo-api/health.svg)

```
[![Health](https://phpackages.com/badges/chipdeals-momo-api/health.svg)](https://phpackages.com/packages/chipdeals-momo-api)
```

###  Alternatives

[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)[tsaiyihua/laravel-linepay

linepay library for laravel

102.9k](/packages/tsaiyihua-laravel-linepay)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
