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
Request Body - application/xml ()
The details of the loan to create.
Root Schema : schema
Type: object
Show Source
Nested Schema : ResourceRef
Type: object
Show Source
Nested Schema : extension
Type: object
The extended attributes.
Nested Schema : Service
Type: object
A service associated with the bundle.
Show Source
Request Body - application/json ()
The details of the loan to create.
Root Schema : schema
Type: object
Show Source
Nested Schema : ResourceRef
Type: object
Show Source
Nested Schema : extension
Type: object
The extended attributes.
Nested Schema : Service
Type: object
A service associated with the bundle.
Show Source
Back to Top

Response

201 Response

The loan was created successfully.

400 Response

The request isn't valid.

500 Response

An internal server error occurred.
Back to Top

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
  }
}
Back to Top