Overview of the Payments APIs

Covers each of the payment method types (CARD, NB, WALLET, or UPI) with eight Transaction APIs. The Payment Methods API returns a list of payment methods (with details) available for your account. Optional Query parameters can be sent to get a filtered list of payment methods that support Emandates, Wallet Direct Debits, Third-Party Validation, and Gateway Reference IDs.

Transaction APIs

All eight of the Transaction APIs below use the same request URL format:

    POST      https://api.juspay.in/txns

There are no URL embedded Path or Query parameters for these APIs.

Payment Method Details (Table 1) are sent with each of the Transaction APIs, plus other API specific parameters as described in Parameter Reference Tables 2-4 below.

The response for each of the Transaction APIs is a Payment Status Object as described in Parameter Reference Table 5 below.

Once a response is received, use the “method” attribute to determine how the customer should be redirected, as explained here.

Basic flow diagram for a Transaction API:

PaymentsAPIFlowPaymentsAPIFlow

Credit / Debit Card transaction - Initiates a credit/debit card payment for an order using either the given card parameters or a token for a stored card.

User has the option of performing an EMI transaction on the given card. If using this option, EMI bank and tenure are must be enabled and supported by your gateway account.

Required:   Payment Method Details,  Card Details         Optional:   EMI Parameters
Returns:   Payment Status Object

Card Encryption - Create a payment transaction for Credit or Debit card with encryped details (card number, expiry month, expiry year, CVV). These details are encrypted using the asymmetric cryptographic algorithm. The encrypted details are prepended with "enc-", and passed to Juspay in the transaction call

Required:   Payment Method Details,  Card Details (encrypted),  card_encoding_version
Returns:   Payment Status Objecttxn_uuid,  and  offer_details: {...} (Obect)

NetBanking Payment - Create a payment transaction for NetBanking. The payment_method attribute must be one from the given table below. You will need to redirect the customer depending on the “method” attribute in the response (see the "Handling the Redirection Method" section below).

Required:   Payment Method Details         Returns:   Payment Status Object

Wallet Payment - Create a payment transaction for paying from a prepaid Wallet. The payment_method attribute must be one from the given table below. You will need to redirect the customer depending on the “method” attribute in the response (see the "Handling the Redirection Method" section below).

Required:   Payment Method Details         Returns:   Payment Status Object

Wallet Direct Debit - Directly debit the amount from a Wallet that is linked to a Customer’s account. If the status in the response is CHARGED, then the payment is immediately successful. If the status in the response is PENDING, then the user wallet doesn’t have sufficient balance for the payment and the topup URL is returned in the response.

NOTE: This is an authenticated call unlike other transaction APIs. This API must be invoked from your server directly. DO NOT send the API Key to client.

Required:   Payment Method Details,   direct_wallet_token    (see List Wallets API)
Returns:   Payment Status Object

ATM Seamless PIN Payment - Create a payment transaction for Credit or Debit card with ATM PIN authentication. In seamless mode, card details will be captured at the merchant’s end. ATM PIN payments are currently limited to only a set of cards. Use /cardbins/:card_bin API to check for a card’s eligibility.
Note: This API is obsolete.

Required:   Payment Method Details,  Card Details,   auth_type = ATMPIN
Returns:   Payment Status Object

ATM Redirection Payment - Create a payment transaction for Credit or Debit card with ATM PIN authentication. In redirection mode, user will be taken to the configured aggregator’s page where the card details will be captured. This is currently supported only through Billdesk.
Note: This API is obsolete.

Required:   Payment Method Details,   auth_type = ATMPIN
Returns:   Payment Status Object

UPI Collect Payment - Create a collect transaction for given VPA. In a UPI collect transaction, payment collect request is sent to the UPI app.

Required:   Payment Method Details,   upi_vpa,  txn_type = UPI_COLLECT
Returns:   Payment Status Object

UPI Intent Payment - Create a UPI payment transaction. In UPI Pay transactions, the response of the /txns call can optionally have SDK parameters for generating the intent URI/ QR code, etc. Merchants can then use these parameters appropriately.

Required:   Payment Method Details,   txn_type = UPI_PAY, and sdk_params ('true' to return SDK parameters)
Returns:   Payment Status Objecttxn_uuid, and  payment.sdk_params: {...}  (Obect)

UPI/Bharat Pay Payment - Create a UPI payment transaction. In UPI Pay transactions, the QR code will be generated and shared in the response. Users can scan the QR from their UPI app and complete the payment.
Note: This API is obsolete.

Required:   Payment Method Details,   txn_type = UPI_PAY or BHARAT_PAY
Returns:   Payment Status Object,   which includes  payment.qrcode: {format, size, data}

Consumer Finance Payment - Create a transaction for paying from a consumer finance application. User may select one from three payment methods: EPAYLATER, SEZZLE, or SHOPSE.

Required:   Payment Method Details
Returns:   Payment Status Objecttxn_uuid



Payment Methods API - Gives a list (with details) of all the payment methods available
for your account. Optional Query parameters can be used to list payment methods that support Emandates, Wallet Direct Debits, Gateway Reference IDs, Outages, and Third-Party Validation (TPV).

Required:  merchant_id
Optional:   Query parameters -- see table below
Returns:    Payment Methods array -- see table below
(includes optional arrays for payment methods that support a given type)
    GET     https://api.juspay.in/merchants/:merchant_id/paymentmethods
Field - Type Description
merchant_id * String URL Embedded (Path) Parameter
ID of the merchant_account that you hold with us.
* = Required
There are no Request (Form) parameters for this API.
Optional URL embedded Query parameters can be sent to get a list of payment methods that support the given type.     (click to open table)
options.add_emandate_payment_methodsBoolean
options.check_wallet_direct_debit_supportBoolean
options.add_supported_reference_idsBoolean
options.add_tpv_payment_methodsBoolean
options.add_outageBoolean
A list (array) of Payment Methods is returned, along with optional lists (arrays) for payment methods that support a given type, as selected by the Query Parameters.       (click to view)
If a Query option is selected for listing payment methods with supported Gateway Reference IDs or Direct Wallet Debit support, the result is shown in the payment_methods array, as marked by the extra parameters below.

If a Query option is selected for listing payment methods that support Emandates, Outages, or Third-Party Validation (TPV), the result is listed in a separate array, as shown below.
{

payment_methods: [...],

    Optionally includes extra parameters for payment methods with
    Supported Gateway Reference IDs and payment methods that
    support Direct Wallet Debit (see table below for parameters).

emandate_payment_methods: [...],

outages: [...],

tpv_payment_methods: [...]

}
Each element in a payment_methods array is a Payment Method Object. Same object is used in arrays listing payment methods that support a given type.
FieldTypeDescription
payment_method_typeStringMust be either CARD, NB, WALLET. Or UPI
payment_methodStringThe actual payment method that was selected by
the user.
descriptionStringBank associated with payment method (or card type)
These extra parameters are returned with the Payment Method Object when listing payment methods of certain types:
FieldTypeDescription
wallet_direct_debit_supportwwBooleanOptionally included in the "payment_methods" list. Returns 'true' or 'false' only when "payment_method_type" = "WALLET"
supported_reference_ids: [....]ArrayOptionally included in the "payment_methods" list. Only used for payment methods with supported gateway reference IDs
statusStringOnly used when listing the payment methods with outages
juspay_bank_codeStringOnly used when listing the payment methods with outages