Create a Loan
post
/bcws/webresources/v1.0/loans
Creates a new loan.
Request
There are no request parameters for this operation.
Supported Media Types
- application/xml
- application/json
Root Schema : schema
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
amount(required): number
The loan amount.
-
channel(required): string
The channel requesting the loan. For example, USSD or IVR.
-
extension: object
extension
The extended attributes.
-
locale(required): string
The locale associated with the loan.
-
resourceId(required): number
The ID of the resource associated with the loan.
-
service: object
Service
-
type: integer
(int32)
The type of loan. Can be one of the following:
- 0: Currency or emergency loan
- 1: Data loan
- 2: Hybrid loan
-
zoneMapName(required): string
The name of the zonemap associated with the loan.
-
zoneMapTarget(required): string
The zone map associated with the loan.
Nested Schema : ResourceRef
Type:
Show Source
object
-
id(required): string
The ID.
-
uri: string
The Uniform Resource Identifier (URI) associated with the resource.
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : Service
Type:
Show Source
object
-
accountNumber: string
The account number associated with the service.
-
discounts: array
discounts
-
extension: object
extension
The extended attributes.
-
products: array
products
-
serviceDetails: object
Discriminator: @class
Discriminator:
{ "propertyName":"@class" }
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : Discriminator: @class
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
aliasList: array
aliasList
The list of aliases associated with the service.
-
balanceGroupRef: object
ResourceRef
-
balGrpIndex: integer
(int32)
The balance group index.
-
creationDate: string
(date-time)
The date and time the service type was created.
-
effectiveDate: string
(date-time)
-
extension: object
extension
The extended attributes.
-
id: object
ResourceRef
-
lastModified: string
(date-time)
The date and time the service was last modified.
-
lastStatusChange: string
(date-time)
The date and time of the last status change.
-
lastStatusComment: string
The comment associated with the last status change.
-
lifeCycleState: integer
(int32)
The current life cycle state.
-
login(required): string
The login associated with the service.
-
name: string
The name of the service.
-
nameinfoObj: object
ResourceRef
-
password(required): string
The password associated with the service.
-
passwordExpiration: string
(date-time)
The date and time the password expires.
-
passwordStatus: integer
(int32)
The current status of the password.
-
pendingDeferredActionsCount: integer
(int32)
The number of deferred actions that are pending for the service.
-
serviceAccessLevel: string
The service access level.
-
status: integer
(int32)
The status.
-
statusFlags: integer
(int32)
The status flags.
-
subscriptionServiceRef: object
ResourceRef
-
svcExpLastNotiOffset: string
The notification offset.
-
svcExpLastNotiT: string
(date-time)
The last notification time.
Nested Schema : Discount
Type:
Show Source
object
-
description: string
The discount's description.
-
extension: object
extension
The extended attributes.
-
id: object
ResourceRef
-
lastStatusChange: string
(date-time)
The date and time the discount's status was last changed.
-
name: string
The discount's name.
-
planName: string
The name of the package containing the discount.
-
purchaseDate(required): string
(date-time)
The date and time the discount was purchased.
-
purchaseEndDate(required): string
(date-time)
The date and time the purchase ends.
-
status: string
The discount's status
-
type: integer
(int32)
The type of discount. Can be one of the following:
- 0: Optional
- 1: Required
- 2: Regular
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : Product
Type:
Show Source
object
-
contractEndDate: string
(date-time)
The end date for the contract.
-
contractName: string
The name of the contract.
-
contractRef: object
ResourceRef
-
contractStartDate: string
(date-time)
The start date for the contract.
-
description: string
The product's descritpion.
-
extension: object
extension
The extended attributes.
-
id: object
ResourceRef
-
isOfferCustomized: boolean
Whether the product contains customized offers (true) or not (false).
-
lastStatusChange: string
(date-time)
The date and time the product's status was last changed.
-
name: string
The product's name.
-
planName: string
The name of the package that contains the product.
-
productRef: object
ResourceRef
-
purchaseDate(required): string
(date-time)
The date and time the product was purchased.
-
purchaseEndDate(required): string
(date-time)
The date and time the purchase ends.
-
status: string
The product's status.
-
termRef: object
ResourceRef
-
type: integer
(int32)
The type of product. Can be one of the following:
- 0: Optional
- 1: Required
- 2: Regular
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : aliasList
Type:
array
The list of aliases associated with the service.
Show Source
-
Array of:
object AliasList
The list of aliases associated with the service.
Nested Schema : extension
Type:
object
The extended attributes.
Root Schema : schema
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
amount(required): number
The loan amount.
-
channel(required): string
The channel requesting the loan. For example, USSD or IVR.
-
extension: object
extension
The extended attributes.
-
locale(required): string
The locale associated with the loan.
-
resourceId(required): number
The ID of the resource associated with the loan.
-
service: object
Service
-
type: integer
(int32)
The type of loan. Can be one of the following:
- 0: Currency or emergency loan
- 1: Data loan
- 2: Hybrid loan
-
zoneMapName(required): string
The name of the zonemap associated with the loan.
-
zoneMapTarget(required): string
The zone map associated with the loan.
Nested Schema : ResourceRef
Type:
Show Source
object
-
id(required): string
The ID.
-
uri: string
The Uniform Resource Identifier (URI) associated with the resource.
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : Service
Type:
Show Source
object
-
accountNumber: string
The account number associated with the service.
-
discounts: array
discounts
-
extension: object
extension
The extended attributes.
-
products: array
products
-
serviceDetails: object
Discriminator: @class
Discriminator:
{ "propertyName":"@class" }
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : Discriminator: @class
Type:
Show Source
object
-
accountRef: object
ResourceRef
-
aliasList: array
aliasList
The list of aliases associated with the service.
-
balanceGroupRef: object
ResourceRef
-
balGrpIndex: integer
(int32)
The balance group index.
-
creationDate: string
(date-time)
The date and time the service type was created.
-
effectiveDate: string
(date-time)
-
extension: object
extension
The extended attributes.
-
id: object
ResourceRef
-
lastModified: string
(date-time)
The date and time the service was last modified.
-
lastStatusChange: string
(date-time)
The date and time of the last status change.
-
lastStatusComment: string
The comment associated with the last status change.
-
lifeCycleState: integer
(int32)
The current life cycle state.
-
login(required): string
The login associated with the service.
-
name: string
The name of the service.
-
nameinfoObj: object
ResourceRef
-
password(required): string
The password associated with the service.
-
passwordExpiration: string
(date-time)
The date and time the password expires.
-
passwordStatus: integer
(int32)
The current status of the password.
-
pendingDeferredActionsCount: integer
(int32)
The number of deferred actions that are pending for the service.
-
serviceAccessLevel: string
The service access level.
-
status: integer
(int32)
The status.
-
statusFlags: integer
(int32)
The status flags.
-
subscriptionServiceRef: object
ResourceRef
-
svcExpLastNotiOffset: string
The notification offset.
-
svcExpLastNotiT: string
(date-time)
The last notification time.
Nested Schema : Discount
Type:
Show Source
object
-
description: string
The discount's description.
-
extension: object
extension
The extended attributes.
-
id: object
ResourceRef
-
lastStatusChange: string
(date-time)
The date and time the discount's status was last changed.
-
name: string
The discount's name.
-
planName: string
The name of the package containing the discount.
-
purchaseDate(required): string
(date-time)
The date and time the discount was purchased.
-
purchaseEndDate(required): string
(date-time)
The date and time the purchase ends.
-
status: string
The discount's status
-
type: integer
(int32)
The type of discount. Can be one of the following:
- 0: Optional
- 1: Required
- 2: Regular
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : Product
Type:
Show Source
object
-
contractEndDate: string
(date-time)
The end date for the contract.
-
contractName: string
The name of the contract.
-
contractRef: object
ResourceRef
-
contractStartDate: string
(date-time)
The start date for the contract.
-
description: string
The product's descritpion.
-
extension: object
extension
The extended attributes.
-
id: object
ResourceRef
-
isOfferCustomized: boolean
Whether the product contains customized offers (true) or not (false).
-
lastStatusChange: string
(date-time)
The date and time the product's status was last changed.
-
name: string
The product's name.
-
planName: string
The name of the package that contains the product.
-
productRef: object
ResourceRef
-
purchaseDate(required): string
(date-time)
The date and time the product was purchased.
-
purchaseEndDate(required): string
(date-time)
The date and time the purchase ends.
-
status: string
The product's status.
-
termRef: object
ResourceRef
-
type: integer
(int32)
The type of product. Can be one of the following:
- 0: Optional
- 1: Required
- 2: Regular
Nested Schema : extension
Type:
object
The extended attributes.
Nested Schema : aliasList
Type:
array
The list of aliases associated with the service.
Show Source
-
Array of:
object AliasList
The list of aliases associated with the service.
Nested Schema : extension
Type:
object
The extended attributes.
Response
201 Response
The loan was created successfully.
400 Response
The request isn't valid.
500 Response
An internal server error occurred.
Examples
This example shows how to create a loan by submitting a POST request on the REST resource using cURL. For more information about cURL, see "Use cURL".
cURL Command
curl -X POST 'http://hostname:port/bcws/webresources/version/loans' -H 'content-type: application/json' -d @createLoan.json
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.
- createLoan.json is the JSON file that specifies the loan to create.
Example of Request Body
This example shows the contents of the createLoan.json file sent as the request body.
{
"accountRef": {
"id": "0.0.0.1+-account+103319"
},
"amount": 50,
"resourceId": 1000095,
"channel" : "USSD",
"type" : 2
}
Example of Response Body
This example shows the contents of the response body in JSON format.
{
"extension": null,
"availableLoanBalance": 50,
"currentBalance": 1955,
"amount": 50,
"loanFee": 10,
"tax": 0,
"balances": [
{
"amount": -800,
"type": 1000095
},
{
"amount": -1000,
"type": 840
}
],
"availableLoanLimit": 9760,
"creditLimit": 10000,
"loanObj": {
"id": "0.0.0.1+-event-billing-loan_debit+335412619122889132",
"uri": null
},
"loanFeeObj": {
"id": "0.0.0.1+-event-billing-loan_fee+335412619122891436",
"uri": null
}
}