mobilemoney.py documentation
  • welcome to mobilemoney.py
  • Introduction
  • Quick Start
  • Getting Help
  • Reference
    • API Reference
      • Client
        • Collection
        • Disbursements
      • Body details
Powered by GitBook
On this page
  • awaitcreate_access_token( authorization )
  • await get_account_balance( authorization, target )
  • await get_account_balance_in( currency, authorization, target )
  • await get_basic_user_info( msisdn, authorization, target )
  • await ask_user_info( authorization, target )
  • await deposit( uuid, authorization, target, body, url_callback )
  • await transfer( uuid, authorization, target, body, url_callback )
  • await get_deposit_status( uuid, authorization, target )
  • await refund( uuid, authorization, target, body, url_callback )
  • await get_transfer_status( uuid, authorization, target )
  • await get_refund_status( uuid, authorization, target )
  • await isActive( account, account_type, authorization, target )
  1. Reference
  2. API Reference
  3. Client

Disbursements

Represent Disbursements Client used for Disbursements product

Method

awaitcreate_access_token( authorization )

Method to create access token for disbursements user

Parameters :

  • authorization (str) - a valid basic authentification token

Return

(bool, data)

{
  "access_token": "string",
  "token_type": "string",
  "expires_in": 0
}

Return Type :

Tuple

await get_account_balance( authorization, target )

Method to get balance for disbursements user

Parameters :

  • authorization (str) - A valid bearer authentification token

  • target (str) - The target environment

Return :

(bool, data)

{
  "availableBalance": "string",
  "currency": "string"
}

Return Type :

Tuple

await get_account_balance_in( currency, authorization, target )

Method to get balance in specific currency for disbursements user

Parameters :

  • currency (str) - A valid ISO4217 Currency

  • authorization (str) - A valid bearer authentification token

  • target (str) - The target environment

Return :

(bool, data)

{
  "availableBalance": "string",
  "currency": "string"
}

Return Type :

Tuple

await get_basic_user_info( msisdn, authorization, target )

Method to get basic user info without consent for disbursements user

Parameters :

  • msisdn (str) - The number of the user

  • authorization (str) - A valid bearer authentification token

  • target (str) - The target environment

Return :

(bool, data)

{
  "given_name": "string",
  "family_name": "string",
  "birthdate": "string",
  "locale": "string",
  "gender": "string",
  "status": "string"
}

Return Type:

Tuple

await ask_user_info( authorization, target )

Method to get user info with consent for disbursements user

Parameters :

  • authorization (str) - A valld bearer authentification token

  • target (str) - The target environment

Return :

(bool, data)

{
  "sub": "string",
  "name": "string",
  "given_name": "string",
  "family_name": "string",
  "middle_name": "string",
  "email": "string",
  "email_verified": true,
  "gender": "string",
  "locale": "string",
  "phone_number": "string",
  "phone_number_verified": true,
  "address": "string",
  "updated_at": 0,
  "status": "string",
  "birthdate": "string",
  "credit_score": "string",
  "active": true,
  "country_of_birth": "string",
  "region_of_birth": "string",
  "city_of_birth": "string",
  "occupation": "string",
  "employer_name": "string",
  "identification_type": "string",
  "identification_value": "string"
}

Return Type :

Tuple

await deposit( uuid, authorization, target, body, url_callback )

Method to make deposit for disbursement user

The library is only taking in charge deposit V2

Parameters :

  • uuid (str) - A valid UUID version 4

  • authorization (str) - A valid bearer authentification token

  • target (str) - The target environment

  • body (Dict) - A dictionnary with full detail of the payment [see detail below]

{
  "amount": "string",
  "currency": "string",
  "externalId": "string",
  "payer": {
    "partyIdType": "MSISDN",
    "partyId": "string"
  },
  "payerMessage": "string",
  "payeeNote": "string"
}

{
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "description": "Amount that will be debited from the payer account."
    },
    "currency": {
      "type": "string",
      "description": "ISO4217 Currency"
    },
    "externalId": {
      "type": "string",
      "description": "External id is used as a reference to the transaction. External id is used for reconciliation. The external id will be included in transaction history report. <br>External id is not required to be unique."
    },
    "payer": {
      "type": "object",
      "properties": {
        "partyIdType": {
          "enum": [
            "MSISDN",
            "EMAIL",
            "PARTY_CODE"
          ],
          "type": "string"
        },
        "partyId": {
          "type": "string"
        }
      },
      "description": "Party identifies a account holder in the wallet platform. Party consists of two parameters, type and partyId. Each type have its own validation of the partyId<br> MSISDN - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN<br> EMAIL - Validated to be a valid e-mail format. Validated with IsEmail<br> PARTY_CODE - UUID of the party. Validated with IsUuid"
    },
    "payerMessage": {
      "type": "string",
      "description": "Message that will be written in the payer transaction history message field."
    },
    "payeeNote": {
      "type": "string",
      "description": "Message that will be written in the payee transaction history note field."
    }
  }
}
  • url_callback ( Optional[str] ) - The website receiving call back

