API REFERENCE

Quotes API

A quote is a priced proposal you send a client before any work or billing starts. This API drafts quotes, takes them through approval and delivery, tracks revisions, and converts the accepted ones into downstream records.

Draft one

Only title is required. client_id is optional, but you need it to set line item locations and to convert the quote later. Optionally pass valid_until, terms_and_conditions, internal_notes, client_notes, and an items array up front, or add lines afterward with POST /api/v1/quotes/{id}/items and reorder them via POST /api/v1/quotes/{id}/items/reorder.

The create body is strict: an unknown top-level field returns 400 instead of being silently dropped. The older notes and terms names are still accepted for one release and saved as internal_notes and terms_and_conditions; a quote_number in the body is ignored because the server assigns it. Move to the real field names now.

Each line item can carry a location_id, plus cost, cost_currency, and unit_code, and these are now saved on inline create, POST /items, and PUT /items/{itemId}. The location must belong to the quote's client; a location from another client, or a location on a quote with no client, returns 400. For a fixed discount line, send a positive unit_price with is_discount: true and discount_type: "fixed"; negative prices are rejected.

When listing with GET /api/v1/quotes, sort must be one of created_at, updated_at, quote_date, valid_until, total_amount, status, quote_number, or title; any other value returns 400. Client details are included by default; pass include_client=false to leave them out.

curl
curl https://algapsa.com/api/v1/quotes \
  -H "X-API-Key: $ALGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "cl_3f9a2c",
    "title": "Q3 firewall refresh",
    "valid_until": "2026-09-30",
    "terms_and_conditions": "50% on acceptance, balance on delivery"
  }'

Approve, send, convert

The lifecycle runs through dedicated actions, not status writes. Push a draft to reviewers with POST /api/v1/quotes/{id}/submit-for-approval, sign off with /approve, then deliver via /send. After that, /resend, /remind, and /request-changes keep the conversation moving. When the client accepts, preview the result with GET /api/v1/quotes/{id}/convert/preview before committing with POST /api/v1/quotes/{id}/convert.

PUT /api/v1/quotes/{id} edits a quote's content only. It does not accept status, and it rejects unknown fields. A body with either returns 400 and nothing is saved, not even the valid fields. This means a caller with plain billing update rights cannot skip the /approve step and its quotes:approve permission check.

To withdraw a quote, call POST /api/v1/quotes/{id}/cancel with an optional reason. You can cancel a quote in any status up to and including accepted. Cancelling an already-cancelled quote changes nothing. Cancelling a converted, superseded, or archived quote returns 409. Each cancellation is recorded in the quote's activity history.

Revisions and history

Cut a new version with POST /api/v1/quotes/{id}/revisions and read the chain from GET /api/v1/quotes/{id}/revisions. Every send, reminder, and change request lands in GET /api/v1/quotes/{id}/activities for an audit trail.

Archive or delete

DELETE /api/v1/quotes/{id} hard-deletes a quote only while it has no business history. A draft that was submitted for approval and sent back for changes can still be deleted. Once a quote has history that must be kept, such as being sent or converted, DELETE returns 409 and names archiving as the alternative.

To put a quote away instead, call POST /api/v1/quotes/{id}/archive. You can archive a quote that is draft, cancelled, rejected, or expired; any other status returns 409, so cancel a sent quote first. Archiving sets archived_at, records a status change in the quote's activity history, and is final: an archived quote cannot move to another status. Archiving does not fire a webhook event.

Endpoints

Every endpoint links through to its full parameters, request and response schemas, and code samples.

GET/api/v1/quotesAlgaPSAList quotesPOST/api/v1/quotesAlgaPSACreate quoteGET/api/v1/quotes/{id}AlgaPSAGet quotePUT/api/v1/quotes/{id}AlgaPSAUpdate quoteDELETE/api/v1/quotes/{id}AlgaPSADelete quoteGET/api/v1/quotes/{id}/activitiesAlgaPSAList quote activitiesPOST/api/v1/quotes/{id}/approveAlgaPSAApprove quotePOST/api/v1/quotes/{id}/archiveAlgaPSAArchive quotePOST/api/v1/quotes/{id}/cancelAlgaPSACancel quotePOST/api/v1/quotes/{id}/convertAlgaPSAConvert quoteGET/api/v1/quotes/{id}/convert/previewAlgaPSAPreview quote conversionGET/api/v1/quotes/{id}/itemsAlgaPSAList quote itemsPOST/api/v1/quotes/{id}/itemsAlgaPSAAdd quote itemPUT/api/v1/quotes/{id}/items/{itemId}AlgaPSAUpdate quote itemDELETE/api/v1/quotes/{id}/items/{itemId}AlgaPSADelete quote itemPOST/api/v1/quotes/{id}/items/reorderAlgaPSAReorder quote itemsPOST/api/v1/quotes/{id}/remindAlgaPSASend quote reminderPOST/api/v1/quotes/{id}/request-changesAlgaPSARequest quote changesPOST/api/v1/quotes/{id}/resendAlgaPSAResend quoteGET/api/v1/quotes/{id}/revisionsAlgaPSAList quote revisionsPOST/api/v1/quotes/{id}/revisionsAlgaPSACreate quote revisionPOST/api/v1/quotes/{id}/sendAlgaPSASend quotePOST/api/v1/quotes/{id}/submit-for-approvalAlgaPSASubmit quote for approval