Get Loans for an Account
get
/bcws/webresources/v1.0/loans/account/{id}
Gets the loans for the account with the specified ID.
Request
Path Parameters
-
id(required): string
The ID of the account to get loans for. For example: 0.0.0.1+-account+123123
Query Parameters
-
loanEndTime(required): string
The latest end date of loans to get, in milliseconds. For example: 1444209849879.
-
loanStartTime(required): string
The earliest start date of the loans to get, in milliseconds. For example: 1444209849879.
-
onlyActiveLoans(required): boolean
Whether to retrieve only active loans (true) or all loans that have been granted (false).
-
service.id(required): string
The service ID to filter loans by.
-
service.type(required): string
The service type to filter loans by.
There's no request body for this operation.
Back to TopResponse
Supported Media Types
- application/xml
- application/json
200 Response
The loans were returned successfully.
Nested Schema : loanDetail
Type:
Show Source
object
-
availableLoanLimit: number
The amount that the customer can currently be loaned, based on the amount specified in creditLimit and the current total outstanding amount for all active loans.
-
creditLimit: number
The maximum total amount the customer can be loaned.
-
extension: object
extension
The extended attributes.
-
loanDetails: array
loanDetails
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : LoanDetails
Type:
Show Source
object
-
channel: string
The channel that requested the loan. For example, USSD or IVR.
-
loanAmount: number
The loan amount.
-
loanDebitRef: object
ResourceRef
-
loanFee: number
The loan's fee.
-
loanFeeRef: object
ResourceRef
-
outstandingAmount: number
The amount of the loan that is still owed.
-
serviceRef: object
ResourceRef
-
tax: number
The tax to apply on the loan.
-
type: integer
(int32)
The type of loan. Can be one of the following:
- 0: Currency or emergency loan
- 1: Data loan
- 2: Hybrid loan
Nested Schema : ResourceRef
Type:
Show Source
object
-
id(required): string
The ID.
-
uri: string
The Uniform Resource Identifier (URI) associated with the resource.
500 Response
An internal server error occurred.
Examples
This example shows how to get the active loans for a specified account by submitting a GET request on the REST resource using cURL. For more information about cURL, see "Use cURL".
cURL Command
curl -X GET 'http://hostname:port/bcws/webresources/version/loans/account/0.0.0.1+-account+103319?onlyActiveLoans=true'
where:
- hostname is the URL for the Billing Care REST server.
- port is the port for the Billing Care REST server.
- version is the version of the API you're using, such as v1.0.
Example of Response Body
This example shows the contents of the response body in JSON format.
{
"extension": null,
"availableLoanLimit": 9400,
"creditLimit": 10000,
"loanDetails": [
{
"serviceRef": {
"id": "0.0.0.0++0",
"uri": null
},
"loanAmount": 50,
"loanFee": 10,
"tax": 0,
"outstandingAmount": 60,
"loanFeeRef": {
"id": "0.0.0.1+-event-billing-loan_fee+335412619122882241",
"uri": null
},
"loanDebitRef": {
"id": "0.0.0.1+-event-billing-loan_debit+335412619122883009",
"uri": null
},
"type": 2,
"channel": "USSD"
},
{
"serviceRef": {
"id": "0.0.0.1+-service-email+42466",
"uri": null
},
"loanAmount": 50,
"loanFee": 10,
"tax": 0,
"outstandingAmount": 60,
"loanFeeRef": {
"id": "0.0.0.1+-event-billing-loan_fee+335412619122883458",
"uri": null
},
"loanDebitRef": {
"id": "0.0.0.1+-event-billing-loan_debit+335412619122880578",
"uri": null
},
"type": 2,
"channel": "USSD"
}
]
}