# Cheese Store

This is a fictional API contract used to demonstrate documentation generated by [Sourcey](https://github.com/sourcey/sourcey). The Cheese Store service, accounts, keys, and endpoints are examples; there is no live cheese-ordering service behind this reference.

The Cheese Store API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer). It uses resource-oriented URLs, standard HTTP methods, and returns JSON responses. All requests are authenticated using an API key or OAuth2 token.

## Getting Started

Read the endpoints and schemas as examples. If you adapt this contract for a real API, issue your own credentials and send them in the `X-API-Key` header.

## Rate Limiting

| Plan       | Requests/hour | Burst |
|------------|---------------|-------|
| Free       | 100           | 10    |
| Pro        | 10,000        | 100   |
| Enterprise | Unlimited     | 1,000 |

When you exceed the rate limit, the API returns `429 Too Many Requests` with a `Retry-After` header.

## Pagination

List endpoints return paginated results. Use `cursor` and `limit` query parameters:

```json
{
  "items": [...],
  "nextCursor": "eyJpZCI6NDJ9",
  "hasMore": true
}
```


Version: 2.0.0

Authentication:
- api_key: apiKey, header X-API-Key. API key authentication. Include your API key in the `X-API-Key` header.

This is an example scheme. Supply credentials from your own service when adapting this contract.

- cheesy_oauth: oauth2. OAuth2 authentication for full API access
- bearer_auth: http (bearer). JWT token obtained from the `/customer/login` endpoint

## List all cheeses

`GET /cheeses`

Returns a paginated list of cheeses in the store. Results can be filtered by status and sorted by name or creation date.

The response includes cursor-based pagination. Use the `nextCursor` value from the response as the `cursor` parameter in subsequent requests.


Authentication (security requirement alternatives):

```json
[
  {
    "api_key": []
  },
  {
    "cheesy_oauth": [
      "read:cheeses"
    ]
  }
]
```

- api_key: apiKey, header X-API-Key. API key authentication. Include your API key in the `X-API-Key` header.

This is an example scheme. Supply credentials from your own service when adapting this contract.

- cheesy_oauth: oauth2. OAuth2 authentication for full API access; scopes: read:cheeses

Parameters:

- `cursor` (query, string, optional) - Pagination cursor from a previous response
  Type: string

- `limit` (query, integer, optional) - Maximum number of cheeses to return
  Type: integer
  
  default: 20
  
  minimum: 1
  
  maximum: 100

- `status` (query, string, optional) - Filter by availability status
  Type: string
  
  enum: ["available","pending","sold"]

- `sort` (query, string, optional) - Sort order for results
  Type: string
  
  default: "name"
  
  enum: ["name","-name","createdAt","-createdAt"]

Responses:

- 200: A paginated list of cheeses

Content type: application/json

Type: object

Paginated list of cheeses

Schema: [CheeseList](https://cheesestore-docs.pages.dev/api/schemas/cheeselist-06d8bd48db.md)

- `items` (optional)
  Type: array
  
  Items:
    Reference: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md); Type: object

- `nextCursor` (optional)
  Type: string; nullable
  
  Cursor for the next page (null if no more results)

- `hasMore` (optional)
  Type: boolean
  
  Whether there are more results

- `total` (optional)
  Type: integer
  
  Total number of matching cheeses

- 429: Rate limit exceeded

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 429,
  "type": "Rate limited",
  "message": "Too many requests, please try again later"
}
```

## Examples

### cURL

```bash
curl -X GET 'https://cheese.example.com/v2/cheeses?limit=20&sort=name' \
  -H 'X-API-Key: YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/cheeses?limit=20&sort=name', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/cheeses?limit=20&sort=name', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://cheese.example.com/v2/cheeses?limit=20&sort=name',
    headers={
        'X-API-Key': 'YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("GET", "https://cheese.example.com/v2/cheeses?limit=20&sort=name", nil)
  req.Header.Set("X-API-Key", "YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/cheeses?limit=20&sort=name')
request = Net::HTTP::Get.new(uri)
request['X-API-Key'] = 'YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.get("https://cheese.example.com/v2/cheeses?limit=20&sort=name")
        .header("X-API-Key", "YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Add a new cheese

`POST /cheeses`

Add a new cheese to the store inventory. The cheese name must be unique within its category.

Authentication (security requirement alternatives):

```json
[
  {
    "cheesy_oauth": [
      "write:cheeses"
    ]
  }
]
```

- cheesy_oauth: oauth2. OAuth2 authentication for full API access; scopes: write:cheeses

Request body: application/json (required)

Cheese object to add to the store

Type: object

Schema: [CheeseInput](https://cheesestore-docs.pages.dev/api/schemas/cheeseinput-4479830925.md)

- `name` (required)
  Type: string
  
  minLength: 1
  
  maxLength: 100

- `category` (optional)
  Type: object
  
  - `name` (optional)
    Type: string

- `photoUrls` (optional)
  Type: array
  
  Items:
    Type: string, uri

- `tags` (optional)
  Type: array
  
  Items:
    Type: object
    
    - `name` (optional)
      Type: string

- `status` (optional)
  Type: string
  
  default: "available"
  
  enum: ["available","pending","sold"]

- `origin` (optional)
  Type: string; nullable

- `pricePerKg` (optional)
  Type: number, float
  
  minimum: 0
  
  exclusiveMinimum: true

- `ageMonths` (optional)
  Type: integer
  
  minimum: 0
  
  maximum: 120

- `organic` (optional)
  Type: boolean
  
  default: false

```json
{
  "name": "Gorgonzola",
  "category": {
    "name": "Italian Cheese"
  },
  "status": "available",
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "name": "blue"
    },
    {
      "name": "italian"
    },
    {
      "name": "creamy"
    }
  ]
}
```

Responses:

- 201: Cheese created successfully

Content type: application/json

Type: object

Schema: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md)

- `id` (required)
  Type: integer, int64
  
  Unique identifier
  
  Example:
  
  ```json
  42
  ```

- `name` (required)
  Type: string
  
  Name of the cheese
  
  minLength: 1
  
  maxLength: 100
  
  Example:
  
  ```json
  "Gorgonzola"
  ```

- `category` (optional)
  Reference: [Category](https://cheesestore-docs.pages.dev/api/schemas/category-292c06f004.md); Type: object

- `photoUrls` (optional)
  Type: array
  
  URLs of cheese photos
  
  Example:
  
  ```json
  [
    "https://wannabechef.com/gorgonzola.jpg"
  ]
  ```
  
  Items:
    Type: string, uri

- `tags` (optional)
  Type: array
  
  Classification tags
  
  Items:
    Reference: [Tag](https://cheesestore-docs.pages.dev/api/schemas/tag-1503916a2a.md); Type: object

- `status` (required)
  Type: string
  
  Availability status in the store
  
  enum: ["available","pending","sold"]
  
  Example:
  
  ```json
  "available"
  ```

- `origin` (optional)
  Type: string; nullable
  
  Country of origin (null if unknown)
  
  Example:
  
  ```json
  "Italy"
  ```

- `pricePerKg` (optional)
  Type: number, float
  
  Price per kilogram in USD
  
  minimum: 0
  
  exclusiveMinimum: true
  
  Example:
  
  ```json
  28.5
  ```

- `ageMonths` (optional)
  Type: integer
  
  Aging period in months
  
  minimum: 0
  
  maximum: 120
  
  Example:
  
  ```json
  12
  ```

- `organic` (optional)
  Type: boolean
  
  Whether the cheese is certified organic
  
  default: false

- `createdAt` (optional)
  Type: string, date-time
  
  When the cheese was added to the store

- `updatedAt` (optional)
  Type: string, date-time
  
  When the cheese was last updated

- 409: A cheese with this name already exists in the category

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

- 422: The request body failed validation

Content type: application/json

Type: object

Schema: [ValidationError](https://cheesestore-docs.pages.dev/api/schemas/validationerror-bdfaef14be.md)

- `code` (optional)
  Type: integer, int32
  
  Example:
  
  ```json
  422
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation error"
  ```

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Your cheese is not mouldy enough"
  ```

- `errors` (optional)
  Type: array
  
  Individual field validation errors
  
  Items:
    Type: object
    
    - `field` (optional)
      Type: string
      
      The field that failed validation
    
    - `message` (optional)
      Type: string
      
      Human-readable error message

```json
{
  "code": 422,
  "type": "Validation error",
  "message": "Your cheese is not mouldy enough",
  "errors": [
    {
      "field": "name",
      "message": "Name is required"
    },
    {
      "field": "status",
      "message": "Must be one of available, pending, sold"
    }
  ]
}
```

## Examples

### cURL

```bash
curl -X POST 'https://cheese.example.com/v2/cheeses' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "Gorgonzola",
  "category": {
    "name": "Italian Cheese"
  },
  "status": "available",
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "name": "blue"
    },
    {
      "name": "italian"
    },
    {
      "name": "creamy"
    }
  ]
}'
```

### JavaScript

```javascript
const body = `{
  "name": "Gorgonzola",
  "category": {
    "name": "Italian Cheese"
  },
  "status": "available",
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "name": "blue"
    },
    {
      "name": "italian"
    },
    {
      "name": "creamy"
    }
  ]
}`;

const response = await fetch('https://cheese.example.com/v2/cheeses', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### TypeScript

```typescript
const body = `{
  "name": "Gorgonzola",
  "category": {
    "name": "Italian Cheese"
  },
  "status": "available",
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "name": "blue"
    },
    {
      "name": "italian"
    },
    {
      "name": "creamy"
    }
  ]
}`;

const response = await fetch('https://cheese.example.com/v2/cheeses', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "name": "Gorgonzola",
  "category": {
    "name": "Italian Cheese"
  },
  "status": "available",
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "name": "blue"
    },
    {
      "name": "italian"
    },
    {
      "name": "creamy"
    }
  ]
}'''

response = requests.post(
    'https://cheese.example.com/v2/cheeses',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "strings"
)

func main() {
  body := strings.NewReader(`{
  "name": "Gorgonzola",
  "category": {
    "name": "Italian Cheese"
  },
  "status": "available",
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "name": "blue"
    },
    {
      "name": "italian"
    },
    {
      "name": "creamy"
    }
  ]
}`)
  req, _ := http.NewRequest("POST", "https://cheese.example.com/v2/cheeses", body)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/cheeses')
request = Net::HTTP::Post.new(uri)
request.body = <<-'BODY'.chomp
{
  "name": "Gorgonzola",
  "category": {
    "name": "Italian Cheese"
  },
  "status": "available",
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "name": "blue"
    },
    {
      "name": "italian"
    },
    {
      "name": "creamy"
    }
  ]
}
BODY
request['Authorization'] = 'Bearer YOUR_TOKEN'
request['Content-Type'] = 'application/json'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let body = r#"{
  "name": "Gorgonzola",
  "category": {
    "name": "Italian Cheese"
  },
  "status": "available",
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "name": "blue"
    },
    {
      "name": "italian"
    },
    {
      "name": "creamy"
    }
  ]
}"#;
    let response = client.post("https://cheese.example.com/v2/cheeses")
        .body(body)
        .header("Authorization", "Bearer YOUR_TOKEN")
        .header("Content-Type", "application/json")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Update an existing cheese

`PUT /cheeses`

Replace an existing cheese with updated data. The cheese ID in the body must match an existing cheese.

Authentication (security requirement alternatives):

```json
[
  {
    "cheesy_oauth": [
      "write:cheeses"
    ]
  }
]
```

- cheesy_oauth: oauth2. OAuth2 authentication for full API access; scopes: write:cheeses

Request body: application/json (required)

Cheese object with updated fields

Type: object

Schema: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md)

- `id` (required)
  Type: integer, int64
  
  Unique identifier
  
  Example:
  
  ```json
  42
  ```

- `name` (required)
  Type: string
  
  Name of the cheese
  
  minLength: 1
  
  maxLength: 100
  
  Example:
  
  ```json
  "Gorgonzola"
  ```

- `category` (optional)
  Reference: [Category](https://cheesestore-docs.pages.dev/api/schemas/category-292c06f004.md); Type: object

- `photoUrls` (optional)
  Type: array
  
  URLs of cheese photos
  
  Example:
  
  ```json
  [
    "https://wannabechef.com/gorgonzola.jpg"
  ]
  ```
  
  Items:
    Type: string, uri

- `tags` (optional)
  Type: array
  
  Classification tags
  
  Items:
    Reference: [Tag](https://cheesestore-docs.pages.dev/api/schemas/tag-1503916a2a.md); Type: object

- `status` (required)
  Type: string
  
  Availability status in the store
  
  enum: ["available","pending","sold"]
  
  Example:
  
  ```json
  "available"
  ```

- `origin` (optional)
  Type: string; nullable
  
  Country of origin (null if unknown)
  
  Example:
  
  ```json
  "Italy"
  ```

- `pricePerKg` (optional)
  Type: number, float
  
  Price per kilogram in USD
  
  minimum: 0
  
  exclusiveMinimum: true
  
  Example:
  
  ```json
  28.5
  ```

- `ageMonths` (optional)
  Type: integer
  
  Aging period in months
  
  minimum: 0
  
  maximum: 120
  
  Example:
  
  ```json
  12
  ```

- `organic` (optional)
  Type: boolean
  
  Whether the cheese is certified organic
  
  default: false

- `createdAt` (optional)
  Type: string, date-time
  
  When the cheese was added to the store

- `updatedAt` (optional)
  Type: string, date-time
  
  When the cheese was last updated

Responses:

- 200: Cheese updated successfully

Content type: application/json

Type: object

Schema: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md)

- `id` (required)
  Type: integer, int64
  
  Unique identifier
  
  Example:
  
  ```json
  42
  ```

- `name` (required)
  Type: string
  
  Name of the cheese
  
  minLength: 1
  
  maxLength: 100
  
  Example:
  
  ```json
  "Gorgonzola"
  ```

- `category` (optional)
  Reference: [Category](https://cheesestore-docs.pages.dev/api/schemas/category-292c06f004.md); Type: object

- `photoUrls` (optional)
  Type: array
  
  URLs of cheese photos
  
  Example:
  
  ```json
  [
    "https://wannabechef.com/gorgonzola.jpg"
  ]
  ```
  
  Items:
    Type: string, uri

- `tags` (optional)
  Type: array
  
  Classification tags
  
  Items:
    Reference: [Tag](https://cheesestore-docs.pages.dev/api/schemas/tag-1503916a2a.md); Type: object

- `status` (required)
  Type: string
  
  Availability status in the store
  
  enum: ["available","pending","sold"]
  
  Example:
  
  ```json
  "available"
  ```

- `origin` (optional)
  Type: string; nullable
  
  Country of origin (null if unknown)
  
  Example:
  
  ```json
  "Italy"
  ```

- `pricePerKg` (optional)
  Type: number, float
  
  Price per kilogram in USD
  
  minimum: 0
  
  exclusiveMinimum: true
  
  Example:
  
  ```json
  28.5
  ```

- `ageMonths` (optional)
  Type: integer
  
  Aging period in months
  
  minimum: 0
  
  maximum: 120
  
  Example:
  
  ```json
  12
  ```

- `organic` (optional)
  Type: boolean
  
  Whether the cheese is certified organic
  
  default: false

- `createdAt` (optional)
  Type: string, date-time
  
  When the cheese was added to the store

- `updatedAt` (optional)
  Type: string, date-time
  
  When the cheese was last updated

- 404: The requested resource was not found

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 404,
  "type": "Not found",
  "message": "Your cheese has already been eaten"
}
```

