Validate cart
const url = 'https://api.fleet.co/platform/v1/carts/42/validate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"purchaser_id":12,"signatory_id":34,"expected_device_ids":[101,102],"require_signatory_role":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.fleet.co/platform/v1/carts/42/validate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "purchaser_id": 12, "signatory_id": 34, "expected_device_ids": [ 101, 102 ], "require_signatory_role": true }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Order id
Example
42Request Body
Section titled “Request Body”object
User id of the purchaser (company employee) for this order after validation
Example
12User id of the person who will sign the contract (must be a company employee). Defaults to the purchaser when omitted. Deprecated: a signatory without is_signatory is still granted it here; set is_signatory on the user first, as this will be required in a future version.
Example
34Ids of the cart’s devices the purchaser reviewed. When set, validation fails with CART_CHANGED unless the cart holds exactly these devices.
Example
[ 101, 102]When true, validation fails with SIGNATORY_REQUIRED unless the signatory already has is_signatory, instead of granting it.
Example
trueResponses
Section titled “Responses”Validated
object
object
Order progress after validation
Example
{ "data": { "client_status": "RECEIVED" }}Validation or business rule error
Missing, invalid, or revoked API key
Example
UnauthorizedINSUFFICIENT_SCOPE for an API key with READ scope, or COMPANY_SELF_EMPLOYED for a sole trader, which Fleet does not serve
object
Example
{ "error": "INSUFFICIENT_SCOPE"}Not found
object
Example
{ "error": "COMPANY_NOT_FOUND"}Conflict
object
Example
{ "error": "ORDER_NOT_CART"}Rate limit exceeded. The RateLimit-* headers give the limit and the reset time.
Example
Too many requests, please try again later.Unexpected server error
object
Example
{ "error": "INTERNAL_ERROR"}Rate limiting is temporarily unavailable; retry with backoff
object
Example generated
{ "message": "example"}
