Hey! These docs are for version 3.2, which is no longer officially supported. Click here for the latest version, 1.0!

Create Order

Creates an order that is a representation of your shopping cart. The order contains important information like amount, customer details, shipping address, billing address, etc. Only after an  order is created, payment can be started.

Notes on Subvention Amount and 'UDF' parameters:
(click to view)
Note:
Subvention Amount: The amount for which the EMI interest should not be calculated. For example - if the Order amount is 100, the subvention amount is 10, interest will be calculated for 100-10 = 90.

Subvention amount can be from 0 to 100. If subvention amount = order amount then its no-cost EMI.

The mechanism of running offers or subvC9C9C9">ention amount is the responsibility of merchants in collaboration with PG/Banks.
'UDF' is used to pass any additional information that is required to be stored at Juspay for any analysis or other operations. In some cases, these UDFs are passed to the downstream gateways as well. Juspay supports 10 UDFs (UDF1 to UDF10). The values passed in UDFs are reflected back in the order status response and in webhooks back to the merchant. If there are any special characters that need to be passed in UDF values, please use UDF 6 to 10 for passing the same. UDF 1 to 5 can be used to pass values which do not have any special characters.
'Metadata’ is used to send custom parameters to the payment aggregators, irrespective of default parameters, The supported parameters are:         (click to open table)
NOTE:
Check table below for additional request parameters that may be required depending on the payment gateway or aggregator used on the backend.
Payment GatewaysFields
metadata.{{payment_gateway:field}}
CCAVENUE_V2metadata.CCAVENUE_V2:promo_code------------
BILLDESKmetadata.BILLDESK:AdditionalInfo3
BILLDESKmetadata.BILLDESK:AdditionalInfo4
FREECHARGEmetadata.FREECHARGE:campaignCode
HSBC_UPImetadata.HSBC_UPI:addInfo
MIGSmetadata.MIGS:vpc_AddendumData
MIGSmetadata.MIGS:vpc_OrderInfo
OLAMONEYmetadata.OLAMONEY:couponCode
PAYTMmetadata.PAYTM:PROMO_CAMP_ID
PAYTMmetadata.PAYTM:CUST_ID
PAYTMmetadata.PAYTM:MERC_UNQ_REF
PAYUmetadata.PAYU:offer_key
PAYUmetadata.PAYU:udf1
PAYUmetadata.PAYU:udf2
PAYUmetadata.PAYU:udf3
PAYUmetadata.PAYU:udf4
PAYUmetadata.PAYU:udf5
PHONEPEmetadata.PHONEPE:merchantContext
RAZORPAYmetadata.RAZORPAY:notes[cust_id]
RAZORPAYmetadata.RAZORPAY:notes[cust_name]
RAZORPAYmetadata.RAZORPAY:offer_id
Subvention Amountmetadata.subvention_amount
TPSLmetadata.TPSL:shoppingCartDetails
TPSLmetadata.TPSL:accountNo
ZAAKPAYmetadata.ZAAKPAY:productDescription
ZAAKPAYmetadata.ZAAKPAY:product1Description
PAYPALmetadata.PAYPAL:landing_page
PAYPALmetadata.PAYPAL:phone_number
PAYPALmetadata.PAYPAL:country_code
PAYPALmetadata.PAYPAL:first_name
PAYPALmetadata.PAYPAL:last_name
PAYPALmetadata.PAYPAL:experience_id
PAYPALmetadata.PAYPAL:brand_name
PAYPALmetadata.PAYPAL:additional_data
PAYPAL - For Link and Paymetadata.PAYPAL:lnp_product_name
PAYPAL - For Link and Paymetadata.PAYPAL:lnp_product_code
PAYPAL - For Link and Paymetadata.PAYPAL:lnp_charge_pattern
PAYPAL - For Link and Paymetadata.PAYPAL:direct_wallet_version
PAYPAL - For Link and Paymetadata.PAYPAL:purchase_category
AMAZONPAYmetadata.AMAZONPAY:sellerNote
To use multiple MID setup, please pass the  gateway_reference Id as per the following format:       (click to view)
Assume you have three line of businesses BUS, TRAIN and FLIGHT and using RAZORPAY and PAYU gateways.

  For BUS LOB pass the following in order create request.

Payment GatewaysFieldsValue
PAYUmetadata.PAYU:gateway_reference_id"BUS"
RAZORPAYmetadata.RAZORPAY:gateway_reference_id"BUS"

  For TRAIN LOB pass the following in order create request.