Return :

(bool, data)

Retrun Type :

Tuple

await transfer( uuid, authorization, target, body, url_callback )

Method to transfer for disbursement user

Parameters :

  • uuid (str) - A valid UUID version 4

  • authorization (str) - A valid bearer authentification token

  • url_callback ( Optional[str] ) - The website receiving call back

Return :

(bool, data)

Return Type :

Tuple

await get_deposit_status( uuid, authorization, target )

Method to get a withdrawal status for collection user

Parameters :

  • uuid (str) - A valid UUID version 4

  • authorization (str) - A valid bearer authentification token

  • target (str) - The target environment

Return :

(bool, data)

{
  "amount": "string",
  "currency": "string",
  "financialTransactionId": "string",
  "externalId": "string",
  "payer": {
    "partyIdType": "MSISDN",
    "partyId": "string"
  },
  "payerMessage": "string",
  "payeeNote": "string",
  "status": "PENDING",
  "reason": {
    "code": "PAYEE_NOT_FOUND",
    "message": "string"
  }
}

Return Type:

Tuple

await refund( uuid, authorization, target, body, url_callback )

Method to transfer for disbursement user

The library is only taking in charge only Refund V2

Parameters :

  • uuid (str) - A valid UUID version 4

  • authorization (str) - A valid bearer authentification token

  • target (str) - The target environment

  • body (Dict) - A dictionnary with full detail of the payment

{
  "amount": "string",
  "currency": "string",
  "externalId": "string",
  "payerMessage": "string",
  "payeeNote": "string",
  "referenceIdToRefund": "UUID-REQUEST-TO-PAY"
}
{
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "description": "Amount that will be debited from the payer account."
    },
    "currency": {
      "type": "string",
      "description": "ISO4217 Currency"
    },
    "externalId": {
      "type": "string",
      "description": "External id is used as a reference to the transaction. External id is used for reconciliation. The external id will be included in transaction history report. <br>External id is not required to be unique."
    },
    "payerMessage": {
      "type": "string",
      "description": "Message that will be written in the payer transaction history message field."
    },
    "payeeNote": {
      "type": "string",
      "description": "Message that will be written in the payee transaction history note field."
    },
    "referenceIdToRefund": {
      "type": "string",
      "description": "Format - UUID. Recource ID of the created refund transaction. This ID is used, for example, validating the status of the‘ ’transaction generated using UUID version 4."
    }
  }
}
  • url_callback ( Optional[str] ) - The website receiving call back

Return :

(bool, data)

Return Type :

Tuple

await get_transfer_status( uuid, authorization, target )

Method to get transfer status for disbursement user

Parameters :

  • uuid (str) - A valid UUID version 4

  • authorization (str) - A valid bearer authentification token

  • target (str) - The target environment

Return :

(bool, data)

{
  "amount": "string",
  "currency": "string",
  "financialTransactionId": "string",
  "externalId": "string",
  "payee": {
    "partyIdType": "MSISDN",
    "partyId": "string"
  },
  "payerMessage": "string",
  "payeeNote": "string",
  "status": "PENDING",
  "reason": {
    "code": "PAYEE_NOT_FOUND",
    "message": "string"
  }
}

Return Type :

Tuple

await get_refund_status( uuid, authorization, target )

Method to get transfer status for disbursement user

Parameters :

  • uuid (str) - A valid UUID version 4

  • authorization (str) - A valid bearer authentification token

  • target (str) - The target environment

Return :

(bool, data)

{
  "amount": "string",
  "currency": "string",
  "financialTransactionId": "string",
  "externalId": "string",
  "payee": {
    "partyIdType": "MSISDN",
    "partyId": "string"
  },
  "payerMessage": "string",
  "payeeNote": "string",
  "status": "PENDING",
  "reason": {
    "code": "PAYEE_NOT_FOUND",
    "message": "string"
  }
}

Return Type :

Tuple

await isActive( account, account_type, authorization, target )

Method to check if an account is active for a collection user

Parameters :

  • account (str) - The account target

  • account_type (str) - Specifies the type of the party ID. Allowed values [msisdn, email, party_code]. default set to msisdn

  • authorization (str) - A valid bearer authentification token

  • target (str) - The target environment

Return :

(bool, data)

Return Type :

Tuple

PreviousCollectionNextBody details

Last updated 2 years ago

async

async

async

async

async

async

async

async

async

async

async

async

According to

body (Dict) - A dictionnary with full detail of the payment []

According to

According to

According to

According to

MTN MOMO API
see detail below
MTN MOMO API
MTN MOMO API
MTN MOMO API
MTN MOMO API
create_access_token()
get_account_balance()
get_account_balance_in()
get_basic_user_info()
ask_user_info()
deposit()
transfer()
refund()
get_deposit_status()
get_transfer_status()
get_refund_status()
isActive()