# Validate cart

**POST** `/carts/{order_id}/validate`

## Parameters

### `order_id` (_path_, required)

Order id

- **Type:** `string`
- **Example:** `"42"`
- **Constraints:** pattern `^[1-9]\d*$`

## Request body

**application/json**

_Schema ref:_ `#/components/schemas/ValidateCartBody` (ValidateCartBody)

```json
{
  "type": "object",
  "properties": {
    "purchaser_id": {
      "type": "integer",
      "minimum": 0,
      "exclusiveMinimum": true,
      "description": "User id of the purchaser (company employee) for this order after validation",
      "example": 12
    },
    "signatory_id": {
      "type": "integer",
      "minimum": 0,
      "exclusiveMinimum": true,
      "description": "User 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": 34
    },
    "expected_device_ids": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 0,
        "exclusiveMinimum": true
      },
      "minItems": 1,
      "description": "Ids 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
      ]
    },
    "require_signatory_role": {
      "type": "boolean",
      "description": "When true, validation fails with SIGNATORY_REQUIRED unless the signatory already has `is_signatory`, instead of granting it.",
      "example": true
    }
  },
  "required": [
    "purchaser_id"
  ]
}
```

## Responses

### 200

Validated

**application/json**

_Schema ref:_ `#/components/schemas/ValidateCartResponse` (ValidateCartResponse)

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "order_id": {
          "type": "integer"
        },
        "client_status": {
          "type": "string",
          "enum": [
            "RECEIVED",
            "BEING_PROCESSED",
            "FINANCING_REQUEST",
            "DOC_REQUIRED",
            "SIGNING",
            "PROCESSING",
            "SHIPPED",
            "RECEPTION_TO_CONFIRM",
            "ONGOING_ORDER",
            "PENDING_DECISION",
            "EQUIPMENT_TO_SEND",
            "ARCHIVED",
            "FAILED",
            "UNKNOWN"
          ],
          "description": "Order progress after validation",
          "example": "BEING_PROCESSED"
        }
      },
      "required": [
        "order_id",
        "client_status"
      ]
    }
  },
  "required": [
    "data"
  ]
}
```

### 400

Validation or business rule error

**application/json**

_Schema ref:_ `#/components/schemas/ValidateCartBadRequestResponse` (ValidateCartBadRequestResponse)

```json
{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Every validation failure, comma-separated",
          "example": "Required, must be an ISO 3166-1 alpha-2 country code"
        },
        "type": {
          "type": "string",
          "enum": [
            "validation_error"
          ]
        },
        "error": {
          "type": "string",
          "enum": [
            "validation_error"
          ]
        }
      },
      "required": [
        "message",
        "type",
        "error"
      ]
    },
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string",
          "enum": [
            "INVALID_PURCHASER",
            "VALIDATE_CART_NO_DEVICES",
            "SIGNATORY_REQUIRED"
          ]
        }
      },
      "required": [
        "error"
      ]
    }
  ]
}
```

### 401

Missing, invalid, or revoked API key

**text/plain**

```json
{
  "type": "string",
  "example": "Unauthorized"
}
```

### 403

INSUFFICIENT_SCOPE for an API key with READ scope, or COMPANY_SELF_EMPLOYED for a sole trader, which Fleet does not serve

**application/json**

_Schema ref:_ `#/components/schemas/ValidateCartForbiddenErrorResponse` (ValidateCartForbiddenErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "INSUFFICIENT_SCOPE",
        "COMPANY_SELF_EMPLOYED"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 404

Not found

**application/json**

_Schema ref:_ `#/components/schemas/ValidateCartNotFoundErrorResponse` (ValidateCartNotFoundErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "COMPANY_NOT_FOUND",
        "CART_NOT_FOUND"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 409

Conflict

**application/json**

_Schema ref:_ `#/components/schemas/ValidateCartConflictErrorResponse` (ValidateCartConflictErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "ORDER_NOT_CART",
        "CART_CHANGED"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 429

Rate limit exceeded. The RateLimit-* headers give the limit and the reset time.

**text/plain**

```json
{
  "type": "string",
  "example": "Too many requests, please try again later."
}
```

### 500

Unexpected server error

**application/json**

_Schema ref:_ `#/components/schemas/InternalErrorResponse` (InternalErrorResponse)

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "INTERNAL_ERROR"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 503

Rate limiting is temporarily unavailable; retry with backoff

**application/json**

_Schema ref:_ `#/components/schemas/RateLimiterUnavailableResponse` (RateLimiterUnavailableResponse)

```json
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  },
  "required": [
    "message"
  ]
}
```

## Security

```json
[
  {
    "bearerAuth": []
  }
]
```

**bearerAuth:** Bearer token using a Fleet platform API key (flt_sk_…).

---

_Generated from the OpenAPI specification for raw Markdown / tooling use._