Payment GatewaysFieldsValue
PAYUmetadata.PAYU:gateway_reference_id"TRAIN"
RAZORPAYmetadata.RAZORPAY:gateway_reference_id"TRAIN"

  For FLIGHT LOB pass the following in order create request.

Payment GatewaysFieldsValue
PAYUmetadata.PAYU:gateway_reference_id"FLIGHT"
RAZORPAYmetadata.RAZORPAY:gateway_reference_id"FLIGHT"
Status, Redirect Info (response) parameters for the Create Order API are listed here:       (click to open table)
FieldTypeDescription
idStringUnique ID generated by JusPay for the given order.
order_idStringGiven order ID.
statusStringStatus of the order. If you receive “CREATED”, then the order is successfully created (see Appendix below for status mapping). If you invoke this API with an order_id which is already created, then this API will return the result of /order/status API.
status_idStringStatus ID is a numeric id corresponding to the status value. See Appendix below for code meaning.
payment_links.webStringLink to checkout page that is optimized for Desktop for the given order.
payment_links.mobileStringLink to Mobile optimized checkout page for the given order.
payment_links.iframeStringLink to iFrame checkout screen. This is typically embedded inside of your own page.
Payment Links
Order create response now has payment links for web, mobile & iFrame. These links can directly be emailed or messaged to your customers. They will be redirected using a link to enter payment information. If you wish to use your own branding, then you can embed the iframe link into your page. Note that, these links are not valid perpetually. As soon as your order expires (this can be changed via our dashboard), the link will cease to work.
        APPENDIX   Order status codes and meaning
Order StatusIDMeaning
CREATED1This order status code in used only for the Create Order API, and is returned when order is successfully created.
NEW10Newly created order.
PENDING_VBV23Authentication is in progress. The customer has to approve the mandate through the PSP App of their choice.
CHARGED21Successful transaction. The subscription cost of the period has been charged.
AUTHENTICATION_FAILED26User did not complete authentication.
AUTHORIZATION_FAILED27User completed authentication, but the bank refused the transaction.
JUSPAY_DECLINED22User input is not accepted by the underlying PG.
AUTHORIZING28Transaction status is pending from bank.
Order Details  - The request consists of the following Parameter Groups and Objects:      (click to open tables)
Each parameter in tables is listed below:
NOTE:
Check table below for additional request parameters that may be required depending on the payment gateway or aggregator used on the backend.
       Parameter Groups:
  Order Info Parameters:
FieldTypeDescription
order_id*StringUnique Identifier for the order. You can pass your native order ID here. it is suggested to keep the order id length as a maximum of 21 characters.
amount*StringAmount that the customer has to pay. Will accept double values with upto two decimal places. For example, 100.15 is valid, but 100.1532 is not valid.
order_typeStringSet to “TPV_PAYMENT” if using Third-Party Validation.
currencyStringISO string of the currency. Use INR for Indian Rupee. Among other accepted values are EUR, USD, GBP. Default value: INR
customer_idStringUnique ID for a customer that you get after running the Create Customer API (Check Customer section for more details)
customer_emailStringEmail address of the customer.
This field is mandatory if gateway requires it.
customer_phoneStringMobile number or fixed line number of the customer.
This field is mandatory if gateway requires it.
descriptionStringShort description for the order. We send this information to the gateways whenever there is a provision for this.
product_idStringAn identifier for the product. Fits well for impulse purchase usecases.
gateway_idStringSpecify your preferred gateway for this order. Complete mapping for “gateway_id” can be found here: Gateway mapping
return_urlStringA fully qualified URL such as http://shop.merchant.com/ to which the customer will be redirected after payment completion. This URL shouldn’t contain any query parameters. This URL takes higher precedence over the common return URL configured in your account settings.
* = Required
  Billing/Shipping Adress Parameters:
FieldTypeDescription
billing_address_first_nameStringFirst name in the billing address
billing_address_last_nameStringLast name in the billing address
billing_address_line1StringLine1 in the billing address
billing_address_line2StringLine2 in the billing address
billing_address_line3StringLine3 in the billing address
billing_address_cityStringBilling address city
billing_address_stateStringBilling address state
billing_address_countryStringBilling address country
billing_address_postal_codeStringBilling address postal code or zip code
billing_address_phoneStringMobile or phone number in the billing address
billing_address_country_code_iso---StringISO Country code
(Default value: IND)
shipping_address_first_nameStringFirst name in the shipping address
shipping_address_last_nameStringLast name in the shipping address
shipping_address_line1StringLine1 in the shipping address
shipping_address_line2StringLine2 in the shipping address
shipping_address_line3StringLine3 in the shipping address
shipping_address_cityStringShipping address city
shipping_address_stateStringShipping address state
shipping_address_countryStringShipping address country
shipping_address_postal_codeStringshipping address postal code or zip code
shipping_address_phoneStringMobile or phone number in the shipping address
shipping_address_country_code_isoStringISO Country code
(Default value: IND)
  UDF Parameters:
