Get Contracts for an Account
get
/bcws/webresources/v1.0/subscriptions/account/{id}/packages
Gets the list of contracts for the specified account.
Note: A contract consists of a purchased package and its subscription terms.
Request
Path Parameters
-
id(required): string
The ID of the account, such as 0.0.0.1+-account+345678.
There's no request body for this operation.
Back to TopResponse
Supported Media Types
- application/xml
- application/json
200 Response
The contracts were returned successfully.
Root Schema : customerPackages
Type:
Show Source
object-
billUnitPackages: array
billUnitPackages
A list of purchased packages
Nested Schema : billUnitPackages
Type:
arrayA list of purchased packages
Show Source
-
Array of:
object BillUnitPackages
A list of purchased packages
Nested Schema : BillUnitPackages
Type:
objectA list of purchased packages
Show Source
-
accountBundles: object
AccountGroup
-
packageCreatedDate: string
(date-time)
The date and time the package was created.
-
packageID: string
The package's ID.
-
packageName: string
The package's name.
-
packagePurchasedDate: string
(date-time)
The date and time the package was purchased.
-
packageTerms: object
SubscriptionTerms
-
serviceType: array
serviceType
Nested Schema : AccountGroup
Type:
Show Source
object-
bundles: array
bundles
-
extension: object
extension
The extended attributes.
-
lastStatusChange: string
(date-time)
The date and time the account group's status was last modified.
-
status: integer
(int32)
The account group's status.
Nested Schema : SubscriptionTerms
Type:
Show Source
object-
accountRef: object
ResourceRef
-
autoRenew: boolean
Whether to automatically renew the terms at the end of its commitment period (true) or not (false).
-
bundleName(required): string
The name of the bundle associated with the subscription terms.
-
bundleRef: object
ResourceRef
-
commitmentEndDate(required): string
(date-time)
The date and time the commitment period ends.
-
commitmentPeriod: integer
(int32)
The duration of the commitment period.
-
commitmentStartDate(required): string
(date-time)
The date and time the commitment period starts.
-
commitmentUnit: integer
(int32)
The unit for the commitment period. Can be one of the following:
- 0: Months
- 1: Days
-
currency: integer
(int32)
The currency associated with the subscription fee.
-
earlyCancellationAllowed: boolean
Whether early cancellation is allowed (true) or not (false).
-
earlyCancellationDate(required): string
(date-time)
The date and time of early cancellation.
-
earlyCancellationFee(required): number
The fee for canceling a subscription early.
-
earlyCancellationType: integer
(int32)
The type of early cancelation fee. Can be one of the following:
- 0: Fixed
- 1: Reducing
-
extension: object
extension
The extended attributes.
-
gracePeriod: integer
(int32)
The duration of the grace period.
-
gracePeriodUnit: integer
(int32)
The unit for the grace period. Can be one of the following:
- 0: Months
- 1: Days
-
id(required): string
The ID.
-
packageId: integer
(int32)
The ID of package associated with the subscription terms.
-
packageRef: object
ResourceRef
-
reducedCancellationFee(required): number
The reduced cancellation fee.
-
renewalContractTerms(required): object
SubscriptionTerms
-
renewWithSameTerms: boolean
Whether to renew with the same terms (true) or with different terms (false).
-
serviceRef: object
ResourceRef
-
subscriberContractRef: object
ResourceRef
-
termsDescription: string
The subscription terms' description.
-
termsName(required): string
The subscription terms' name.
Nested Schema : extension
Type:
objectThe extended attributes.
Nested Schema : PurchasedBundle
Type:
Show Source
object-
bundleID: string
The bundle's ID.
-
bundleName: string
The bundle's name.
-
bundleType: integer
(int32)
The type of bundle. Can be one of the following:
- 0: Optional
- 1: Required
- 2: Add-on
-
extension: object
extension
The extended attributes.
-
packageId: string
The ID of the package that contains the bundle.
Nested Schema : extension
Type:
objectThe extended attributes.
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:
objectThe extended attributes.
Nested Schema : ServiceGroup
Type:
Show Source
object-
bundles: array
bundles
-
extension: object
extension
The extended attributes.
-
lastStatusChange: string
(date-time)
The date and time the service's status was last modified.
-
serviceId: string
The service's ID.
-
serviceName: string
The service's name.
-
serviceRef: object
ResourceRef
-
status: integer
(int32)
The service's status.
Nested Schema : extension
Type:
objectThe extended attributes.
500 Response
An internal server error occurred.
Examples
This example shows how to get an account's list of purchased packages, along with their subscription terms, 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/subscriptions/account/0.0.0.1+-account+1612699/packages
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.
{
"billUnitPackages": [
{
"packageID": "0.0.0.1+-plan+865226",
"packageName": "Package2_renew_with_different_term",
"packagePurchasedDate": 1393676012000,
"packageTerms": {
"extension": null,
"id": "0.0.0.1+-subscription_terms+861562",
"termsName": "Term_12month_renew_diff",
"termsDescription": "",
"packageRef": {
"id": "0.0.0.1+-plan+865226",
"uri": null
},
"bundleRef": null,
"serviceRef": null,
"subscriberContractRef": {
"id": "0.0.0.1+-subscriber_contract+1613147",
"uri": null
},
"accountRef": {
"id": "0.0.0.1+-account+1612699",
"uri": null
},
"commitmentPeriod": 12,
"commitmentUnit": 0,
"commitmentStartDate": 1393660800000,
"commitmentEndDate": 1425196800000,
"earlyCancellationAllowed": true,
"earlyCancellationDate": 1398927600000,
"earlyCancellationFee": 100,
"reducedCancellationFee": null,
"autoRenew": true,
"renewWithSameTerms": false,
"bundleName": null,
"currency": 840,
"gracePeriod": 0,
"gracePeriodUnit": 0,
"earlyCancellationType": 1,
"renewalContractTerms": {
"extension": null,
"id": "0.0.0.1+-subscription_terms+862905",
"termsName": null,
"termsDescription": null,
"packageRef": null,
"bundleRef": null,
"serviceRef": null,
"subscriberContractRef": null,
"accountRef": null,
"commitmentPeriod": 12,
"commitmentUnit": 0,
"commitmentStartDate": null,
"commitmentEndDate": null,
"earlyCancellationAllowed": false,
"earlyCancellationDate": null,
"earlyCancellationFee": 0,
"reducedCancellationFee": null,
"autoRenew": false,
"renewWithSameTerms": false,
"bundleName": null,
"currency": 840,
"gracePeriod": 0,
"gracePeriodUnit": 0,
"earlyCancellationType": 0,
"renewalContractTerms": null
}
},
"serviceType": [
{
"extension": null,
"serviceId": "ip_2",
"serviceName": "ip",
"serviceRef": {
"id": "0.0.0.1+-service-ip+1609947",
"uri": null
},
"lastStatusChange": 1393676012000,
"status": 10100,
"bundles": [
{
"extension": null,
"bundleID": "0.0.0.1+-deal+856633",
"bundleName": "Ip_Deal",
"bundleType": 1,
"packageId": "223"
}
]
}
],
"accountBundles": null,
"packageCreatedDate": 1393676012000
}
]
}