Aller au contenu
Sur cette page

Quote

Quote CRUD, lifecycle, and conversion to invoices

Display a listing of quotes

GET /api/v1/quotes

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.view

Paramètres

Nom Emplacement Type Requis Description
status query string non
customer_id query integer non
date_from query string non
date_to query string non
sort query string non
page query integer non
per_page query integer non

Réponses

Statut Description
200 For non-paginated data, return as before
422

Exemple de requête

curl -X GET "https://kworia.com/api/v1/quotes" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json"

Store a newly created quote

POST /api/v1/quotes

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.create

Corps de la requête

Champ Type Requis Description
customer_id integer oui
issue_date string oui
currency string oui
notes string non
terms string non
valid_until string oui
items array oui

Réponses

Statut Description
201 For non-paginated data, return as before
422
403

Exemple de requête

curl -X POST "https://kworia.com/api/v1/quotes" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": 1,
    "issue_date": "string",
    "currency": "string",
    "notes": "string",
    "terms": "string",
    "valid_until": "string",
    "items": []
}'

Display the specified quote

GET /api/v1/quotes/{id}

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.view

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Réponses

Statut Description
200 For non-paginated data, return as before

Exemple de requête

curl -X GET "https://kworia.com/api/v1/quotes/{id}" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json"

Update the specified quote

PUT /api/v1/quotes/{id}

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.update.any

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Corps de la requête

Champ Type Requis Description
customer_id integer non
issue_date string non
currency string non
notes string non
terms string non
valid_until string non
items array non

Réponses

Statut Description
200 For non-paginated data, return as before
409 Modifying a locked (sent/accepted) quote is a domain conflict, not a server error — surface 409, not 500. Branch on the quote_locked error_code: the message is in the user's language.
422
403

Exemple de requête

curl -X PUT "https://kworia.com/api/v1/quotes/{id}" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": 1,
    "issue_date": "string",
    "currency": "string",
    "notes": "string",
    "terms": "string",
    "valid_until": "string",
    "items": []
}'

Remove the specified quote

DELETE /api/v1/quotes/{id}

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.delete

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Réponses

Statut Description
200 For non-paginated data, return as before

Exemple de requête

curl -X DELETE "https://kworia.com/api/v1/quotes/{id}" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json"

Convert quote to invoice

POST /api/v1/quotes/{id}/convert-to-invoice

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.create

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Réponses

Statut Description
201 For non-paginated data, return as before

Exemple de requête

curl -X POST "https://kworia.com/api/v1/quotes/{id}/convert-to-invoice" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json"

Duplicate a quote

POST /api/v1/quotes/{id}/duplicate

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.create

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Réponses

Statut Description
201 For non-paginated data, return as before

Exemple de requête

curl -X POST "https://kworia.com/api/v1/quotes/{id}/duplicate" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json"

Mark quote as accepted

POST /api/v1/quotes/{id}/mark-accepted

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.create

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Corps de la requête

Champ Type Requis Description
accepted_at string non

Réponses

Statut Description
200 For non-paginated data, return as before
422

Exemple de requête

curl -X POST "https://kworia.com/api/v1/quotes/{id}/mark-accepted" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "accepted_at": "string"
}'

Mark quote as rejected

POST /api/v1/quotes/{id}/mark-rejected

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.create

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Corps de la requête

Champ Type Requis Description
rejected_at string non
rejection_reason string non

Réponses

Statut Description
200 For non-paginated data, return as before
422

Exemple de requête

curl -X POST "https://kworia.com/api/v1/quotes/{id}/mark-rejected" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "rejected_at": "string",
    "rejection_reason": "string"
}'

Download quote PDF

GET /api/v1/quotes/{id}/pdf

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.view

Uses method injection for the PDF service (only this method needs it).

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Réponses

Statut Description
200

Exemple de requête

curl -X GET "https://kworia.com/api/v1/quotes/{id}/pdf" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json"

Send quote via email

POST /api/v1/quotes/{id}/send

Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.

Portée du jeton API : quotes.create

Paramètres

Nom Emplacement Type Requis Description
id path integer oui

Corps de la requête

Champ Type Requis Description
recipients string non
message string non
attach_pdf string non

Réponses

Statut Description
200 For non-paginated data, return as before

Exemple de requête

curl -X POST "https://kworia.com/api/v1/quotes/{id}/send" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "X-Organization-Id: {{organization_id}}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "recipients": "string",
    "message": "string",
    "attach_pdf": "string"
}'