Twid S2S (Rewards) Onboarding and API Specification
1. Pre-requisites
2. Sample End-to-end User flow
3. Sample Requests and Responses
getPaymentMethods for Twid:
Request:
Response:
Process SDK Call for Rendering TWID Rewards
Eligibility Request
Eligibility Response
Note:
There are two types of vouchers (“discount” and “cashback”). The same can be identified by the value of the key “title” under voucher_info object in redeemable_info of eligibility response.
Refer Payment Locking
to consume
paymentLockingPayloadV2.rewardRulesto filter instruments which are eligible with the corresponding reward.There are two different flows available for using Twid Rewards -
Linking Flow (
rewardDetails.optVerification : true)Users would have to link with OTP authentication before they can see Rewards.
Non-Linking Flow (
rewardDetails.optVerification : falseor the key itself will not be present)No authentication required. Users can see Rewards directly if they have any eligible Rewards.
Twid Reward consent & linking (Only for Linking Flow**)
Authenticate (Create Wallet) Request: (Only for Linking Flow**)
Sample Response: (Only for Linking Flow**)
Link Wallet Request: (Only for Linking Flow**)
Sample Response: (Only for Linking Flow**)
Order Create
Sample Request
Sample Response
Transaction Create
Sample Txns Process Payload
Sample Txns Process Response
Note:
For split_amount key, the total discount amount i.e., Reward Amount + Voucher Amount (Only Instant Discount, if any) should be passed. Cashback type Voucher amount should not be included.
Voucher cannot be applied alone, for any voucher to be applied, there has to be a Reward applied otherwise the voucher cannot be applied.
Both, voucher_id and reward_id has to be passed as a String type.
direct_wallet_token: <token> should include the token received from RefreshWallet response. This is a mandatory key to be passed if it’s via Linking Flow. This is not required for Non-Linking flow.
The above is just a sample process response (in an ideal case where we receive terminal status before SDK terminate), although it’s possible we do not get a terminal status by that time. Hence, it is recommended to always poll for order-status response or configure and consume the webhook response for order-status.
Sample Txns API
Sample Txns Response
Order Status
Sample Request
Sample Response
Transaction Sync
Sample Request
Sample Response
Refund (Transaction Based)
Sample Request
Sample Response
Refund (Order Based)
Sample Request:
Sample Response:
Note: Current documentation illustrates transaction Id based refunds for split payments (both full and partial refunds). Order based refunds feature is upcoming.
5. FAQs
1. How can payment page merchants avail new TWID flow ?
Update to package version 3.21_<>_RC3 or above.
2. How do merchants transition smoothly from TWID redirection flow (referred as V1) to the S2S flow (referred as V2) ?
|
Frontend Version (New = Package 3.21_<>_RC3 and above)
|
TWID Gateway creds enabled
|
Eligibility Resp from Juspay Backend
|
User Experience
|
|---|---|---|---|
Old
| V1
| V1
| Redirected to TWID page for payment
|
Old
| V2
| No Response
| TWID will not be shown
|
Old
| V1 & V2
| V1
| Redirected to TWID page for payment
|
New
| V1
| V1
| Redirected to TWID page for payment
|
New
| V2
| V2
| User will do split transaction
|
New
| V1 & V2
| V2
| User will do split transaction
|
- Have questions?
- Need help? Contact support
- LLM? Read llms.txt

