Overview
A subscription is created when a customer pays aSUBSCRIPTION payment link. Compago then charges the saved card on the agreed cadence. These endpoints let you read those agreements and their billing history.
Read-only in this version. Pausing, resuming, cancelling, re-pricing and retrying a failed charge are done from the dashboard. Compago’s automatic dunning retries failing subscriptions on its own regardless.
The subscription object
GET /developer/v1/subscription/{id} adds totalCollected, the sum of every pending and confirmed payment on the subscription, and daysActive.
Lifecycle
The two failure counters
failedAttempts counts retries within the current cycle and resets when a charge succeeds. When it reaches maxFailedAttempts, that cycle is written off and failedBillingCycles goes up by one. When failedBillingCycles reaches maxFailedBillingCycles, the subscription is cancelled.
Watch failedBillingCycles if you want to warn a customer before you lose them: it is how close the agreement is to ending. failedAttempts is noise inside a single month.
Billing history
These examples call the production host. While you build, replace
https://api-harmony.compago.com with https://demo-api-harmony.compago.com and use a key from the Demo dashboard. See Environments.GET /developer/v1/payment, cursor-paginated.