Développeurs
Référence · CRM

Opportunités

Lister les opportunités #

GET/api/public/v1/quosuite/crm/deals
Scope : crm:readlistCrmDeals

Filtrable 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ête

    Langue des libellés (et du PDF). Défaut : Accept-Language, sinon la langue de l’espace.

    frenar
  • pagenumberrequête

    Numéro de page (à partir de 1).

  • pageSizenumberrequête

    Éléments par page (100 au plus).

  • sortstringrequête

    Tri : 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 sur id rend la pagination stable.

  • updatedSincestringrequête

    Ne 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ête

    Pagination par curseur : nextCursor de 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 de page.

  • limitnumberrequête

    Pagination par curseur : éléments par page (100 au plus). ?limit=100 ouvre un parcours par curseur ; la réponse rend pagination.nextCursor.

  • pipelineIdstring (uuid)requête
  • stageIdstring (uuid)requête
  • statusstring[]requête

    Statuts, séparés par des virgules (OPEN, WON, LOST).

  • accountIdstring (uuid)requête
  • contactIdstring (uuid)requête
  • ownerIdstring (uuid)requête
  • currencystringrequête
  • closeFromstringrequête

    Clôture prévue à partir du (inclus).

  • closeTostringrequête

    Clôture prévue jusqu’au (inclus).

  • archivedbooleanrequête

Réponse 200application/json

Succès.

  • itemsCrmDealDto[]obligatoire
    Détail de CrmDealDto
  • paginationPaginationDtoobligatoire
    Dé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.

Exemple de requête
curl 'https://quosuite.com/api/public/v1/quosuite/crm/deals' \
  -H "Authorization: Bearer $QUOSUITE_API_KEY"
Exemple de réponse
{
  "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é #

POST/api/public/v1/quosuite/crm/deals
Scope : crm:writeIdempotentcreateCrmDeal

Pipeline 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ête

    Clé 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 : 422 IDEMPOTENCY_KEY_REUSED. Premier appel encore en cours : 409 IDEMPOTENCY_IN_PROGRESS.

Corps de la requête application/json

  • titlestringobligatoire
    ex.Équipement atelier BTP Horizon
  • accountIdstring (uuid) | null
  • contactIdstring (uuid) | null
  • pipelineIdstring (uuid)

    Défaut : le pipeline par défaut (GET /crm/pipelines).

  • stageIdstring (uuid)

    Défaut : la première étape du pipeline.

  • amountnumber

    Montant HT, ignoré quand lines est fourni.

    min.0ex.42000
  • currencystring

    Défaut : la devise du compte, sinon de l’espace.

    ex.TND
  • probabilitynumber

    Défaut : celle de l’étape.

    min.0max.100
  • expectedCloseDatestring | null
    ex.2026-12-20
  • ownerIdstring (uuid) | null

    Propriétaire : un utilisateur de l’espace (GET /crm/owners). Omis à la création : aucun (une automatisation « nouvelle piste » peut l’attribuer) ; null en modification : le retirer.

  • sourceobject
  • descriptionobject
  • linesCrmDealLineInput[]

    Lignes indicatives (remplacent les précédentes).

    Détail de CrmDealLineInput

Réponse 201application/json

Créé.

  • idstring (uuid)obligatoire
  • titlestringobligatoire
    ex.Équipement atelier BTP Horizon
  • accountIdstring (uuid) | null
  • contactIdstring (uuid) | null
  • pipelineIdstring (uuid)obligatoire
  • stageIdstring (uuid)obligatoire
  • stageNamestringobligatoire
    ex.Négociation
  • statusstringobligatoire
    valeursOPENWONLOST
  • statusLabelstringobligatoire
    ex.Ouverte
  • amountnumberobligatoire

    Montant HT (total des lignes s’il y en a).

    ex.42000
  • currencystringobligatoire
    ex.TND
  • probabilitynumberobligatoire

    Probabilité 0–100.

    ex.75
  • weightedAmountnumberobligatoire

    Montant × probabilité.

    ex.31500
  • expectedCloseDatestring | null
    ex.2026-12-20
  • ownerIdstring (uuid) | null
  • ownerNamestring | null
  • lostReasonstring | null
  • sourcestring | null
  • descriptionstring | null
  • leadIdstring (uuid) | null

    Piste d’origine.

  • stageChangedAtstringobligatoire

    Entrée dans l’étape actuelle.

  • lastActivityAtstringobligatoire

    Dernier geste commercial (activité, déplacement…).

  • closedAtstring | null
  • archivedbooleanobligatoire
  • linesCrmDealLineDto[]obligatoire
    Détail de CrmDealLineDto
  • documentsCrmDealDocumentDto[]obligatoire

    Pièces de vente rattachées.

    Détail de CrmDealDocumentDto
  • createdAtstringobligatoire
  • updatedAtstringobligatoire

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.

Exemple de requête
# 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"
}'
Exemple de réponse
{
  "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é #

GET/api/public/v1/quosuite/crm/deals/{id}
Scope : crm:readgetCrmDeal

Avec ses lignes indicatives et ses pièces de vente rattachées.

Paramètres

  • idstring (uuid)cheminobligatoire
  • langstringrequête

    Langue 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)obligatoire
  • titlestringobligatoire
    ex.Équipement atelier BTP Horizon
  • accountIdstring (uuid) | null
  • contactIdstring (uuid) | null
  • pipelineIdstring (uuid)obligatoire
  • stageIdstring (uuid)obligatoire
  • stageNamestringobligatoire
    ex.Négociation
  • statusstringobligatoire
    valeursOPENWONLOST
  • statusLabelstringobligatoire
    ex.Ouverte
  • amountnumberobligatoire

    Montant HT (total des lignes s’il y en a).

    ex.42000
  • currencystringobligatoire
    ex.TND
  • probabilitynumberobligatoire

    Probabilité 0–100.

    ex.75
  • weightedAmountnumberobligatoire

    Montant × probabilité.

    ex.31500
  • expectedCloseDatestring | null
    ex.2026-12-20
  • ownerIdstring (uuid) | null
  • ownerNamestring | null
  • lostReasonstring | null
  • sourcestring | null
  • descriptionstring | null
  • leadIdstring (uuid) | null

    Piste d’origine.

  • stageChangedAtstringobligatoire

    Entrée dans l’étape actuelle.

  • lastActivityAtstringobligatoire

    Dernier geste commercial (activité, déplacement…).

  • closedAtstring | null
  • archivedbooleanobligatoire
  • linesCrmDealLineDto[]obligatoire
    Détail de CrmDealLineDto
  • documentsCrmDealDocumentDto[]obligatoire

    Pièces de vente rattachées.

    Détail de CrmDealDocumentDto
  • createdAtstringobligatoire
  • updatedAtstringobligatoire

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.

