Opportunités
- GET
/crm/dealsLister les opportunités - POST
/crm/dealsCréer une opportunité - GET
/crm/deals/{id}Détail d’une opportunité - PATCH
/crm/deals/{id}Modifier une opportunité - POST
/crm/deals/{id}/lostMarquer une opportunité perdue - POST
/crm/deals/{id}/quoteGénérer le devis d’une opportunité - POST
/crm/deals/{id}/reopenRouvrir une opportunité close - POST
/crm/deals/{id}/stageFaire avancer une opportunité (changer d’étape) - POST
/crm/deals/{id}/wonMarquer une opportunité gagnée
Lister les opportunités #
/api/public/v1/quosuite/crm/dealscrm:readlistCrmDealsFiltrable par pipeline, étape, statut, compte, contact, propriétaire, devise et clôture prévue ; archivées exclues sauf archived=true. En curseur, tri permis sur createdAt, updatedAt, amount, title. Tri permis : createdAt, updatedAt, amount, title, expectedCloseDate (défaut -createdAt).
Paramètres
langstringrequêteLangue des libellés (et du PDF). Défaut :
Accept-Language, sinon la langue de l’espace.frenarpagenumberrequêteNuméro de page (à partir de 1).
pageSizenumberrequêteÉléments par page (100 au plus).
sortstringrequêteTri : champs séparés par des virgules, préfixe
-pour l’ordre décroissant. Champs permis : voir la description de la route. Un dernier critère suridrend la pagination stable.updatedSincestringrequêteNe renvoie que les éléments créés ou modifiés depuis cet instant (ISO 8601, inclus). Avec
sort=updatedAt, c’est la forme recommandée d’une synchronisation incrémentale.cursorstringrequêtePagination par curseur :
nextCursorde la page précédente, à repasser tel quel avec les mêmes filtres et le même tri. Stable même si des éléments sont créés pendant le parcours, et de coût constant quelle que soit la profondeur. Exclusif depage.limitnumberrequêtePagination par curseur : éléments par page (100 au plus).
?limit=100ouvre un parcours par curseur ; la réponse rendpagination.nextCursor.pipelineIdstring (uuid)requêtestageIdstring (uuid)requêtestatusstring[]requêteStatuts, séparés par des virgules (
OPEN,WON,LOST).accountIdstring (uuid)requêtecontactIdstring (uuid)requêteownerIdstring (uuid)requêtecurrencystringrequêtecloseFromstringrequêteClôture prévue à partir du (inclus).
closeTostringrequêteClôture prévue jusqu’au (inclus).
archivedbooleanrequête
Réponse 200application/json
Succès.
itemsCrmDealDto[]obligatoireDétail de CrmDealDto
paginationPaginationDtoobligatoireDétail de PaginationDto
Erreurs
400VALIDATION_FAILEDIDEMPOTENCY_KEY_INVALIDINVALID_CURSOR
Paramètre ou corps invalide (champ manquant, inconnu, mal typé, tri non permis), ou curseur de pagination émis pour un autre tri ou d’autres filtres.
401API_KEY_MISSINGAPI_KEY_INVALIDAPI_KEY_REVOKEDAPI_KEY_EXPIRED
Jeton absent, invalide, révoqué ou expiré.
403API_KEY_WRONG_PERIMETERAPI_INSUFFICIENT_SCOPEAPI_ORIGIN_NOT_ALLOWEDAPI_TENANT_MISMATCHAPI_TENANT_INACTIVEAPI_MODULE_UNAVAILABLEAPI_FEATURE_UNAVAILABLE
Jeton valide mais insuffisant : mauvais périmètre, scope manquant, origine refusée, abonnement inactif ou module / option non inclus dans le plan.
429API_RATE_LIMITEDAPI_AUTH_BLOCKED
Quota du jeton ou de l’espace atteint (voir Retry-After), ou adresse bloquée.
500INTERNAL_ERROR
Erreur inattendue. Citez requestId au support.
503SERVICE_UNAVAILABLE
Indisponibilité temporaire (voir Retry-After). Aucun détail d’infrastructure.
curl 'https://quosuite.com/api/public/v1/quosuite/crm/deals' \
-H "Authorization: Bearer $QUOSUITE_API_KEY"{
"success": true,
"data": {
"items": [
{
"id": "2e69f4db-32f4-46c6-8d3b-3614f407cb99",
"title": "Équipement atelier BTP Horizon",
"accountId": "6443098c-7bf2-4812-8cac-1c9d5438fddd",
"contactId": "876f5ec7-f7dc-435a-8d04-26b625cfaead",
"pipelineId": "426a702d-1f21-4952-89db-8e069d3e565d",
"stageId": "66358d3d-f38e-4482-8c4a-96784e51d8e1",
"stageName": "Négociation",
"status": "OPEN",
"statusLabel": "Ouverte",
"amount": 42000,
"currency": "TND",
"probability": 75,
"weightedAmount": 31500,
"expectedCloseDate": "2026-12-20",
"ownerId": "332806c4-2ef5-4aca-8355-483d344c51d5",
"ownerName": null,
"lostReason": null,
"source": null,
"description": null,
"leadId": "8d012a2d-740a-4282-82be-a54283e63615",
"stageChangedAt": "2026-10-02T09:15:00.000Z",
"lastActivityAt": "2026-10-02T09:15:00.000Z",
"closedAt": "2026-10-02T09:15:00.000Z",
"archived": true,
"lines": [
{
"id": "a0bf6e21-0769-41e2-8e0d-b8126ac89ff5",
"articleId": "8bc5a87b-4885-4296-8e2f-169e920ce389",
"label": "Établi d’atelier 2 m",
"quantity": 6,
"unitPrice": 890,
"discountPct": 0,
"vatRate": 19,
"total": 5340
}
],
"documents": [
{
"documentId": "2cbae947-e0de-49a6-8612-6aa08420a959",
"number": "DEV-2026-0021",
"type": "DEVIS",
"typeLabel": "Devis",
"status": "DRAFT",
"origin": "GENERATED"
}
],
"createdAt": "2026-10-02T09:15:00.000Z",
"updatedAt": "2026-10-02T09:15:00.000Z"
}
],
"pagination": {
"page": 1,
"pageSize": 25,
"totalItems": 132,
"totalPages": 6,
"limit": 100,
"nextCursor": "c1.eyJzIjoiZGF0ZTpkZXNjLGlkOmFzYyIsImYiOiJ…",
"hasMore": true
}
},
"timestamp": "2026-10-02T09:15:00.000Z"
}Essayer cette requête
Créer une opportunité #
/api/public/v1/quosuite/crm/dealscrm:writeIdempotentcreateCrmDealPipeline par défaut et première étape si omis ; probabilité de l’étape sauf saisie. Avec lines, le montant est leur total HT (articles ERP : libellé, prix, TVA par défaut). Une devise autre que celle de l’espace exige l’option multi-devise (402).
Paramètres
Idempotency-Keystringen-têteClé d'idempotence (1–255 caractères ASCII imprimables, UUID v4 recommandé). Un nouvel essai avec la même clé et le même corps dans les 24 h rejoue la réponse du premier appel réussi (en-tête
Idempotent-Replayed: true) au lieu de créer une seconde fois. Même clé, corps différent : 422IDEMPOTENCY_KEY_REUSED. Premier appel encore en cours : 409IDEMPOTENCY_IN_PROGRESS.
Corps de la requête application/json
titlestringobligatoireex.Équipement atelier BTP HorizonaccountIdstring (uuid) | nullcontactIdstring (uuid) | nullpipelineIdstring (uuid)Défaut : le pipeline par défaut (
GET /crm/pipelines).stageIdstring (uuid)Défaut : la première étape du pipeline.
amountnumberMontant HT, ignoré quand
linesest fourni.min.0ex.42000currencystringDéfaut : la devise du compte, sinon de l’espace.
ex.TNDprobabilitynumberDéfaut : celle de l’étape.
min.0max.100expectedCloseDatestring | nullex.2026-12-20ownerIdstring (uuid) | nullPropriétaire : un utilisateur de l’espace (
GET /crm/owners). Omis à la création : aucun (une automatisation « nouvelle piste » peut l’attribuer) ;nullen modification : le retirer.sourceobjectdescriptionobjectlinesCrmDealLineInput[]Lignes indicatives (remplacent les précédentes).
Détail de CrmDealLineInput
Réponse 201application/json
Créé.
idstring (uuid)obligatoiretitlestringobligatoireex.Équipement atelier BTP HorizonaccountIdstring (uuid) | nullcontactIdstring (uuid) | nullpipelineIdstring (uuid)obligatoirestageIdstring (uuid)obligatoirestageNamestringobligatoireex.NégociationstatusstringobligatoirevaleursOPENWONLOSTstatusLabelstringobligatoireex.OuverteamountnumberobligatoireMontant HT (total des lignes s’il y en a).
ex.42000currencystringobligatoireex.TNDprobabilitynumberobligatoireProbabilité 0–100.
ex.75weightedAmountnumberobligatoireMontant × probabilité.
ex.31500expectedCloseDatestring | nullex.2026-12-20ownerIdstring (uuid) | nullownerNamestring | nulllostReasonstring | nullsourcestring | nulldescriptionstring | nullleadIdstring (uuid) | nullPiste d’origine.
stageChangedAtstringobligatoireEntrée dans l’étape actuelle.
lastActivityAtstringobligatoireDernier geste commercial (activité, déplacement…).
closedAtstring | nullarchivedbooleanobligatoirelinesCrmDealLineDto[]obligatoireDétail de CrmDealLineDto
documentsCrmDealDocumentDto[]obligatoirePièces de vente rattachées.
Détail de CrmDealDocumentDto
createdAtstringobligatoireupdatedAtstringobligatoire
Erreurs
400VALIDATION_FAILEDIDEMPOTENCY_KEY_INVALIDINVALID_CURSOR
Paramètre ou corps invalide (champ manquant, inconnu, mal typé, tri non permis), ou curseur de pagination émis pour un autre tri ou d’autres filtres.
401API_KEY_MISSINGAPI_KEY_INVALIDAPI_KEY_REVOKEDAPI_KEY_EXPIRED
Jeton absent, invalide, révoqué ou expiré.
402PLAN_QUOTA_EXCEEDEDFEATURE_NOT_INCLUDEDMODULE_NOT_INCLUDED
Limite ou option du plan d’abonnement (quota mensuel de documents, multi-devise…).
403API_KEY_WRONG_PERIMETERAPI_INSUFFICIENT_SCOPEAPI_ORIGIN_NOT_ALLOWEDAPI_TENANT_MISMATCHAPI_TENANT_INACTIVEAPI_MODULE_UNAVAILABLEAPI_FEATURE_UNAVAILABLE
Jeton valide mais insuffisant : mauvais périmètre, scope manquant, origine refusée, abonnement inactif ou module / option non inclus dans le plan.
404NOT_FOUND
Ressource absente — ou appartenant à un autre espace, ce qui revient au même.
409CONFLICTIDEMPOTENCY_IN_PROGRESS
Conflit : valeur unique déjà prise, ou même clé d’idempotence encore en cours.
422BUSINESS_RULE_VIOLATIONIDEMPOTENCY_KEY_REUSED
Requête bien formée mais refusée par une règle de gestion de l’ERP (transition de statut interdite, pièce réglée verrouillée, stock…), ou clé d’idempotence réutilisée.
429API_RATE_LIMITEDAPI_AUTH_BLOCKED
Quota du jeton ou de l’espace atteint (voir Retry-After), ou adresse bloquée.
500INTERNAL_ERROR
Erreur inattendue. Citez requestId au support.
503SERVICE_UNAVAILABLE
Indisponibilité temporaire (voir Retry-After). Aucun détail d’infrastructure.
# Une clé par opération, réutilisée telle quelle à chaque nouvel essai.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/crm/deals' \
-H "Authorization: Bearer $QUOSUITE_API_KEY" \
-H 'Idempotency-Key: 3f1c2a9e-5b7d-4e8a-9c1f-2d6b8e4a7c30' \
-H 'Content-Type: application/json' \
-d '{
"title": "Équipement atelier BTP Horizon"
}'{
"success": true,
"data": {
"id": "2e69f4db-32f4-46c6-8d3b-3614f407cb99",
"title": "Équipement atelier BTP Horizon",
"accountId": "6443098c-7bf2-4812-8cac-1c9d5438fddd",
"contactId": "876f5ec7-f7dc-435a-8d04-26b625cfaead",
"pipelineId": "426a702d-1f21-4952-89db-8e069d3e565d",
"stageId": "66358d3d-f38e-4482-8c4a-96784e51d8e1",
"stageName": "Négociation",
"status": "OPEN",
"statusLabel": "Ouverte",
"amount": 42000,
"currency": "TND",
"probability": 75,
"weightedAmount": 31500,
"expectedCloseDate": "2026-12-20",
"ownerId": "332806c4-2ef5-4aca-8355-483d344c51d5",
"ownerName": null,
"lostReason": null,
"source": null,
"description": null,
"leadId": "8d012a2d-740a-4282-82be-a54283e63615",
"stageChangedAt": "2026-10-02T09:15:00.000Z",
"lastActivityAt": "2026-10-02T09:15:00.000Z",
"closedAt": "2026-10-02T09:15:00.000Z",
"archived": true,
"lines": [
{
"id": "a0bf6e21-0769-41e2-8e0d-b8126ac89ff5",
"articleId": "8bc5a87b-4885-4296-8e2f-169e920ce389",
"label": "Établi d’atelier 2 m",
"quantity": 6,
"unitPrice": 890,
"discountPct": 0,
"vatRate": 19,
"total": 5340
}
],
"documents": [
{
"documentId": "2cbae947-e0de-49a6-8612-6aa08420a959",
"number": "DEV-2026-0021",
"type": "DEVIS",
"typeLabel": "Devis",
"status": "DRAFT",
"origin": "GENERATED"
}
],
"createdAt": "2026-10-02T09:15:00.000Z",
"updatedAt": "2026-10-02T09:15:00.000Z"
},
"timestamp": "2026-10-02T09:15:00.000Z"
}Détail d’une opportunité #
/api/public/v1/quosuite/crm/deals/{id}crm:readgetCrmDealAvec ses lignes indicatives et ses pièces de vente rattachées.
Paramètres
idstring (uuid)cheminobligatoirelangstringrequêteLangue des libellés (et du PDF). Défaut :
Accept-Language, sinon la langue de l’espace.frenar
Réponse 200application/json
Succès.
idstring (uuid)obligatoiretitlestringobligatoireex.Équipement atelier BTP HorizonaccountIdstring (uuid) | nullcontactIdstring (uuid) | nullpipelineIdstring (uuid)obligatoirestageIdstring (uuid)obligatoirestageNamestringobligatoireex.NégociationstatusstringobligatoirevaleursOPENWONLOSTstatusLabelstringobligatoireex.OuverteamountnumberobligatoireMontant HT (total des lignes s’il y en a).
ex.42000currencystringobligatoireex.TNDprobabilitynumberobligatoireProbabilité 0–100.
ex.75weightedAmountnumberobligatoireMontant × probabilité.
ex.31500expectedCloseDatestring | nullex.2026-12-20ownerIdstring (uuid) | nullownerNamestring | nulllostReasonstring | nullsourcestring | nulldescriptionstring | nullleadIdstring (uuid) | nullPiste d’origine.
stageChangedAtstringobligatoireEntrée dans l’étape actuelle.
lastActivityAtstringobligatoireDernier geste commercial (activité, déplacement…).
closedAtstring | nullarchivedbooleanobligatoirelinesCrmDealLineDto[]obligatoireDétail de CrmDealLineDto
documentsCrmDealDocumentDto[]obligatoirePièces de vente rattachées.
Détail de CrmDealDocumentDto
createdAtstringobligatoireupdatedAtstringobligatoire
Erreurs
400VALIDATION_FAILEDIDEMPOTENCY_KEY_INVALIDINVALID_CURSOR
Paramètre ou corps invalide (champ manquant, inconnu, mal typé, tri non permis), ou curseur de pagination émis pour un autre tri ou d’autres filtres.
401API_KEY_MISSINGAPI_KEY_INVALIDAPI_KEY_REVOKEDAPI_KEY_EXPIRED
Jeton absent, invalide, révoqué ou expiré.
403API_KEY_WRONG_PERIMETERAPI_INSUFFICIENT_SCOPEAPI_ORIGIN_NOT_ALLOWEDAPI_TENANT_MISMATCHAPI_TENANT_INACTIVEAPI_MODULE_UNAVAILABLEAPI_FEATURE_UNAVAILABLE
Jeton valide mais insuffisant : mauvais périmètre, scope manquant, origine refusée, abonnement inactif ou module / option non inclus dans le plan.
404NOT_FOUND
Ressource absente — ou appartenant à un autre espace, ce qui revient au même.
429API_RATE_LIMITEDAPI_AUTH_BLOCKED
Quota du jeton ou de l’espace atteint (voir Retry-After), ou adresse bloquée.
500INTERNAL_ERROR
Erreur inattendue. Citez requestId au support.
503SERVICE_UNAVAILABLE
Indisponibilité temporaire (voir Retry-After). Aucun détail d’infrastructure.
curl 'https://quosuite.com/api/public/v1/quosuite/crm/deals/aac39e3a-0c40-44b2-8697-b597f357c5a9' \
-H "Authorization: Bearer $QUOSUITE_API_KEY"{
"success": true,
"data": {
"id": "2e69f4db-32f4-46c6-8d3b-3614f407cb99",
"title": "Équipement atelier BTP Horizon",
"accountId": "6443098c-7bf2-4812-8cac-1c9d5438fddd",
"contactId": "876f5ec7-f7dc-435a-8d04-26b625cfaead",
"pipelineId": "426a702d-1f21-4952-89db-8e069d3e565d",
"stageId": "66358d3d-f38e-4482-8c4a-96784e51d8e1",
"stageName": "Négociation",
"status": "OPEN",
"statusLabel": "Ouverte",
"amount": 42000,
"currency": "TND",
"probability": 75,
"weightedAmount": 31500,
"expectedCloseDate": "2026-12-20",
"ownerId": "332806c4-2ef5-4aca-8355-483d344c51d5",
"ownerName": null,
"lostReason": null,
"source": null,
"description": null,
"leadId": "8d012a2d-740a-4282-82be-a54283e63615",
"stageChangedAt": "2026-10-02T09:15:00.000Z",
"lastActivityAt": "2026-10-02T09:15:00.000Z",
"closedAt": "2026-10-02T09:15:00.000Z",
"archived": true,
"lines": [
{
"id": "a0bf6e21-0769-41e2-8e0d-b8126ac89ff5",
"articleId": "8bc5a87b-4885-4296-8e2f-169e920ce389",
"label": "Établi d’atelier 2 m",
"quantity": 6,
"unitPrice": 890,
"discountPct": 0,
"vatRate": 19,
"total": 5340
}
],
"documents": [
{
"documentId": "2cbae947-e0de-49a6-8612-6aa08420a959",
"number": "DEV-2026-0021",
"type": "DEVIS",
"typeLabel": "Devis",
"status": "DRAFT",
"origin": "GENERATED"
}
],
"createdAt": "2026-10-02T09:15:00.000Z",
"updatedAt": "2026-10-02T09:15:00.000Z"
},
"timestamp": "2026-10-02T09:15:00.000Z"
}Essayer cette requête
Modifier une opportunité #
/api/public/v1/quosuite/crm/deals/{id}crm:writeupdateCrmDealSeuls les champs envoyés changent ; lines remplace toutes les lignes. Pour changer d’étape, préférer POST /crm/deals/{id}/stage.
Paramètres
idstring (uuid)cheminobligatoire
Corps de la requête application/json
titlestringex.Équipement atelier BTP HorizonaccountIdstring (uuid) | nullcontactIdstring (uuid) | nullpipelineIdstring (uuid)Défaut : le pipeline par défaut (
GET /crm/pipelines).stageIdstring (uuid)Défaut : la première étape du pipeline.
amountnumberMontant HT, ignoré quand
linesest fourni.min.0ex.42000currencystringDéfaut : la devise du compte, sinon de l’espace.
ex.TNDprobabilitynumberDéfaut : celle de l’étape.
min.0max.100expectedCloseDatestring | nullex.2026-12-20ownerIdstring (uuid) | nullPropriétaire : un utilisateur de l’espace (
GET /crm/owners). Omis à la création : aucun (une automatisation « nouvelle piste » peut l’attribuer) ;nullen modification : le retirer.sourceobjectdescriptionobjectlinesCrmDealLineInput[]Lignes indicatives (remplacent les précédentes).
Détail de CrmDealLineInput
Réponse 200application/json
Succès.
idstring (uuid)obligatoiretitlestringobligatoireex.Équipement atelier BTP HorizonaccountIdstring (uuid) | nullcontactIdstring (uuid) | nullpipelineIdstring (uuid)obligatoirestageIdstring (uuid)obligatoirestageNamestringobligatoireex.NégociationstatusstringobligatoirevaleursOPENWONLOSTstatusLabelstringobligatoireex.OuverteamountnumberobligatoireMontant HT (total des lignes s’il y en a).
ex.42000currencystringobligatoireex.TNDprobabilitynumberobligatoireProbabilité 0–100.
ex.75weightedAmountnumberobligatoireMontant × probabilité.
ex.31500expectedCloseDatestring | nullex.2026-12-20ownerIdstring (uuid) | nullownerNamestring | nulllostReasonstring | nullsourcestring | nulldescriptionstring | nullleadIdstring (uuid) | nullPiste d’origine.
stageChangedAtstringobligatoireEntrée dans l’étape actuelle.
lastActivityAtstringobligatoireDernier geste commercial (activité, déplacement…).
closedAtstring | nullarchivedbooleanobligatoirelinesCrmDealLineDto[]obligatoireDétail de CrmDealLineDto
documentsCrmDealDocumentDto[]obligatoirePièces de vente rattachées.
Détail de CrmDealDocumentDto
createdAtstringobligatoireupdatedAtstringobligatoire
Erreurs
400VALIDATION_FAILEDIDEMPOTENCY_KEY_INVALIDINVALID_CURSOR
Paramètre ou corps invalide (champ manquant, inconnu, mal typé, tri non permis), ou curseur de pagination émis pour un autre tri ou d’autres filtres.
401API_KEY_MISSINGAPI_KEY_INVALIDAPI_KEY_REVOKEDAPI_KEY_EXPIRED
Jeton absent, invalide, révoqué ou expiré.
403API_KEY_WRONG_PERIMETERAPI_INSUFFICIENT_SCOPEAPI_ORIGIN_NOT_ALLOWEDAPI_TENANT_MISMATCHAPI_TENANT_INACTIVEAPI_MODULE_UNAVAILABLEAPI_FEATURE_UNAVAILABLE
Jeton valide mais insuffisant : mauvais périmètre, scope manquant, origine refusée, abonnement inactif ou module / option non inclus dans le plan.
404NOT_FOUND
Ressource absente — ou appartenant à un autre espace, ce qui revient au même.
409CONFLICTIDEMPOTENCY_IN_PROGRESS
Conflit : valeur unique déjà prise, ou même clé d’idempotence encore en cours.
422BUSINESS_RULE_VIOLATIONIDEMPOTENCY_KEY_REUSED
Requête bien formée mais refusée par une règle de gestion de l’ERP (transition de statut interdite, pièce réglée verrouillée, stock…), ou clé d’idempotence réutilisée.
429API_RATE_LIMITEDAPI_AUTH_BLOCKED
Quota du jeton ou de l’espace atteint (voir Retry-After), ou adresse bloquée.
500INTERNAL_ERROR
Erreur inattendue. Citez requestId au support.
503SERVICE_UNAVAILABLE
Indisponibilité temporaire (voir Retry-After). Aucun détail d’infrastructure.
curl -X PATCH 'https://quosuite.com/api/public/v1/quosuite/crm/deals/aac39e3a-0c40-44b2-8697-b597f357c5a9' \
-H "Authorization: Bearer $QUOSUITE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"title": "Équipement atelier BTP Horizon",
"amount": 42000,
"currency": "TND",
"expectedCloseDate": "2026-12-20"
}'{
"success": true,
"data": {
"id": "2e69f4db-32f4-46c6-8d3b-3614f407cb99",
"title": "Équipement atelier BTP Horizon",
"accountId": "6443098c-7bf2-4812-8cac-1c9d5438fddd",
"contactId": "876f5ec7-f7dc-435a-8d04-26b625cfaead",
"pipelineId": "426a702d-1f21-4952-89db-8e069d3e565d",
"stageId": "66358d3d-f38e-4482-8c4a-96784e51d8e1",
"stageName": "Négociation",
"status": "OPEN",
"statusLabel": "Ouverte",
"amount": 42000,
"currency": "TND",
"probability": 75,
"weightedAmount": 31500,
"expectedCloseDate": "2026-12-20",
"ownerId": "332806c4-2ef5-4aca-8355-483d344c51d5",
"ownerName": null,
"lostReason": null,
"source": null,
"description": null,
"leadId": "8d012a2d-740a-4282-82be-a54283e63615",
"stageChangedAt": "2026-10-02T09:15:00.000Z",
"lastActivityAt": "2026-10-02T09:15:00.000Z",
"closedAt": "2026-10-02T09:15:00.000Z",
"archived": true,
"lines": [
{
"id": "a0bf6e21-0769-41e2-8e0d-b8126ac89ff5",
"articleId": "8bc5a87b-4885-4296-8e2f-169e920ce389",
"label": "Établi d’atelier 2 m",
"quantity": 6,
"unitPrice": 890,
"discountPct": 0,
"vatRate": 19,
"total": 5340
}
],
"documents": [
{
"documentId": "2cbae947-e0de-49a6-8612-6aa08420a959",
"number": "DEV-2026-0021",
"type": "DEVIS",
"typeLabel": "Devis",
"status": "DRAFT",
"origin": "GENERATED"
}
],
"createdAt": "2026-10-02T09:15:00.000Z",
"updatedAt": "2026-10-02T09:15:00.000Z"
},
"timestamp": "2026-10-02T09:15:00.000Z"
}Marquer une opportunité perdue #
/api/public/v1/quosuite/crm/deals/{id}/lostcrm:writeloseCrmDealMotif obligatoire ; envoie crm_deal.lost.
Paramètres
idstring (uuid)cheminobligatoire
Corps de la requête application/json
reasonstringobligatoireex.Prix trop élevé
Réponse 200application/json
Succès.
idstring (uuid)obligatoiretitlestringobligatoireex.Équipement atelier BTP HorizonaccountIdstring (uuid) | nullcontactIdstring (uuid) | nullpipelineIdstring (uuid)obligatoirestageIdstring (uuid)obligatoirestageNamestringobligatoireex.NégociationstatusstringobligatoirevaleursOPENWONLOSTstatusLabelstringobligatoireex.OuverteamountnumberobligatoireMontant HT (total des lignes s’il y en a).
ex.42000currencystringobligatoireex.TNDprobabilitynumberobligatoireProbabilité 0–100.
ex.75weightedAmountnumberobligatoireMontant × probabilité.
ex.31500expectedCloseDatestring | nullex.2026-12-20ownerIdstring (uuid) | nullownerNamestring | nulllostReasonstring | nullsourcestring | nulldescriptionstring | nullleadIdstring (uuid) | nullPiste d’origine.
stageChangedAtstringobligatoireEntrée dans l’étape actuelle.
lastActivityAtstringobligatoireDernier geste commercial (activité, déplacement…).
closedAtstring | nullarchivedbooleanobligatoirelinesCrmDealLineDto[]obligatoireDétail de CrmDealLineDto
documentsCrmDealDocumentDto[]obligatoirePièces de vente rattachées.
Détail de CrmDealDocumentDto
createdAtstringobligatoireupdatedAtstringobligatoire
Erreurs
400VALIDATION_FAILEDIDEMPOTENCY_KEY_INVALIDINVALID_CURSOR
Paramètre ou corps invalide (champ manquant, inconnu, mal typé, tri non permis), ou curseur de pagination émis pour un autre tri ou d’autres filtres.
401API_KEY_MISSINGAPI_KEY_INVALIDAPI_KEY_REVOKEDAPI_KEY_EXPIRED
Jeton absent, invalide, révoqué ou expiré.
403API_KEY_WRONG_PERIMETERAPI_INSUFFICIENT_SCOPEAPI_ORIGIN_NOT_ALLOWEDAPI_TENANT_MISMATCHAPI_TENANT_INACTIVEAPI_MODULE_UNAVAILABLEAPI_FEATURE_UNAVAILABLE
Jeton valide mais insuffisant : mauvais périmètre, scope manquant, origine refusée, abonnement inactif ou module / option non inclus dans le plan.
404NOT_FOUND
Ressource absente — ou appartenant à un autre espace, ce qui revient au même.
409CONFLICTIDEMPOTENCY_IN_PROGRESS
Conflit : valeur unique déjà prise, ou même clé d’idempotence encore en cours.
422BUSINESS_RULE_VIOLATIONIDEMPOTENCY_KEY_REUSED
Requête bien formée mais refusée par une règle de gestion de l’ERP (transition de statut interdite, pièce réglée verrouillée, stock…), ou clé d’idempotence réutilisée.
429API_RATE_LIMITEDAPI_AUTH_BLOCKED
Quota du jeton ou de l’espace atteint (voir Retry-After), ou adresse bloquée.
500INTERNAL_ERROR
Erreur inattendue. Citez requestId au support.
503SERVICE_UNAVAILABLE
Indisponibilité temporaire (voir Retry-After). Aucun détail d’infrastructure.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/crm/deals/aac39e3a-0c40-44b2-8697-b597f357c5a9/lost' \
-H "Authorization: Bearer $QUOSUITE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"reason": "Prix trop élevé"
}'{
"success": true,
"data": {
"id": "2e69f4db-32f4-46c6-8d3b-3614f407cb99",
"title": "Équipement atelier BTP Horizon",
"accountId": "6443098c-7bf2-4812-8cac-1c9d5438fddd",
"contactId": "876f5ec7-f7dc-435a-8d04-26b625cfaead",
"pipelineId": "426a702d-1f21-4952-89db-8e069d3e565d",
"stageId": "66358d3d-f38e-4482-8c4a-96784e51d8e1",
"stageName": "Négociation",
"status": "OPEN",
"statusLabel": "Ouverte",
"amount": 42000,
"currency": "TND",
"probability": 75,
"weightedAmount": 31500,
"expectedCloseDate": "2026-12-20",
"ownerId": "332806c4-2ef5-4aca-8355-483d344c51d5",
"ownerName": null,
"lostReason": null,
"source": null,
"description": null,
"leadId": "8d012a2d-740a-4282-82be-a54283e63615",
"stageChangedAt": "2026-10-02T09:15:00.000Z",
"lastActivityAt": "2026-10-02T09:15:00.000Z",
"closedAt": "2026-10-02T09:15:00.000Z",
"archived": true,
"lines": [
{
"id": "a0bf6e21-0769-41e2-8e0d-b8126ac89ff5",
"articleId": "8bc5a87b-4885-4296-8e2f-169e920ce389",
"label": "Établi d’atelier 2 m",
"quantity": 6,
"unitPrice": 890,
"discountPct": 0,
"vatRate": 19,
"total": 5340
}
],
"documents": [
{
"documentId": "2cbae947-e0de-49a6-8612-6aa08420a959",
"number": "DEV-2026-0021",
"type": "DEVIS",
"typeLabel": "Devis",
"status": "DRAFT",
"origin": "GENERATED"
}
],
"createdAt": "2026-10-02T09:15:00.000Z",
"updatedAt": "2026-10-02T09:15:00.000Z"
},
"timestamp": "2026-10-02T09:15:00.000Z"
}Générer le devis d’une opportunité #
/api/public/v1/quosuite/crm/deals/{id}/quotecrm:writeIdempotentquoteCrmDealCrée un devis ERP brouillon pour le client du compte, dans la devise de l’opportunité, avec ses lignes — numérotation, tarif client, taxes et contrôle multi-devise de l’ERP. Le compte doit avoir une fiche client, ou createClient: true. Le devis se lit ensuite par GET /sales/quotes/{id}.
Scopes requis en plus : sales:write.
Paramètres
idstring (uuid)cheminobligatoireIdempotency-Keystringen-têteClé d'idempotence (1–255 caractères ASCII imprimables, UUID v4 recommandé). Un nouvel essai avec la même clé et le même corps dans les 24 h rejoue la réponse du premier appel réussi (en-tête
Idempotent-Replayed: true) au lieu de créer une seconde fois. Même clé, corps différent : 422IDEMPOTENCY_KEY_REUSED. Premier appel encore en cours : 409IDEMPOTENCY_IN_PROGRESS.
Corps de la requête application/json
validUntilstringValidité du devis.
ex.2026-12-31createClientbooleanCréer la fiche client ERP du compte s’il n’en a pas (sinon 422).
défautfalse
Réponse 201application/json
Créé.
dealCrmDealDtoobligatoireL’opportunité, avec la pièce rattachée.
Détail de CrmDealDto
quoteCrmDealDocumentDtoobligatoireLe devis créé (brouillon).
Détail de CrmDealDocumentDto
Erreurs
400VALIDATION_FAILEDIDEMPOTENCY_KEY_INVALIDINVALID_CURSOR
Paramètre ou corps invalide (champ manquant, inconnu, mal typé, tri non permis), ou curseur de pagination émis pour un autre tri ou d’autres filtres.
401API_KEY_MISSINGAPI_KEY_INVALIDAPI_KEY_REVOKEDAPI_KEY_EXPIRED
Jeton absent, invalide, révoqué ou expiré.
402PLAN_QUOTA_EXCEEDEDFEATURE_NOT_INCLUDEDMODULE_NOT_INCLUDED
Limite ou option du plan d’abonnement (quota mensuel de documents, multi-devise…).
403API_KEY_WRONG_PERIMETERAPI_INSUFFICIENT_SCOPEAPI_ORIGIN_NOT_ALLOWEDAPI_TENANT_MISMATCHAPI_TENANT_INACTIVEAPI_MODULE_UNAVAILABLEAPI_FEATURE_UNAVAILABLE
Jeton valide mais insuffisant : mauvais périmètre, scope manquant, origine refusée, abonnement inactif ou module / option non inclus dans le plan.
404NOT_FOUND
Ressource absente — ou appartenant à un autre espace, ce qui revient au même.
409CONFLICTIDEMPOTENCY_IN_PROGRESS
Conflit : valeur unique déjà prise, ou même clé d’idempotence encore en cours.
422BUSINESS_RULE_VIOLATIONIDEMPOTENCY_KEY_REUSED
Requête bien formée mais refusée par une règle de gestion de l’ERP (transition de statut interdite, pièce réglée verrouillée, stock…), ou clé d’idempotence réutilisée.
429API_RATE_LIMITEDAPI_AUTH_BLOCKED
Quota du jeton ou de l’espace atteint (voir Retry-After), ou adresse bloquée.
500INTERNAL_ERROR
Erreur inattendue. Citez requestId au support.
503SERVICE_UNAVAILABLE
Indisponibilité temporaire (voir Retry-After). Aucun détail d’infrastructure.
# Une clé par opération, réutilisée telle quelle à chaque nouvel essai.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/crm/deals/aac39e3a-0c40-44b2-8697-b597f357c5a9/quote' \
-H "Authorization: Bearer $QUOSUITE_API_KEY" \
-H 'Idempotency-Key: 3f1c2a9e-5b7d-4e8a-9c1f-2d6b8e4a7c30' \
-H 'Content-Type: application/json' \
-d '{
"validUntil": "2026-12-31"
}'{
"success": true,
"data": {
"deal": {
"id": "2e69f4db-32f4-46c6-8d3b-3614f407cb99",
"title": "Équipement atelier BTP Horizon",
"accountId": "6443098c-7bf2-4812-8cac-1c9d5438fddd",
"contactId": "876f5ec7-f7dc-435a-8d04-26b625cfaead",
"pipelineId": "426a702d-1f21-4952-89db-8e069d3e565d",
"stageId": "66358d3d-f38e-4482-8c4a-96784e51d8e1",
"stageName": "Négociation",
"status": "OPEN",
"statusLabel": "Ouverte",
"amount": 42000,
"currency": "TND",
"probability": 75,
"weightedAmount": 31500,
"expectedCloseDate": "2026-12-20",
"ownerId": "332806c4-2ef5-4aca-8355-483d344c51d5",
"ownerName": null,
"lostReason": null,
"source": null,
"description": null,
"leadId": "8d012a2d-740a-4282-82be-a54283e63615",
"stageChangedAt": "2026-10-02T09:15:00.000Z",
"lastActivityAt": "2026-10-02T09:15:00.000Z",
"closedAt": "2026-10-02T09:15:00.000Z",
"archived": true,
"lines": [
{
"id": "a0bf6e21-0769-41e2-8e0d-b8126ac89ff5",
"articleId": "8bc5a87b-4885-4296-8e2f-169e920ce389",
"label": "Établi d’atelier 2 m",
"quantity": 6,
"unitPrice": 890,
"discountPct": 0,
"vatRate": 19,
"total": 5340
}
],
"documents": [
{
"documentId": "2cbae947-e0de-49a6-8612-6aa08420a959",
"number": "DEV-2026-0021",
"type": "DEVIS",
"typeLabel": "Devis",
"status": "DRAFT",
"origin": "GENERATED"
}
],
"createdAt": "2026-10-02T09:15:00.000Z",
"updatedAt": "2026-10-02T09:15:00.000Z"
},
"quote": {
"documentId": "2cbae947-e0de-49a6-8612-6aa08420a959",
"number": "DEV-2026-0021",
"type": "DEVIS",
"typeLabel": "Devis",
"status": "DRAFT",
"origin": "GENERATED"
}
},
"timestamp": "2026-10-02T09:15:00.000Z"
}Rouvrir une opportunité close #
/api/public/v1/quosuite/crm/deals/{id}/reopencrm:writereopenCrmDealParamètres
idstring (uuid)cheminobligatoire
Corps de la requête application/json
stageIdstring (uuid)Étape de réouverture (défaut : la dernière).
Réponse 200application/json
Succès.
idstring (uuid)obligatoiretitlestringobligatoireex.Équipement atelier BTP HorizonaccountIdstring (uuid) | nullcontactIdstring (uuid) | nullpipelineIdstring (uuid)obligatoirestageIdstring (uuid)obligatoirestageNamestringobligatoireex.NégociationstatusstringobligatoirevaleursOPENWONLOSTstatusLabelstringobligatoireex.OuverteamountnumberobligatoireMontant HT (total des lignes s’il y en a).
ex.42000currencystringobligatoireex.TNDprobabilitynumberobligatoireProbabilité 0–100.
ex.75weightedAmountnumberobligatoireMontant × probabilité.
ex.31500expectedCloseDatestring | nullex.2026-12-20ownerIdstring (uuid) | nullownerNamestring | nulllostReasonstring | nullsourcestring | nulldescriptionstring | nullleadIdstring (uuid) | nullPiste d’origine.
stageChangedAtstringobligatoireEntrée dans l’étape actuelle.
lastActivityAtstringobligatoireDernier geste commercial (activité, déplacement…).
closedAtstring | nullarchivedbooleanobligatoirelinesCrmDealLineDto[]obligatoireDétail de CrmDealLineDto
documentsCrmDealDocumentDto[]obligatoirePièces de vente rattachées.
Détail de CrmDealDocumentDto
createdAtstringobligatoireupdatedAtstringobligatoire
Erreurs
400VALIDATION_FAILEDIDEMPOTENCY_KEY_INVALIDINVALID_CURSOR
Paramètre ou corps invalide (champ manquant, inconnu, mal typé, tri non permis), ou curseur de pagination émis pour un autre tri ou d’autres filtres.
401API_KEY_MISSINGAPI_KEY_INVALIDAPI_KEY_REVOKEDAPI_KEY_EXPIRED
Jeton absent, invalide, révoqué ou expiré.
403API_KEY_WRONG_PERIMETERAPI_INSUFFICIENT_SCOPEAPI_ORIGIN_NOT_ALLOWEDAPI_TENANT_MISMATCHAPI_TENANT_INACTIVEAPI_MODULE_UNAVAILABLEAPI_FEATURE_UNAVAILABLE
Jeton valide mais insuffisant : mauvais périmètre, scope manquant, origine refusée, abonnement inactif ou module / option non inclus dans le plan.
404NOT_FOUND
Ressource absente — ou appartenant à un autre espace, ce qui revient au même.
409CONFLICTIDEMPOTENCY_IN_PROGRESS
Conflit : valeur unique déjà prise, ou même clé d’idempotence encore en cours.
422BUSINESS_RULE_VIOLATIONIDEMPOTENCY_KEY_REUSED
Requête bien formée mais refusée par une règle de gestion de l’ERP (transition de statut interdite, pièce réglée verrouillée, stock…), ou clé d’idempotence réutilisée.
429API_RATE_LIMITEDAPI_AUTH_BLOCKED
Quota du jeton ou de l’espace atteint (voir Retry-After), ou adresse bloquée.
500INTERNAL_ERROR
Erreur inattendue. Citez requestId au support.
503SERVICE_UNAVAILABLE
Indisponibilité temporaire (voir Retry-After). Aucun détail d’infrastructure.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/crm/deals/aac39e3a-0c40-44b2-8697-b597f357c5a9/reopen' \
-H "Authorization: Bearer $QUOSUITE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"stageId": "a1bd7d9b-e983-4246-8947-6e1e7573b419"
}'{
"success": true,
"data": {
"id": "2e69f4db-32f4-46c6-8d3b-3614f407cb99",
"title": "Équipement atelier BTP Horizon",
"accountId": "6443098c-7bf2-4812-8cac-1c9d5438fddd",
"contactId": "876f5ec7-f7dc-435a-8d04-26b625cfaead",
"pipelineId": "426a702d-1f21-4952-89db-8e069d3e565d",
"stageId": "66358d3d-f38e-4482-8c4a-96784e51d8e1",
"stageName": "Négociation",
"status": "OPEN",
"statusLabel": "Ouverte",
"amount": 42000,
"currency": "TND",
"probability": 75,
"weightedAmount": 31500,
"expectedCloseDate": "2026-12-20",
"ownerId": "332806c4-2ef5-4aca-8355-483d344c51d5",
"ownerName": null,
"lostReason": null,
"source": null,
"description": null,
"leadId": "8d012a2d-740a-4282-82be-a54283e63615",
"stageChangedAt": "2026-10-02T09:15:00.000Z",
"lastActivityAt": "2026-10-02T09:15:00.000Z",
"closedAt": "2026-10-02T09:15:00.000Z",
"archived": true,
"lines": [
{
"id": "a0bf6e21-0769-41e2-8e0d-b8126ac89ff5",
"articleId": "8bc5a87b-4885-4296-8e2f-169e920ce389",
"label": "Établi d’atelier 2 m",
"quantity": 6,
"unitPrice": 890,
"discountPct": 0,
"vatRate": 19,
"total": 5340
}
],
"documents": [
{
"documentId": "2cbae947-e0de-49a6-8612-6aa08420a959",
"number": "DEV-2026-0021",
"type": "DEVIS",
"typeLabel": "Devis",
"status": "DRAFT",
"origin": "GENERATED"
}
],
"createdAt": "2026-10-02T09:15:00.000Z",
"updatedAt": "2026-10-02T09:15:00.000Z"
},
"timestamp": "2026-10-02T09:15:00.000Z"
}Faire avancer une opportunité (changer d’étape) #
/api/public/v1/quosuite/crm/deals/{id}/stagecrm:writemoveCrmDealÉcriture conditionnée à l’étape lue : deux déplacements simultanés, le second reçoit 409. Une opportunité close ne change pas d’étape (rouvrir d’abord) ; l’étape doit appartenir au pipeline (CRM_STAGE_PIPELINE_MISMATCH). Envoie crm_deal.stage_changed et déclenche les automatisations « entrée dans une étape ».
Paramètres
idstring (uuid)cheminobligatoire
Corps de la requête application/json
stageIdstring (uuid)obligatoireÉtape cible (du pipeline de l’opportunité, ou de
pipelineId).pipelineIdstring (uuid)Changer aussi de pipeline.
Réponse 200application/json
Succès.
idstring (uuid)obligatoiretitlestringobligatoireex.Équipement atelier BTP HorizonaccountIdstring (uuid) | nullcontactIdstring (uuid) | nullpipelineIdstring (uuid)obligatoirestageIdstring (uuid)obligatoirestageNamestringobligatoireex.NégociationstatusstringobligatoirevaleursOPENWONLOSTstatusLabelstringobligatoireex.OuverteamountnumberobligatoireMontant HT (total des lignes s’il y en a).
ex.42000currencystringobligatoireex.TNDprobabilitynumberobligatoireProbabilité 0–100.
ex.75weightedAmountnumberobligatoireMontant × probabilité.
ex.31500expectedCloseDatestring | nullex.2026-12-20ownerIdstring (uuid) | nullownerNamestring | nulllostReasonstring | nullsourcestring | nulldescriptionstring | nullleadIdstring (uuid) | nullPiste d’origine.
stageChangedAtstringobligatoireEntrée dans l’étape actuelle.
lastActivityAtstringobligatoireDernier geste commercial (activité, déplacement…).
closedAtstring | nullarchivedbooleanobligatoirelinesCrmDealLineDto[]obligatoireDétail de CrmDealLineDto
documentsCrmDealDocumentDto[]obligatoirePièces de vente rattachées.
Détail de CrmDealDocumentDto
createdAtstringobligatoireupdatedAtstringobligatoire
Erreurs
400VALIDATION_FAILEDIDEMPOTENCY_KEY_INVALIDINVALID_CURSOR
Paramètre ou corps invalide (champ manquant, inconnu, mal typé, tri non permis), ou curseur de pagination émis pour un autre tri ou d’autres filtres.
401API_KEY_MISSINGAPI_KEY_INVALIDAPI_KEY_REVOKEDAPI_KEY_EXPIRED
Jeton absent, invalide, révoqué ou expiré.
403API_KEY_WRONG_PERIMETERAPI_INSUFFICIENT_SCOPEAPI_ORIGIN_NOT_ALLOWEDAPI_TENANT_MISMATCHAPI_TENANT_INACTIVEAPI_MODULE_UNAVAILABLEAPI_FEATURE_UNAVAILABLE
Jeton valide mais insuffisant : mauvais périmètre, scope manquant, origine refusée, abonnement inactif ou module / option non inclus dans le plan.
404NOT_FOUND
Ressource absente — ou appartenant à un autre espace, ce qui revient au même.
409CONFLICTIDEMPOTENCY_IN_PROGRESS
Conflit : valeur unique déjà prise, ou même clé d’idempotence encore en cours.
422BUSINESS_RULE_VIOLATIONIDEMPOTENCY_KEY_REUSED
Requête bien formée mais refusée par une règle de gestion de l’ERP (transition de statut interdite, pièce réglée verrouillée, stock…), ou clé d’idempotence réutilisée.
429API_RATE_LIMITEDAPI_AUTH_BLOCKED
Quota du jeton ou de l’espace atteint (voir Retry-After), ou adresse bloquée.
500INTERNAL_ERROR
Erreur inattendue. Citez requestId au support.
503SERVICE_UNAVAILABLE
Indisponibilité temporaire (voir Retry-After). Aucun détail d’infrastructure.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/crm/deals/aac39e3a-0c40-44b2-8697-b597f357c5a9/stage' \
-H "Authorization: Bearer $QUOSUITE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"stageId": "3ac41960-b92a-4238-8260-64a975c11dbd"
}'{
"success": true,
"data": {
"id": "2e69f4db-32f4-46c6-8d3b-3614f407cb99",
"title": "Équipement atelier BTP Horizon",
"accountId": "6443098c-7bf2-4812-8cac-1c9d5438fddd",
"contactId": "876f5ec7-f7dc-435a-8d04-26b625cfaead",
"pipelineId": "426a702d-1f21-4952-89db-8e069d3e565d",
"stageId": "66358d3d-f38e-4482-8c4a-96784e51d8e1",
"stageName": "Négociation",
"status": "OPEN",
"statusLabel": "Ouverte",
"amount": 42000,
"currency": "TND",
"probability": 75,
"weightedAmount": 31500,
"expectedCloseDate": "2026-12-20",
"ownerId": "332806c4-2ef5-4aca-8355-483d344c51d5",
"ownerName": null,
"lostReason": null,
"source": null,
"description": null,
"leadId": "8d012a2d-740a-4282-82be-a54283e63615",
"stageChangedAt": "2026-10-02T09:15:00.000Z",
"lastActivityAt": "2026-10-02T09:15:00.000Z",
"closedAt": "2026-10-02T09:15:00.000Z",
"archived": true,
"lines": [
{
"id": "a0bf6e21-0769-41e2-8e0d-b8126ac89ff5",
"articleId": "8bc5a87b-4885-4296-8e2f-169e920ce389",
"label": "Établi d’atelier 2 m",
"quantity": 6,
"unitPrice": 890,
"discountPct": 0,
"vatRate": 19,
"total": 5340
}
],
"documents": [
{
"documentId": "2cbae947-e0de-49a6-8612-6aa08420a959",
"number": "DEV-2026-0021",
"type": "DEVIS",
"typeLabel": "Devis",
"status": "DRAFT",
"origin": "GENERATED"
}
],
"createdAt": "2026-10-02T09:15:00.000Z",
"updatedAt": "2026-10-02T09:15:00.000Z"
},
"timestamp": "2026-10-02T09:15:00.000Z"
}Marquer une opportunité gagnée #
/api/public/v1/quosuite/crm/deals/{id}/woncrm:writewinCrmDealProbabilité 100 %, closedAt posé ; envoie crm_deal.won.
Paramètres
idstring (uuid)cheminobligatoire
Réponse 200application/json
Succès.
idstring (uuid)obligatoiretitlestringobligatoireex.Équipement atelier BTP HorizonaccountIdstring (uuid) | nullcontactIdstring (uuid) | nullpipelineIdstring (uuid)obligatoirestageIdstring (uuid)obligatoirestageNamestringobligatoireex.NégociationstatusstringobligatoirevaleursOPENWONLOSTstatusLabelstringobligatoireex.OuverteamountnumberobligatoireMontant HT (total des lignes s’il y en a).
ex.42000currencystringobligatoireex.TNDprobabilitynumberobligatoireProbabilité 0–100.
ex.75weightedAmountnumberobligatoireMontant × probabilité.
ex.31500expectedCloseDatestring | nullex.2026-12-20ownerIdstring (uuid) | nullownerNamestring | nulllostReasonstring | nullsourcestring | nulldescriptionstring | nullleadIdstring (uuid) | nullPiste d’origine.
stageChangedAtstringobligatoireEntrée dans l’étape actuelle.
lastActivityAtstringobligatoireDernier geste commercial (activité, déplacement…).
closedAtstring | nullarchivedbooleanobligatoirelinesCrmDealLineDto[]obligatoireDétail de CrmDealLineDto
documentsCrmDealDocumentDto[]obligatoirePièces de vente rattachées.
Détail de CrmDealDocumentDto
createdAtstringobligatoireupdatedAtstringobligatoire
Erreurs
400VALIDATION_FAILEDIDEMPOTENCY_KEY_INVALIDINVALID_CURSOR
Paramètre ou corps invalide (champ manquant, inconnu, mal typé, tri non permis), ou curseur de pagination émis pour un autre tri ou d’autres filtres.
401API_KEY_MISSINGAPI_KEY_INVALIDAPI_KEY_REVOKEDAPI_KEY_EXPIRED
Jeton absent, invalide, révoqué ou expiré.
403API_KEY_WRONG_PERIMETERAPI_INSUFFICIENT_SCOPEAPI_ORIGIN_NOT_ALLOWEDAPI_TENANT_MISMATCHAPI_TENANT_INACTIVEAPI_MODULE_UNAVAILABLEAPI_FEATURE_UNAVAILABLE
Jeton valide mais insuffisant : mauvais périmètre, scope manquant, origine refusée, abonnement inactif ou module / option non inclus dans le plan.
404NOT_FOUND
Ressource absente — ou appartenant à un autre espace, ce qui revient au même.
409CONFLICTIDEMPOTENCY_IN_PROGRESS
Conflit : valeur unique déjà prise, ou même clé d’idempotence encore en cours.
422BUSINESS_RULE_VIOLATIONIDEMPOTENCY_KEY_REUSED
Requête bien formée mais refusée par une règle de gestion de l’ERP (transition de statut interdite, pièce réglée verrouillée, stock…), ou clé d’idempotence réutilisée.
429API_RATE_LIMITEDAPI_AUTH_BLOCKED
Quota du jeton ou de l’espace atteint (voir Retry-After), ou adresse bloquée.
500INTERNAL_ERROR
Erreur inattendue. Citez requestId au support.
503SERVICE_UNAVAILABLE
Indisponibilité temporaire (voir Retry-After). Aucun détail d’infrastructure.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/crm/deals/aac39e3a-0c40-44b2-8697-b597f357c5a9/won' \
-H "Authorization: Bearer $QUOSUITE_API_KEY"{
"success": true,
"data": {
"id": "2e69f4db-32f4-46c6-8d3b-3614f407cb99",
"title": "Équipement atelier BTP Horizon",
"accountId": "6443098c-7bf2-4812-8cac-1c9d5438fddd",
"contactId": "876f5ec7-f7dc-435a-8d04-26b625cfaead",
"pipelineId": "426a702d-1f21-4952-89db-8e069d3e565d",
"stageId": "66358d3d-f38e-4482-8c4a-96784e51d8e1",
"stageName": "Négociation",
"status": "OPEN",
"statusLabel": "Ouverte",
"amount": 42000,
"currency": "TND",
"probability": 75,
"weightedAmount": 31500,
"expectedCloseDate": "2026-12-20",
"ownerId": "332806c4-2ef5-4aca-8355-483d344c51d5",
"ownerName": null,
"lostReason": null,
"source": null,
"description": null,
"leadId": "8d012a2d-740a-4282-82be-a54283e63615",
"stageChangedAt": "2026-10-02T09:15:00.000Z",
"lastActivityAt": "2026-10-02T09:15:00.000Z",
"closedAt": "2026-10-02T09:15:00.000Z",
"archived": true,
"lines": [
{
"id": "a0bf6e21-0769-41e2-8e0d-b8126ac89ff5",
"articleId": "8bc5a87b-4885-4296-8e2f-169e920ce389",
"label": "Établi d’atelier 2 m",
"quantity": 6,
"unitPrice": 890,
"discountPct": 0,
"vatRate": 19,
"total": 5340
}
],
"documents": [
{
"documentId": "2cbae947-e0de-49a6-8612-6aa08420a959",
"number": "DEV-2026-0021",
"type": "DEVIS",
"typeLabel": "Devis",
"status": "DRAFT",
"origin": "GENERATED"
}
],
"createdAt": "2026-10-02T09:15:00.000Z",
"updatedAt": "2026-10-02T09:15:00.000Z"
},
"timestamp": "2026-10-02T09:15:00.000Z"
}Générée depuis le contrat OpenAPI QuoSuite API v1.0.0.