Yoki Finance
  • Introduction
    • What is Yoki Finance?
    • Our Values
    • $YOKI token
  • Subscription payments
    • Subscription payments gateway
    • For merchant
      • Glossary
      • How to create the subscription plan
      • Payment plan page
      • Money flows and settlement
      • Get subscription statuses
      • API integration
        • Introduction
        • Steps
        • Localhost environment
        • API brief overview
        • Sending to Telegram group
      • Data export
    • Chains and Tokens
  • Dollar-Cost-Averaging
    • Dollar-Cost-Averaging app
    • Overview
    • Architecture
    • Creating the first subscription
    • Chains and Tokens
    • Analytics
    • Fees
    • Integration
  • Social Media
    • Website
    • Twitter
    • Medium
    • Discord
Powered by GitBook
On this page
  1. Subscription payments
  2. For merchant
  3. API integration

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:

  1. Subscription is created.

  2. Periodic payment is processed.

  3. Periodic payment is failed. We provide a retry mechanism, so there can be two cases:

    1. Subscription went to error state (e.g., not enough funds or allowance) and stopped.

    2. 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.

  4. 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.

PreviousAPI integrationNextSteps

Last updated 1 year ago