This endpoint will be used by the providers for loan collection when the loan repayment is due.
Currently, there are two implementations in the debit customer endpoint. The same request will be used for both, but the response differs depending on which implementation is triggered. They are:
- Debit Customer from Card: The service will use the customer’s provided payment debit card to trigger a payment request to IPG with the specified amount.
- Debit Customer from Bank Account: The service will use the customer’s bank account details to send a payment request to the specified bank. (NOTE: this will ONLY happen for banks that have provided their Direct-to-Account Debit APIs)
Request Message description
Field
# | Field name | Data type | Max length | Required | Description |
1 | customerId | String | 50 | true | The Email or Mobile Number of the User. |
2 | loanId | Numeric String | 50 | true | The loan id of the loan for which this debit is for. |
3 | amount | Long | true | The Amount to be debited from the user’s payment card. (This is in lower denomination KOBO) | |
4. | providerCode | String | 50 | True | The provider code |
5 | transactionId | String | 15 | false | The Identifier for this transaction. This will be used to requery this transaction if needs be |
Endpoint
POST /loans/{loanId}/debit
Headers
Authorization: Bearer {{token}}
Sample Request
{
"customerId": "2348123456789",
"providerCode": "MINES",
"transactionId": "958984578597843798438",
"amount": 1000000 // ten thousand naira only.
}
Response Message field description
Field# | Field name | Data Type | Max Length | Required | Description |
---|---|---|---|---|---|
1 | responseCode | Numeric String | 5 | true | The code indicating the result of the processing of this request. |
2 | responseDescription | String | 255 | true | The Description of the responseCode. |
3 | transactionRef | String | 50 | true | The Quickteller Transaction Reference of the Debit done. |
4 | balance | Long | false | The customer’s balance will be returned when he/she does not have sufficient funds to pay back the loan. | |
5 | transactionId | String | The Identifier of this transaction. This will be used of requery of this transaction if needs be. | ||
6 | transactionDate | String | false | This is the date/timestamp of the direct-to-account debit request. | |
7. | requestReference | String | 20 | false | This is the unique identifier for all direct-to-account debit requests. |
Sample Response for Card Debit (success)
{
"responseCode": "00",
"responseDescription": "Successful",
"transactionRef": "UBN|WEB|ILS|20170501120945|0198849",
"transactionId": "958984578597843798438"
}
Sample Response for Account Debit (success)
{
"responseCode": "00",
"responseMessage": "Successful",
"transactionId": "12341234abcd",
"amount": 5000,
"transactionDate": "2019-12-17 14:21:06",
"requestReference": "2634301"
}
Sample Response Card Debit (failure)
{
"responseCode": "96",
"responseMessage": "Issuer or Switch Inoperative."
}
Sample Response Account Debit (failure)
{
"responseCode": "07",
"responseMessage": "Invalid Account",
"transactionId": "2214201090888345937",
"amount": "2000",
"transactionDate": "2019-12-17 14:08:38",
"requestReference": "2634279"
}
Sample Response for Account Debit (duplicate)
{
"responseCode": "94",
"responseMessage": "Duplicate Transaction",
"transactionId": "12341234abcd",
"amount": 5000,
"transactionDate": "2019-12-17 14:21:39",
"requestReference": "2634302"
}