Services
Create a service
Registers a sellable line that does not come out of the inventory: a technician, a transport, a working day.
services:writeResult
generated from the schema
The rate is NOT set here — that is what the patch is for, which has its own block. Returns the created service.
Arguments
Service name as the customer will see it.
Limits: min length 2, max length 200
Service type.
Available options: crew, fleet, general
Service description.
Limits: max length 2000
Collection it belongs to.
Limits: min length 1
Quantity added to an order by default.
Limits: min 1
Whether it appears as a plannable service.
Resources needed to provide it.
Limits: max 20 items
Show child attributesHide child attributes
What is needed to provide it: personnel or vehicle.
Available options: personnel, vehicle
How many are needed.
Limits: min 1
Tags the assigned resource must have. E.g.: "Carné C".
Limits: max 20 items, each max length 100
Idempotency key chosen by the client (a UUID is recommended). Repeating the same key with the same arguments within 24 h returns the stored response without executing again; with different arguments it responds 422. It is the safe way to retry after a network failure.
Limits: min length 1, max length 255
Optimistic locking: the meta.etag you got from the detail read of this resource (or "*"). If the resource changed since, the call fails with 412 precondition_failed before writing anything; read it again and retry. Omit it to write unconditionally.
Limits: min length 1
Result
On success the result carries structuredContent with data and meta. These are the attributes of data.
Show the attributes of data
Unique service identifier.
Service name as the customer sees it.
Type: crew (personnel), fleet (vehicles) or general.
Description; null if it has none.
Quantity added to an order by default.
Whether it appears as a plannable service.
Whether its amount counts towards the document total.
Path of the collection it belongs to; null if it is in none.
Resources needed to provide it.
Show child attributesHide child attributes
What is needed to provide it: personnel or vehicle.
Available options: personnel, vehicle
How many are needed.
Limits: min 1
Tags the assigned resource must have. E.g.: "Carné C".
Limits: max 20 items, each max length 100
Creation date in ISO 8601 UTC; null if not recorded.
Last modification date in ISO 8601 UTC; null if not recorded.
An error is a result with isError: true and the problem in content[0].; there is no structuredContent. See Errors.
The same operation by REST
This tool runs POST /api/v1/services.
Related pages
Link to this section: Related pagesServices
Create a service
Registers a sellable line that does not come out of the inventory: a technician, a transport, a working day.
Guides
Safe writes
An assistant that can write can also write the wrong thing. Decide which tools need a person, retry without duplicating, and know what a write sets in motion.
Guides
Errors
A tool error is a result with
isError: trueand the problem in the first text block. Branch on itscode.
Was this page helpful?