PaymentAPI Documentation

The PaymentAPI allows seamless e-payments for Microfinance Institutes (MFIs) running the Infinity Loan tracking system. PaymentAPI integrates with the Infinity system to manage installment and loan payments through a set of defined endpoints.

1. GetInstallmentInfo

Retrieve installment information for a customer based on national ID.

Endpoint

GET https://paymentapi.inf-eg.com/getinstallmentinfo?key=testingapikeyformaraypayment&nation_id=28001012500000&paymentcomp=MASARY&mfi=mf_demo&paymenttype=installment&bankinfo=1

Parameters

Parameter Description Example Value
key API security key (use testingapikeyformaraypayment for testing, it will change in production). testingapikeyformaraypayment
nation_id 14-digit national number of the MFI customer. 28001012500000
paymentcomp Payment company (e.g., FAWRY, MASARY, BEE, AMUAL, AMAN). MASARY
mfi Name of the microfinance institute (use mf_demo for testing, prefix starts with "mf_"). mf_demo
paymenttype Type of payment service (e.g., installment or payoff). installment
bankinfo If set to 1, the response includes bank information. 1 or 0
no_of_installment Number of installment to be paid in one transaction. 1

Response

On success:

{
  "success": true,
  "info": {
    "BILL_ID": "1001008",
    "CUSTOMER_ID": "28001012500000",
    "CUSTOMER_NAME": "محمد حسن محمد ",
    "DUE_AMOUNT": "300.00",
    "MAX_AMOUNT": "300.00",
    "MIN_AMOUNT": "300.00",
    "ISSUE_DATE": "2017-10-17 00:00:00",
    "DUE_DATE": "2018-06-17 00:00:00",
    "EXPIRY_DATE": "2023-05-06 00:00:00",
    "BILL_DESCRIPTION": "سداد القسط رقم 8 من 12 المستحق بتاريخ 2018/6",
    "CUSTOMER_EMAIL": "a@b.c",
    "CUSTOMER_NUMBER": "01000000000",
    "BANK": "10"
  }
}

On failure:

Error Code Description
401 Unauthorized: Incorrect API key or payment company name.
-6 Invalid national ID (less than 14 digits).
-5 Incorrect national ID format.
-4 No customer records found for this national ID.
-3 No due installments for this customer.
-10 General error or database error.

2. SetPayment

Records a payment transaction for a specific bill ID.

Endpoint

GET https://paymentapi.inf-eg.com/setpayment?key=testingapikeyformaraypayment&customer_id=28001012500000&BILL_ID=1001008&payment_date=2022-01-01&reference_id=trns007&amount=300&paymentcomp=MASARY&mfi=mf_demo&paymenttype=installment

Parameters

Parameter Description Example Value
key API security key, used to authenticate the request. testingapikeyformaraypayment
customer_id 14-digit national number of the customer, returned from the GetInstallmentInfo endpoint. 28001012500000
BILL_ID Unique identifier for the installment, returned from the GetInstallmentInfo endpoint. 1001008
payment_date Date of payment in YYYY-MM-DD format. 2022-01-01
reference_id Unique transaction reference code from the payment company. trns007
amount Payment amount for the installment. 300
paymentcomp Name of the payment company (e.g., FAWRY, MASARY, BEE, AMUAL, AMAN). MASARY
mfi Name of the microfinance institution, prefixed with mf_. mf_demo
paymenttype Type of payment service (e.g., installment or payoff). installment
no_of_installment Number of installment to be paid in one transaction. 1

Response

{
  "success": true
}

Possible Errors

-2 Duplicate reference_id in production environment.
-1 No unpaid installment available for this customer.
-8 Installment already paid.
-10 General error or database issue.

3. CheckStatus

Checks the status of a specific payment transaction.

Endpoint

GET https://paymentapi.inf-eg.com/checkstatus?key=testingapikeyformaraypayment&reference_id=trns007&amount=300&paymentcomp=MASARY&mfi=mf_demo

Parameters

Parameter Description Example Value
key API security key, used to authenticate the request. testingapikeyformaraypayment
reference_id Unique transaction reference code from the payment company. trns007
amount Amount associated with the transaction. 300
paymentcomp Name of the payment company (e.g., FAWRY, MASARY, BEE, AMUAL, AMAN). MASARY
mfi Name of the microfinance institution, prefixed with mf_. mf_demo

Response

On success:

{
  "error": 0,
  "success": true,
  "message": "Transaction already exists"
}