post https://api.juspay.in/txns#CreateWithPayments
NOTE: PCI Compliant merchants
If you are a PCI compliant merchant, you can combine Create Order API request with Payments API request in a single API request. The sample request is shown below:
The response for the Create Order with Payments API is a Payment Status Object , which is the usual response for /txns
APIs. (click to view)
/txns
APIs. (click to view)Parameter | Type | Description |
---|---|---|
order_id | String | Unique Identifier for the order. |
txn_id | String | Transaction ID for the payment attempt. |
status | String | Status of the transaction. See Appendix below for status mapping. PENDING_VBV indicates that the transaction requires authentication to complete. |
payment.authentication.method | String | HTTP Method for authentication. Can be one of GET or POST (See redirection instructions in the "Handling the Redirection Method" section.) |
payment.authentication.url | String | URL to which the user has to be taken to for completing the authentication |
payment.authentication.params | Object | Present only when the method is POST. This a mapping via a list of key:value pairs that must be sent along with the URL for authentication. Do not hardcode the params in your client * Never assume that you will receive param “x” or param “y”. This is completely dynamic and will vary on a case by case basis. |
Status | ID | Meaning |
---|---|---|
NEW | 10 | Newly created order |
PENDING_VBV | 23 | Authentication is in progress |
CHARGED | 21 | Successful transaction |
AUTHENTICATION_FAILED | 26 | User did not complete authentication |
AUTHORIZATION_FAILED | 27 | User completed authentication, but bank refused the transaction |
JUSPAY_DECLINED | 22 | User input is not accepted by the underlying PG |
AUTHORIZING | 28 | Transaction status is pending from bank |
⭣The request consists of Payment Method Details, with optional Card Details (only if a card is used). w w w w w (click to open tables) Each parameter in tables is listed below:
The request consists of Payment Method Details, with optional Card Details (only if a card is used). w w w w w (click to open tables) Each parameter in tables is listed below:
Payment Method Details:
Field | Type | Description | |
---|---|---|---|
order:wwwwwwwwww {param1, param2,..} | * | Object | Parameters pertaining to the order for which the payment is started. |
Parameters for the order
object: (click to open)
Field | Type | Description | |
---|---|---|---|
order_id | * | String | Unique Identifier for the order. |
amount | * | String | Amount that the customer is to pay. Will accept double values with up to two decimal places. |
currency | String | ISO string of the currency. Use INR for Indian Rupee. Among other accepted values are EUR, USD, GBP. Default value: INR | |
customer_id | String | String that uniquely identifies the customer. ID returned when you created customer object. | |
return_url | String | A fully qualified URL such as https://shop.merchant.com/ to which the customer will be redirected after payment completion. No query parameters. This URL has higher precedence over common return URL configured in your account settings. |
merchant_id | * | String | ID of the merchant_account that you hold with us. |
payment_method_type | * | String | Must be either CARD, NB, WALLET, or UPI, depending on the transaction type. |
payment_method | String | The actual payment method that was selected by the user. This must be one from the tables for payment method of the corresponding Payments API. For cards, use one of VISA/MASTERCARD/MAESTRO/AMEX/RUPAY. This is usually inferred from the card number itself and we will take care of this if you are unable to provide this from your end. | |
redirect_after_payment | * | Boolean | This is a boolean variable and accepts true/false. We recommend that you set this to true and use the redirection flow. If set to true, then the user is redirected to the return_url configured for the order. If set to false, then the user will be stopped at the response page from the gateway. Your client should be able to read the page/title to infer that the user has completed the transaction. |
format | * | String | If it is set to json, then the response will be HTTP 200 with a JSON formatted text. Otherwise, the response is HTTP 302 with the Location attribute having the destination URL. |
* = Required
Card Details:
Note:
Card Security Code (CVV) is not required in case of Sodexo saved card transactions.
Field | Type | Description | |
---|---|---|---|
card_token | String | A valid card token obtained using /card/list API. If you send this parameter, then card_number, name_on_card, card_exp_year, and card_exp_month fields are not required. If the token is generated using the /card/tokenize API, card_number, name_on_card, card_exp_year, card_exp_month and card_security_code fields are not required. | |
card_number | * | String | A valid credit/debit card number. Not required if card token is used. |
name_on_card | String | Card holder name. Should contain alphabetical characters only. | |
card_exp_year | * | String | Represent the expiry year of the card as YY (two digits only) |
card_exp_month | * | String | Represent the expiry month of the card as MM (two digits only) |
card_security_code | * | String | CVV of the card. Usually three digits. Not required in case of SODEXO saved card transactions. |
save_to_locker | Boolean | This is a boolean variable and accepts true/false. If set to true, then the card will be saved in locker when the transaction is successful. Else, the card will not be saved. |
* = Condtionally required if
For credit/debit card payments, the given card parameters or a token for a stored card are to be used. User also has the option of performing an EMI transaction on the given card. Additional parameters for EMI transactions are listed here:
card_token
is not used.For credit/debit card payments, the given card parameters or a token for a stored card are to be used. User also has the option of performing an EMI transaction on the given card. Additional parameters for EMI transactions are listed here:
EMI Parameters: (click to open table)
Field | Type | Description | |
---|---|---|---|
is_emi | Boolean | Default is false. Set it to true if the user wishes to perform an EMI transaction on the given card. | |
emi_bank | String | Represents the bank that issued the card. Value must be one of the entries mentioned under EMI Bank in the support matrix below. | |
emi_tenure | int32 | The tenure of the EMI in number of months. | |
auth_type | String | THREE_DS/OTP/VISA_CHECKOUT | |
emi_type | String | The type of EMI ie STANDARD_EMI or NO_COST_EMI |
The following table lists valid combinations for
emi_bank
and emi_tenure
, although you need to check if the bank has approved all the tenures for your gateway account. JusPay does not validate this for you.Valid emi_bank and emi_tenure combinations.
EMI Bank | EMI Tenure | Supported Gateways |
---|---|---|
HDFC | 3,6,9,12,18,24 | PAYU, HDFC, RAZORPAY, BILLDESK |
CITI | 3,6,9,12,18,24 | PAYU |
ICICI | 3,6,9,12,18,24 | PAYU, ICICI, CCAVENUE, RAZORPAY,BILLDESK |
SBI | 3,6,9,12 | PAYU, CCAVENUE, BILLDESK |
AXIS | 3,6,9,12 | PAYU, ICICI, CCAVENUE, RAZORPAY, BILLDESK |
SCB | 3,6,9,12,18,24 | ICICI, PAYU,BILLDESK |
KOTAK | 3,6,9,12 | ICICI, CCAVENUE, PAYU, RAZORPAY, BILLDESK |
HSBC | 3,6,9,12 | ICICI, CCAVENUE, PAYU, BILLDESK |
AMEX | 3,6,9,12 | PAYU, CCAVENUE, RAZORPAY |
INDUSIND | 3,6,9,12,18,24 | PAYU, CCAVENUE, RAZORPAY |
RBL | 3,6,9,12,18,24 | RAZORPAY, PAYU,BILLDESK |
YES | 3,6,9,12,18,24 | PAYU, BILLDESK |
ICICIDC | 3,6,9,12 | PAYU |
AXISDC | 3,6,9,12 | PAYU |
HDFCDC | 3,6,9,12,18 | PAYU, BILLDESK |
BOB | 3,6,9,12,18 | PAYU,RAZORPAY |
BAJAJFINSERV | 3,6,9,12 | PAYU |
Note:
Please make sure that the respective EMI bank and tenure are enabled for your account at the gateway end, else the transaction might fail.
Please find the eligibility amount range below for some of the EMI options as provided by PayUEMI Option | Amount Range |
---|---|
HDFC Debit Card EMI | 5,00,000>=Txn amount>=5,000 |
Bajaj Finserv EMI | Transaction amount>=4,499 |
Zest Money EMI | 3,00,000>=Transaction amount>=1,000 |
Axis Debit Card EMI | 1,00,000>=Transaction amount>=5,000 |
curl --location --request POST 'https://api.juspay.in/txns' \
--header 'Authorization: Basic Auth of <your-api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'order.order_id=ord_1590759422' \
--data-urlencode 'order.amount=101550.00' \
--data-urlencode 'order.currency=INR' \
--data-urlencode 'order.customer_id=cst_1590759422' \
--data-urlencode 'order.return_url=https://merchant.in/payments' \
--data-urlencode 'merchant_id=<your-merchant-id>' \
--data-urlencode 'payment_method_type=CARD' \
--data-urlencode 'payment_method=VISA' \
--data-urlencode 'card_number=438628***8677' \
--data-urlencode 'card_exp_month=09' \
--data-urlencode 'card_exp_year=25' \
--data-urlencode 'name_on_card=***' \
--data-urlencode 'card_security_code=***' \
--data-urlencode 'save_to_locker=true' \
--data-urlencode 'redirect_after_payment=true' \
--data-urlencode 'format=json'