---
page_title: Create Order
product: API Reference
page_source: https://juspay.io/in/docs/api-reference/docs/cred-pay/create-order
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fapi-reference%2Fdocs%2Fcred-pay%2Fcreate-order
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/api-reference/llms.txt
---

## API Version: default


# Create Order API



Create 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.## Endpoints:
- Sandbox: https://sandbox.juspay.in/orders

- Production: https://api.juspay.in/orders

## Request Type: 
POST

## Content-Type: 
application/json

## Authorization:

#### Basic Auth:
Consists of two parts.

* Username: API Key obtained from Juspay dashboard
* Password: Empty string

Example:-MUQ2QUZEQzhFQTY0OUU5QTIxQzNFNTQwNkFDMEZCOg==
- Value: MUQ2QUZEQzhFQTY0OUU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: Base64 Encoded Username-Password, Mandatory
## Headers:

#### Content-Type:
application/x-www-form-urlencoded
- Tags: String, Mandatory

#### x-routing-id:
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.

> **Warning**
> This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.


- Value: customer_1122
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location --request POST 'https://api.juspay.in/orders' \
--header 'Authorization: Basic <API_KEY>' \
--header 'x-routing-id: customer_1122'\
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'order_id=Test1608304994' \
--data-urlencode 'amount=100'
--data-urlencode 'metadata.CRED:offers_applied:false'

```

### Sample Response:

#### Response:
```json
{
      "status": "CREATED",
      "status_id": 1,
      "id": "ordeh_963ad7719c6edcb",
      "order_id": "Test1608301033",
      "payment_links": {
          "iframe":
          "https://api.juspay.in/merchant/ipay/ordeh_963ad7719c6edcb",
          "web":
          "https://api.juspay.in/merchant/pay/ordeh_963ad7719c6edcb",
          "mobile":
          "https://api.juspay.in/merchant/pay/ordeh_963ad7719c6edcb?mobile=true"
      }
  }
```

## Body Parameters:
### Basic Parameters:

#### order_id:
- Description: Unique Identifier for the order. Should be Alphanumeric with character length less than 18.
- Value: value
- Tags: String, Mandatory

#### amount:
- Description: 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.
- Tags: Double, Mandatory

#### offers_applied:
- Description: In order to avoid the discount being offered twice in the user payment journey, this field has been introduced. 

At the time of Order Creation at Juspay server merchant should pass field offers_applied = true/false based on whether the user has applied an offer on the merchant payment page or not.
- Tags: String
## API Responses:
### 200:

#### status:
- Description: Status of order
- Tags: String

#### status_id:
- Description: Status ID is a numeric id corresponding to the status value.
- Tags: Integer

#### id:
- Description: Unique ID generated by Juspay for the given order
- Tags: String

#### order_id:
- Description: Order Id passed during order creation
- Tags: String

#### payment_links:
- Description: Https link using which user can open payment page and perform transaction against the order created
- Value:
  - **Web**:
    - Tags: String
  - **Mobile**:
    - Tags: String
  - **Iframe**:
    - Tags: String
- Tags: JSON
### 400:

#### status:
- Description: Bad Request
- Tags: String

#### error_code:
- Description: Details of keys missing

Example:-Mandatory fields are missing


- Tags: String

#### error_message:
- Description: Further Details of keys missing
- Tags: String


---

## See Also

- [Check Eligibility API](https://juspay.io/in/docs/api-reference/docs/cred-pay/check-eligibility-api)
- [Txns API](https://juspay.io/in/docs/api-reference/docs/cred-pay/txns-api)
