Order creation

Creating your first Order

Order is cornerstone for conducting payments with Juspay. Order to Juspay is akin to what a shopping cart to a merchant is. Order encapsulates all the information that is required for a payment. All the payments, refunds, etc. are associated to an Order and it becomes the root reference.

Keeping in mind the fundamentals of distributed systems, we have let you choose your order_id when you create the order. This way, you can check the status of your order through our API whenever you want.

To know how to create the order, please refer to our API documentation

Nonetheless, please find the below snippet to quickly create an order. Note that you have to substitute the correct API Key.

curl -k https://api.juspay.in/order/create \
    -u your_api_key: \
    -d "amount=10.00" \
    -d "order_id=ord_007" \
    -d "customer_id=guest_user_101" \
    -d "customer_email=customer@gmail.com" \
    -d "customer_phone=919988665522" \
    -d "product_id=:pid" \
    -d "description=Order Info"

Mandatory Parameters

Different payment gateways & aggregators have varying set of parameters that are mandatory. Depending on your backend gateway please ensure that the mandatory parameters are sent to avoid any failures.

Parameter HDFC ICICI Axis PayU Citrus PayTM EBS RazorPay CCAvenue
order_id Yes Yes Yes Yes Yes Yes Yes Yes Yes
amount Yes Yes Yes Yes Yes Yes Yes Yes Yes
customer_id Yes Yes Yes Yes Yes Yes Yes Yes Yes
customer_email Yes Yes Yes Yes Yes Yes Yes Yes Yes
customer_phone Optional Optional Optional Yes Yes Yes Yes Yes Yes
description Optional Optional Yes Yes Yes Yes Yes Yes Yes
product_id No No No No No No No No No
billing_address_first_name No No No Optional Optional No Yes No Yes
billing_address_last_name No No No Optional Optional No Yes No Yes
billing_address_line1 No No No Optional Optional No Yes No Yes
billing_address_line2 No No No Optional Optional No Yes No Yes
billing_address_line3 No No No Optional Optional No Yes No Yes
billing_address_city No No No Optional Optional No Yes No Yes
billing_address_state No No No Optional Optional No Yes No Yes
billing_address_country No No No Optional Optional No Yes No Yes
billing_address_postal_code No No No Optional Optional No Yes No Yes
billing_address_phone No No No Optional Optional No Yes No Yes
billing_address_country_code_iso No No No Optional Optional No Yes No Yes
shipping_address_first_name No No No Optional Optional No Yes No Yes
shipping_address_last_name No No No Optional Optional No Yes No Yes
shipping_address_line1 No No No Optional Optional No Yes No Yes
shipping_address_line2 No No No Optional Optional No Yes No Yes
shipping_address_line3 No No No Optional Optional No Yes No Yes
shipping_address_city No No No Optional Optional No Yes No Yes
shipping_address_state No No No Optional Optional No Yes No Yes
shipping_address_country No No No Optional Optional No Yes No Yes
shipping_address_postal_code No No No Optional Optional No Yes No Yes
shipping_address_phone No No No Optional Optional No Yes No Yes
shipping_address_country_code_iso No No No Optional Optional No Yes No Yes

To understand what each of these parameters are, please refer to our API documentation