Authentication
Every request needs a partner token, issued by the wholesale desk once your account is approved. Send it as a bearer token over HTTPS. Tokens are scoped to a single delivery address.
Authorization: Bearer pb_live_xxxxxxxxxxxxxxxx
All responses are JSON in UTF-8. Prices are in US dollars, times are in Pacific time with an explicit offset.
Endpoints
GET /v1/products
List the current wholesale catalogue with prices per unit and per crate.
curl https://api.pinecrestbakes.com/v1/products \
-H "Authorization: Bearer $PB_TOKEN"
{
"data": [
{ "sku": "SD-800", "name": "Country sourdough 800 g",
"unit_price": 6.50, "crate_size": 12, "days": ["tue","wed","thu","fri","sat"] },
{ "sku": "CR-BTR", "name": "Butter croissant",
"unit_price": 2.40, "crate_size": 24, "days": ["daily"] }
]
}
GET /v1/delivery-slots
Available delivery windows for the next 14 days, with the cut-off time for each.
curl "https://api.pinecrestbakes.com/v1/delivery-slots?from=2026-11-03" \
-H "Authorization: Bearer $PB_TOKEN"
{
"data": [
{ "date": "2026-11-03", "window": "05:30-07:30", "cutoff": "2026-11-01T18:00:00-07:00" }
]
}
POST /v1/orders
Create or replace the order for a delivery date. Send the same Idempotency-Key to retry safely.
curl -X POST https://api.pinecrestbakes.com/v1/orders \
-H "Authorization: Bearer $PB_TOKEN" \
-H "Idempotency-Key: 7c1e-cafe-0420" \
-d '{"date":"2026-11-03","lines":[{"sku":"SD-800","qty":12}]}'
{ "id": "ord_48213", "status": "confirmed", "total": 78.00 }
GET /v1/invoices/{id}
Fetch an invoice with its line items. PDF copies are available from the order portal.
curl https://api.pinecrestbakes.com/v1/invoices/inv_2026_10_118 \
-H "Authorization: Bearer $PB_TOKEN"
{ "id": "inv_2026_10_118", "period": "2026-10", "amount_due": 1243.60, "due": "2026-11-14" }
Errors
| Code | Meaning |
400 | Malformed request or unknown SKU. |
401 | Missing or revoked token. |
409 | Cut-off has passed for that delivery date. The dough is already resting. |
429 | Too many requests. Retry after the Retry-After header. |
Status & limits
The API allows 60 requests per minute per token. Planned maintenance happens on Mondays, when the bakery is closed. For help, email api@pinecrestbakes.com.