Quote Endpoints
Quotes represent proposals sent to organizations. They follow a lifecycle from draft through fulfillment, with automatic provisioning of entitlements upon payment.
Base path: /wp-json/middag-account/v1/quotes
Endpoints
| Method | Endpoint | Auth | Scope | Description |
|---|---|---|---|---|
| GET | /quotes | JWT + Org | quotes | List quotes |
| GET | /quotes/{id} | JWT + Org | quotes | Quote details |
| POST | /quotes/{id}/accept | JWT + Org | quotes | Accept quote |
| POST | /quotes/{id}/reject | JWT + Org | quotes | Reject quote |
| GET | /quotes/{id}/payment | JWT + Org | quotes + finances | Payment status |
GET /quotes
List quotes for the current organization.
Headers: X-Middag-Organization: {org_id}
Query filters:
| Parameter | Type | Values |
|---|---|---|
status | string | draft, sent, viewed, accepted, paid, fulfilled, expired, rejected, cancelled |
Response (200):
{
"success": true,
"data": [
{
"id": 201,
"status": "sent",
"total": "5400.00",
"currency": "BRL",
"valid_until": "2026-05-15",
"organization_id": 42,
"line_items": [
{
"product_name": "Campus EAD - Annual",
"quantity": 1,
"unit_price": "5400.00",
"entitlement_class": "PLG"
}
],
"created_at": "2026-04-01T10:00:00Z"
}
],
"meta": {
"page": 1,
"per_page": 20,
"total": 1,
"pages": 1
}
}GET /quotes/:id
Full quote details including line items, notes, and linked order/entitlement data.
Response fields: id, status, total, subtotal, currency, valid_until, organization_id, company, line_items[], order_id, entitlement_ids[], notes, rejection_reason, created_at, updated_at.
POST /quotes/:id/accept
Accept a quote. This triggers WooCommerce order creation. The quote must be in sent or viewed status.
Response (200):
{
"success": true,
"data": {
"quote_id": 201,
"status": "accepted",
"order_id": 502
},
"message": "Quote accepted"
}Returns 409 CONFLICT if the quote is expired, rejected, or already accepted.
POST /quotes/:id/reject
Reject a quote with an optional reason. The quote must be in sent or viewed status.
Request:
{
"reason": "Budget constraints for this quarter"
}Response (200):
{
"success": true,
"message": "Quote rejected"
}GET /quotes/:id/payment
Check payment status for an accepted quote. Requires both quotes and finances scopes.
Quote Lifecycle
draft -> sent -> viewed -> accepted -> paid -> fulfilled
| |
+-> expired +-> cancelled
|
+-> rejectedWhen a quote reaches paid status, the middag/quote/paid hook fires and auto-provisions entitlements based on line items.
Statuses
| Status | Description |
|---|---|
draft | Created by admin, not yet sent to client |
sent | Delivered to client |
viewed | Client has opened the quote |
accepted | Client accepted, WC order created |
paid | Payment confirmed |
fulfilled | Entitlements provisioned (terminal) |
expired | Past validity date without acceptance (terminal) |
rejected | Client rejected the quote (terminal) |
cancelled | Cancelled by admin (terminal) |
Related
- Entitlement Endpoints -- Entitlements created from paid quotes
- Order Endpoints -- Orders created from accepted quotes
- Lifecycle States