Billing Customer Class APS type
In this document:
The considered APS type (download
)
extends the Resource APS type(s) and looks as follows:
{
"name": "CustomerClass",
"id": "http://www.odin.com/billing/CustomerClass/1.0",
"apsVersion": "2.0",
"implements": [
"http://aps-standard.org/types/core/resource/1.0"
],
"properties": {
"classId": {
"type": "integer",
"required": true,
"final": true
},
"name": {
"type": "string"
}
}
}
The APS type is used to manage a collection of APS resources. To get a list of resources from that collection, use the following API call:
GET /aps/2/collections/customer-classes?<RQL-filter>
NAME |
TYPE |
ATTRIBUTES |
DEFAULT |
DESCRIPTION |
---|---|---|---|---|
classId |
Integer |
Required Final |
Internal Customer Class ID |
|
name |
String |
Not Required |
Customer Class name |
Using the APS ID of the vendor’s BssAccountInformation resource , get the list of available customer classes:
GET /aps/2/resources/b7aba5b5-0516-4ad1-aec9-b31c77d74296/ownCustomerClasses
The response must look like this:
HTTP/1.1 200 OK
[
{
"aps": {
"type": "http://www.odin.com/billing/CustomerClass/1.0",
"id": "208e4172-1fdc-6ce9-aebd-1f4152889255",
"status": "aps:ready",
"revision": 2,
"modified": "2017-10-13T12:03:32Z"
},
"classId": 0,
"name": "Default"
},
{
"aps": {
"type": "http://www.odin.com/billing/CustomerClass/1.0",
"id": "6e465116-637c-4977-9524-f1c52a00633e",
"status": "aps:ready",
"revision": 2,
"modified": "2017-10-16T08:37:49Z"
},
"classId": 1,
"name": "Test Class"
}
]
To determine the customer class assigned currently to an account, request that account for
the customer class linked with the BssAccountInformation resource through the customerClass
link. In the following example, the GET request refers to the customerClass
link of the BssAccountInformation resource belonging to the required account:
GET /aps/2/resources/ceeeffac-d2f2-4e36-ae4a-3fe27ed58097/customerClass
The response contains the representation of the customer class.
HTTP/1.1 200 OK
[
{
"aps": {
"type": "http://www.odin.com/billing/CustomerClass/1.0",
"id": "208e4172-1fdc-6ce9-aebd-1f4152889255",
"status": "aps:ready",
"revision": 2,
"modified": "2017-10-13T12:03:32Z"
},
"classId": 0,
"name": "Default"
}
]
In accordance with the aps.id
, classId
, and name
fields, the customer is currently linked with the “Default”
customer class from the vendor’s list identified in the previous step.
If the vendor of an account has two or more customer classes, it is possible to switch customers to one or another customer class:
POST /aps/2/resources/ceeeffac-d2f2-4e36-ae4a-3fe27ed58097/customerClass
{
"aps": {
"type": "http://www.odin.com/billing/CustomerClass/1.0",
"id": "6e465116-637c-4977-9524-f1c52a00633e"
}}
On success, the APS controller returns a response similar to this:
HTTP/1.1 200 OK
{
"aps": {
"type": "http://www.odin.com/billing/CustomerClass/1.0",
"id": "6e465116-637c-4977-9524-f1c52a00633e",
"status": "aps:ready",
"revision": 2,
"modified": "2017-10-16T08:37:49Z",
"package":
{
"id": "f8521d26-a3a9-4f1a-a48c-a3bcc96b7921",
"href": "/aps/2/packages/f8521d26-a3a9-4f1a-a48c-a3bcc96b7921"
}
},
"classId": 1,
"name": "Test Class"
}
Now, the customer is assigned to another customer class.