Skip to content

Add / Update Kit Product

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).

HeaderRequiredValue
api-keyyesImport API key
Content-Typeyesapplication/json
{
"product_id": 7,
"quantity": 2,
"mandatory": true
}
FieldTypeRequiredDescription
product_idintyesMust exist in the products table
quantityintyesMin: 1
mandatorybooleannoDefaults to false

HTTP 201 Created

{
"success": true,
"entry": {
"user_id": 42,
"product_id": 7,
"quantity": 2,
"mandatory": true
}
}
StatusDescription
401Missing api-key header
403Invalid api-key value
404User not found
422Validation error (missing or invalid field)

This endpoint can trigger one of two emails (only when the user_product_kit site feature is enabled, and never on staging sites):

  • First kit item ever assigned to the user — sends a PasswordNewUser email with a login link, immediately.
  • A new product is added to an existing kit, or the quantity of an already-assigned product is increased (e.g. 12) — sends a NewItemAccess email with a login link. This only fires once the user’s kit is at least a day old (first kit item created before today), and is debounced: if multiple changes happen within a 30-minute window, only one email is queued, delayed by 30 minutes from the triggering change.

Decreasing or keeping the same quantity for an existing item does not trigger an email.