udf1 to udf10 - Optional user defined fields which will be echoed back in the response from Juspay with a Max character limit of 255. These fields may be used to pass any additional information that is required to be stored at Juspay for any analysis or other operations. In some cases, these UDFs are passed to the downstream gateways as well.
FieldTypeDescription
udf1StringUser Defined Field
udf2String
udf3String
udf4String
udf5String
udf6String
udf7String
udf8String
udf9String
udf10String
    Objects:
  Metadata Parameters:
FieldTypeDescription
subvention_amountStringThe amount for which the EMI interest should not be calculated.
{{payment_gateway:field}}StringCustomized parameter for payment gateway/aggregator/field. Insert in {{payment_gateway:field}} from the 'Metadata' table above. This is irrespective of default parameters.
bank_account_details:
   [(...),(....),(...),..]
ArrayThis is an array of Bank Accounts JSON objects that provides details of each bank account of a given customer.   (See table)
(Used only for TPV payments)
    Bank Accounts Object:
FieldTypeDescription
bank_account_number*StringCustomer's bank account number
bank_ifscStringIFSC code for the bank branch
juspay_bank_codeStringJuspay bank code given from Eligibility API.     e.g. JP_HDFC
bank_beneficiary_nameStringName of account holder
bank_account_id*StringBank account id provided by Juspay while storing bank account details
* =
Conditional - either bank_account_number or bank_account_id is mandatory.
  Options Parameter:
FieldTypeDescription
get_client_auth_tokenStringClient side authenticaion token. This is required to obtain the client_auth_token, which is used for SDK integration and Hyper SDK calls
Other Parameters sent by API, but not included in an Object or
Parameter Group:
FieldTypeDescription
versionStringPass the version as 2018-10-25
Note: Different payment gateways & aggregators have a varying set of parameters that are mandatory. Please ensure that the mandatory parameters are sent for your backend gateway.
(click to view & move left to right)
ParameterHDFCICICIAxisPayUCitrusPayTMEBSRazorPayCCAvenue
order_idYesYesYesYesYesYesYesYesYes
amountYesYesYesYesYesYesYesYesYes
customer_idYesYesYesYesYesYesYesYesYes
customer_emailYesYesYesYesYesYesYesYesYes
customer_phoneOptionalOptionalOptionalYesYesYesYesYesYes
descriptionOptionalOptionalYesYesYesYesYesYesYes
product_idNoNoNoNoNoNoNoNoNo
billing_address_first_nameNoNoNoOptionalOptionalNoYesNoYes
billing_address_last_nameNoNoNoOptionalOptionalNoYesNoYes
billing_address_line1NoNoNoOptionalOptionalNoYesNoYes
billing_address_line2NoNoNoOptionalOptionalNoYesNoYes
billing_address_line3NoNoNoOptionalOptionalNoYesNoYes
billing_address_cityNoNoNoOptionalOptionalNoYesNoYes
billing_address_stateNoNoNoOptionalOptionalNoYesNoYes
billing_address_countryNoNoNoOptionalOptionalNoYesNoYes
billing_address_postal_codeNoNoNoOptionalOptionalNoYesNoYes
billing_address_phoneNoNoNoOptionalOptionalNoYesNoYes
billing_address_country_code_isoNoNoNoOptionalOptionalNoYesNoYes
shipping_address_first_nameNoNoNoOptionalOptionalNoYesNoYes
shipping_address_last_nameNoNoNoOptionalOptionalNoYesNoYes
shipping_address_line1NoNoNoOptionalOptionalNoYesNoYes
shipping_address_line2NoNoNoOptionalOptionalNoYesNoYes
shipping_address_line3NoNoNoOptionalOptionalNoYesNoYes
shipping_address_cityNoNoNoOptionalOptionalNoYesNoYes
shipping_address_stateNoNoNoOptionalOptionalNoYesNoYes
shipping_address_countryNoNoNoOptionalOptionalNoYesNoYes
shipping_address_postal_codeNoNoNoOptionalOptionalNoYesNoYes
shipping_address_phoneNoNoNoOptionalOptionalNoYesNoYes
shipping_address_country_code_isoNoNoNoOptionalOptionalNoYesNoYes
Language
Authentication
Basic
base64
:
Click Try It! to start a request and see the response here!