Deposit Tracking Session
A Sample Code For Creating A Deposit Tracking Session
Below, you can find an example of how to create a deposit tracking session using TypeScript code. With our infrastructure, customers can keep track of deposits made and monitor the status of each deposit as it progresses through various stages. Start your journey by creating a deposit session.
Creating A Deposit Tracking Session API Endpoint
To ensure that your POST requests are handled correctly, follow these steps: Firstly, convert the request body to a string using JSON.stringify(). Then, calculate the x-payload-hash based on this stringified body and pass it on to the x-payload-hash header. Additionally, use the same stringified body while making the POST request and ensure that the HMAC payload is base 64 encoded. It's crucial to examine the sample code carefully to ensure that these steps are implemented correctly. Failing to complete these steps will result in your request being rejected with an error code of errorHmacDoesNotMatch.
POST
https://api-prod.alfa-instap-cpt.uk/pgpub/session
Session Token and Operation No mean the same thing for our system. Before tracking deposits for your users, you need to create a deposit tracking session. The system associates this session with a session token. The system manages session tokens.
Headers
content-type*
string
application/json
x-api-key*
string
Replace your API key
x-payload-hash*
string
Request Body
userId*
string
STRING [Min 1,Max 4000] Characters The userId field is your user's unique Id. The system uses this parameter to track deposit events, and it distinguishes deposit sessions using this parameter. userId parameter must be unique within the customer's infrastructure.
userName*
string
STRING [Min 1,Max 4000] Characters This parameter is for display only, and the system does not use this parameter while tracking deposit events.
userNameSurname
string
STRING [Min 1,Max 4000] Characters This parameter is for display only, and the system does not use this parameter while tracking deposit events.
userEmail
string
STRING [Min 1,Max 4000] Characters This parameter is for display only, and the system does not use this parameter while tracking deposit events.
maxPaymentAmountInUSD
number
NUMBER The system uses this parameter to set the state of the deposit. The state of the deposit can be overpaid, underpaid or correct.
This parameter can not be less than zero or smaller than minPaymentAmountInUSD.
The default value of this parameter is 5000$.
minPaymentAmountInUSD
number
NUMBER The system uses this parameter to set the state of the deposit. The state of the deposit can be overpaid, underpaid or correct.
This parameter can not be less than zero or bigger than maxPaymentAmountInUSD.
If the customer sets this parameter, the system initializes the minimum payment for this amount. If the customer bypasses this parameter, the system uses the system's default which is 10$.
sessionDefaultFiatCurrency
string
STRING 3 Characters If the customer sets this parameter, the system initializes the session for this fiat currency. If the customer bypasses this parameter, the system selects USD as the initial currency of the session. Your users can change this parameter during the checkout process, and the client code of the checkout page will make the necessary conversions. Possible values are USD,EUR,GBP ,KRW, BRL and TRY.
sessionDefaultLanguage
string
STRING 2 Characters The system activates the checkout page for this language. If not present, the checkout page will use the system's default session language.
redirectUrl
string
Upon completion of the deposit tracking session, this field specifies the exact web address to which the user will be automatically redirected. The URL provided should be accessible and lead to the appropriate destination for a seamless user experience.
The system successfully creates the deposit tracking session.
Querying The Deposit Tracking Session API Endpoint
GET
https://api-prod.alfa-instap-cpt.uk/pgpub/session/{sessionToken}
One can learn about the state of the deposit tracking session using this endpoint.
Query Parameters
sessionToken*
string
The session token to be queried
Headers
content-type*
string
application/json
x-api-key*
string
Replace your API key
The status of the session will be one of the following.
NEW: This state means the system successfully creates a new payment gateway session.
COMPLETED: This state indicates that the system detects a completed blockchain transaction.
EXPIRED: This state means that the payment gateway session has expired without any deposit event.
FAILED: This state suggests the system abnormally terminated the payment gateway session. It can only occur if the system does not push the event to our event source.
Last updated
Was this helpful?