- 422: The request body failed validation

Content type: application/json

Type: object

Schema: [ValidationError](https://cheesestore-docs.pages.dev/api/schemas/validationerror-bdfaef14be.md)

- `code` (optional)
  Type: integer, int32
  
  Example:
  
  ```json
  422
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation error"
  ```

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Your cheese is not mouldy enough"
  ```

- `errors` (optional)
  Type: array
  
  Individual field validation errors
  
  Items:
    Type: object
    
    - `field` (optional)
      Type: string
      
      The field that failed validation
    
    - `message` (optional)
      Type: string
      
      Human-readable error message

```json
{
  "code": 422,
  "type": "Validation error",
  "message": "Your cheese is not mouldy enough",
  "errors": [
    {
      "field": "name",
      "message": "Name is required"
    },
    {
      "field": "status",
      "message": "Must be one of available, pending, sold"
    }
  ]
}
```

## Examples

### cURL

```bash
curl -X PUT 'https://cheese.example.com/v2/cheeses' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "id": 42,
  "name": "Gorgonzola",
  "category": {
    "id": 1,
    "name": "Italian Cheese"
  },
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "id": 1,
      "name": "blue"
    }
  ],
  "status": "available",
  "origin": "Italy",
  "pricePerKg": 28.5,
  "ageMonths": 12,
  "organic": false,
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z"
}'
```

### JavaScript

```javascript
const body = `{
  "id": 42,
  "name": "Gorgonzola",
  "category": {
    "id": 1,
    "name": "Italian Cheese"
  },
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "id": 1,
      "name": "blue"
    }
  ],
  "status": "available",
  "origin": "Italy",
  "pricePerKg": 28.5,
  "ageMonths": 12,
  "organic": false,
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z"
}`;

const response = await fetch('https://cheese.example.com/v2/cheeses', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### TypeScript

```typescript
const body = `{
  "id": 42,
  "name": "Gorgonzola",
  "category": {
    "id": 1,
    "name": "Italian Cheese"
  },
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "id": 1,
      "name": "blue"
    }
  ],
  "status": "available",
  "origin": "Italy",
  "pricePerKg": 28.5,
  "ageMonths": 12,
  "organic": false,
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z"
}`;

const response = await fetch('https://cheese.example.com/v2/cheeses', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "id": 42,
  "name": "Gorgonzola",
  "category": {
    "id": 1,
    "name": "Italian Cheese"
  },
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "id": 1,
      "name": "blue"
    }
  ],
  "status": "available",
  "origin": "Italy",
  "pricePerKg": 28.5,
  "ageMonths": 12,
  "organic": false,
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z"
}'''

response = requests.put(
    'https://cheese.example.com/v2/cheeses',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "strings"
)

func main() {
  body := strings.NewReader(`{
  "id": 42,
  "name": "Gorgonzola",
  "category": {
    "id": 1,
    "name": "Italian Cheese"
  },
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "id": 1,
      "name": "blue"
    }
  ],
  "status": "available",
  "origin": "Italy",
  "pricePerKg": 28.5,
  "ageMonths": 12,
  "organic": false,
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z"
}`)
  req, _ := http.NewRequest("PUT", "https://cheese.example.com/v2/cheeses", body)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/cheeses')
request = Net::HTTP::Put.new(uri)
request.body = <<-'BODY'.chomp
{
  "id": 42,
  "name": "Gorgonzola",
  "category": {
    "id": 1,
    "name": "Italian Cheese"
  },
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "id": 1,
      "name": "blue"
    }
  ],
  "status": "available",
  "origin": "Italy",
  "pricePerKg": 28.5,
  "ageMonths": 12,
  "organic": false,
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z"
}
BODY
request['Authorization'] = 'Bearer YOUR_TOKEN'
request['Content-Type'] = 'application/json'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let body = r#"{
  "id": 42,
  "name": "Gorgonzola",
  "category": {
    "id": 1,
    "name": "Italian Cheese"
  },
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "id": 1,
      "name": "blue"
    }
  ],
  "status": "available",
  "origin": "Italy",
  "pricePerKg": 28.5,
  "ageMonths": 12,
  "organic": false,
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z"
}"#;
    let response = client.put("https://cheese.example.com/v2/cheeses")
        .body(body)
        .header("Authorization", "Bearer YOUR_TOKEN")
        .header("Content-Type", "application/json")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Find cheeses by status

`GET /cheeses/findByStatus`

Multiple status values can be provided as comma-separated strings. Returns all cheeses matching any of the given statuses.

Authentication (security requirement alternatives):

```json
[
  {
    "cheesy_oauth": [
      "read:cheeses"
    ]
  }
]
```

- cheesy_oauth: oauth2. OAuth2 authentication for full API access; scopes: read:cheeses

Parameters:

- `status` (query, array, required) - Status values to filter by
  Type: array
  
  Items:
    Type: string
    
    default: "available"
    
    enum: ["available","pending","sold"]

Responses:

- 200: Matching cheeses

Content type: application/json

Type: array

Items:
  Reference: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md); Type: object

- 400: Invalid status value provided

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

## Examples

### cURL

```bash
curl -X GET 'https://cheese.example.com/v2/cheeses/findByStatus?status=available' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/cheeses/findByStatus?status=available', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/cheeses/findByStatus?status=available', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://cheese.example.com/v2/cheeses/findByStatus?status=available',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("GET", "https://cheese.example.com/v2/cheeses/findByStatus?status=available", nil)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/cheeses/findByStatus?status=available')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.get("https://cheese.example.com/v2/cheeses/findByStatus?status=available")
        .header("Authorization", "Bearer YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Find cheeses by tags

`GET /cheeses/findByTags`

Multiple tags can be provided as comma-separated strings (e.g. `?tags=blue,italian,aged`).

**Deprecated:** Use `GET /cheeses?tags=blue,italian` query parameter instead.


Deprecated.

Authentication (security requirement alternatives):

```json
[
  {
    "cheesy_oauth": [
      "read:cheeses"
    ]
  }
]
```

- cheesy_oauth: oauth2. OAuth2 authentication for full API access; scopes: read:cheeses

Parameters:

- `tags` (query, array, required) - Tags to filter by
  Type: array
  
  Items:
    Type: string

Responses:

- 200: Matching cheeses

Content type: application/json

Type: array

Items:
  Reference: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md); Type: object

