Creating External Purchases

Creating purchases using Client's Login System:

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.

Steps to Enable External Purchase:

  1. Navigate to global subscription settings on our dashboard (Visualise > Manage Subscriptions > Global Settings)

  2. Select ‘My Login’

  3. 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:

  1. 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.

  2. 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.

PUBLIC KEY:

-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDTRnZkcSXEZ/PUSlJDCXf1SHGS
GKTc1CaT6/BqgXO6aSjC3QVZ1WKzeKhfhksy6iNHld9w0BLTfgHTCzKuFzvfa1tH
wfyyd+00wYSLBsGtQb1G+sO8o96yPASYe8thlnIN2jnFxZ+W9M+pb+h5pAuifIcS
XUjz4sZ6Y4lHhLLHvQIDAQAB
-----END PUBLIC KEY-----
  1. 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:

Conscent Sandbox Env.postman_environment.json

External Purchase APIs.postman_environmnet.json

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:

PARAMETER DATATYPEDESCRIPTION

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

Last updated