Creating a Subscription
This functionality is available only upon approval by the Security Department. To enable subscriptions, please contact our support team.
A subscription allows you to automatically charge a client’s card without their direct involvement. This is useful for recurring payments, such as:
rent,
internet access,
mobile phone top-ups,
other periodic services.
Step 1: Create an initial (setup) payment
To bind the client’s card to a subscription, pass the subscription parameter when initiating the payment:
For hosted form:
subscription=trueFor API request:
subscription=true
📌 It’s strongly recommended to also pass hideOtherMethods=true to ensure the subscription is initialized specifically via the card method.
IP Address Forwarding
Initial payment via API: pass the
ipof the user who is subscribing.Initial payment via form or widget:
ipis not passed. The payer'sipwill be received by the handler; save it together with thesubscriptionId.
Step 2: Receive the subscription ID
After the initial payment is completed, your payment handler will receive the following parameter:
Store this ID — it will be required for future recurring charges.
Step 3: Trigger recurring charge
To initiate an auto-charge:
Ensure the subscription status is
activeUse the standard API method to create a payment
Pass the
subscriptionIdvia:
The amount and charge interval are fully managed on your side.
Refunding the Initial Payment
If you sell a subscription with the first month free, you may need to initially charge the customer a small amount and then refund it — for example, to verify the card or create the subscription.
Subscriptions in Unitpay do not automatically refund the initial payment. However, you can refund the initial payment yourself using the payment refund method by passing the unitpayId received for the initial payment as the paymentId parameter.
Last updated
Was this helpful?