Subscriptions / Create Subscription Item
### Endpoint Description This endpoint is designed to create a new subscription item within the system. It allows users to submit specific details about the subscription item they wish to ad
Body parameters
module
|
string |
Example: subscription_items
|
data
|
array |
Example:
|
### Endpoint Description
This endpoint is designed to create a new subscription item within the system. It allows users to submit specific details about the subscription item they wish to add.
## Important facts
> The **subscription_id** must exist in the module Subscriptions
> The **item_id** must exist in the module Invoice Items
### Request
- **Method**: POST
- **Content-Type**: application/json
- **Payload**:
- `module` (string): Specifies the module to which the data belongs. In this case, it is set to `"subscription_items"`.
- `data` (array): An array of objects that contain the details of the subscription item.
- Each object in the array should have:
- `field` (string): The name of the field being set, e.g., `"title"`.
- `value` (string): The value to be assigned to the specified field, e.g., `"Storage Space"`.
### Response
Upon a successful request, the server responds with a JSON object containing:
- `success` (boolean): Indicates whether the request was successful.
- `data` (object): Contains additional information about the created subscription item.
- `id` (integer): The unique identifier for the newly created subscription item.
### Example
**Request Body:**
``` json
{
"module": "subscription_items",
"data": [
{
"field": "title",
"value": "Storage Space"
}
]
}
**Response:**json
{
"success": true,
"data": {
"id": 0
}
}
```
This endpoint is essential for managing subscription items effectively within the application.