PATCH /v1/products/{id}
const url = 'https://api.asap.cool/v1/products/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {'Content-Type': 'application/json'}, body: '{"description":"example","name":"example","unit":"example","unit_price_cents":1,"vat_rate":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.asap.cool/v1/products/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Content-Type: application/json' \ --data '{ "description": "example", "name": "example", "unit": "example", "unit_price_cents": 1, "vat_rate": "example" }'Parameters
Section intitulée « Parameters »Path Parameters
Section intitulée « Path Parameters »Product identifier.
Request Body required
Section intitulée « Request Body required »Body of PATCH /v1/products/{id}.
The three-state semantics (omitted vs null vs value) are captured
by #[serde(default, deserialize_with = ...)] on each nullable field
using a double Option: None means the key was absent,
Some(None) means it was explicitly null.
object
Description (omitted / null / value).
New name (non-null when present; trimmed, non-empty).
Unit label (omitted / null / value).
New unit price in centimes (non-null when present, >= 0).
New VAT rate (non-null when present).
Example generated
{ "description": "example", "name": "example", "unit": "example", "unit_price_cents": 1, "vat_rate": "example"}Responses
Section intitulée « Responses »Updated product.
Public projection of a [Product].
object
RFC3339 creation timestamp.
Optional description.
Stable identifier.
Name.
Unit label (e.g. hour, day, piece).
Unit price excluding VAT, in integer centimes.
RFC3339 last-update timestamp.
VAT rate as a percentage string (e.g. "20.00").
Example generated
{ "created_at": "example", "description": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "unit": "example", "unit_price_cents": 1, "updated_at": "example", "vat_rate": "example"}No active org.
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}Missing invoice:write scope.
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}Not found or cross-org.
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}Invalid product payload.
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}