Create Order with Transaction
This API creates an order and initiates the transaction consecutively. Both order creation parameters and payment details must be passed in this API. Parameters need to included in format order.<parameter_name>.
For example, order.metadata.JUSPAY:gateway_reference_id
Consists of two parts.
Username: API Key obtained from Juspay dashboard
Password: Empty string
Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
Merchant ID provided by Juspay
Example:-
merchant-id
application/x-www-form-urlencoded
Unique Identifier for the order. Should be Alphanumeric with character length less than 21.
Example:-
order-id-9876580
Amount that the customer has to pay. Will accept stringified double or integer values with upto two decimal places. For example, "100.15" and "100" are valid input but "100.1532" is not valid.
It is the ID with which merchant refers to a customer object. This id is used to access the stored payment methods, allow EMI transactions and setup subscriptions.
In case of guest login it should be an empty string.
Example:-
customer-id-007
Email address of the customer. If the backend gateway requires it, then you must send this value.
Example:-
test@gmail.com
Mobile number or fixed line number of the customer. If the backend gateway requires it, then you must send this value.
Example:-
9999999912
ISO string of the currency. Accepted values are BRL, EUR, USD, GBP,HKD. Default value: INR
A fully qualified URL which the customer will be redirected after payment completion. It is also required to provide the control back to SDK after the completion of transaction. This URL shouldn't contain any query parameters or Ip address. This URL takes higher precedence over the common return URL configured in your account settings.
Example:-
https://shop.merchant.com
ID of the merchant_account that you hold with us.
Depending on type of payment to be processed.
Example:-
CARD
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.
A valid card token obtained using /card/list API. If you send this parameter, then card_number, name_on_card, card_exp_year, 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.
A valid credit/debit card number
Card holder name. Should contain alphabetical characters only.
Represent the expiry year of the card as YY (two digits only)
Represent the expiry month of the card as MM (two digits only)
CVV of the card. Usually three digits. Optional for all VISA saved cards, SODEXO saved cards, and saved cards of select issuing banks of MASTERCARD
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. Only applicable for international cards.
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.
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.
Type of the transaction, please pass the following details
1. AUTHENTICATION => To perform authentication only
2. AUTHORIZATION => To perform authorization only
3. CAPTURE => To Perform Standalone capture
4. AUTHN_AUTHZ => To Perform Authentication and Authorization
5. AUTHZ_CAPTURE => To Perform Authorization and capture
Authentication params to be passed to perform the only authorization i.e. for order.txn_type = AUTHORIZATION | AUTHZ_CAPTURE
{
"eci": "",
"cavv": "",
"threeDSVersion": "",
"threeDSTransStatusReason": "",
"threeDSServerTransID": "",
"threeDSTransStatus": "",
"cavvAlgorithm": "",
"threeDSTransId": ""
}
Autorization param to be passed to perform capture i.e. order.txn_type = CAPTURE
{
"authIdCode": "",
"acquirerBin": "",
"acquirerMid": "",
"mcc": "",
"merchantName": ""
}
auth_type refers to authorization type of the transaction
NO_THREE_DS => for non 3DS transaction
THREE_DS => for 3DS transaction
Set it to true if you want no Two Factor Authentication(2FA) where transaction gets successful once it is initiated.
Set it to true if you need to mandate the 3DS challenge for a new card.
order_id
PENDING_VBV
txn_uuid
Offer ID’s passed in transaction
error
invalid_card_number
invalid_request
Have questions?
- Need help? Contact support
- LLM? Read llms.txt

