Create New Item
POST/api/items
Headers
| Field | Type | Description |
|---|---|---|
| authtoken | String | Authentication token, generated from admin area |
Parameters
| Field | Type | Description |
|---|---|---|
| description | String | Mandatory item description/name |
| rate | Number | Mandatory item rate/price |
| long_description | String | optional Optional long description |
| tax | Number | optional Optional primary tax ID |
| tax2 | Number | optional Optional secondary tax ID |
| group_id | Number | optional Optional item group ID (default: 0) |
| unit | String | optional Optional unit of measurement |
curl -X POST "https://yoursite.com/api/items" \
-H "authtoken: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "description": "...", "rate": "..." }' Success-Response:
HTTP/1.1 200 OK
{
"status": true,
"message": "Item created successfully",
"item_id": 123
} Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Item creation failed"
}