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 dashboardlink icon).

Note: API keys must be Base64-encoded for authentication.

Note
  1. Ensure your system never sends the same order_id twice.

  2. Explicitly set currency in the ISO(4217) 3-digit format.

  3. Send amount as a String ("10.00") to prevent floating point issues.

  4. 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.

  5. If the customer is created, pass the customer_id in the order.

API Endpoints
Sandbox Link
POST
https://api.sandbox.juspay.io/orders
Production Link
POST
https://api.juspay.io/orders
Authorization Header
Headers
Body
200 : Success
400 : Invalid Input data
Last updated 3 months ago