Skip to main content

Integration Guide for Recurring Payments

Prerequisites

Before you begin integration, ensure the following:

  • You have API credentials (AppCode, AppKey) for your environment.
  • Your notify URL has been configured with QFPay for receiving asynchronous webhook notifications.
  • Your frontend supports rendering and submitting Payment Element.

Integration Flow Overview

The complete recurring payment integration consists of the following steps:

  1. Set up webhook endpoint to receive payment_token, subscription, and subscription_payment notifications.
  2. Create Customer object and obtain customer_id.
  3. Render Payment Element in frontend to create token using payment.pay() and customer_id.
  4. Capture the token_id from webhook notification or token API response.
  5. Create Product object to define billing amount, frequency, and interval.
  6. Create Subscription with customer_id, token_id, and product_id.
  7. (Optional) Monitor subscription status via webhook or Query API.

recurring-payment-flow


Best Practices

note

Use Query API for syncing subscription states to your CRM.

tip

After each subscription creation, confirm receipt of webhook with ACTIVE or INCOMPLETE state to ensure it was created successfully.

warning

Always store subscription_id and token_id in your database for tracking and later billing actions such as retry, cancellation, or reporting.


Next Steps