Exemple de requête
curl 'https://quosuite.com/api/public/v1/quosuite/crm/deals/aac39e3a-0c40-44b2-8697-b597f357c5a9' \
  -H "Authorization: Bearer $QUOSUITE_API_KEY"
Exemple de réponse
{
  "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é #

PATCH/api/public/v1/quosuite/crm/deals/{id}
Scope : crm:writeupdateCrmDeal

Seuls 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

  • titlestring
    ex.Équipement atelier BTP Horizon
  • accountIdstring (uuid) | null
  • contactIdstring (uuid) | null
  • pipelineIdstring (uuid)

    Défaut : le pipeline par défaut (GET /crm/pipelines).

  • stageIdstring (uuid)

    Défaut : la première étape du pipeline.

  • amountnumber

    Montant HT, ignoré quand lines est fourni.

    min.0ex.42000
  • currencystring

    Défaut : la devise du compte, sinon de l’espace.

    ex.TND
  • probabilitynumber

    Défaut : celle de l’étape.

    min.0max.100
  • expectedCloseDatestring | null
    ex.2026-12-20
  • ownerIdstring (uuid) | null

    Propriétaire : un utilisateur de l’espace (GET /crm/owners). Omis à la création : aucun (une automatisation « nouvelle piste » peut l’attribuer) ; null en modification : le retirer.

  • sourceobject
  • descriptionobject
  • linesCrmDealLineInput[]

    Lignes indicatives (remplacent les précédentes).

    Détail de CrmDealLineInput

Réponse 200application/json

Succès.

  • idstring (uuid)obligatoire
  • titlestringobligatoire
    ex.Équipement atelier BTP Horizon
  • accountIdstring (uuid) | null
  • contactIdstring (uuid) | null
  • pipelineIdstring (uuid)obligatoire
  • stageIdstring (uuid)obligatoire
  • stageNamestringobligatoire
    ex.Négociation
  • statusstringobligatoire
    valeursOPENWONLOST
  • statusLabelstringobligatoire
    ex.Ouverte
  • amountnumberobligatoire

    Montant HT (total des lignes s’il y en a).

    ex.42000
  • currencystringobligatoire
    ex.TND
  • probabilitynumberobligatoire

    Probabilité 0–100.

    ex.75
  • weightedAmountnumberobligatoire

    Montant × probabilité.

    ex.31500
  • expectedCloseDatestring | null
    ex.2026-12-20
  • ownerIdstring (uuid) | null
  • ownerNamestring | null
  • lostReasonstring | null
  • sourcestring | null
  • descriptionstring | null
  • leadIdstring (uuid) | null

    Piste d’origine.

  • stageChangedAtstringobligatoire

    Entrée dans l’étape actuelle.

  • lastActivityAtstringobligatoire

    Dernier geste commercial (activité, déplacement…).

  • closedAtstring | null
  • archivedbooleanobligatoire
  • linesCrmDealLineDto[]obligatoire
    Détail de CrmDealLineDto
  • documentsCrmDealDocumentDto[]obligatoire

    Pièces de vente rattachées.

    Détail de CrmDealDocumentDto
  • createdAtstringobligatoire
  • updatedAtstringobligatoire

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.

Exemple de requête
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"
}'
Exemple de réponse
{
  "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 #

POST/api/public/v1/quosuite/crm/deals/{id}/lost
Scope : crm:writeloseCrmDeal

Motif obligatoire ; envoie crm_deal.lost.

Paramètres

  • idstring (uuid)cheminobligatoire

Corps de la requête application/json

  • reasonstringobligatoire
    ex.Prix trop élevé

Réponse 200application/json

Succès.

  • idstring (uuid)obligatoire
  • titlestringobligatoire
    ex.Équipement atelier BTP Horizon
  • accountIdstring (uuid) | null
  • contactIdstring (uuid) | null
  • pipelineIdstring (uuid)obligatoire
  • stageIdstring (uuid)obligatoire
  • stageNamestringobligatoire
    ex.Négociation
  • statusstringobligatoire
    valeursOPENWONLOST
  • statusLabelstringobligatoire
    ex.Ouverte
  • amountnumberobligatoire

    Montant HT (total des lignes s’il y en a).

    ex.42000
  • currencystringobligatoire
    ex.TND
  • probabilitynumberobligatoire

    Probabilité 0–100.

    ex.75
  • weightedAmountnumberobligatoire

    Montant × probabilité.

    ex.31500
  • expectedCloseDatestring | null
    ex.2026-12-20
  • ownerIdstring (uuid) | null
  • ownerNamestring | null
  • lostReasonstring | null
  • sourcestring | null
  • descriptionstring | null
  • leadIdstring (uuid) | null

    Piste d’origine.

  • stageChangedAtstringobligatoire

    Entrée dans l’étape actuelle.

  • lastActivityAtstringobligatoire

    Dernier geste commercial (activité, déplacement…).

  • closedAtstring | null
  • archivedbooleanobligatoire
  • linesCrmDealLineDto[]obligatoire
    Détail de CrmDealLineDto
  • documentsCrmDealDocumentDto[]obligatoire

    Pièces de vente rattachées.

    Détail de CrmDealDocumentDto
  • createdAtstringobligatoire
  • updatedAtstringobligatoire

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.

Exemple de requête
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é"
}'
Exemple de réponse
{
  "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é #

POST/api/public/v1/quosuite/crm/deals/{id}/quote
Scope : crm:writeIdempotentquoteCrmDeal

Cré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)cheminobligatoire
  • Idempotency-Keystringen-tête

    Clé 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 : 422 IDEMPOTENCY_KEY_REUSED. Premier appel encore en cours : 409 IDEMPOTENCY_IN_PROGRESS.

