Links

Subscription

This Section guides you to create subscription via api.
The subscription documention will guide you, how to integrate subscription payment via api. If you want to skip the 3DS option, please contact Foloosi's support team.
NOTE,
A subscription can only be created when the API is set to live mode.

Basic Requirements

Steps to create subscription

To create a subscription and send the subscription link to the customer via SMS or email, this process will skip the payment step before creating the subscription. The link will be sent after the subscription is created, and the customer can proceed with the payment.
1
// Create Subscription
2
POST API LINK: https://api.foloosi.com/v1/subscription/create
3
4
// Post Body Fields
5
{
6
"plan_name" : "Api new plan test", /** YOUR PLAN NAME*/
7
"billing_type" : "month", /** value must be day/week/month/year */
8
"billing_cycle" : 1, /** it only applicable for week and month billing type.ex Every 1 weeks */
9
"billing_currency" : "AED", /** it should be 3 digit code and other than AED you should enabled multi currency option from Foloosi */
10
"billing_amount" : "SUBSCRIPTION AMOUNT",
11
"setup_fee" : "SETUP FEE", /** Optional - which is subscription setup one time fee */
12
"total_count" : 10, /** number of deductions */
13
"description" : "monthly demo plan",
14
"start_date" : "dd-mm-yyyy", //which is optional param.if you given value should be in the format
15
//Note : if you given date means .at the time of payment will be charged by transaction
16
//amount as you given .subscription recurring will start on the given date and given billing amount
17
"notify_email" : "Yes" || "No",
18
"notify_sms" : "Yes" || "No",
19
"customer" : {
20
"name" : "CUSTOMER NAME",
21
"email" : "CUSTOMER EMAIL ID",
22
"phone_code" : "CUSTOMER MOBILE CODE", /** Eg: +971 */
23
"phone_number" : "CUSTOMER MOBILE NO"
24
}
25
}
26
27
//Sample response
28
{
29
"message": "Subscription created successfully",
30
"data": {
31
"subscription_no": "FAPISC1234567XXXXXX122fw11"
32
}
33
}
34

Sample images

After successful subscription creation, it has to be listed in Foloosi panel. Please login to view the subscription created.
Subscription list
Click the subscription id to view details like below
Subscription detail popup
To get the Subscription Details
For Subscription Details, you can use the Get request as below,
1
GET API LINK: https://api.foloosi.com/v1/open/subscription-link/detail/YOUR_TRANSACTION_ID
2
3
HEADERS:
4
secret_key : YOUR_SECRET_KEY
5
6
SAMPLE RESPONSE:
7
{
8
"message": "Subscription details are",
9
"data": {
10
"customer": {
11
"name": "FOLOOSI CUSTOMER",
12
"email": "[email protected]",
13
"mobile": "567812345",
14
"card_last_four": "5123"
15
},
16
"plan": {
17
"name": "Mobile PostPaid",
18
"type": "Billed Every month",
19
"amount": "AED 114.60",
20
"unit": "1 x AED 114.60 per unit",
21
"setup_fee": 0,
22
"status": "active",
23
"created": "01-10-2022 02:11 am"
24
},
25
"invoices": [
26
{
27
"id": 50094,
28
"subscription_id": 1031,
29
"billing_type": "month",
30
"billing_count": 1,
31
"bill_date": "2022-11-01",
32
"status": "paid"
33
},
34
{
35
"id": 50095,
36
"subscription_id": 1031,
37
"billing_type": "month",
38
"billing_count": 1,
39
"bill_date": "2022-12-01",
40
"status": "pending"
41
}
42
]
43
}
44
}
To cancel a Subscription
NOTE : Follow any one of the methods below to cancel a subscription,
a. To cancel a Subscription with api , you can use the api given below,
PUT API LINK: https://api.foloosi.com/v1/open/subscription-link/suspend
HEADERS:
secret_key : YOUR_SECRET_KEY
BODY:
subscription_no : YOUR_SUBSCRIPTION_NO
SAMPLE RESPONSE:
{
"message": "Subscription cancelled successfully",
"data": {
"status": 200
}
}
b. You can cancel the subscription directly from foloosi panel.
  • login to foloosi panel.
  • click subscriptions under subscription category.
  • click the subscription id, it will open a popup as shown below.
    cancel subscription
    NOTE
    Supports 170 World Currencies

    Properties

    List of properties available:
    Name
    Type
    Required
    Description
    secret_key
    String
    true
    your foloosi secret key
    plan_name
    String
    true
    Your Subscription Plan Name
    billing_type
    String
    true
    value must be day/week/month/year
    billing_cycle
    integer
    false
    it only applicable for week and month billing type.ex Every 1 weeks
    setup_fee
    String
    false
    which is subscription setup one time fee
    billing_amount
    String
    true
    subscription amount
    billing_currency
    String
    true
    transaction currency
    total_count
    Integer
    true
    number of deductions
    description
    String
    false
    describe the subscription details.
    start_date
    Date
    false
    if you given date means .at the time of payment will be charged by transaction, amount as you given .subscription recurring will start on the given date and given billing amount Format should be in "dd-mm-yyyy".
    name
    String
    false
    customer name - auto render in payment popup if passed
    email
    String
    true
    customer email Id
    phone_number
    String
    true
    customer mobile number
    phone_code
    String
    true
    customer mobile code

Support

Visit https://www.foloosi.com for support requests or email to [email protected]

Developed by

Foloosi Technologies Pvt Ltd.

License

Copyrights (c) 2022 Foloosi