Skip to content

Stop counting a product

DELETE
/products/{id}/stock
curl --request DELETE \
--url https://example.com/products/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/stock \
--cookie bottle.session_token=<bottle.session_token>

The product is always available on the shop again. Its movements are kept. A count starts it again.

id
required

UUID v7

string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f

UUID v7

The count, its rules, and the last 50 movements, newest first

Media typeapplication/json
object
productId
required

UUID v7

string format: uuid
stockOnHand
required
integer | null
stockLowAt
required
integer | null
whenOut
required
string | null
Allowed values: stop continue
movements
required
Array<object>
object
id
required

UUID v7

string format: uuid
change
required
integer
after
required
integer
reason
required
string
Allowed values: sale cancelled restock adjustment
orderId
required

UUID v7

string | null format: uuid
note
required
string | null
userId
required
string | null
createdAt
required
string format: date-time
Example
{
"productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"whenOut": "stop",
"movements": [
{
"id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"reason": "sale",
"orderId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"
}
]
}

Not signed in

Media typeapplication/json
object
error
required
string
message
required
string
Example
{
"error": "not_found",
"message": "Customer not found"
}

Not a member, or without the permission this needs

Media typeapplication/json
object
error
required
string
message
required
string
Example
{
"error": "not_found",
"message": "Customer not found"
}

Not found

Media typeapplication/json
object
error
required
string
message
required
string
Example
{
"error": "not_found",
"message": "Customer not found"
}

Validation failed

Media typeapplication/json
object
error
required
string
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}