Skip to main content
This guide provides a step-by-step approach for integrating QFPay’s Recurring Payments solution, including prerequisites, API sequence, and best practices for live environments.

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
    • subscription_payment
  2. Create Customer object and obtain customer_id.
  3. Render Payment Element in frontend to create a 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

Use the Query API to synchronise subscription states with your CRM or internal system.
After each subscription creation, confirm receipt of a webhook with state ACTIVE or INCOMPLETE to ensure it was created successfully.
Always store subscription_id and token_id in your database for tracking and future billing actions such as retry, cancellation, reporting, or reconciliation.

Next Steps