Corps de la requête application/json

  • validUntilstring

    Validité du devis.

    ex.2026-12-31
  • createClientboolean

    Créer la fiche client ERP du compte s’il n’en a pas (sinon 422).

    défautfalse

Réponse 201application/json

Créé.

  • dealCrmDealDtoobligatoire

    L’opportunité, avec la pièce rattachée.

    Détail de CrmDealDto
  • quoteCrmDealDocumentDtoobligatoire

    Le 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.

Exemple de requête
# 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"
}'
Exemple de réponse
{
  "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 #

POST/api/public/v1/quosuite/crm/deals/{id}/reopen
Scope : crm:writereopenCrmDeal

Paramè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)obligatoire
  • titlestringobligatoire
    ex.Équipement atelier BTP Horizon
  • accountIdstring (uuid) | null
  • contactIdstring (uuid) | null
  • pipelineIdstring (uuid)obligatoire
  • stageIdstring (uuid)obligatoire
  • stageNamestringobligatoire
    ex.Négociation
  • statusstringobligatoire
    valeursOPENWONLOST
  • statusLabelstringobligatoire
    ex.Ouverte
  • amountnumberobligatoire

    Montant HT (total des lignes s’il y en a).

    ex.42000
  • currencystringobligatoire
    ex.TND
  • probabilitynumberobligatoire

    Probabilité 0–100.

    ex.75
  • weightedAmountnumberobligatoire

    Montant × probabilité.

    ex.31500
  • expectedCloseDatestring | null
    ex.2026-12-20
  • ownerIdstring (uuid) | null
  • ownerNamestring | null
  • lostReasonstring | null
  • sourcestring | null
  • descriptionstring | null
  • leadIdstring (uuid) | null

    Piste d’origine.

  • stageChangedAtstringobligatoire

    Entrée dans l’étape actuelle.

  • lastActivityAtstringobligatoire

    Dernier geste commercial (activité, déplacement…).

  • closedAtstring | null
  • archivedbooleanobligatoire
  • linesCrmDealLineDto[]obligatoire
    Détail de CrmDealLineDto
  • documentsCrmDealDocumentDto[]obligatoire

    Pièces de vente rattachées.

    Détail de CrmDealDocumentDto
  • createdAtstringobligatoire
  • updatedAtstringobligatoire

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.

