API support and webhooks
Use Recurly's REST API endpoints and webhooks to programmatically retrieve mobile app subscription data and respond to subscription lifecycle events.
This feature requires an additional cost. Contact Recurly Sales for pricing details.
REST API endpoints
These REST API endpoints let you programmatically pull information about your mobile app subscriptions from Recurly in JSON format.
External products
Use these endpoints to view information about the external products you configured during setup.
External subscriptions
Use these endpoints to view information about external subscriptions — the Apple or Google subscriptions your customers have purchased.
- List all External Subscriptions by Site
- List all External Subscriptions by Account
- Fetch an External Subscription
Entitlements
Use this endpoint to view the entitlements granted to a specific customer (account).
For the complete list of endpoints specific to App Management, start at External Subscription and scroll down.
Webhooks
For key events in the subscription lifecycle, Recurly triggers a webhook so you can take follow-up action — like emailing your customer — based on the notification.
Recurly webhook payloads are lightweight by design and require a follow-up call to the REST API to get the most up-to-date information about an app store subscription. The JSON and XML examples below show a notification for a new external subscription. To get more detail, call the Fetch an External Subscription endpoint with the id provided in the webhook.
{
"id": "s0lo0hdfmauc",
"object_type": "external_subscription",
"site_id": "qpem7fkwr763",
"event_type": "created",
"event_time": "2022-12-06T22:19:15Z"
}<new_external_subscription_notification>
<external_subscription>
<id>uuid</>
</external_subscription>
<external_resource>
<id></id>
<external_object_reference></external_object_reference>
</external_resource>
<external_product_reference>
<id></id>
<reference_code></reference_code>
<created_at></created_at>
<updated_at></updated_at>
</external_product_reference>
</new_external_subscription_notification>Configuring Recurly to send webhooks
To configure webhooks for App Management, navigate to Integrations → Webhooks in Recurly and select Configure at the top right. You can either create a New Endpoint or select Options → Edit for an existing one. When configuring the endpoint, scroll to the External Subscription section and select the checkbox for any event you're interested in. The next section covers those events in detail. To learn more about Recurly webhooks in general, see the Webhooks developer documentation.
Complete list of webhook events
The table below lists every webhook Recurly sends related to mobile app subscriptions. Each one maps to a specific Apple or Google notification. For JSON and XML examples of each webhook, see the External Subscription Notifications section of the Webhooks page in the Recurly Development Hub.
| Recurly event | Apple event | Google event |
| canceled | DID_CHANGE_RENEWAL_STATUS > AUTO_RENEW_DISABLED | SUBSCRIPTION_CANCELED |
| consumption_requested | CONSUMPTION_REQUEST | N/A |
| created (new subscription) | SUBSCRIBED > INITIAL_BUY | SUBSCRIPTION_PURCHASED |
| downgraded | DID_CHANGE_RENEWAL_PREF > DOWNGRADE | N/A |
| downgrade_canceled | DID_CHANGE_RENEWAL_PREF | N/A |
| expired | EXPIRED > VOLUNTARY EXPIRED > BILLING_RETRY EXPIRED > PRICE_INCREASE | SUBSCRIPTION_EXPIRED |
| extended_renewal | RENEWAL_EXTENDED | SUBSCRIPTION_DEFERRED |
| failed_renewal | DID_FAIL_TO_RENEW | SUBSCRIPTION_ON_HOLD |
| failed_renewal_with_grace_period | DID_FAIL_TO_RENEW > GRACE_PERIOD | SUBSCRIPTION_IN_GRACE_PERIOD |
| grace_period_expired | GRACE_PERIOD_EXPIRED | N/A |
| pause_schedule_changed | N/A | SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED |
| paused | N/A | SUBSCRIPTION_PAUSED |
| plan_changed | N/A | SUBSCRIPTION_PURCHASED |
| price_change_confirmed | N/A | SUBSCRIPTION_PRICE_CHANGE_CONFIRMED |
| reactivated | DID_CHANGE_RENEWAL_STATUS > AUTO_RENEW_ENABLED | SUBSCRIPTION_RESTARTED |
| recovered | N/A | SUBSCRIPTION_RECOVERED |
| refunded | REFUND | N/A |
| refund_declined | REFUND_DECLINED | N/A |
| refund_reversed | REFUND_REVERSED | N/A |
| renewed | DID_RENEW DID_RENEW > BILLING_RECOVERY | SUBSCRIPTION_RENEWED |
| resubscribed | SUBSCRIBED > RESUBSCRIBE | N/A |
| resubscribed_incorrect_account | SUBSCRIBED > RESUBSCRIBE | N/A |
| revoked | N/A | SUBSCRIPTION_REVOKED |
| upgraded | DID_CHANGE_RENEWAL_PREF > UPGRADE | N/A |
| voided | N/A | SUBSCRIPTION_VOIDED |
Viewing triggered webhooks
All triggered webhooks are viewable in Recurly under Integrations → Webhooks. You can also reach a filtered view of triggered webhooks from the Webhooks link when viewing the details of an account or external subscription.