Cheese Store
v2.0.0https://cheese.example.com/v2Example production URL (not a live service)https://sandbox.cheese.example.com/v2Example sandbox URL (not a live service)http://localhost:3000/v2Example local development URLThis is a fictional API contract used to demonstrate documentation generated by 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. 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:
{
"items": [...],
"nextCursor": "eyJpZCI6NDJ9",
"hasMore": true
}Authentication
api_ keyapiKeyAPI 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.
API Key: X-API-Key in header
cheesy_ oauthoauth2OAuth2 authentication for full API access
- Authorization URL
https://cheese.example.com/oauth/authorize
read:cheeses- Read cheese datawrite:cheeses- Create and update cheesesread:orders- View order historywrite:orders- Place and manage orders
- Authorization URL
https://cheese.example.com/oauth/authorize- Token URL
https://cheese.example.com/oauth/token
read:cheeses- Read cheese datawrite:cheeses- Create and update cheesesread:orders- View order historywrite:orders- Place and manage orders
bearer_ authhttpJWT token obtained from the /customer/login endpoint
Scheme: bearer (JWT)
Cheese
Cheese endpoints provide access to information and operations relating to the cheeses available in the store.
Cheeses can be filtered by status, tags, and category. Each cheese has a unique ID, name, category, and availability status.
List all 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.
Parameters
cursorstringqueryPagination cursor from a previous response
limitinteger[1, 100]20queryMaximum number of cheeses to return
statusstringavailablependingsoldqueryFilter by availability status
sortstringname-namecreatedAt-createdAtnamequerySort order for results
Response
A paginated list of cheeses
Rate limit exceeded
Authorization
api_ keyapiKey in headerAPI 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_ oauthoauth2OAuth2 authentication for full API access
Scopes: read:cheeses
Add a new cheese
Add a new cheese to the store inventory. The cheese name must be unique within its category.
Body
Cheese object to add to the store
namestringrequiredcategoryobjectphotoUrlsArray<string>tagsArray<object>statusstringavailablependingsoldavailableoriginstring | nullpricePerKgnumber<float>> 0ageMonthsinteger[0, 120]organicbooleanfalseResponse
Cheese created successfully
A cheese with this name already exists in the category
The request body failed validation
Authorization
cheesy_ oauthoauth2OAuth2 authentication for full API access
Scopes: write:cheeses
Update an existing cheese
Replace an existing cheese with updated data. The cheese ID in the body must match an existing cheese.
Body
Cheese object with updated fields
idinteger<int64>requiredUnique identifier
42namestringrequiredName of the cheese
GorgonzolacategoryCategoryphotoUrlsArray<string>URLs of cheese photos
[
"https://wannabechef.com/gorgonzola.jpg"
]tagsArray<Tag>Classification tags
statusstringavailablependingsoldrequiredAvailability status in the store
availableoriginstring | nullCountry of origin (null if unknown)
ItalypricePerKgnumber<float>> 0Price per kilogram in USD
28.5ageMonthsinteger[0, 120]Aging period in months
12organicbooleanfalseWhether the cheese is certified organic
createdAtstring<date-time>When the cheese was added to the store
updatedAtstring<date-time>When the cheese was last updated
Response
Cheese updated successfully
The requested resource was not found
The request body failed validation
Authorization
cheesy_ oauthoauth2OAuth2 authentication for full API access
Scopes: write:cheeses
Find cheeses by status
Multiple status values can be provided as comma-separated strings. Returns all cheeses matching any of the given statuses.
Parameters
statusArray<string>availablependingsoldrequiredqueryStatus values to filter by
Response
Matching cheeses
Invalid status value provided
Authorization
cheesy_ oauthoauth2OAuth2 authentication for full API access
Scopes: read:cheeses
Get cheese by ID
Returns detailed information about a specific cheese, including its category, tags, and current availability status.
Parameters
cheeseIdinteger<int64>>= 1requiredpathUnique identifier for the cheese
Authorization
api_ keyapiKey in headerAPI 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.
Update cheese with form data
Updates specific fields of a cheese using form data. Only provided fields are updated.
Parameters
cheeseIdinteger<int64>>= 1requiredpathUnique identifier for the cheese
namestringqueryUpdated name of the cheese
statusstringavailablependingsoldqueryUpdated status of the cheese
Response
Cheese updated
The requested resource was not found
The request body failed validation
Authorization
cheesy_ oauthoauth2OAuth2 authentication for full API access
Scopes: write:cheeses
Delete a cheese
Permanently removes a cheese from the store. This action cannot be undone. Any pending orders for this cheese will be cancelled.
Parameters
cheeseIdinteger<int64>>= 1requiredpathUnique identifier for the cheese
X-Confirm-DeletebooleanrequiredheaderMust be set to true to confirm deletion
Response
Authorization
cheesy_ oauthoauth2OAuth2 authentication for full API access
Scopes: write:cheeses
Upload a cheese image
Upload a photo of the cheese. Supports JPEG, PNG, and WebP formats. Maximum file size is 10MB.
Body
filestring<binary>requiredImage file (JPEG, PNG, or WebP, max 10MB)
captionstringOptional caption for the image
isPrimarybooleanfalseSet as the primary display image
Parameters
cheeseIdinteger<int64>requiredpathID of cheese to upload image for
Response
Authorization
cheesy_ oauthoauth2OAuth2 authentication for full API access
Scopes: write:cheeses
Store
Store endpoints provide access to cheese store orders and inventory management. Orders track the purchase lifecycle from placement through delivery.
Get store inventory
Returns a map of cheese status codes to quantities, representing the current inventory levels.
Response
Inventory counts by status
Authorization
api_ keyapiKey in headerAPI 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.
Place a cheese 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}.
Body
Order details
Response
Order placed successfully
The request body failed validation
Authorization
cheesy_ oauthoauth2OAuth2 authentication for full API access
Scopes: write:orders
Get order by ID
Retrieve details of a specific order. For testing, use order IDs between 1 and 10.
Parameters
orderIdinteger<int64>>= 1requiredpathID of the order
Authorization
api_ keyapiKey in headerAPI 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.
Cancel an order
Cancel a pending order. Orders that have already been shipped cannot be cancelled.
Parameters
orderIdinteger<int64>>= 1requiredpathID of the order
Response
Authorization
cheesy_ oauthoauth2OAuth2 authentication for full API access
Scopes: write:orders
Customer
Customer endpoints handle account creation, authentication, and profile management.
Customer accounts support OAuth2 login and API key authentication.
Create a customer account
Register a new customer account. The username and email must be unique.
Body
Customer registration details
usernamestringrequiredfirstNamestringlastNamestringemailstring<email>requiredpasswordstring<password>requiredphonestring | nullResponse
Customer account created
Username or email already exists
The request body failed validation
Create multiple customers
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:
{
"created": [...],
"errors": [
{ "index": 2, "message": "Email already exists" }
]
}Body
Array of customer objects to create
Response
Batch creation result
The request body failed validation
Customer login
Authenticate a customer and receive a session token. The token expires after 24 hours.
Body
usernamestringrequiredThe customer's username
passwordstring<password>requiredThe customer's password
Response
Login successful
Invalid username or password
Customer logout
End the current customer session and invalidate the session token.
Response
Logout successful
Authorization
bearer_ authhttp (bearer)JWT token obtained from the /customer/login endpoint
Get customer by username
Retrieve a customer's profile by their username.
Parameters
usernamestringrequiredpathThe customer's username
Authorization
api_ keyapiKey in headerAPI 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_ authhttp (bearer)JWT token obtained from the /customer/login endpoint
Update customer profile
Update a customer's profile. Can only be performed by the authenticated customer.
Body
Updated customer fields
usernamestringrequiredfirstNamestringlastNamestringemailstring<email>requiredpasswordstring<password>requiredphonestring | nullParameters
usernamestringrequiredpathThe customer's username
Response
Customer updated
The requested resource was not found
The request body failed validation
Authorization
bearer_ authhttp (bearer)JWT token obtained from the /customer/login endpoint
Delete customer account
Permanently delete a customer account and all associated data. This action cannot be undone.
Parameters
usernamestringrequiredpathThe customer's username
Response
Customer deleted
The requested resource was not found
Authorization
bearer_ authhttp (bearer)JWT token obtained from the /customer/login endpoint
Models
Cheese
objectidinteger<int64>requiredUnique identifier
42namestringrequiredName of the cheese
GorgonzolacategoryCategoryphotoUrlsArray<string>URLs of cheese photos
[
"https://wannabechef.com/gorgonzola.jpg"
]tagsArray<Tag>Classification tags
statusstringavailablependingsoldrequiredAvailability status in the store
availableoriginstring | nullCountry of origin (null if unknown)
ItalypricePerKgnumber<float>> 0Price per kilogram in USD
28.5ageMonthsinteger[0, 120]Aging period in months
12organicbooleanfalseWhether the cheese is certified organic
createdAtstring<date-time>When the cheese was added to the store
updatedAtstring<date-time>When the cheese was last updated
CheeseInput
objectnamestringrequiredcategoryobjectphotoUrlsArray<string>tagsArray<object>statusstringavailablependingsoldavailableoriginstring | nullpricePerKgnumber<float>> 0ageMonthsinteger[0, 120]organicbooleanfalseCheeseList
objectPaginated list of cheeses
itemsArray<Cheese>nextCursorstring | nullCursor for the next page (null if no more results)
hasMorebooleanWhether there are more results
totalintegerTotal number of matching cheeses
Order
objectidinteger<int64>1001itemsArray<OrderItem>shippingAddressAddressstatusstringplacedapprovedshippeddeliveredcancelledOrder lifecycle status
placednotesstring | nullSpecial instructions for the order
totalnumber<float>Order total in USD
114.5shipDatestring<date-time> | nullEstimated ship date (null if not yet scheduled)
createdAtstring<date-time>updatedAtstring<date-time>{
"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"
}Address
objectstreetstringrequired123 Cheese LanecitystringrequiredCheddarvillestatestring | nullWIzipCodestring53001countrystringrequiredISO 3166-1 alpha-2 country code
USCustomer
objectidinteger<int64>1usernamestringgordofirstNamestringCustomer first name
AlottalastNamestringCustomer last name
Cheeseemailstring<email>love@cheese.comphonestring | null+3344556677customerStatusstringbronzesilvergoldplatinumCustomer tier based on purchase volume
goldfavouriteCheeseCheese | objectThe customer's favourite cheese (by reference or by name)
createdAtstring<date-time>CustomerInput
objectusernamestringrequiredfirstNamestringlastNamestringemailstring<email>requiredpasswordstring<password>requiredphonestring | null