Exemple de requête
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"
}'
Exemple de réponse
{
  "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) #

POST/api/public/v1/quosuite/crm/deals/{id}/stage
Scope : crm: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)obligatoire
  • titlestringobligatoire
    ex.Équipement atelier BTP Horizon
  • accountIdstring (uuid) | null
  • contactIdstring (uuid) | null
  • pipelineIdstring (uuid)obligatoire
  • stageIdstring (uuid)obligatoire
  • stageNamestringobligatoire
    ex.Négociation
  • statusstringobligatoire
    valeursOPENWONLOST
  • statusLabelstringobligatoire
    ex.Ouverte
  • amountnumberobligatoire

    Montant HT (total des lignes s’il y en a).

    ex.42000
  • currencystringobligatoire
    ex.TND
  • probabilitynumberobligatoire

    Probabilité 0–100.

    ex.75
  • weightedAmountnumberobligatoire

    Montant × probabilité.

    ex.31500
  • expectedCloseDatestring | null
    ex.2026-12-20
  • ownerIdstring (uuid) | null
  • ownerNamestring | null
  • lostReasonstring | null
  • sourcestring | null
  • descriptionstring | null
  • leadIdstring (uuid) | null

    Piste d’origine.

  • stageChangedAtstringobligatoire

    Entrée dans l’étape actuelle.

  • lastActivityAtstringobligatoire

    Dernier geste commercial (activité, déplacement…).

  • closedAtstring | null
  • archivedbooleanobligatoire
  • linesCrmDealLineDto[]obligatoire
    Détail de CrmDealLineDto
  • documentsCrmDealDocumentDto[]obligatoire

    Pièces de vente rattachées.

    Détail de CrmDealDocumentDto
  • createdAtstringobligatoire
  • updatedAtstringobligatoire

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.

Exemple de requête
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"
}'
Exemple de réponse
{
  "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 #

POST/api/public/v1/quosuite/crm/deals/{id}/won
Scope : crm:writewinCrmDeal

Probabilité 100 %, closedAt posé ; envoie crm_deal.won.

Paramètres

  • idstring (uuid)cheminobligatoire

Réponse 200application/json

Succès.

  • idstring (uuid)obligatoire
  • titlestringobligatoire
    ex.Équipement atelier BTP Horizon
  • accountIdstring (uuid) | null
  • contactIdstring (uuid) | null
  • pipelineIdstring (uuid)obligatoire
  • stageIdstring (uuid)obligatoire
  • stageNamestringobligatoire
    ex.Négociation
  • statusstringobligatoire
    valeursOPENWONLOST
  • statusLabelstringobligatoire
    ex.Ouverte
  • amountnumberobligatoire

    Montant HT (total des lignes s’il y en a).

    ex.42000
  • currencystringobligatoire
    ex.TND
  • probabilitynumberobligatoire

    Probabilité 0–100.

    ex.75
  • weightedAmountnumberobligatoire

    Montant × probabilité.

    ex.31500
  • expectedCloseDatestring | null
    ex.2026-12-20
  • ownerIdstring (uuid) | null
  • ownerNamestring | null
  • lostReasonstring | null
  • sourcestring | null
  • descriptionstring | null
  • leadIdstring (uuid) | null

    Piste d’origine.

  • stageChangedAtstringobligatoire

    Entrée dans l’étape actuelle.

  • lastActivityAtstringobligatoire

    Dernier geste commercial (activité, déplacement…).

  • closedAtstring | null
  • archivedbooleanobligatoire
  • linesCrmDealLineDto[]obligatoire
    Détail de CrmDealLineDto
  • documentsCrmDealDocumentDto[]obligatoire

    Pièces de vente rattachées.

    Détail de CrmDealDocumentDto
  • createdAtstringobligatoire
  • updatedAtstringobligatoire

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.

Exemple de requête
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/crm/deals/aac39e3a-0c40-44b2-8697-b597f357c5a9/won' \
  -H "Authorization: Bearer $QUOSUITE_API_KEY"
Exemple de réponse
{
  "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.