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 direct_debit.payment_successful is sent:

direct_debit.payment_successful

API object

{
    "event": "direct_debit.payment_successful",
    "data": {
        "type": "onetime-debit",
        "object": {
            "description": "ALVES LTD",
            "amount": 200000,
            "fee": 0,
            "liveMode": true,
            "account": {
                "institution": "5f2d08bf60b92e2888287704",
                "_id": "61db4dcc969bd74a67c88cc4",
                "bvn": "22495860795",
                "accountNumber": "2000112345",
                "authMethod": "internet_banking",
                "name": "DANIEL, AUGUSTINE",
                "linked": true,
                "type": "DIGITAL_SAVINGS_ACCOUNT",
                "customer": "61d72a9da7911d391e123456",
                "updated_at": "2022-01-09T21:04:12.986Z",
                "currency": "NGN",
                "balance": 200000,
                "status": "PROCESSING",
                "__v": 0,
                "app": "5f3d989bbad92412a0312345",
                "business": "60cc934a615900081512345",
                "created_at": "2022-01-09T21:04:12.751Z"
            },
            "updated_at": "2022-01-09T21:05:14.141Z",
            "currency": "NGN",
            "reference": "UIJNAJa898Jaja",
            "status": "successful",
            "id": "txd_4oqzxLO8984992123",
            "created_at": "2022-01-09T21:04:13.279Z",
            "message": "Payment was successful"
        }
    }
}

Fields for direct_debit.payment_successfull(one-time-payment) webhook

FieldDescriptionType
eventThe webhook event action that triggered the webhook, e.g. direct_debit.payment_successfulstring
dataAll information related to this event webhookstring
data.typeThis refers to the type of MonoPay events i.e one-time-payment or recurring-paymentstring
data.objectAn object containing the account data object and all other important data fieldsstring
data.object.descriptionThe description added for this paymentstring
data.object.amountThe amount to be transferred from the customer's accountinteger
data.object.feeThe fee deducted from this paymentinteger
data.object.liveModeThe live mode state for tis particular app.boolean
data.object.accountAn object containing the account data objectstring
data.object.account.institutionThe institution id of the customer's bankstring
data.object.account._idThe unique identifier for the member which has new or updated transaction datastring
data.object.account.bvnThe bvn of the customerstring
data.object.account.accountNumberThe account number of the customerstring
data.object.account.authMethodThe auth. method of the customer's bankstring
data.object.account.nameThe full account name of the customer's bankstring
data.object.account.linkedThe linked status of the customer's accountboolean
data.object.account.typeThe type of customer's accountstring
data.object.account.customerThe customer's idstring
data.object.account.updated_atThe last updated time of the customer's accountstring
data.object.account.currencyThe currency of the customer's accountstring
data.object.account.balanceThe current account balance of the customer's accountinteger
data.object.account.statusThe status of the current transaction, if it is AVAILABLE, PROCESSING, FAILEDstring
data.object.account.appThe app id for which this customer's account is connected tostring
data.object.account.businessThe business id for which this customer's account is connected tostring
data.object.account.created_atThe time this customer's account was connected.string
data.object.updated_atThe date this transaction webhook object was updatedstring
data.object.currencyThe cuurency for this paymentstring
data.object.referenceThe reference identifier for this paymentstring
data.object.statusThe status for this current paymentstring
data.object.idThe identifier for this paymentstring
data.object.created_atThe date this transaction webhook object was createdstring
data.object.messageThe message status for this paymentstring

2. Recurring payment

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

direct_debit.payment_successful

API object

{
    "event": "direct_debit.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 direct_debit.payment_successful(recurring-payment) webhook

Field description type
event The webhook event action that triggered the webhook, e.g. direct_debit.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