Creating External Purchases
Creating purchases using Client's Login System:
Last updated
Creating purchases using Client's Login System:
Last updated
a. This feature enables clients to integrate their login system, providing Conscent with only the user's unique user ID. Conscent will then optimize the user journey based on this information, enhancing the overall experience.
b. The client is responsible for managing the login and payment flow from their end, as Conscent does not have access to these details.
Navigate to global subscription settings on our dashboard (Visualise > Manage Subscriptions > Global Settings)
Select ‘My Login’
Enter the redirect URL you want ConsCent to redirect the user to, along with the purchase token where you can handle the user’s purchase.
Purchase Flow:
ConsCent redirects users from the Subscription Landing Page to your site using the redirect URL set on the dashboard. The purchase token is passed as a query parameter during this redirection process.
Purchase information is transmitted to the client in the form of a JSON Web Token (JWT). Clients can easily extract and read purchase information from the JWT payload. The JWT is signed using the RS256 algorithm to ensure data integrity and authenticity.
Additionally, clients can verify the JWT using the public key provided by ConsCent.
After successfully charging the user for the purchase, the client must create a purchase record on ConsCent using the create external purchase API. This step ensures the synchronization of purchase data between our system and ConsCent's platform.
Step 1: Creating the Token:
You can create the JWT token by using our create-external-purcase-token API.
Attached is the Postman collection file for using the APIs.
Postman documentation can be found below:
Replace the URLs based on the environment (SANDBOX/PRODUCTION)
Step 2: Verify the JWT in your system and complete the purchase.
You may refer to https://jwt.io/introduction
Step 3: Pass the token in the create-purchase API (postman collection attached above)
SAMPLE JWT Payload details:
id
string
unique id assigned to each token to ensure consumability
iat
number
creation time in UTC timestamp format
subscriptionId
string
unique subscription ID for each subscription
tierId
string
unique tier ID for each subscription tier
amount
number
amount to be deducted to complete purchase
currency
string
currency in which amount is to be deducted
clientId
string
unique client ID for each client
consumeFreeTrial
boolean
Flag to avail of free trial
couponCode
string
coupon code applied by the user
ipAddress
string
IP address of the user
userAgent
string
user agent of the user