Integrate the recurring billing APIs to automated your subscription payments
name
, cycle
and amount
. Remember to include header Content-Type: application/x-www-form-urlencoded
Parameter | Description | Example |
---|---|---|
name | Plan name | Spotify Premium |
description | The description of the subscription plan | Spotify Monthly Subscription |
cycle | Billing frequency (weekly / monthly / yearly / custom / save_card). If cycle = custom then the user has to send the fields cycle_repeat and cycle_frequency | monthly |
cycle_repeat | [This field is only applicable when cycle = custom] It’s the number of times the cycle will repeat. | 4 |
cycle_frequency | [This field is only applicable when cycle = custom] It’s the frequency of the cycle [day / week / month / year] | week |
currency | Currency related to the recurring billing | SGD |
amount | Amount related to the recurring billing | 9.90 |
reference | Arbitrary reference number that you can map to your internal reference number. This value cannot be edited by the customer | XXXX123 |
plan_id
, customer_email
, and start_date
.
If you would like to create a subscription without a plan, you need to send plan_id = null
and the following mandatory fields: name
, cycle
, amount
, customer_email
, and start_date
. Remember to include the header Content-Type: application/x-www-form-urlencoded
.Parameter | Description | Example |
---|---|---|
plan_id | Subscription plan id created from step 1 | 973ee344-6737-4897-9929-edbc9d7bf433 |
customer_email | Customer email | paul@hitpayapp.com |
customer_name | Customer name | Paul |
start_date | Billing start date (YYYY-MM-DD) in SGT | 2022-11-11 |
amount | By default, the amount from the subscription plan will be used. Use this parameter for discounts for customers. | 7.90 |
currency | Currency related to the recurring billing | SGD |
payment_methods[] | Choice of payment methods you want to offer the customer | giro, card |
redirect_url | URL where hitpay redirects the user after the user enters card details and the subscription is active. | https://spotify.com/subscription-completed |
reference | Arbitrary reference number for mapping purposes. Customer cannot edit this value. | XXXX123 |
webhook | Optional URL for hitpay to send a POST request on new charges or charging errors. | https://webhoo.site/test |
send_email | Hitpay sends email receipts to the customer. Default value is false. | true |
times_to_be_charged | Number of times to charge the customer. | 3 |
application/x-www-form-urlencoded
.Parameter | Description |
---|---|
payment_id | Payment ID |
recurring_billing_id | Recurring billing request ID |
amount | Amount related to the recurring billing |
currency | Currency related to the recurring billing |
status | Payment status (succeeded / failed) |
reference | Arbitrary reference number that you have mapped during recurring billing request creation |
hmac | Message Authentication code of this webhook request |
salt
from your dashboard under API Keys
.
What happens if an attached card associated with an active plan gets declined?
When will a scheduled customer subscription be canceled?
If a customer's subscription is canceled, should I reuse the same one?
Webhook Signature Mismatch?
Facing Invalid Business API Key Error
Product Checklist