API Overview

Customers

The chief premise of this endpoint is to allow you list all customers created under your Epay Account. Kindly take note that this is a protected resource.

The response returns a paginated list of customers

Endpoint Details

Endpoint Url https://epaygh.com/api/v1/customers
Method GET

Request Headers

Content-Type application/json
Authorization Bearer {access_token}


//Example Response

{
    "success": true,
    "message": "Customers retrieved Successfully",
    "customers": {
        "current_page": 1,
        "data": [
            {
                "id": 36,
                "name": "okays",
                "email": "okays@gmail.com",
                "telephone": "054**********",
                "created_at": "2018-12-03 14:25:55",
                "updated_at": "2018-12-03 14:25:55"
            },
            {
                "id": 35,
                "name": "something",
                "email": "some@gmail.com",
                "telephone": "054**********",
                "created_at": "2018-12-03 14:25:13",
                "updated_at": "2018-12-03 14:25:13"
            },
            {
                "id": 34,
                "name": "samiiii",
                "email": "sammii@gmail.com",
                "telephone": "054**********",
                "created_at": "2018-12-03 14:21:10",
                "updated_at": "2018-12-03 14:21:10"
            },
            {
                "id": 33,
                "name": "sam",
                "email": "sam@gmail.cmo",
                "telephone": "054**********",
                "created_at": "2018-11-30 12:18:21",
                "updated_at": "2018-11-30 12:18:21"
            },
            {
                "id": 31,
                "name": "sams",
                "email": "sams@gmail.com",
                "telephone": "054**********",
                "created_at": "2018-10-22 15:12:00",
                "updated_at": "2018-10-22 15:12:00"
            },
            {
                "id": 27,
                "name": "babs",
                "email": "babs@gmail.com",
                "telephone": "0548797248",
                "created_at": "2018-10-13 12:40:17",
                "updated_at": "2018-10-13 12:40:17"
            },
            {
                "id": 26,
                "name": "Akos",
                "email": "akos@gmail.com",
                "telephone": "024**********",
                "created_at": "2018-10-12 16:38:19",
                "updated_at": "2018-10-12 16:38:19"
            },
            {
                "id": 25,
                "name": "Akosa",
                "email": "skos2@gmail.com",
                "telephone": "024**********",
                "created_at": "2018-10-12 16:36:08",
                "updated_at": "2018-10-12 16:36:08"
            },
        ],
        "first_page_url": "http://localhost:8000/api/v1/customers?page=1",
        "from": 1,
        "last_page": 2,
        "last_page_url": "http://localhost:8000/api/v1/customers?page=2",
        "next_page_url": "http://localhost:8000/api/v1/customers?page=2",
        "path": "http://localhost:8000/api/v1/customers",
        "per_page": 20,
        "prev_page_url": null,
        "to": 20,
        "total": 32
    }
}


Create New Customer

The chief premise of this endpoint is to allow you to create a customer under your Epay Account.

Kindly take note that this is a protected resource.


Endpoint Details

Endpoint Url https://epaygh.com/api/v1/customers
Method POST

Request Headers

Content-Type application/json
Accept application/json
Authorization Bearer {access_token}


Request Body Parameters

Parameter Field Type Required Description
name String Yes This is the name of the
customer.
email String Yes This is the email of the
customer.
telephone String Yes This is the telephone number
of the customer.


//Example Request Body

{
    "name" : "My Name",
    "email" : "myname@gmail.com",
    "telephone": "024************"
}

//Example Success Response

{
    "success": true,
    "message": "Customer created Successfully",
    "data": {
        "customer": [
            {
                "id": 37,
                "name": ""My Name",
                "email": "myname@gmail.com",
                "telephone": "024************",
                "created_at": "2019-01-22 16:15:32",
                "updated_at": "2019-01-22 16:15:32"
            }
        ]
    }
}


Retrieve Customer

The chief premise of this endpoint is to allow you to retrieve a single customer data as well as all transactions of the customer.

Kindly take note that this is a protected resource.


Endpoint Details

Endpoint Url https://epaygh.com/api/v1/customers/{customer_id}
Method GET

Headers

Content-Type application/json
Accept application/json
Authorization Bearer {access_token}


//Example Response Body

{
    "success": true,
    "message": "Transactions retrieved Successfully",
    "data": {
        "customer": {
            "id": 6,
            "name": "Someone",
            "email": "someone@gmail.com",
            "telephone": "0548797248",
            "created_at": "2018-09-08 14:44:19",
            "updated_at": "2018-09-08 14:44:19"
        },
        "transactions": [
            {
                "id": 140,
                "reference": "EP-j9fxp1hMJv9PiAx3",
                "payment_method": "momo",
                "payment_no": "0548797248",
                "amount": "22",
                "status": "pending",
                "created_at": "2018-10-31 15:59:44",
                "updated_at": "2018-10-31 15:59:44",
                "type": "payments",
                "description": "loan repayment"
            },
            {
                "id": 139,
                "reference": "EP-eqbgF8Nn0vPTC1lh",
                "payment_method": "momo",
                "payment_no": "0548797248",
                "amount": "1",
                "status": "success",
                "created_at": "2018-10-29 22:32:08",
                "updated_at": "2018-10-29 22:32:08",
                "type": "payments",
                "description": "samples"
            },
            {
                "id": 127,
                "reference": "EP-CAHjxoVAvbCmD54W",
                "payment_method": "momo",
                "payment_no": "0548797248",
                "amount": "1",
                "status": "failed",
                "created_at": "2018-10-13 23:12:57",
                "updated_at": "2018-10-13 23:12:57",
                "type": "payments",
                "description": "optional"
            },
            {
                "id": 115,
                "reference": "EP-03xROG5LUtYa2UE5",
                "payment_method": "card",
                "payment_no": "card",
                "amount": "5",
                "status": "pending",
                "created_at": "2018-10-13 12:19:55",
                "updated_at": "2018-10-13 12:19:55",
                "type": "payments",
                "description": "Payment of Service"
            },
                   {
                "id": 111,
                "reference": "EP-bOroxrb0vac2EMT4",
                "payment_method": "momo",
                "payment_no": "0548797248",
                "amount": "1",
                "status": "failed",
                "created_at": "2018-10-11 14:53:55",
                "updated_at": "2018-10-11 14:54:28",
                "type": "payments",
                "description": "sams"
            }
        ]
    }
}



Next, learn more about how to Know your customers on Epay.