Attach Customer Product
This API is used to attach (allocate) a single product to a single sub-customer.
A product can be attached (allocated) to the same sub-customer multiple times.
Developer Notes: Reject any request to attach a product whose “planType” is not “ACCOUNT_PRODUCT”.
|
HTTP URL |
|
|---|---|
| POST | /api/v2/customer/{id}/attach-product |
Eligibility
The Requestor is eligible to attach a product to his sub-customers. It is not allowed to attach a product to itself or any other level in the customers’ hierarchy.
API Request
Request Structure
|
Parameter |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
customerId |
UUID |
M |
Sub-customer UUID, which the product should be attached (allocated) to. |
|
productId |
UUID |
M |
Product UUID, which should be attached to the sub-customer. |
API Response
Response Structure
|
Parameter |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
errorCode |
String |
O |
Failure code. See list below, under ‘Error Codes’ section. |
|
errorMessage |
String |
O |
Failure detailed description. See list below, under ‘Error Codes’ section. |
|
content |
Object |
O |
Array of main response body object displayed when an API call was successful. For a failure, it will be empty. |
|
pageable |
Object |
O |
Paging information object displayed when an API call was successful. For a failure, it will be empty. |
Content data objects
|
Element |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
requestId |
UUID |
M |
Request instance ID. To be used by external systems to query the call (operation) status, whether in progress, successful or failed. |
|
productInstanceId |
UUID |
M |
Product instance UUID representing the product being attached to a sub-customer. |
Pageable data objects
|
Element |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
page |
Numeric |
M |
Page number |
|
size |
Numeric |
M |
Page size. Number of requested elements per page |
|
totalPages |
Numeric |
M |
Total amount of available pages per requested page size |
|
totalElements |
Numeric |
M |
Total amount of retrieved elements |
Error Codes
In addition to the general success and failure codes, the following error codes are possible.
|
Code |
Message |
|---|---|
|
GLOBAL_1001 |
Service unavailable. Please try again |
|
CUSTOMER_1048 |
Failed to attach product |
Examples
Request Body
{
"customerId": "ff74dca6-8e7f-4b85-a42b-13860913b370",
"productId": "d7ecef34-5b23-21ae-9e53-905a7d6d43a8"
}
Response Body: Success ACK
{
"errorCode": "",
"errorMessage": "",
"content": [
{
"requestId": "ff74dca6-8e7f-4b85-a42b-13860913b370",
"productInstanceId": "d1d2f769-f755-4210-bf76-00fa023623e9"
}
],
"pageable": {
"page": 0,
"size": 10,
"totalPages": 1,
"totalElements": 1
}
}
Response Body: Failure NAK
{
"errorCode": "CUSTOMER_1048",
"errorMessage": "Failed to attach product instance",
"content": "",
"pageable": null
}