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:
- Set up webhook endpoint to receive
payment_token,subscription, andsubscription_paymentnotifications. - Create Customer object and obtain
customer_id. - Render Payment Element in frontend to create token using
payment.pay()andcustomer_id. - Capture the
token_idfrom webhook notification or token API response. - Create Product object to define billing amount, frequency, and interval.
- Create Subscription with
customer_id,token_id, andproduct_id. - (Optional) Monitor subscription status via webhook or Query API.
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.