Upload Statement (Extraction)

Upload Bank statement for analysis and credit scoring

Upload Bank Statements

POST {{BASE_URL}}/api/v1/statement/mfi/bank/upload

This endpoint allows you to upload Mpesa Statements for extraction, analysis and scoring

Headers

Request Body

{
   "status":202,
   "message":"Statement saved successfully. Extraction process initiated",
   "data":{
      "reference_id":"22050643-73b9-4eec-ac73-4572d643ac1c",
      "name":"ANTHONY KAMAU",
      "phone_number":"254700123456"
      "statement_type": "user_statement",
       "short_code": null,
       "statement_period": "17 Oct 2022 - 17 Jan 2023"
   }
}

Statement upload request Example

{
    "national_id": 546444747,
    "file_name": "546444747.pdf",
    "file": "base 64 file string",
    "bank": "equity"
    "callback_url": "https://webhook.site/5dbae6c8-4aab-4bd9-a30f-a4ce358fddda",
}

Statement Callback Response Example

{
    "status": "success",
    "data": {
        "national_id": "546444747",
        "output_data": {
            "national_id": "546444747",
            "first_transaction_date": "1970-01-01",
            "last_transaction_date": "1970-01-01",
            "bank_statement_days": 1,
            "bank_inactive_days": 19522,
            "bank_total_days": 1,
            "max_debit": 500.0,
            "mean_debit": 86.32786885245902,
            "debit_std": 136.65029212585375,
            "debit_zscore": 0.6317430245443734,
            "total_debit": 10532.0,
            "max_credit": 333.0,
            "mean_credit": 17.704918032786885,
            "credit_std": 60.86893855433151,
            "credit_zscore": 0.2908695050922156,
            "total_credit": 2160.0,
            "n_debit": 24,
            "n_credit": 10,
            "n_transactions": 34,
            "n_ratio": 2.4,
            "avg_balance": 118.95081967213115,
            "balance_std": 111.52334552769116,
            "z_balance": 1.0666001733475234,
            "min_balance": 1.0,
            "max_balance": 493.0,
            "debit_credit_ratio": 4.88,
            "z_received": 0.6291485863771015,
            "average_monthly_received": 10532.0,
            "unemployment": 6.6,
            "inflation": 9.2,
            "fx": 129.8,
            "gas": 1.4,
            "food_inflation": 13.3,
            "bank_rate": 8.75,
            "Total": 0.660370272871831,
            "new_repeat": "new",
            "gender": "Male",
            "dob": "1995-02-01",
            "name": "ANTHONY MATHENGE",
            "location": "Nairobi",
            "age": 28,
            "score": 475.46254228011225,
            "average_score": 475.46254228011225,
            "default_probability": 0.12664743805327444,
            "score_cat": "Good"
        },
        "ref_id": "dee34d94-f37c-41de-b48d-7096485b91a6"
    }
}

Last updated