API Overview

Charge a Customer

The chief premise of this endpoint is to provide a single endpoint that allows you to charge your customers mobile money wallet or credit card. Charges are identified by a unique, random ID called reference.

All payments are instantly deposited into your Epay wallet. The amount taken from your customer is deposited with zero percent (0%) charge. This is a protected route hence you need to pass your access token through the Authorization header, that is, Authorization : Bearer {access_token}

We process all transactions asynchronously. Hence you would have to set your callback/webhook url on your dashboard under the settings section to receive the status of every posted transaction or call out the retrieve a transaction endpoint to verify status of the transaction.


Enpoint Details

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


Request Headers

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


Request Body Parameters

Parameter Field Type Required Description
reference String Yes This is a unique ID that represents
the transaction.
amount Float Yes The amount you wish to charge the customer.

Amount must be of type float.
Eg; 1.00 or 50.00
currency String No This is the currency code.
The default is GHS.
See our [supported currencies](https://docs.epaygh.com/docs/supported-currencies/)
customer_name String Yes This is the name of the customer
you are charging.
customer_email String Yes This is the email
of the customer
you are charging.
customer_telephone String Yes This is the telephone
number of the customer
you are charging.
payment_description String No This is the description of
the payment.


Charging a Mobile Money Wallet


Parameter Field Type Required Description
mobile_wallet_number String Yes, for only
mobile money
charges
This is the number of the
mobile money wallet you
wish to charge.
mobile_wallet_network String Yes, for only
mobile money
charges
This is how you wish to
charge the customer and
must be set to ‘momo’.
payment_method String Yes, for only
mobile money
charges
This is the network of the
mobile money wallet you
wish to charge.
voucher String Yes, for only
vodafone mobile
money wallets
This is the voucher the
user generates to authorize
the payment..



//Example Request Body ( Mobile money)

{   
    "reference" : "EP-2JBH23JJBJBJ",
    "amount" : 1.00,
    "payment_method" : "momo",
    "customer_name": "Akosua Manu",
    "customer_email" : "akosuamanu@gmail.com",
    "customer_telephone" : "054**********",
    "mobile_wallet_number" : "054**********",
    "mobile_wallet_network":"mtn",
    "payment_description": "A test payment"
}

//Example Success Response (Mobile money)

{
    "success": true,
    "message": "A payment request has been sent to the mobile wallet. 
    Please Approve Payment.",
    "data": {
        "customer": {
            "id": 37,
            "name": "Akosua Manu",
            "email": "akosuamanu@gmail.com",
            "telephone": "054**********",
            "created_at": "2019-01-22 16:15:32",
            "updated_at": "2019-01-22 16:15:32"
        },
        "transaction": {
            "reference": "EP-2JBH23JJBJBJ",
            "payment_method": "momo",
            "description": "A test payment",
            "amount": 1.00,
            "mobile_wallet_number": "054**********",
            "mobile_wallet_network": "mtn"
        }
    }
}


Charging a Credit Card (returns a url to redirect to)


Parameter Field Type Required Description
payment_method String Yes, for only
credit card
charges
This is how you wish to
charge the customer and
must be set to ‘card’
//Example Request Body (Credit Card)

{   
    "reference" : "EP-HBSABSDKKAS",
    "amount" : 1.00,
    "payment_method" : "card",
    "customer_name": "Akosua Manu",
    "customer_email" : "akosuamanu@gmail.com",
    "customer_telephone" : "054**********",
    "payment_description": "A sample payment"
}

//Example Success Response (Credit Card)

{
    "success": true,
    "message": "Redirect to url provided to complete payment",
    "data": {
        "customer": {
            "id": 37,
            "name": "Akosua Manu",
            "email": "akosua manu@gmail.com",
            "telephone": "054**********",
            "created_at": "2019-01-22 16:15:32",
            "updated_at": "2019-01-22 16:15:32"
        },
        "transaction": {
            "reference": "EP-HBSABSDKKAS",
            "payment_method": "card",
            "description": "A sample payment",
            "amount": 1.00
        },
        "redirect_url": "https://migs.mastercard.com.au/vpcpay"
    }
}

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