Create a subscription
Send the amount and the interval with each subscription; the gateway charges on its own and every paid cycle lands in your ledger.
Create
POST https://pay.contagorda.com/connect
{ "amount": "49.90", "currency": "BRL", "interval": "month", "description": "Blackevin PRO", "return_to": "https://app.blackevin.com/billing", "customer": { "external_ref": "user_42", "email": "[email protected]" } }
Idempotency-Key is required. Set the app's Charges to Subscriptions and /connect creates one; amount, currency and interval (month or year) come in the body, since your product knows its plans. POST https://pay.contagorda.com/api/v1/subscriptions does the same with the full subscription in the answer.
What happens next
- 1The customer pays and comes back with the signed token, like a one-off payment (its claims include subscription).
- 2subscription.activated arrives by webhook; each later cycle sends session.paid and subscription.renewed.
- 3Its current_period_end can be null: the gateway reports the period a moment after the payment, and subscription.updated brings it. The same event says when the period end or cancel_at changes without a change of status.
- 4A failed renewal sends subscription.past_due while the gateway retries.
Stripe only for now. Read one with GET /api/v1/subscriptions/:id.