Add / Update Kit Product
POST /api/users/{user}/kit
Section titled “POST /api/users/{user}/kit”Adds a product to the user’s kit. If the product is already assigned to the user it will be updated — this endpoint behaves as an upsert.
The {user} path parameter is the internal user id (use Find User by Email to look it up).
Headers
Section titled “Headers”| Header | Required | Value |
|---|---|---|
api-key | yes | Import API key |
Content-Type | yes | application/json |
Request body
Section titled “Request body”{ "product_id": 7, "quantity": 2, "mandatory": true}Fields
Section titled “Fields”| Field | Type | Required | Description |
|---|---|---|---|
product_id | int | yes | Must exist in the products table |
quantity | int | yes | Min: 1 |
mandatory | boolean | no | Defaults to false |
Response
Section titled “Response”HTTP 201 Created
{ "success": true, "entry": { "user_id": 42, "product_id": 7, "quantity": 2, "mandatory": true }}HTTP error codes
Section titled “HTTP error codes”| Status | Description |
|---|---|
401 | Missing api-key header |
403 | Invalid api-key value |
404 | User not found |
422 | Validation error (missing or invalid field) |