Twid S2S (Rewards) Onboarding and API Specification

1. Pre-requisites

Step 1
Configuring a new gateway account for Twid_v2 on the Juspay Dashboard
All Fields are Mandatory except Resend Otp Wait Time
All Fields are Mandatory except Resend Otp Wait Time
Step 2
Updating existing gateway account to add Twid_v2 from the Juspay Dashboard

2. Sample End-to-end User flow

Best Reward and Instrument Locking
More Rewards and Instrument Locking
More Rewards and Instrument Locking
More Rewards & Voucher Selection
More Rewards and Voucher Selection
More Rewards and Voucher Selection
Split Payment & Transaction
Split Payment and Transaction
Split Payment and Transaction
Note

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 Lockinglink icon to consume paymentLockingPayloadV2.rewardRules to 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 : false or the key itself will not be present)

      • No authentication required. Users can see Rewards directly if they have any eligible Rewards.

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:

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

  2. Voucher cannot be applied alone, for any voucher to be applied, there has to be a Reward applied otherwise the voucher cannot be applied.

  3. Both, voucher_id and reward_id has to be passed as a String type.

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

  5. 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) ?

Scroll inside to view more
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

Last updated 4 months ago