- 400: Invalid tag value

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

## Examples

### cURL

```bash
curl -X GET 'https://cheese.example.com/v2/cheeses/findByTags?tags=string' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/cheeses/findByTags?tags=string', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/cheeses/findByTags?tags=string', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://cheese.example.com/v2/cheeses/findByTags?tags=string',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("GET", "https://cheese.example.com/v2/cheeses/findByTags?tags=string", nil)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/cheeses/findByTags?tags=string')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.get("https://cheese.example.com/v2/cheeses/findByTags?tags=string")
        .header("Authorization", "Bearer YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Get cheese by ID

`GET /cheeses/{cheeseId}`

Returns detailed information about a specific cheese, including its category, tags, and current availability status.

Authentication (security requirement alternatives):

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

- api_key: apiKey, header X-API-Key. API key authentication. Include your API key in the `X-API-Key` header.

This is an example scheme. Supply credentials from your own service when adapting this contract.


Parameters:

- `cheeseId` (path, integer, int64, required) - Unique identifier for the cheese
  Type: integer, int64
  
  minimum: 1

Responses:

- 200: Cheese details

Content type: application/json

Type: object

Schema: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md)

- `id` (required)
  Type: integer, int64
  
  Unique identifier
  
  Example:
  
  ```json
  42
  ```

- `name` (required)
  Type: string
  
  Name of the cheese
  
  minLength: 1
  
  maxLength: 100
  
  Example:
  
  ```json
  "Gorgonzola"
  ```

- `category` (optional)
  Reference: [Category](https://cheesestore-docs.pages.dev/api/schemas/category-292c06f004.md); Type: object

- `photoUrls` (optional)
  Type: array
  
  URLs of cheese photos
  
  Example:
  
  ```json
  [
    "https://wannabechef.com/gorgonzola.jpg"
  ]
  ```
  
  Items:
    Type: string, uri

- `tags` (optional)
  Type: array
  
  Classification tags
  
  Items:
    Reference: [Tag](https://cheesestore-docs.pages.dev/api/schemas/tag-1503916a2a.md); Type: object

- `status` (required)
  Type: string
  
  Availability status in the store
  
  enum: ["available","pending","sold"]
  
  Example:
  
  ```json
  "available"
  ```

- `origin` (optional)
  Type: string; nullable
  
  Country of origin (null if unknown)
  
  Example:
  
  ```json
  "Italy"
  ```

- `pricePerKg` (optional)
  Type: number, float
  
  Price per kilogram in USD
  
  minimum: 0
  
  exclusiveMinimum: true
  
  Example:
  
  ```json
  28.5
  ```

- `ageMonths` (optional)
  Type: integer
  
  Aging period in months
  
  minimum: 0
  
  maximum: 120
  
  Example:
  
  ```json
  12
  ```

- `organic` (optional)
  Type: boolean
  
  Whether the cheese is certified organic
  
  default: false

- `createdAt` (optional)
  Type: string, date-time
  
  When the cheese was added to the store

- `updatedAt` (optional)
  Type: string, date-time
  
  When the cheese was last updated

```json
{
  "id": 42,
  "name": "Gorgonzola",
  "category": {
    "id": 1,
    "name": "Italian Cheese"
  },
  "status": "available",
  "photoUrls": [
    "https://wannabechef.com/gorgonzola.jpg"
  ],
  "tags": [
    {
      "id": 1,
      "name": "blue"
    },
    {
      "id": 2,
      "name": "italian"
    }
  ]
}
```

- 404: The requested resource was not found

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 404,
  "type": "Not found",
  "message": "Your cheese has already been eaten"
}
```

## Examples

### cURL

```bash
curl -X GET 'https://cheese.example.com/v2/cheeses/42' \
  -H 'X-API-Key: YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/cheeses/42', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/cheeses/42', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://cheese.example.com/v2/cheeses/42',
    headers={
        'X-API-Key': 'YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("GET", "https://cheese.example.com/v2/cheeses/42", nil)
  req.Header.Set("X-API-Key", "YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/cheeses/42')
request = Net::HTTP::Get.new(uri)
request['X-API-Key'] = 'YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.get("https://cheese.example.com/v2/cheeses/42")
        .header("X-API-Key", "YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Update cheese with form data

`POST /cheeses/{cheeseId}`

Updates specific fields of a cheese using form data. Only provided fields are updated.

Authentication (security requirement alternatives):

```json
[
  {
    "cheesy_oauth": [
      "write:cheeses"
    ]
  }
]
```

- cheesy_oauth: oauth2. OAuth2 authentication for full API access; scopes: write:cheeses

Parameters:

- `cheeseId` (path, integer, int64, required) - Unique identifier for the cheese
  Type: integer, int64
  
  minimum: 1

- `name` (query, string, optional) - Updated name of the cheese
  Type: string

- `status` (query, string, optional) - Updated status of the cheese
  Type: string
  
  enum: ["available","pending","sold"]

Responses:

- 200: Cheese updated

Content type: application/json

Type: object

Schema: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md)

- `id` (required)
  Type: integer, int64
  
  Unique identifier
  
  Example:
  
  ```json
  42
  ```

- `name` (required)
  Type: string
  
  Name of the cheese
  
  minLength: 1
  
  maxLength: 100
  
  Example:
  
  ```json
  "Gorgonzola"
  ```

- `category` (optional)
  Reference: [Category](https://cheesestore-docs.pages.dev/api/schemas/category-292c06f004.md); Type: object

- `photoUrls` (optional)
  Type: array
  
  URLs of cheese photos
  
  Example:
  
  ```json
  [
    "https://wannabechef.com/gorgonzola.jpg"
  ]
  ```
  
  Items:
    Type: string, uri

- `tags` (optional)
  Type: array
  
  Classification tags
  
  Items:
    Reference: [Tag](https://cheesestore-docs.pages.dev/api/schemas/tag-1503916a2a.md); Type: object

- `status` (required)
  Type: string
  
  Availability status in the store
  
  enum: ["available","pending","sold"]
  
  Example:
  
  ```json
  "available"
  ```

- `origin` (optional)
  Type: string; nullable
  
  Country of origin (null if unknown)
  
  Example:
  
  ```json
  "Italy"
  ```

- `pricePerKg` (optional)
  Type: number, float
  
  Price per kilogram in USD
  
  minimum: 0
  
  exclusiveMinimum: true
  
  Example:
  
  ```json
  28.5
  ```

- `ageMonths` (optional)
  Type: integer
  
  Aging period in months
  
  minimum: 0
  
  maximum: 120
  
  Example:
  
  ```json
  12
  ```

- `organic` (optional)
  Type: boolean
  
  Whether the cheese is certified organic
  
  default: false

- `createdAt` (optional)
  Type: string, date-time
  
  When the cheese was added to the store

- `updatedAt` (optional)
  Type: string, date-time
  
  When the cheese was last updated

- 404: The requested resource was not found

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 404,
  "type": "Not found",
  "message": "Your cheese has already been eaten"
}
```

- 422: The request body failed validation

Content type: application/json

Type: object

