Create Order API
This is a server-to-server API that creates an order in the Juspay system and retrieves the client_auth_token.
Amount and order id are the mandatory fields, the contact details like email, phone number, customer id's are conditional and depends on the underlying payment gateway/ aggregator used.
'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.
Note: Auth api key should be Base64 encoded.
Mandatory Fields:
Amount and Order ID are required.
Contact details (e.g., email, phone number) are conditional, depending on the payment gateway used.
UDF (User-Defined Fields):
Juspay supports 10 UDFs (UDF1 to UDF10) for storing custom information.
Special characters can be passed using UDF6 to UDF10.
UDF values are included in order status responses and webhooks.
Metadata:
Use to send custom parameters to payment aggregators, beyond the default.
Payment Links:
The response includes web, mobile, and iFrame payment links. If you wish to use your own branding, then you can embed the iframe link into your page.
These can be shared directly with customers but expire based on order validity (modifiable via the dashboard
).
Note: API keys must be Base64-encoded for authentication.
Ensure your system never sends the same order_id twice.
Explicitly set currency in the ISO(4217) 3-digit format.
Send amount as a String ("10.00") to prevent floating point issues.
Always pass options.get_client_auth_token: "true" if you are using the Android/iOS SDK, as this generates the token needed to initialize the UI.
If the customer is created, pass the customer_id in the order.
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
Pass the date in YYYY-MM-DD format
Example:-
2023-01-01
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.
Example:-
1.00
Client side authenticaion token required for Hyper SDK calls
Example:- Value : true
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
Highly recommended to provide whenever available, as many payment gateways rely on it for risk assessment, authentication flows, and customer communication.
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:-
99999999
ISO string of the currency. Use BRL for Brazilian Real. Among other accepted values are EUR, USD, GBP, SGD, IDR etc. Default value: INR
Short description for the order. We send this information to the backend gateways whenever there is a provision for this.
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
An identifier for the product. Fits well for impulse purchase usecases.
Example:-
John
Specify your preferred gateway for this order.
Example:-
Wick
First name in the billing address
Last name in the billing address
Line1 in the billing address
Line2 in the billing address
Line3 in the billing address
Billing address city
Billing address state
Billing address country
Billing address postal code or zip code
Mobile or phone number in the billing address
ISO Country code Default value: IND
First name in the shipping address
Last name in the shipping address
Line1 in the shipping address
Line2 in the shipping address
Line3 in the shipping address
Shipping address city
Shipping address state
Shipping address country
Shipping address postal code or zip code
Mobile or phone number in the shipping address
ISO Country code Default value: IND
Use this parameter only when you have use case of gateway reference ID. For detailed information check here.
The amount for which the EMI interest should not be calculated.
Merchant can pass dynamic webhook URL in this field. The webhook authentication would be same as the one configured on the dashboard. Ex: metadata.webhook_url=https://merchant.juspay/response
The default is set to true. Pass false to for pre-auth orders.
Set it to true if you need to mandate the 3DS challenge for a new card.
Expiry Time in Minutes post which the payment link will expire
User Defined Parameter (UDF)
This field can be used to send any user defined parameters
The UDF parameters for orders can be seen in the JUSPAY dashboard under each order
Example:-
user5349
User Defined Parameter (UDF)
This field can be used to send any user defined parameters
The UDF parameters for orders can be seen in the JUSPAY dashboard under each order
Example:-
user_5349
Status of order
Example:- NEW
Status ID is a numeric id corresponding to the status value.
Unique ID generated by Juspay for the given order
Order Id passed during order creation
Https link using which user can open payment page and perform transaction against the order created
Bad Request
Details of keys missing
Example:-
Mandatory fields are missing
Further Details of keys missing
Have questions?
- Need help? Contact support
- LLM? Read llms.txt

