Change Product Bundle
This API allows you to change the product bundle associated with an existing case.
HTTP Request
POST <BASE_URL>/api/v1/cases/:caseId
| Parameter | Type | Description |
|---|---|---|
caseId | string | Required. The unique identifier (UUID) of the case. |
Headers
| Header | Type | Description |
|---|---|---|
cv-api-key | string | Required. Your unique API key for authentication. |
Content-Type | string | Required. Must be application/json. |
Request Body
The request body is a JSON object with a top-level action field and a productBundle object containing the product bundle details.
| Field | Type | Description |
|---|---|---|
action | string | Required. The action to be performed. This must be CHANGE_PRODUCT_BUNDLE. |
productBundle | object | An object containing the product bundle details. |
productBundle Object
| Field | Type | Description |
|---|---|---|
id | string | Required. The unique identifier (UUID) of the product bundle to assign to the case. |
Example Request
curl --location '<BASE_URL>/api/v1/cases/:caseId' \
--header 'cv-api-key: <redacted>' \
--header 'Content-Type: application/json' \
--data-raw '{
"action": "CHANGE_PRODUCT_BUNDLE",
"productBundle": {
"id": "a1b2c3d4-5e6f-7g8h-9i0j-k1l2m3n4o5p6"
}
}
Responses
Success Response
A successful request returns a 200 status code with a message confirming the product bundle was changed and includes the product bundle details.
{
"status": 200,
"success": true,
"message": "Case product bundle changed successfully",
"data": {
"productBundle": {
"id": "a1b2c3d4-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
"name": "Premium Bundle"
}
}
}
Failure Responses
A request can fail for several reasons, returning a 400 Bad Request or a specific error message.
Invalid action in the request body:
If the action field is not a recognized value like CHANGE_PRODUCT_BUNDLE, the API will return a bad request error.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "Invalid action"
}
Missing required fields
If the productBundle.id field is missing or empty, the API will return a specific error message.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "Product Bundle is required"
}
Case Not Found
This response is returned if no case exists with the provided caseId.
{
"status": 404,
"success": false,
"message": "Invalid request",
"error": "No Case found for provided details!"
}
Permission Denied
This response occurs if the case exists but belongs to a different organization, indicating that the cv-api-key does not have permission to access it.
{
"status": 403,
"success": false,
"message": "Invalid request",
"error": "Permission denied!"
}
Invalid Product Bundle
If the provided product bundle ID does not exist or is invalid, the API will return a 400 Bad Request error.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "Invalid product bundle ID"
}