Schema: [ValidationError](https://cheesestore-docs.pages.dev/api/schemas/validationerror-bdfaef14be.md)

- `code` (optional)
  Type: integer, int32
  
  Example:
  
  ```json
  422
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation error"
  ```

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Your cheese is not mouldy enough"
  ```

- `errors` (optional)
  Type: array
  
  Individual field validation errors
  
  Items:
    Type: object
    
    - `field` (optional)
      Type: string
      
      The field that failed validation
    
    - `message` (optional)
      Type: string
      
      Human-readable error message

```json
{
  "code": 422,
  "type": "Validation error",
  "message": "Your cheese is not mouldy enough",
  "errors": [
    {
      "field": "name",
      "message": "Name is required"
    },
    {
      "field": "status",
      "message": "Must be one of available, pending, sold"
    }
  ]
}
```

## Examples

### cURL

```bash
curl -X POST 'https://cheese.example.com/v2/cheeses/42' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/cheeses/42', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/cheeses/42', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.post(
    'https://cheese.example.com/v2/cheeses/42',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("POST", "https://cheese.example.com/v2/cheeses/42", nil)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/cheeses/42')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.post("https://cheese.example.com/v2/cheeses/42")
        .header("Authorization", "Bearer YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Delete a cheese

`DELETE /cheeses/{cheeseId}`

Permanently removes a cheese from the store. This action cannot be undone. Any pending orders for this cheese will be cancelled.

Authentication (security requirement alternatives):

```json
[
  {
    "cheesy_oauth": [
      "write:cheeses"
    ]
  }
]
```

- cheesy_oauth: oauth2. OAuth2 authentication for full API access; scopes: write:cheeses

Parameters:

- `cheeseId` (path, integer, int64, required) - Unique identifier for the cheese
  Type: integer, int64
  
  minimum: 1

- `X-Confirm-Delete` (header, boolean, required) - Must be set to `true` to confirm deletion
  Type: boolean
  
  const: true

Responses:

- 204: Cheese deleted successfully

- 404: The requested resource was not found

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 404,
  "type": "Not found",
  "message": "Your cheese has already been eaten"
}
```

- 409: Cheese has active orders and cannot be deleted

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

## Examples

### cURL

```bash
curl -X DELETE 'https://cheese.example.com/v2/cheeses/42' \
  -H 'X-Confirm-Delete: true' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/cheeses/42', {
  method: 'DELETE',
  headers: {
    'X-Confirm-Delete': 'true',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/cheeses/42', {
  method: 'DELETE',
  headers: {
    'X-Confirm-Delete': 'true',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.delete(
    'https://cheese.example.com/v2/cheeses/42',
    headers={
        'X-Confirm-Delete': 'true',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("DELETE", "https://cheese.example.com/v2/cheeses/42", nil)
  req.Header.Set("X-Confirm-Delete", "true")
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/cheeses/42')
request = Net::HTTP::Delete.new(uri)
request['X-Confirm-Delete'] = 'true'
request['Authorization'] = 'Bearer YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.delete("https://cheese.example.com/v2/cheeses/42")
        .header("X-Confirm-Delete", "true")
        .header("Authorization", "Bearer YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Upload a cheese image

`POST /cheeses/{cheeseId}/uploadImage`

Upload a photo of the cheese. Supports JPEG, PNG, and WebP formats. Maximum file size is 10MB.

Authentication (security requirement alternatives):

```json
[
  {
    "cheesy_oauth": [
      "write:cheeses"
    ]
  }
]
```

- cheesy_oauth: oauth2. OAuth2 authentication for full API access; scopes: write:cheeses

Parameters:

- `cheeseId` (path, integer, int64, required) - ID of cheese to upload image for
  Type: integer, int64

Request body: multipart/form-data (required)

Type: object

- `file` (required)
  Type: string, binary
  
  Image file (JPEG, PNG, or WebP, max 10MB)

- `caption` (optional)
  Type: string
  
  Optional caption for the image
  
  maxLength: 200

- `isPrimary` (optional)
  Type: boolean
  
  Set as the primary display image
  
  default: false

Responses:

- 200: Image uploaded successfully

Content type: application/json

Type: object

- `imageUrl` (optional)
  Type: string, uri

- `thumbnailUrl` (optional)
  Type: string, uri

- `size` (optional)
  Type: integer
  
  File size in bytes

- 413: File too large (max 10MB)

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

- 415: Unsupported media type

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

## Examples

### cURL

```bash
curl -X POST 'https://cheese.example.com/v2/cheeses/0/uploadImage' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  --form-string 'caption=string' \
  --form-string 'isPrimary=false'
```

### JavaScript

```javascript
const form = new FormData();
form.append('caption', 'string');
form.append('isPrimary', 'false');
const response = await fetch('https://cheese.example.com/v2/cheeses/0/uploadImage', {
  method: 'POST',
  headers: {"Authorization":"Bearer YOUR_TOKEN"},
  body: form,
});
console.log(await response.text());
```

### TypeScript

```typescript
const form = new FormData();
form.append('caption', 'string');
form.append('isPrimary', 'false');
const response = await fetch('https://cheese.example.com/v2/cheeses/0/uploadImage', {
  method: 'POST',
  headers: {"Authorization":"Bearer YOUR_TOKEN"},
  body: form,
});
console.log(await response.text());
```

### Python

```python
import requests
from contextlib import ExitStack

with ExitStack() as stack:
    files = [
        ('caption', (None, 'string')),
        ('isPrimary', (None, 'false')),
    ]
    response = requests.request('POST', 'https://cheese.example.com/v2/cheeses/0/uploadImage', headers={"Authorization":"Bearer YOUR_TOKEN"}, files=files)
    print(response.text)
```

### Go

```go
package main
import ("bytes"; "fmt"; "io"; "mime/multipart"; "net/http")
func main() {
  var body bytes.Buffer
  writer := multipart.NewWriter(&body)
  writer.WriteField("caption", "string")
  writer.WriteField("isPrimary", "false")
  writer.Close()
  req, _ := http.NewRequest("POST", "https://cheese.example.com/v2/cheeses/0/uploadImage", &body)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  req.Header.Set("Content-Type", writer.FormDataContentType())
  resp, err := http.DefaultClient.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
uri = URI('https://cheese.example.com/v2/cheeses/0/uploadImage')
request = Net::HTTPGenericRequest.new('POST', true, true, uri.request_uri, {})
request['Authorization'] = 'Bearer YOUR_TOKEN'
request.set_form([['caption', 'string'], ['isPrimary', 'false']], 'multipart/form-data')
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
puts response.body
```

### Rust

```rust
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let form = reqwest::multipart::Form::new()
    .text("caption", "string")
    .text("isPrimary", "false")
    ;
  let response = reqwest::Client::new().request(reqwest::Method::from_bytes(b"POST")?, "https://cheese.example.com/v2/cheeses/0/uploadImage")
    .header("Authorization", "Bearer YOUR_TOKEN")
    .multipart(form).send().await?;
  println!("{}", response.text().await?);
  Ok(())
}
```


## Get store inventory

`GET /store/inventory`

Returns a map of cheese status codes to quantities, representing the current inventory levels.

Authentication (security requirement alternatives):

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

- api_key: apiKey, header X-API-Key. API key authentication. Include your API key in the `X-API-Key` header.

This is an example scheme. Supply credentials from your own service when adapting this contract.


Responses:

- 200: Inventory counts by status

Content type: application/json

Type: object

Additional properties: 
  Type: integer, int32

```json
{
  "available": 256,
  "pending": 34,
  "sold": 1089
}
```

## Examples

### cURL

```bash
curl -X GET 'https://cheese.example.com/v2/store/inventory' \
  -H 'X-API-Key: YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/store/inventory', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/store/inventory', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://cheese.example.com/v2/store/inventory',
    headers={
        'X-API-Key': 'YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("GET", "https://cheese.example.com/v2/store/inventory", nil)
  req.Header.Set("X-API-Key", "YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/store/inventory')
request = Net::HTTP::Get.new(uri)
request['X-API-Key'] = 'YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.get("https://cheese.example.com/v2/store/inventory")
        .header("X-API-Key", "YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Place a cheese order

`POST /store/order`

Place an order to purchase cheese from the store. The cheese must be in `available` status.

Orders are processed asynchronously. Use the returned order ID to check status via `GET /store/order/{orderId}`.


Authentication (security requirement alternatives):

```json
[
  {
    "cheesy_oauth": [
      "write:orders"
    ]
  }
]
```

- cheesy_oauth: oauth2. OAuth2 authentication for full API access; scopes: write:orders

Request body: application/json (required)

Order details

Type: object

Schema: [OrderInput](https://cheesestore-docs.pages.dev/api/schemas/orderinput-fdf8fed0b2.md)

- `items` (required)
  Type: array
  
  minItems: 1
  
  maxItems: 50
  
  Items:
    Type: object
    
    - `cheeseId` (required)
      Type: integer, int64
    
    - `quantity` (required)
      Type: integer
      
      minimum: 1
      
      maximum: 100

- `shippingAddress` (required)
  Reference: [Address](https://cheesestore-docs.pages.dev/api/schemas/address-56ef8f2095.md); Type: object

- `notes` (optional)
  Type: string; nullable
  
  maxLength: 500

```json
{
  "items": [
    {
      "cheeseId": 42,
      "quantity": 3
    },
    {
      "cheeseId": 17,
      "quantity": 1
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "notes": "Please wrap each wheel separately"
}
```

Responses:

- 201: Order placed successfully

Content type: application/json

Type: object

Schema: [Order](https://cheesestore-docs.pages.dev/api/schemas/order-6be090825c.md)

Example:

```json
{
  "id": 1001,
  "items": [
    {
      "cheeseId": 42,
      "cheeseName": "Gorgonzola",
      "quantity": 3,
      "pricePerKg": 28.5
    },
    {
      "cheeseId": 17,
      "cheeseName": "Brie",
      "quantity": 1,
      "pricePerKg": 22
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "status": "placed",
  "notes": "Please wrap each wheel separately",
  "total": 114.5,
  "shipDate": null,
  "createdAt": "2026-03-10T14:30:00Z",
  "updatedAt": "2026-03-10T14:30:00Z"
}
```

- `id` (optional)
  Type: integer, int64
  
  Example:
  
  ```json
  1001
  ```

- `items` (optional)
  Type: array
  
  Items:
    Reference: [OrderItem](https://cheesestore-docs.pages.dev/api/schemas/orderitem-6b56cf7850.md); Type: object

- `shippingAddress` (optional)
  Reference: [Address](https://cheesestore-docs.pages.dev/api/schemas/address-56ef8f2095.md); Type: object

- `status` (optional)
  Type: string
  
  Order lifecycle status
  
  enum: ["placed","approved","shipped","delivered","cancelled"]
  
  Example:
  
  ```json
  "placed"
  ```

- `notes` (optional)
  Type: string; nullable
  
  Special instructions for the order

- `total` (optional)
  Type: number, float
  
  Order total in USD
  
  Example:
  
  ```json
  114.5
  ```

- `shipDate` (optional)
  Type: string, date-time; nullable
  
  Estimated ship date (null if not yet scheduled)

- `createdAt` (optional)
  Type: string, date-time

- `updatedAt` (optional)
  Type: string, date-time

- 422: The request body failed validation

Content type: application/json

Type: object

Schema: [ValidationError](https://cheesestore-docs.pages.dev/api/schemas/validationerror-bdfaef14be.md)

- `code` (optional)
  Type: integer, int32
  
  Example:
  
  ```json
  422
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation error"
  ```

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Your cheese is not mouldy enough"
  ```

- `errors` (optional)
  Type: array
  
  Individual field validation errors
  
  Items:
    Type: object
    
    - `field` (optional)
      Type: string
      
      The field that failed validation
    
    - `message` (optional)
      Type: string
      
      Human-readable error message

```json
{
  "code": 422,
  "type": "Validation error",
  "message": "Your cheese is not mouldy enough",
  "errors": [
    {
      "field": "name",
      "message": "Name is required"
    },
    {
      "field": "status",
      "message": "Must be one of available, pending, sold"
    }
  ]
}
```

## Examples

### cURL

```bash
curl -X POST 'https://cheese.example.com/v2/store/order' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "items": [
    {
      "cheeseId": 42,
      "quantity": 3
    },
    {
      "cheeseId": 17,
      "quantity": 1
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "notes": "Please wrap each wheel separately"
}'
```

### JavaScript

```javascript
const body = `{
  "items": [
    {
      "cheeseId": 42,
      "quantity": 3
    },
    {
      "cheeseId": 17,
      "quantity": 1
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "notes": "Please wrap each wheel separately"
}`;

const response = await fetch('https://cheese.example.com/v2/store/order', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### TypeScript

```typescript
const body = `{
  "items": [
    {
      "cheeseId": 42,
      "quantity": 3
    },
    {
      "cheeseId": 17,
      "quantity": 1
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "notes": "Please wrap each wheel separately"
}`;

const response = await fetch('https://cheese.example.com/v2/store/order', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "items": [
    {
      "cheeseId": 42,
      "quantity": 3
    },
    {
      "cheeseId": 17,
      "quantity": 1
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "notes": "Please wrap each wheel separately"
}'''

response = requests.post(
    'https://cheese.example.com/v2/store/order',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "strings"
)

func main() {
  body := strings.NewReader(`{
  "items": [
    {
      "cheeseId": 42,
      "quantity": 3
    },
    {
      "cheeseId": 17,
      "quantity": 1
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "notes": "Please wrap each wheel separately"
}`)
  req, _ := http.NewRequest("POST", "https://cheese.example.com/v2/store/order", body)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/store/order')
request = Net::HTTP::Post.new(uri)
request.body = <<-'BODY'.chomp
{
  "items": [
    {
      "cheeseId": 42,
      "quantity": 3
    },
    {
      "cheeseId": 17,
      "quantity": 1
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "notes": "Please wrap each wheel separately"
}
BODY
request['Authorization'] = 'Bearer YOUR_TOKEN'
request['Content-Type'] = 'application/json'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let body = r#"{
  "items": [
    {
      "cheeseId": 42,
      "quantity": 3
    },
    {
      "cheeseId": 17,
      "quantity": 1
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "notes": "Please wrap each wheel separately"
}"#;
    let response = client.post("https://cheese.example.com/v2/store/order")
        .body(body)
        .header("Authorization", "Bearer YOUR_TOKEN")
        .header("Content-Type", "application/json")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Get order by ID

`GET /store/order/{orderId}`

Retrieve details of a specific order. For testing, use order IDs between 1 and 10.

Authentication (security requirement alternatives):

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

- api_key: apiKey, header X-API-Key. API key authentication. Include your API key in the `X-API-Key` header.

This is an example scheme. Supply credentials from your own service when adapting this contract.


Parameters:

- `orderId` (path, integer, int64, required) - ID of the order
  Type: integer, int64
  
  minimum: 1

Responses:

- 200: Order details

Content type: application/json

Type: object

Schema: [Order](https://cheesestore-docs.pages.dev/api/schemas/order-6be090825c.md)

Example:

```json
{
  "id": 1001,
  "items": [
    {
      "cheeseId": 42,
      "cheeseName": "Gorgonzola",
      "quantity": 3,
      "pricePerKg": 28.5
    },
    {
      "cheeseId": 17,
      "cheeseName": "Brie",
      "quantity": 1,
      "pricePerKg": 22
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "status": "placed",
  "notes": "Please wrap each wheel separately",
  "total": 114.5,
  "shipDate": null,
  "createdAt": "2026-03-10T14:30:00Z",
  "updatedAt": "2026-03-10T14:30:00Z"
}
```

- `id` (optional)
  Type: integer, int64
  
  Example:
  
  ```json
  1001
  ```

- `items` (optional)
  Type: array
  
  Items:
    Reference: [OrderItem](https://cheesestore-docs.pages.dev/api/schemas/orderitem-6b56cf7850.md); Type: object

- `shippingAddress` (optional)
  Reference: [Address](https://cheesestore-docs.pages.dev/api/schemas/address-56ef8f2095.md); Type: object

- `status` (optional)
  Type: string
  
  Order lifecycle status
  
  enum: ["placed","approved","shipped","delivered","cancelled"]
  
  Example:
  
  ```json
  "placed"
  ```

- `notes` (optional)
  Type: string; nullable
  
  Special instructions for the order

- `total` (optional)
  Type: number, float
  
  Order total in USD
  
  Example:
  
  ```json
  114.5
  ```

- `shipDate` (optional)
  Type: string, date-time; nullable
  
  Estimated ship date (null if not yet scheduled)

- `createdAt` (optional)
  Type: string, date-time

- `updatedAt` (optional)
  Type: string, date-time

- 404: The requested resource was not found

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 404,
  "type": "Not found",
  "message": "Your cheese has already been eaten"
}
```

## Examples

### cURL

```bash
curl -X GET 'https://cheese.example.com/v2/store/order/1001' \
  -H 'X-API-Key: YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/store/order/1001', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/store/order/1001', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://cheese.example.com/v2/store/order/1001',
    headers={
        'X-API-Key': 'YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("GET", "https://cheese.example.com/v2/store/order/1001", nil)
  req.Header.Set("X-API-Key", "YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/store/order/1001')
request = Net::HTTP::Get.new(uri)
request['X-API-Key'] = 'YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.get("https://cheese.example.com/v2/store/order/1001")
        .header("X-API-Key", "YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Cancel an order

`DELETE /store/order/{orderId}`

Cancel a pending order. Orders that have already been shipped cannot be cancelled.

Authentication (security requirement alternatives):

```json
[
  {
    "cheesy_oauth": [
      "write:orders"
    ]
  }
]
```

- cheesy_oauth: oauth2. OAuth2 authentication for full API access; scopes: write:orders

Parameters:

- `orderId` (path, integer, int64, required) - ID of the order
  Type: integer, int64
  
  minimum: 1

Responses:

- 204: Order cancelled successfully

- 404: The requested resource was not found

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 404,
  "type": "Not found",
  "message": "Your cheese has already been eaten"
}
```

- 409: Order has already been shipped

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

## Examples

### cURL

```bash
curl -X DELETE 'https://cheese.example.com/v2/store/order/1001' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/store/order/1001', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/store/order/1001', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.delete(
    'https://cheese.example.com/v2/store/order/1001',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("DELETE", "https://cheese.example.com/v2/store/order/1001", nil)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/store/order/1001')
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.delete("https://cheese.example.com/v2/store/order/1001")
        .header("Authorization", "Bearer YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Create a customer account

`POST /customer`

Register a new customer account. The username and email must be unique.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Customer registration details

Type: object

Schema: [CustomerInput](https://cheesestore-docs.pages.dev/api/schemas/customerinput-63c834e0ae.md)

- `username` (required)
  Type: string
  
  minLength: 3
  
  maxLength: 30
  
  pattern: "^[a-zA-Z0-9_-]+$"

- `firstName` (optional)
  Type: string
  
  maxLength: 50

- `lastName` (optional)
  Type: string
  
  maxLength: 50

- `email` (required)
  Type: string, email

- `password` (required)
  Type: string, password
  
  minLength: 8
  
  maxLength: 128

- `phone` (optional)
  Type: string; nullable

```json
{
  "username": "gordo",
  "firstName": "Alotta",
  "lastName": "Cheese",
  "email": "love@cheese.com",
  "password": "secret123!",
  "phone": "+3344556677"
}
```

Responses:

- 201: Customer account created

Content type: application/json

Type: object

Schema: [Customer](https://cheesestore-docs.pages.dev/api/schemas/customer-bf3763383a.md)

- `id` (optional)
  Type: integer, int64
  
  Example:
  
  ```json
  1
  ```

- `username` (optional)
  Type: string
  
  Example:
  
  ```json
  "gordo"
  ```

- `firstName` (optional)
  Type: string
  
  Customer first name
  
  Example:
  
  ```json
  "Alotta"
  ```

- `lastName` (optional)
  Type: string
  
  Customer last name
  
  Example:
  
  ```json
  "Cheese"
  ```

- `email` (optional)
  Type: string, email
  
  Example:
  
  ```json
  "love@cheese.com"
  ```

- `phone` (optional)
  Type: string; nullable
  
  Example:
  
  ```json
  "+3344556677"
  ```

- `customerStatus` (optional)
  Type: string
  
  Customer tier based on purchase volume
  
  enum: ["bronze","silver","gold","platinum"]
  
  Example:
  
  ```json
  "gold"
  ```

- `favouriteCheese` (optional)
  Type: unknown
  
  The customer's favourite cheese (by reference or by name)
  
  oneOf:
    Reference: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md); Type: object
  
    Type: object
    
    - `name` (required)
      Type: string

- `createdAt` (optional)
  Type: string, date-time

- 409: Username or email already exists

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

- 422: The request body failed validation

Content type: application/json

Type: object

Schema: [ValidationError](https://cheesestore-docs.pages.dev/api/schemas/validationerror-bdfaef14be.md)

- `code` (optional)
  Type: integer, int32
  
  Example:
  
  ```json
  422
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation error"
  ```

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Your cheese is not mouldy enough"
  ```

- `errors` (optional)
  Type: array
  
  Individual field validation errors
  
  Items:
    Type: object
    
    - `field` (optional)
      Type: string
      
      The field that failed validation
    
    - `message` (optional)
      Type: string
      
      Human-readable error message

```json
{
  "code": 422,
  "type": "Validation error",
  "message": "Your cheese is not mouldy enough",
  "errors": [
    {
      "field": "name",
      "message": "Name is required"
    },
    {
      "field": "status",
      "message": "Must be one of available, pending, sold"
    }
  ]
}
```

## Examples

### cURL

```bash
curl -X POST 'https://cheese.example.com/v2/customer' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "username": "gordo",
  "firstName": "Alotta",
  "lastName": "Cheese",
  "email": "love@cheese.com",
  "password": "secret123!",
  "phone": "+3344556677"
}'
```

### JavaScript

```javascript
const body = `{
  "username": "gordo",
  "firstName": "Alotta",
  "lastName": "Cheese",
  "email": "love@cheese.com",
  "password": "secret123!",
  "phone": "+3344556677"
}`;

const response = await fetch('https://cheese.example.com/v2/customer', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### TypeScript

```typescript
const body = `{
  "username": "gordo",
  "firstName": "Alotta",
  "lastName": "Cheese",
  "email": "love@cheese.com",
  "password": "secret123!",
  "phone": "+3344556677"
}`;

const response = await fetch('https://cheese.example.com/v2/customer', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "username": "gordo",
  "firstName": "Alotta",
  "lastName": "Cheese",
  "email": "love@cheese.com",
  "password": "secret123!",
  "phone": "+3344556677"
}'''

response = requests.post(
    'https://cheese.example.com/v2/customer',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "strings"
)

func main() {
  body := strings.NewReader(`{
  "username": "gordo",
  "firstName": "Alotta",
  "lastName": "Cheese",
  "email": "love@cheese.com",
  "password": "secret123!",
  "phone": "+3344556677"
}`)
  req, _ := http.NewRequest("POST", "https://cheese.example.com/v2/customer", body)
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/customer')
request = Net::HTTP::Post.new(uri)
request.body = <<-'BODY'.chomp
{
  "username": "gordo",
  "firstName": "Alotta",
  "lastName": "Cheese",
  "email": "love@cheese.com",
  "password": "secret123!",
  "phone": "+3344556677"
}
BODY
request['Content-Type'] = 'application/json'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let body = r#"{
  "username": "gordo",
  "firstName": "Alotta",
  "lastName": "Cheese",
  "email": "love@cheese.com",
  "password": "secret123!",
  "phone": "+3344556677"
}"#;
    let response = client.post("https://cheese.example.com/v2/customer")
        .body(body)
        .header("Content-Type", "application/json")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Create multiple customers

`POST /customer/createMultiple`

Create a batch of customer accounts from an array. Each customer is validated independently - partial success is possible.

Returns the created customers and any validation errors:

```json
{
  "created": [...],
  "errors": [
    { "index": 2, "message": "Email already exists" }
  ]
}
```


Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Array of customer objects to create

Type: array

minItems: 1

maxItems: 100

Items:
  Reference: [CustomerInput](https://cheesestore-docs.pages.dev/api/schemas/customerinput-63c834e0ae.md); Type: object

Responses:

- 200: Batch creation result

Content type: application/json

Type: object

- `created` (optional)
  Type: array
  
  Items:
    Reference: [Customer](https://cheesestore-docs.pages.dev/api/schemas/customer-bf3763383a.md); Type: object

- `errors` (optional)
  Type: array
  
  Items:
    Type: object
    
    - `index` (optional)
      Type: integer
    
    - `message` (optional)
      Type: string

- 422: The request body failed validation

Content type: application/json

Type: object

Schema: [ValidationError](https://cheesestore-docs.pages.dev/api/schemas/validationerror-bdfaef14be.md)

- `code` (optional)
  Type: integer, int32
  
  Example:
  
  ```json
  422
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation error"
  ```

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Your cheese is not mouldy enough"
  ```

- `errors` (optional)
  Type: array
  
  Individual field validation errors
  
  Items:
    Type: object
    
    - `field` (optional)
      Type: string
      
      The field that failed validation
    
    - `message` (optional)
      Type: string
      
      Human-readable error message

```json
{
  "code": 422,
  "type": "Validation error",
  "message": "Your cheese is not mouldy enough",
  "errors": [
    {
      "field": "name",
      "message": "Name is required"
    },
    {
      "field": "status",
      "message": "Must be one of available, pending, sold"
    }
  ]
}
```

## Examples

### cURL

```bash
curl -X POST 'https://cheese.example.com/v2/customer/createMultiple' \
  -H 'Content-Type: application/json' \
  --data-raw '[
  {
    "username": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "user@example.com",
    "password": "********",
    "phone": "string"
  }
]'
```

### JavaScript

```javascript
const body = `[
  {
    "username": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "user@example.com",
    "password": "********",
    "phone": "string"
  }
]`;

const response = await fetch('https://cheese.example.com/v2/customer/createMultiple', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### TypeScript

```typescript
const body = `[
  {
    "username": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "user@example.com",
    "password": "********",
    "phone": "string"
  }
]`;

const response = await fetch('https://cheese.example.com/v2/customer/createMultiple', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''[
  {
    "username": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "user@example.com",
    "password": "********",
    "phone": "string"
  }
]'''

response = requests.post(
    'https://cheese.example.com/v2/customer/createMultiple',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "strings"
)

func main() {
  body := strings.NewReader(`[
  {
    "username": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "user@example.com",
    "password": "********",
    "phone": "string"
  }
]`)
  req, _ := http.NewRequest("POST", "https://cheese.example.com/v2/customer/createMultiple", body)
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/customer/createMultiple')
request = Net::HTTP::Post.new(uri)
request.body = <<-'BODY'.chomp
[
  {
    "username": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "user@example.com",
    "password": "********",
    "phone": "string"
  }
]
BODY
request['Content-Type'] = 'application/json'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let body = r#"[
  {
    "username": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "user@example.com",
    "password": "********",
    "phone": "string"
  }
]"#;
    let response = client.post("https://cheese.example.com/v2/customer/createMultiple")
        .body(body)
        .header("Content-Type", "application/json")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Customer login

`POST /customer/login`

Authenticate a customer and receive a session token. The token expires after 24 hours.

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `username` (required)
  Type: string
  
  The customer's username

- `password` (required)
  Type: string, password
  
  The customer's password

Responses:

- 200: Login successful

Content type: application/json

Type: object

- `token` (optional)
  Type: string
  
  JWT session token

- `expiresAt` (optional)
  Type: string, date-time
  
  Token expiration time (UTC)

- 401: Invalid username or password

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

## Examples

### cURL

```bash
curl -X POST 'https://cheese.example.com/v2/customer/login' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "username": "string",
  "password": "********"
}'
```

### JavaScript

```javascript
const body = `{
  "username": "string",
  "password": "********"
}`;

const response = await fetch('https://cheese.example.com/v2/customer/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### TypeScript

```typescript
const body = `{
  "username": "string",
  "password": "********"
}`;

const response = await fetch('https://cheese.example.com/v2/customer/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "username": "string",
  "password": "********"
}'''

response = requests.post(
    'https://cheese.example.com/v2/customer/login',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "strings"
)

func main() {
  body := strings.NewReader(`{
  "username": "string",
  "password": "********"
}`)
  req, _ := http.NewRequest("POST", "https://cheese.example.com/v2/customer/login", body)
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/customer/login')
request = Net::HTTP::Post.new(uri)
request.body = <<-'BODY'.chomp
{
  "username": "string",
  "password": "********"
}
BODY
request['Content-Type'] = 'application/json'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let body = r#"{
  "username": "string",
  "password": "********"
}"#;
    let response = client.post("https://cheese.example.com/v2/customer/login")
        .body(body)
        .header("Content-Type", "application/json")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Customer logout

`GET /customer/logout`

End the current customer session and invalidate the session token.

Authentication (security requirement alternatives):

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

- bearer_auth: http (bearer). JWT token obtained from the `/customer/login` endpoint

Responses:

- 204: Logout successful

## Examples

### cURL

```bash
curl -X GET 'https://cheese.example.com/v2/customer/logout' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/customer/logout', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/customer/logout', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://cheese.example.com/v2/customer/logout',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("GET", "https://cheese.example.com/v2/customer/logout", nil)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/customer/logout')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.get("https://cheese.example.com/v2/customer/logout")
        .header("Authorization", "Bearer YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Get customer by username

`GET /customer/{username}`

Retrieve a customer's profile by their username.

Authentication (security requirement alternatives):

```json
[
  {
    "api_key": []
  },
  {
    "bearer_auth": []
  }
]
```

- api_key: apiKey, header X-API-Key. API key authentication. Include your API key in the `X-API-Key` header.

This is an example scheme. Supply credentials from your own service when adapting this contract.

- bearer_auth: http (bearer). JWT token obtained from the `/customer/login` endpoint

Parameters:

- `username` (path, string, required) - The customer's username
  Type: string
  
  minLength: 3
  
  maxLength: 30
  
  pattern: "^[a-zA-Z0-9_-]+$"

Responses:

- 200: Customer profile

Content type: application/json

Type: object

Schema: [Customer](https://cheesestore-docs.pages.dev/api/schemas/customer-bf3763383a.md)

- `id` (optional)
  Type: integer, int64
  
  Example:
  
  ```json
  1
  ```

- `username` (optional)
  Type: string
  
  Example:
  
  ```json
  "gordo"
  ```

- `firstName` (optional)
  Type: string
  
  Customer first name
  
  Example:
  
  ```json
  "Alotta"
  ```

- `lastName` (optional)
  Type: string
  
  Customer last name
  
  Example:
  
  ```json
  "Cheese"
  ```

- `email` (optional)
  Type: string, email
  
  Example:
  
  ```json
  "love@cheese.com"
  ```

- `phone` (optional)
  Type: string; nullable
  
  Example:
  
  ```json
  "+3344556677"
  ```

- `customerStatus` (optional)
  Type: string
  
  Customer tier based on purchase volume
  
  enum: ["bronze","silver","gold","platinum"]
  
  Example:
  
  ```json
  "gold"
  ```

- `favouriteCheese` (optional)
  Type: unknown
  
  The customer's favourite cheese (by reference or by name)
  
  oneOf:
    Reference: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md); Type: object
  
    Type: object
    
    - `name` (required)
      Type: string

- `createdAt` (optional)
  Type: string, date-time

- 404: The requested resource was not found

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 404,
  "type": "Not found",
  "message": "Your cheese has already been eaten"
}
```

## Examples

### cURL

```bash
curl -X GET 'https://cheese.example.com/v2/customer/gordo' \
  -H 'X-API-Key: YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/customer/gordo', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/customer/gordo', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://cheese.example.com/v2/customer/gordo',
    headers={
        'X-API-Key': 'YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("GET", "https://cheese.example.com/v2/customer/gordo", nil)
  req.Header.Set("X-API-Key", "YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/customer/gordo')
request = Net::HTTP::Get.new(uri)
request['X-API-Key'] = 'YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.get("https://cheese.example.com/v2/customer/gordo")
        .header("X-API-Key", "YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Update customer profile

`PUT /customer/{username}`

Update a customer's profile. Can only be performed by the authenticated customer.

Authentication (security requirement alternatives):

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

- bearer_auth: http (bearer). JWT token obtained from the `/customer/login` endpoint

Parameters:

- `username` (path, string, required) - The customer's username
  Type: string
  
  minLength: 3
  
  maxLength: 30
  
  pattern: "^[a-zA-Z0-9_-]+$"

Request body: application/json (required)

Updated customer fields

Type: object

Schema: [CustomerInput](https://cheesestore-docs.pages.dev/api/schemas/customerinput-63c834e0ae.md)

- `username` (required)
  Type: string
  
  minLength: 3
  
  maxLength: 30
  
  pattern: "^[a-zA-Z0-9_-]+$"

- `firstName` (optional)
  Type: string
  
  maxLength: 50

- `lastName` (optional)
  Type: string
  
  maxLength: 50

- `email` (required)
  Type: string, email

- `password` (required)
  Type: string, password
  
  minLength: 8
  
  maxLength: 128

- `phone` (optional)
  Type: string; nullable

Responses:

- 200: Customer updated

Content type: application/json

Type: object

Schema: [Customer](https://cheesestore-docs.pages.dev/api/schemas/customer-bf3763383a.md)

- `id` (optional)
  Type: integer, int64
  
  Example:
  
  ```json
  1
  ```

- `username` (optional)
  Type: string
  
  Example:
  
  ```json
  "gordo"
  ```

- `firstName` (optional)
  Type: string
  
  Customer first name
  
  Example:
  
  ```json
  "Alotta"
  ```

- `lastName` (optional)
  Type: string
  
  Customer last name
  
  Example:
  
  ```json
  "Cheese"
  ```

- `email` (optional)
  Type: string, email
  
  Example:
  
  ```json
  "love@cheese.com"
  ```

- `phone` (optional)
  Type: string; nullable
  
  Example:
  
  ```json
  "+3344556677"
  ```

- `customerStatus` (optional)
  Type: string
  
  Customer tier based on purchase volume
  
  enum: ["bronze","silver","gold","platinum"]
  
  Example:
  
  ```json
  "gold"
  ```

- `favouriteCheese` (optional)
  Type: unknown
  
  The customer's favourite cheese (by reference or by name)
  
  oneOf:
    Reference: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md); Type: object
  
    Type: object
    
    - `name` (required)
      Type: string

- `createdAt` (optional)
  Type: string, date-time

- 404: The requested resource was not found

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 404,
  "type": "Not found",
  "message": "Your cheese has already been eaten"
}
```

- 422: The request body failed validation

Content type: application/json

Type: object

Schema: [ValidationError](https://cheesestore-docs.pages.dev/api/schemas/validationerror-bdfaef14be.md)

- `code` (optional)
  Type: integer, int32
  
  Example:
  
  ```json
  422
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation error"
  ```

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Your cheese is not mouldy enough"
  ```

- `errors` (optional)
  Type: array
  
  Individual field validation errors
  
  Items:
    Type: object
    
    - `field` (optional)
      Type: string
      
      The field that failed validation
    
    - `message` (optional)
      Type: string
      
      Human-readable error message

```json
{
  "code": 422,
  "type": "Validation error",
  "message": "Your cheese is not mouldy enough",
  "errors": [
    {
      "field": "name",
      "message": "Name is required"
    },
    {
      "field": "status",
      "message": "Must be one of available, pending, sold"
    }
  ]
}
```

## Examples

### cURL

```bash
curl -X PUT 'https://cheese.example.com/v2/customer/gordo' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "username": "string",
  "firstName": "string",
  "lastName": "string",
  "email": "user@example.com",
  "password": "********",
  "phone": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "username": "string",
  "firstName": "string",
  "lastName": "string",
  "email": "user@example.com",
  "password": "********",
  "phone": "string"
}`;

const response = await fetch('https://cheese.example.com/v2/customer/gordo', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### TypeScript

```typescript
const body = `{
  "username": "string",
  "firstName": "string",
  "lastName": "string",
  "email": "user@example.com",
  "password": "********",
  "phone": "string"
}`;

const response = await fetch('https://cheese.example.com/v2/customer/gordo', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "username": "string",
  "firstName": "string",
  "lastName": "string",
  "email": "user@example.com",
  "password": "********",
  "phone": "string"
}'''

response = requests.put(
    'https://cheese.example.com/v2/customer/gordo',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "strings"
)

func main() {
  body := strings.NewReader(`{
  "username": "string",
  "firstName": "string",
  "lastName": "string",
  "email": "user@example.com",
  "password": "********",
  "phone": "string"
}`)
  req, _ := http.NewRequest("PUT", "https://cheese.example.com/v2/customer/gordo", body)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/customer/gordo')
request = Net::HTTP::Put.new(uri)
request.body = <<-'BODY'.chomp
{
  "username": "string",
  "firstName": "string",
  "lastName": "string",
  "email": "user@example.com",
  "password": "********",
  "phone": "string"
}
BODY
request['Authorization'] = 'Bearer YOUR_TOKEN'
request['Content-Type'] = 'application/json'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let body = r#"{
  "username": "string",
  "firstName": "string",
  "lastName": "string",
  "email": "user@example.com",
  "password": "********",
  "phone": "string"
}"#;
    let response = client.put("https://cheese.example.com/v2/customer/gordo")
        .body(body)
        .header("Authorization", "Bearer YOUR_TOKEN")
        .header("Content-Type", "application/json")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Delete customer account

`DELETE /customer/{username}`

Permanently delete a customer account and all associated data. This action cannot be undone.

Authentication (security requirement alternatives):

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

- bearer_auth: http (bearer). JWT token obtained from the `/customer/login` endpoint

Parameters:

- `username` (path, string, required) - The customer's username
  Type: string
  
  minLength: 3
  
  maxLength: 30
  
  pattern: "^[a-zA-Z0-9_-]+$"

Responses:

- 204: Customer deleted

- 404: The requested resource was not found

Content type: application/json

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

```json
{
  "code": 404,
  "type": "Not found",
  "message": "Your cheese has already been eaten"
}
```

## Examples

### cURL

```bash
curl -X DELETE 'https://cheese.example.com/v2/customer/gordo' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://cheese.example.com/v2/customer/gordo', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### TypeScript

```typescript
const response = await fetch('https://cheese.example.com/v2/customer/gordo', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.delete(
    'https://cheese.example.com/v2/customer/gordo',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```

### Go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
)

func main() {
  req, _ := http.NewRequest("DELETE", "https://cheese.example.com/v2/customer/gordo", nil)
  req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}
```

### Ruby

```ruby
require 'net/http'
require 'json'

uri = URI('https://cheese.example.com/v2/customer/gordo')
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer YOUR_TOKEN'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
data = JSON.parse(response.body)
```

### Rust

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = reqwest::Client::new();
    let response = client.delete("https://cheese.example.com/v2/customer/gordo")
        .header("Authorization", "Bearer YOUR_TOKEN")
        .send()
        .await?
        .text()
        .await?;
    println!("{}", response);
    Ok(())
}
```


## Cheese

Type: object

Schema: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md)

- `id` (required)
  Type: integer, int64
  
  Unique identifier
  
  Example:
  
  ```json
  42
  ```

- `name` (required)
  Type: string
  
  Name of the cheese
  
  minLength: 1
  
  maxLength: 100
  
  Example:
  
  ```json
  "Gorgonzola"
  ```

- `category` (optional)
  Reference: [Category](https://cheesestore-docs.pages.dev/api/schemas/category-292c06f004.md); Type: object

- `photoUrls` (optional)
  Type: array
  
  URLs of cheese photos
  
  Example:
  
  ```json
  [
    "https://wannabechef.com/gorgonzola.jpg"
  ]
  ```
  
  Items:
    Type: string, uri

- `tags` (optional)
  Type: array
  
  Classification tags
  
  Items:
    Reference: [Tag](https://cheesestore-docs.pages.dev/api/schemas/tag-1503916a2a.md); Type: object

- `status` (required)
  Type: string
  
  Availability status in the store
  
  enum: ["available","pending","sold"]
  
  Example:
  
  ```json
  "available"
  ```

- `origin` (optional)
  Type: string; nullable
  
  Country of origin (null if unknown)
  
  Example:
  
  ```json
  "Italy"
  ```

- `pricePerKg` (optional)
  Type: number, float
  
  Price per kilogram in USD
  
  minimum: 0
  
  exclusiveMinimum: true
  
  Example:
  
  ```json
  28.5
  ```

- `ageMonths` (optional)
  Type: integer
  
  Aging period in months
  
  minimum: 0
  
  maximum: 120
  
  Example:
  
  ```json
  12
  ```

- `organic` (optional)
  Type: boolean
  
  Whether the cheese is certified organic
  
  default: false

- `createdAt` (optional)
  Type: string, date-time
  
  When the cheese was added to the store

- `updatedAt` (optional)
  Type: string, date-time
  
  When the cheese was last updated

## CheeseInput

Type: object

Schema: [CheeseInput](https://cheesestore-docs.pages.dev/api/schemas/cheeseinput-4479830925.md)

- `name` (required)
  Type: string
  
  minLength: 1
  
  maxLength: 100

- `category` (optional)
  Type: object
  
  - `name` (optional)
    Type: string

- `photoUrls` (optional)
  Type: array
  
  Items:
    Type: string, uri

- `tags` (optional)
  Type: array
  
  Items:
    Type: object
    
    - `name` (optional)
      Type: string

- `status` (optional)
  Type: string
  
  default: "available"
  
  enum: ["available","pending","sold"]

- `origin` (optional)
  Type: string; nullable

- `pricePerKg` (optional)
  Type: number, float
  
  minimum: 0
  
  exclusiveMinimum: true

- `ageMonths` (optional)
  Type: integer
  
  minimum: 0
  
  maximum: 120

- `organic` (optional)
  Type: boolean
  
  default: false

## CheeseList

Type: object

Paginated list of cheeses

Schema: [CheeseList](https://cheesestore-docs.pages.dev/api/schemas/cheeselist-06d8bd48db.md)

- `items` (optional)
  Type: array
  
  Items:
    Reference: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md); Type: object

- `nextCursor` (optional)
  Type: string; nullable
  
  Cursor for the next page (null if no more results)

- `hasMore` (optional)
  Type: boolean
  
  Whether there are more results

- `total` (optional)
  Type: integer
  
  Total number of matching cheeses

## Category

Type: object

Schema: [Category](https://cheesestore-docs.pages.dev/api/schemas/category-292c06f004.md)

- `id` (optional)
  Type: integer, int64
  
  Example:
  
  ```json
  1
  ```

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "Italian Cheese"
  ```

## Tag

Type: object

Schema: [Tag](https://cheesestore-docs.pages.dev/api/schemas/tag-1503916a2a.md)

- `id` (optional)
  Type: integer, int64
  
  Example:
  
  ```json
  1
  ```

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "blue"
  ```

## Order

Type: object

Schema: [Order](https://cheesestore-docs.pages.dev/api/schemas/order-6be090825c.md)

Example:

```json
{
  "id": 1001,
  "items": [
    {
      "cheeseId": 42,
      "cheeseName": "Gorgonzola",
      "quantity": 3,
      "pricePerKg": 28.5
    },
    {
      "cheeseId": 17,
      "cheeseName": "Brie",
      "quantity": 1,
      "pricePerKg": 22
    }
  ],
  "shippingAddress": {
    "street": "123 Cheese Lane",
    "city": "Cheddarville",
    "state": "WI",
    "zipCode": "53001",
    "country": "US"
  },
  "status": "placed",
  "notes": "Please wrap each wheel separately",
  "total": 114.5,
  "shipDate": null,
  "createdAt": "2026-03-10T14:30:00Z",
  "updatedAt": "2026-03-10T14:30:00Z"
}
```

- `id` (optional)
  Type: integer, int64
  
  Example:
  
  ```json
  1001
  ```

- `items` (optional)
  Type: array
  
  Items:
    Reference: [OrderItem](https://cheesestore-docs.pages.dev/api/schemas/orderitem-6b56cf7850.md); Type: object

- `shippingAddress` (optional)
  Reference: [Address](https://cheesestore-docs.pages.dev/api/schemas/address-56ef8f2095.md); Type: object

- `status` (optional)
  Type: string
  
  Order lifecycle status
  
  enum: ["placed","approved","shipped","delivered","cancelled"]
  
  Example:
  
  ```json
  "placed"
  ```

- `notes` (optional)
  Type: string; nullable
  
  Special instructions for the order

- `total` (optional)
  Type: number, float
  
  Order total in USD
  
  Example:
  
  ```json
  114.5
  ```

- `shipDate` (optional)
  Type: string, date-time; nullable
  
  Estimated ship date (null if not yet scheduled)

- `createdAt` (optional)
  Type: string, date-time

- `updatedAt` (optional)
  Type: string, date-time

## OrderInput

Type: object

Schema: [OrderInput](https://cheesestore-docs.pages.dev/api/schemas/orderinput-fdf8fed0b2.md)

- `items` (required)
  Type: array
  
  minItems: 1
  
  maxItems: 50
  
  Items:
    Type: object
    
    - `cheeseId` (required)
      Type: integer, int64
    
    - `quantity` (required)
      Type: integer
      
      minimum: 1
      
      maximum: 100

- `shippingAddress` (required)
  Reference: [Address](https://cheesestore-docs.pages.dev/api/schemas/address-56ef8f2095.md); Type: object

- `notes` (optional)
  Type: string; nullable
  
  maxLength: 500

## OrderItem

Type: object

Schema: [OrderItem](https://cheesestore-docs.pages.dev/api/schemas/orderitem-6b56cf7850.md)

- `cheeseId` (optional)
  Type: integer, int64

- `cheeseName` (optional)
  Type: string

- `quantity` (optional)
  Type: integer
  
  minimum: 1

- `pricePerKg` (optional)
  Type: number, float

## Address

Type: object

Schema: [Address](https://cheesestore-docs.pages.dev/api/schemas/address-56ef8f2095.md)

- `street` (required)
  Type: string
  
  Example:
  
  ```json
  "123 Cheese Lane"
  ```

- `city` (required)
  Type: string
  
  Example:
  
  ```json
  "Cheddarville"
  ```

- `state` (optional)
  Type: string; nullable
  
  Example:
  
  ```json
  "WI"
  ```

- `zipCode` (optional)
  Type: string
  
  pattern: "^\\d{5}(-\\d{4})?$"
  
  Example:
  
  ```json
  "53001"
  ```

- `country` (required)
  Type: string
  
  ISO 3166-1 alpha-2 country code
  
  minLength: 2
  
  maxLength: 2
  
  Example:
  
  ```json
  "US"
  ```

## Customer

Type: object

Schema: [Customer](https://cheesestore-docs.pages.dev/api/schemas/customer-bf3763383a.md)

- `id` (optional)
  Type: integer, int64
  
  Example:
  
  ```json
  1
  ```

- `username` (optional)
  Type: string
  
  Example:
  
  ```json
  "gordo"
  ```

- `firstName` (optional)
  Type: string
  
  Customer first name
  
  Example:
  
  ```json
  "Alotta"
  ```

- `lastName` (optional)
  Type: string
  
  Customer last name
  
  Example:
  
  ```json
  "Cheese"
  ```

- `email` (optional)
  Type: string, email
  
  Example:
  
  ```json
  "love@cheese.com"
  ```

- `phone` (optional)
  Type: string; nullable
  
  Example:
  
  ```json
  "+3344556677"
  ```

- `customerStatus` (optional)
  Type: string
  
  Customer tier based on purchase volume
  
  enum: ["bronze","silver","gold","platinum"]
  
  Example:
  
  ```json
  "gold"
  ```

- `favouriteCheese` (optional)
  Type: unknown
  
  The customer's favourite cheese (by reference or by name)
  
  oneOf:
    Reference: [Cheese](https://cheesestore-docs.pages.dev/api/schemas/cheese-6e5a59d4fd.md); Type: object
  
    Type: object
    
    - `name` (required)
      Type: string

- `createdAt` (optional)
  Type: string, date-time

## CustomerInput

Type: object

Schema: [CustomerInput](https://cheesestore-docs.pages.dev/api/schemas/customerinput-63c834e0ae.md)

- `username` (required)
  Type: string
  
  minLength: 3
  
  maxLength: 30
  
  pattern: "^[a-zA-Z0-9_-]+$"

- `firstName` (optional)
  Type: string
  
  maxLength: 50

- `lastName` (optional)
  Type: string
  
  maxLength: 50

- `email` (required)
  Type: string, email

- `password` (required)
  Type: string, password
  
  minLength: 8
  
  maxLength: 128

- `phone` (optional)
  Type: string; nullable

## Error

Type: object

Schema: [Error](https://cheesestore-docs.pages.dev/api/schemas/error-54a0e8c17e.md)

- `code` (required)
  Type: integer, int32
  
  Example:
  
  ```json
  404
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Not found"
  ```

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "Your cheese has already been eaten"
  ```

## ValidationError

Type: object

Schema: [ValidationError](https://cheesestore-docs.pages.dev/api/schemas/validationerror-bdfaef14be.md)

- `code` (optional)
  Type: integer, int32
  
  Example:
  
  ```json
  422
  ```

- `type` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation error"
  ```

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Your cheese is not mouldy enough"
  ```

- `errors` (optional)
  Type: array
  
  Individual field validation errors
  
  Items:
    Type: object
    
    - `field` (optional)
      Type: string
      
      The field that failed validation
    
    - `message` (optional)
      Type: string
      
      Human-readable error message
