Chimoney
Chimoney
  • Introduction 👋🏾
  • Features ⭐️
  • 💡API DOCS
    • Chimoney Object ✌
    • Account 😎
      • Get a transaction
      • Get multiple transactions
      • Transfer an account
      • Delete unpaid transaction
    • Collection(Payments) 📱📲
      • Collect Mobile Money Payment
      • Initiate a mobile money payment
      • Verify a Mobile Money Payment
    • Info 🤷‍♀️
      • Assets
      • Airtime Countries
      • Mobile money codes
      • USD-amount-in-local
      • Local-amount-in-usd
    • Payouts 💰
      • Airtime
      • Chimoney
      • Mobile-money
      • Send
      • Initiate-chimoney
    • Reedem 📥
      • Airtime
    • Sub-accounts 🏷
      • Create
      • List
      • Get
    • Wallets 📦
      • List
      • Lookup
      • Transfer
Powered by GitBook
On this page
  • #Javascript FETCH
  • #Python REQUESTS
  • #PHP cURL
  1. API DOCS
  2. Collection(Payments) 📱📲

Initiate a mobile money payment

collections/mobile-money/collect

Initiating a momo payment is no rocket science, here is how to it, Chief 😉

The user gets a text message (SMS) to confirm the payment and you can use the /mobile-money/verify endpoint to verify when payment has been confirmed by a user.

POST https://live.chimoney.io/api/v0.1/collections/mobile-money/collect

Initiate a transaction

Headers

Name
Type
Description

X-API-Key*

API_KEY_FROM_DEV_PORTAL

Request Body

Name
Type
Description

amount*

1

currency*

KES

email*

team@chimoney.io

phone_number*

+254710102720

fullname*

firstname lastname

country*

Kenya

tx_ref*

text_113 from your record

{
    // transaction detail
}

#Javascript FETCH

var myHeaders = new Headers();
myHeaders.append("X-API-Key", "API_KEY_FROM_DEV_PORTAL");

var raw = "{\n    \"id\": \"PaymentID\"\n}";

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://live.chimoney.io/api/v0.1/collections/mobile-money/all", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

#Python REQUESTS

import requests

url = "https://live.chimoney.io/api/v0.1/collections/mobile-money/all"

payload = "{\n    \"id\": \"PaymentID\"\n}"
headers = {
  'X-API-Key': 'API_KEY_FROM_DEV_PORTAL'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

#PHP cURL

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://live.chimoney.io/api/v0.1/collections/mobile-money/all',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_POSTFIELDS =>'{
    "id": "PaymentID"
}',
  CURLOPT_HTTPHEADER => array(
    'X-API-Key: API_KEY_FROM_DEV_PORTAL'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Yay! It's done.

PreviousCollect Mobile Money PaymentNextVerify a Mobile Money Payment

Last updated 3 years ago

💡