Introduction
This page describes high-level how a merchant can get notifications about subscription statuses via API. To read more about API and its objects please go to API brief overview.
Yoki notifies the merchant by firing webhook handler URL (provided by merchant) with POST request upon the following events:
Periodic payment is failed. We provide a retry mechanism, so there can be two cases:
Subscription went to error state (e.g., not enough funds or allowance) and stopped.
Subscription will try to charge the user in 24 hours (max 5 tries).
If in the webhook payload paymentFailedInfo.nextRunDate is null, then it means it was the last retry and subscription will be stopped.
Subscription is cancelled by the user. This event is fired only when user intentionally canceled a subscription.
To see the data that will be passed to your API, you can click to links above and use services like https://webhook.site/ , https://webhook-test.com/ (no endorsement), to see the data that comes in.
Important: in your actual implementation webhook API must return either an empty response or {} (empty JSON object) and 2XX status code, otherwise call is considered unsuccessful and will be retried. Max number of retries is 18 over the course of 12 hours.
Last updated