API Integration / Upcoming Annual Renewals API Endpoint
Upcoming Annual Renewals API Endpoint
Send a branded email notifying customers of their upcoming annual renewal. Available to Enterprise accounts; requires setup assistance from the Churn Buster team.
Thirty days before an annual subscription renews, call this endpoint to notify Churn Buster of the upcoming invoice. Churn Buster immediately sends a branded renewal-notice email to your customer.
Two requirements:
- This feature is available to Enterprise accounts that have requested access via the Churn Buster team.
- Emails only send when using your live-mode API key. Test-mode requests are logged but send nothing.
Request
curl -X "POST" "https://api.churnbuster.io/v1/upcoming_annual_renewals" \
-H "Content-Type: application/json" \
-u "ACCOUNT_ID:API_KEY" \
-d '{
"invoice": {
"source": "stripe",
"source_id": "sub_abc123",
"amount_in_cents": 4999,
"currency": "USD",
"renews_at": 1822392000
},
"customer": {
"source": "stripe",
"source_id": "cus_abc123",
"email": "sarah@example.com",
"properties": {
"first_name": "Sarah",
"last_name": "Doe"
}
}
}'
renews_at is a Unix timestamp in seconds.
Verify your requests
- Test mode: view requests in the test debugger.
- Live mode: view recent requests in the live debugger.
About invoice.source_id
The upcoming invoice may not have an ID assigned yet. In that case, use the subscription ID as the invoice.source_id.
About source and source_id
Use IDs from your payment processor when possible. On Stripe, source is "stripe" and source_id is the Stripe ID (e.g. "cus_sampleID").
If that's not possible, use IDs from your in-house billing system: source is "in_house" and source_id is your internal ID.
IDs should be unique to customers, subscriptions, invoices, payment methods, and payments.