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

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

string

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

string

data.object.description

The description added for this payment

string

data.object.amount

The amount to be transferred from the customer's account

integer

data.object.fee

The fee deducted from this payment

integer

data.object.liveMode

The live mode state for tis particular app.

boolean

data.object.account

An object containing the account data object

string

data.object.account.institution

The institution id of the customer's bank

string

data.object.account._id

The unique identifier for the member which has new or updated transaction data

string

data.object.account.bvn

The bvn of the customer

string

data.object.account.accountNumber

The account number of the customer

string

data.object.account.authMethod

The auth. method of the customer's bank

string

data.object.account.name

The full account name of the customer's bank

string

data.object.account.linked

The linked status of the customer's account

boolean

data.object.account.type

The type of customer's account

string

data.object.account.customer

The customer's id

string

data.object.account.updated_at

The last updated time of the customer's account

string

data.object.account.currency

The currency of the customer's account

string

data.object.account.balance

The current account balance of the customer's account

integer

data.object.account.status

The status of the current transaction, if it is AVAILABLE, PROCESSING, FAILED

string

data.object.account.app

The app id for which this customer's account is connected to

string

data.object.account.business

The business id for which this customer's account is connected to

string

data.object.account.created_at

The time this customer's account was connected.

string

data.object.updated_at

The date this transaction webhook object was updated

string

data.object.currency

The cuurency for this payment

string

data.object.reference

The reference identifier for this payment

string

data.object.status

The status for this current payment

string

data.object.id

The identifier for this payment

string

data.object.created_at

The date this transaction webhook object was created

string

data.object.message

The message status for this payment

string

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
Did this page help you?