DirectPay (Payments)

1. One-time payment

After a payment has been successful for a one-time-payment for a particular user, the following webhook event mono_pay.payment_successful is sent:

mono_pay.payment_successful

API object

{
    "event": "mono_payment.payment_successful",
    "data": {
        "type": "one-time-payment",
        "object": {
            "_id": "6034f5bbc459881e392fcf71",
            "amount": 1000,
            "currency": "ngn",
            "status": "successful",
            "account": {
                "_id": "6034f5bbc459881e392fcf72",
                "status": "AVAILABLE",
                "name": "OLADUNNI KHADIJAH OGUNGBEFUN",
                "accountNumber": "2253252328", 
                "type": "Saving",
                "balance": 249769,
                "bvn": "9422",
                "currency": "ngn"
            }
            "customer_id": "6034f5bbc459881e392fcf74",    
            "created_at" : "2021-10-02T10:33:34.000Z",
            "updated_at" : "2021-10-02T10:33:34.000Z" 
        }
    }
}

Fields for mono_pay.payment_successful(one-time-payment webhook

Field description type
event The webhook event action that triggered the webhook, e.g. mono_pay.payment_successful string
data All information related to this event webhook object
data.type This refers to the type of MonoPay events i.e one-time-payment or recurring-payment string
data.object An object containing the account data object and all other important data fields object
data.object._id The unique identifier for this particular webhook event string
data.object.amount The amount to be transferred from the customer's account string
data.object.currency The currency of the amount to be transferred string
data.object.status This refers to the status of this particular transaction whether it is failed or successful string
data.object.account An object with all account related data object
data.object.account._id The unique identifier for the member which has new or updated transaction data string
data.object.account.status The status of the current transaction, if it is AVAILABLE, PROCESSING, FAILED string
data.object.account.name The account name of the debited user string
data.object.account.accountNumber The account number of the debited user string
data.object.account.type The account type of the debited user E.g SAVINGS ACCOUNT, CURRENT ACCOUNT etc string
data.object.account.balance The current account balance of the debited user number
data.object.account.bvn The BVN of the debited user string
data.object.account.currency The currency of the connected user string
data.object.customer_id The generated unique identifier for a customer string
data.object.created_at The date this transaction webhook object was created string
data.object.updated_at The date this transaction webhook object was updated string

2. Recurring payment

After a payment has been successful for a recurring-payment for a particular user, the following webhook event mono_pay.payment_successful is sent:

mono_pay.payment_successful

API object

{
    "event": "mono_pay.payment_successful",
    "data": {
        "type": "recurring-payment",
        "object": {
            "_id": "6034f5bbc459881e392fcf71",
            "amount": 1000,
            "currency": "ngn",
            "status": "successful",
            "account": {
                "_id": "6034f5bbc459881e392fcf72",
                "status": "AVAILABLE",
                "name": "OLADUNNI KHADIJAH OGUNGBEFUN",
                "accountNumber": "2253252328", 
                "type": "Saving",
                "balance": 249769,
                "bvn": "9422",
                "currency": "ngn"
            },
            "plan": {
                "_id": "6034f5bbc459881e392fcf75",
                "name": "Monthly Payment Plan",
                "amount": 1000, 
                "currency": "ngn",
                "period": "monthly",
                "duration": 10
            },
            "customer_id": "6034f5bbc459881e392fcf74",
            "start_date": "2021-10-02T10:33:34.000Z",
            "end_date": "2021-10-12T10:33:34.000Z",
            "created_at" : "2021-10-02T10:33:34.000Z",
            "updated_at" : "2021-10-02T10:33:34.000Z" 
        }
    }
}

Fields for mono_pay.payment_successful(recurring-payment) webhook

Field description type
event The webhook event action that triggered the webhook, e.g. mono_pay.payment_successful string
data All information related to this event webhook object
data.type This refers to the type of MonoPay events i.e one-time-payment or recurring-payment string
data.object An object containing the account data object and all other important data fields object
data.object._id The unique identifier for this particular webhook event string
data.object.amount The amount to be transferred from the customer's account number
data.object.currency The currency of the amount to be transferred string
data.object.status This refers to the status of this particular transaction whether it is failed or successful string
data.object.account An object with all account related data object
data.object.account._id The unique identifier for the member which has new or updated transaction data string
data.object.account.status The status of the current transaction, if it is AVAILABLE, PROCESSING, FAILED string
data.object.account.name The account name of the debited user string
data.object.account.accountNumber The account number of the debited user string
data.object.account.type The account type of the debited user E.g SAVINGS ACCOUNT, CURRENT ACCOUNT etc string
data.object.account.balance The current account balance of the debited user number
data.object.account.bvn The BVN of the debited user string
data.object.account.currency The currency of the connected user string
data.object.plan._id A unique identifier for this particular plan string
data.object.plan.name The name set for this plan string
data.object.plan.amount The amount set for this plan number
data.object.plan.currency The currency set for this plan string
data.object.plan.period The period set for this plan e.g daily, monthly, yearly string
data.object.plan.duration The duration set for this plan number
data.object.customer_id The generated unique identifier for a customer string
data.object.start_date The date set for a transaction to be initiated string
data.object.end_date The date set for a transaction to be ended string
data.object.created_at The date this transaction webhook object was created string
data.object.updated_at The date this transaction webhook object was updated string

What’s Next
Did this page help you?