Subrents
Update a subrent
Changes the terms of a subrent: status (pending, active, completed or cancelled), dates, notes, whether the need is resolved and its link to a purchase order (send only the fields to change).
subrents:writesubrents:write- 120/min
- May need an add-on
- Server annotation: Idempotent
Result
generated from the schema
linkQuantity deserves attention: if it is LOWER than the quantity of the subrent, the record is SPLIT —the original keeps that quantity and another one is born with the rest—, and what is returned is the original. What is paid to the supplier is NOT part of the public contract, neither to read nor to write. It requires subrents in the plan of the account —included in the current offer, and with the purchases add-on in older plans— (402 without it). Returns the full subrent, the same projection as its GET.
Arguments
Subrent identifier.
Limits: min length 1
New subrent status.
Available options: pending, active, completed, cancelled
Start of the subrent (ISO 8601 with offset); null clears it.
End of the subrent (ISO 8601 with offset); null clears it.
true when the material need that motivated the subrent is already covered.
Purchase order the subrent is linked to; null unlinks it.
Limits: min length 1
Quantity linked to the purchase order. If it is lower than the subrent quantity, the record is split: the original keeps this quantity and a new one is created with the rest.
Limits: > 0
Subrent notes; null clears them.
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 subrent identifier.
bulk if it is a quantity of a bulk item, serialized if it is a specific unit.
Available options: bulk, serialized
Subrent status.
Available options: pending, active, completed, cancelled
Identifier of the subrented item.
Name of the subrented item.
Item SKU; null if it has none.
Subrented units; null if it is a specific unit.
Identifier of the specific unit; null if bulk.
Code of the specific unit; null if bulk.
Identifier of the supplier that lends the material; null if not decided yet.
Supplier name; null if not decided yet.
true if the need is already covered, that is, if the supplier and material are confirmed.
Start of the required period in ISO 8601 UTC; null if not set.
End of the required period in ISO 8601 UTC; null if not set.
Pickup date from the supplier in ISO 8601 UTC; null if not set.
Return date to the supplier in ISO 8601 UTC; null if not set.
Order that motivates the subrent; null if it has none.
Associated project; null if it has none.
Purchase order that formalizes it; null if none has been issued.
Warehouse where the material is received; null if not applicable.
Subrent notes; null if it has none.
Creation date in ISO 8601 UTC.
Last modification date in ISO 8601 UTC.
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 PATCH /api/v1/subrents/{subrentId}.
Related pages
Link to this section: Related pagesSubrents
Update a subrent
Changes the terms of a subrent: status (
pending,active,completedorcancelled), dates, notes, whether the need is resolved and its link to a purchase order (send only the fields to change).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?