Skip to main content

Overview

A subscription is created when a customer pays a SUBSCRIPTION 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.
Returns the same payment object as GET /developer/v1/payment, cursor-paginated.

Finding subscriptions at risk

A failing subscription is nearly always an expired or replaced card. Point the customer at their card on file rather than asking them to subscribe again, which would start a new agreement and lose the history of this one.

Filters