Public
Documentation Settings

TransxndPay S2S v1 API Spec

All endpoints in this API expect a json request and return a json object. Every response contains a _status_ field that specifies if the request was successful or not. The structure of the response object is stated below:

status Indicates whether the call was successful or not
message Additional messages are passed here
data Main response object is stored here.

You are expected to extracted and parse the contents of the data field in your application.

Each transaction cycle consists of the following stages:

  • Generate payToken: A short-lived jwt token is received from the API. This token MUST be included in all subsequent steps in the transaction.

  • Initiate Authentication: This stage is used to create a session between the client(payer) and the Payment Gateway. If successful, the endpoint will return a nested json object that contans multiple keys, amongst which is the t_id key. Run any generated html in data.authentication.redirect.html payer's (user's) browser before moving on to the next step.

  • Authenticate Payment: At this stage, you pass the user's credit card details, along with the t_id generated in Stage 2, the user's IP address, details about the transaction (amount, description etc), as well as the URL to redirect the user to AFTER the user completes 3DS validation into your request object. If the value of data.response.gatewayRecommendation is PROCEED, that means you can proceed to the next step by running the generated html in data.authentication.redirect.html in the payer's (user's) browser before moving on to the next step.

  • 3Ds validation: At this stage, the user completes the 3Ds validation by submitting the OTP sent to his phone number or email address. Upon submission, the user will be redirected to the URL that was specified when calling the authenticate_payer endpoint. The api will post a payload to this URL. Parse the contents of this response and check for the following keys, result and response_gatewayRecommendation. If 3DS validation was successful, the value of response_gatewayRecommendation will be PROCEED.

  • Complete Payment: This is the fiinal stage of the transaction process. The user's card details, along with the order details are sent to the payment gateway and the user's card will be charged accordingly. Parse the response fom the gateway and check the value of data.result.order.status. If the value is CAPTURED, that means the user's card has been successfully debited, and you can go ahead to give value to user.

Loading