À quoi sert la ressource « Abonnements récurrents » ?
Abonnements récurrents : plan, périodicité, engagement, préavis, indexation et fin de vie
Quels endpoints sont disponibles ?
| Méthode | Adresse | Action |
|---|---|---|
| GET | /api/v1/subscriptions et /{id} | lire (liste paginée ou un élément par identifiant) |
| POST | /api/v1/subscriptions | créer un élément |
| PUT | /api/v1/subscriptions/{id} | remplacer un élément |
| PATCH | /api/v1/subscriptions/{id} | modifier certains champs |
| DELETE | /api/v1/subscriptions/{id} | supprimer un élément |
Quels champs contient la ressource « Abonnements récurrents » ?
| Champ | Type et description |
|---|---|
| id | string |
| tenantId | string |
| clientId | string |
| amount | number |
| frequency | string |
| status | string |
| name | string |
| nextBillingDate | string |
| reference | string |
| category | string |
| planId | string |
| type | SaaS|Maintenance|Service|Location|Autre |
| priority | Basse|Moyenne|Haute|Critique |
| description | string |
| tags | string[] |
| departmentId | string |
| managerId | string |
| legalEntityId | string |
| currency | string |
| taxRate | number |
| discountPercent | number |
| trialEndDate | string |
| paymentMethod | string |
| setupFee | number |
| activationFee | number |
| cancellationFee | number |
| isAutoBillingEnabled | boolean |
| priceIndexationClause | string |
| totalLtv | number |
| startDate | string |
| endDate | string |
| commitmentMonths | number |
| autoRenew | boolean |
| noticePeriodDays | number |
| renewalDate | string |
| terminationDate | string |
| terminationReason | string |
| slaLevel | Bronze|Silver|Gold|Platinum |
| dataStorageLimitGb | number |
| userSeatLimit | number |
| backupFrequency | string |
| customerHealthScore | number |
| churnProbability | number |
| campaignId | string |
| partnerId | string |
| acquisitionChannel | string |
| internalNotes | string |
| publicNotes | string |
| lastIndexationDate | YYYY-MM-DD |
| statusReason | string |
| customerKind | 'professionnel'|'consommateur'|'non_professionnel' — information de reconduction L215-1 |
| concludedOnline | boolean — résiliation en ligne L215-1-1 |
| sourceQuoteId | string — devis signé |
| sourceQuoteNumber | string |
| items | SubscriptionItem[] — lignes à prix figés { id, planId, kind, label, pricingModel, quantity, unitPriceHT, tiers, packageSize, vatRate, usageUnit, includedUnits, usageAggregation, minimumAmountHT, salesAccount, productId |
| itemSegments | { until: YYYY-MM-DD, items: SubscriptionItem[] }[] — terme échu : lignes en vigueur avant un changement dans la période non facturée |
| billingIntervalMonths | number |
| billingAnchorDay | number (1-31) |
| billingTiming | 'advance'|'arrears' |
| billedUntil | YYYY-MM-DD — début de la prochaine période à facturer |
| lastInvoiceId | string |
| lastInvoiceNumber | string |
| setupFeeBilled | boolean |
| paymentTermsDays | number |
| prenotificationDays | number — pré-notification SEPA |
| pausedFrom | YYYY-MM-DD |
| pauseUntil | YYYY-MM-DD |
| pauseReason | string |
| cancelRequestedAt | YYYY-MM-DD |
| cancelChannel | 'interface'|'portail'|'courrier'|'email'|'telephone' |
| cancelMode | 'immediate'|'period_end'|'notice' |
| cancelAt | YYYY-MM-DD — date d’effet |
| cancelProrataCredit | boolean |
| renewalTermMonths | number |
| renewalNoticeFor | YYYY-MM-DD |
| renewalNoticeSentAt | YYYY-MM-DD |
| indexation | { enabled, indexCode, baseValue, baseMonth, fixedPart, anniversaryMonth, capPercent, floorPercent, lastAppliedAt, lastIndexValue, lastIndexMonth, lastCoefficient } |
| discountEndsAt | YYYY-MM-DD |
| stripeCustomerId | string (cus_…) |
| stripePaymentMethodId | string (pm_…) |
| cardBrand | string |
| cardLast4 | string |
| cardExpMonth | number |
| cardExpYear | number |
| paymentFailureCount | number |
| lastPaymentFailureAt | YYYY-MM-DD |
| lastPaymentFailureCode | string |
| portalTokenHash | string — empreinte SHA-256 du lien de l’espace abonné |
| portalTokenIssuedAt | ISO8601 |
| customFields | Record<string, any> |
| attachments | string[] |
| documentUrls | { name: string, url: string, size?: number, type?: string }[] |
| createdAt | string |
| updatedAt | string |
| kanbanOrder | number — rang dans la colonne du kanban |
Comment filtrer, trier et paginer ?
Exemple de lecture filtrée et triée : GET /api/v1/subscriptions?filter[clientId]=…&sort=amount:desc&limit=50.
Le filtre est une égalité stricte sur un champ déclaré, le tri s’écrit champ:asc ou champ:desc, la page contient 50 éléments par défaut et 200 au plus, un champ inconnu renvoie une erreur 400 plutôt qu’un résultat faux.
Quelles autorisations faut-il ?
- Une offre qui inclut l’API publique : Enterprise.
- Une clé d’API créée dans Système › Intégrations, envoyée dans l’en-tête Authorization: Bearer, limitée au dossier qui l’a émise.
- Une portée accordée à la clé pour cette ressource : lecture, écriture et suppression.