Skip to main content
POST
Add Subscription

Authorizations

x-api-key
string
header
required

Merchant API Key

x-signature
string
header
required

Generated request signature

Body

application/json
quoteCurrCode
enum<string>
required

Fiat currency for which request needs to be initiated.

Available options:
USD,
EURO,
INR
maxQuoteAmount
string
required

This is the amount in the same denomination as quoteCurrCode. This is the maximum value for which we can use the mandate for auto debit the amount. This amount will be inclusive of GST/VAT. Please configure it accordingly. Note: UPI has a maximum limit of ₹15,000 per mandate. Cards have a limit of ₹500,000 per mandate.

returnUrl
string
required

This URL is needed to redirect the user after the session is completed.This url will be a redirection with status, subscriptionId, and referenceId values passed in the query parameters.

frequency
enum<string>
required

Frequency of the subscription renewal period.

Available options:
DAIL,
WEEK,
MNTH,
BIMN,
QURT,
MIAN,
YEAR,
ONDM
billTo
object
required

Billing Details of the customer

items
object[]
required

Items the customer wants to buy.

customerId
string<MongoId>

If the customer is already created use customerId and then email is optional parameter.

email
string

Customer's email. Require this to send an invoice. This parameter is mandatory if clientReferenceId is not passed.

clientReferenceId
string

Customer's reference id that the partner can pass to map it to the customer on Transact Bridge panel. If email is not passed in the request body, the customer must enter the email on the product checkout page. This parameter is mandatory if email is not passed.

phoneNo
string

The customer's Indian phone number in the format of +91-XXXXXXXX

Example:

"+91-9876543210"

taxIdentity
string

PAN number of the customer

gstIdentity
string

If the customer is business type then GST can be used so that the business can get input credits.

name
string

Name of the customer

referenceId
string<referenceId>

This is a partner-generated ID to map a subscription. Partners can use this to query the subscriptions as well. This cannot be the same for two subscriptions. Reference ID that was passed by the partner during the generation of the session.

Maximum string length: 128
userTaxId
string

We will create a userTaxId for the partner. This allows us to tax the product correctly. For example: Partners can have two different userTaxId one for 18% GST and the other for 5% GST.

payMethod
enum<string>[]

If payMethod parameter is sent by the partner then on the payment page for the customer only that payment method will be visible to user.

Available options:
UPI,
NB,
CC,
DC
redirectionType
enum<string>
default:SAME_PAGE

Depending on the redirection type value, the user will either be redirected to a new page for payment or to the same window of the product page. Default value is NEW_PAGE.

Available options:
SAME_PAGE,
NEW_PAGE
description
string

To set the subscription view

collectionMechanism
enum<string>

Only AUTOPAY is allowed right now.

Available options:
AUTOPAY
billAtStart
boolean
default:true

If this is true, then the subscription is prepaid based subscription and allows to deduction of money before providing the product to the end customer and generating the invoice at the start of the subscription period. If this is false then it is a postpaid subscription which creates an invoice at the end of the subscription period.

couponDetails
object

To pass the coupon object and apply different coupons on the subscription.

pendingExpire
string

Number of minutes after which the status of the subscription if PENDING (Customer did not pay) it becomes PENDING_EXPIRED which is a terminal state and now customers cannot pay on the same subscription.

maxUnpaidInvoices
string
default:0

Max unpaid invoices allowed for the subscription. For example, if maxUnpaidInvoices is set to 2 then after 2 unpaid invoices the subscription status will be converted from ACTIVE to the status based on postMaxUnpaidInvoices.

postMaxUnpaidInvoices
enum<string>
default:PAUSED

Subscription status after maxUnpaidInvoices threshold is crossed by the customer. Default Value: PAUSED

Available options:
PENDING,
PENDING_EXPIRED,
PAUSED,
EXPIRED,
CANCELLED
dayUntillDue
string
default:1

Period of time from the issue date after which DUE invoice is converted into OVERDUE status

billingDateAnchor
string

It allows the partner to configure the billing cycle from a fixed date. If not passed then the subscription period will start from the day the customer pays for it. For Example: if the frequency is MNTH (monthly) and billingDateAnchor is set to 2, this means that the invoice will be created on every 2nd day of each month.

trialSettings
object

Configuration of the trial mechanism

maxUnpausedInvoiceDueCount
object

Maximum number of unpaid invoices count allowed after that the subscription is PAUSED by the system. For example, if a subscription has been paused due to 3 non payment of invoices and this parameter is set to be 2 then once the customer pays 1 invoice the subscription will be re activated.

reAttemptConfig
object[]

To configure how the reattempt for failed invoices be processed.

shipTo
object

Shipping Details of the Customer

sameAsBilling
boolean

To make the shipping address the same as the billing address. If sameAsBilling parameter value is set as true then shipTo is not mandatory, and the invoice will have the same shipping and billing address.

meta
object

To add meta params in the subscription. They will be passed in the webhook and query API as well.

dropIn
object

If this is set to be true then the response will contain token that can be used in the drop-in module. This can only be sent in the request if DropIn module has been enabled for the Partner Account.

Response

200 - application/json

Payment session created successfully.

status
string

The response from the API

sub_status
string

Used for internal purposes only

data
object

Contains the subscription ID and URL