---
page_source: https://juspay.io/in/docs/part-payments/docs/integration/create-order-part-payment
page_title: Create Order (Part Payment)
---

## API Version: default


# Create Order



You can pass the payload in the order creation API or in the session API call.

> **Note**
> 1. `part_number` key have to be sequential in case of fixed plan
> 2. `no_of_parts` should total to the total number of parts in the fixed plan
> 3. `plan_due_date` of the selected plan by user will be considered as order expiry
> 4. `plan_id` must be unique for each plan
> 5. `maximum_no_of_parts` and `minimum_part_amount` are mandatory parameters in case of EDITABLE plans.
> 6. key `status` inside part_payment takes `OPTIONAL/REQUIRED` as value. Selected OPTIONAL means users will see part payment as one of the option to make payment.
> 7. `due_date` and `plan_due_date` have to be EPOCH time for part payment details

## Endpoints:
- Sandbox: https://sandbox.juspay.in/session

## Request Type: 
POST

## Content-Type: 
application/json

## Authorization:

#### Basic Auth:
- Value: Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: Base64 Encoded Username:Password, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location 'https://sandbox.juspay.in/session' \
--header 'version: 2025-06-01' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic OTNBQTlFNzdCMzA0NzxxxxxxxxxVBOEE4NjMwMDcxOg==' \
--data-raw '{
    "order_id": "1749208003",
    "first_name": "John",
    "last_name": "Wick",
    "customer_phone": "96523xxx86",
    "email_address": "test007@gmail.com",
    "customer_id": "sftrj5ty4tg4gtfsd4",
    "payment_page_client_id": "your_clientID",
    "service": "in.juspay.hyperpay",
    "merchant_id": "your_merchantID",
    "amount": "20000.00",
    "currency": "INR",
    "description": "test",
    "return_url": "https://sandbox.juspay.in/end",
    "metadata.JUSPAY:gateway_reference_id": "testmode",
    "payment_rules": {
        "payment_flows": {
            "part_payment": {
                "status": "OPTIONAL",
                "info": {
                    "plan_info": [
                        {
                            "plan_type": "FIXED",
                            "plan_type_title": "",
                            "plan_type_description": "",
                            "fixed_plan_details": [
                                {
                                    "plan_id": "123",
                                    "no_of_parts": 2,
                                    "parts_info": [
                                        {
                                            "amount": "10000",
                                            "due_date": "1749285664",
                                            "part_description": "",
                                            "part_number": 1
                                        },
                                        {
                                            "amount": "10000",
                                            "description": "",
                                            "due_date": "1749372064",
                                            "part_number": 2
                                        }
                                    ],
                                    "plan_due_date": "1749372064"
                                },
                                {
                                    "plan_id": "1234",
                                    "no_of_parts": 2,
                                    "parts_info": [
                                        {
                                            "amount": "5000",
                                            "due_date": "1749285664",
                                            "description": "",
                                            "part_number": 1
                                        },
                                        {
                                            "amount": "15000",
                                            "description": "",
                                            "due_date": "1749372064",
                                            "part_number": 2
                                        }
                                    ],
                                    "plan_due_date": "1749372064"
                                }
                            ]
                        },
                        {
                            "plan_type": "EDITABLE",
                            "editable_plan_details": [
                                {
                                    "minimum_part_amount": "1000",
                                    "plan_due_date": "1749372064",
                                    "maximum_no_of_parts": 5,
                                    "plan_title": "",
                                    "plan_description": "",
                                    "plan_id": "123454"
                                }
                            ],
                            "plan_type_description": "",
                            "fixed_plan_details": null,
                            "plan_type_title": ""
                        }
                    ]
                }
            }
        }
    }
}'
```

### Sample Response:

#### Response:
```plaintext
{
    "status": "NEW",
    "id": "ordeh_0bf87dee38ff444d82f37a225a9d2638",
    "order_id": "1749026515",
    "payment_links": {
        "web": "https://sandbox.assets.juspay.in/payment-page/order/ordeh_0bf87dee38ff444d82f37a225a9d2638",
        "expiry": "2025-06-11T08:41:55Z"
    },
    "sdk_payload": {
        "requestId": "ee2cca9e5bd1414885bf3ac4e8870c14",
        "service": "in.juspay.hyperpay",
        "payload": {
            "metadata.JUSPAY:gatewayReferenceId": "testmode",
            "firstName": "John",
            "clientId": "dharnesh2",
            "paymentRules": {
                "payment_flows": {
                    "part_payment": {
                        "status": "OPTIONAL",
                        "info": {
                            "plan_info": [
                                {
                                    "plan_type": "FIXED",
                                    "plan_type_description": "",
                                    "fixed_plan_details": [
                                        {
                                            "plan_due_date": "1749372064",
                                            "parts_info": [
                                                {
                                                    "part_description": "",
                                                    "part_number": 1,
                                                    "amount": "10000",
                                                    "due_date": "1749285664"
                                                },
                                                {
                                                    "part_number": 2,
                                                    "description": "",
                                                    "amount": "10000",
                                                    "due_date": "1749372064"
                                                }
                                            ],
                                            "no_of_parts": 2,
                                            "plan_id": "123"
                                        },
                                        {
                                            "plan_due_date": "1749372064",
                                            "parts_info": [
                                                {
                                                    "part_number": 1,
                                                    "description": "",
                                                    "amount": "5000",
                                                    "due_date": "1749285664"
                                                },
                                                {
                                                    "part_number": 2,
                                                    "description": "",
                                                    "amount": "15000",
                                                    "due_date": "1749372064"
                                                }
                                            ],
                                            "no_of_parts": 2,
                                            "plan_id": "1234"
                                        }
                                    ],
                                    "plan_type_title": ""
                                },
                                {
                                    "plan_type": "EDITABLE",
                                    "editable_plan_details": [
                                        {
                                            "minimum_part_amount": "1000",
                                            "plan_due_date": "1749372064",
                                            "maximum_no_of_parts": 5,
                                            "plan_title": "",
                                            "plan_description": "",
                                            "plan_id": "123454"
                                        }
                                    ],
                                    "plan_type_description": "",
                                    "fixed_plan_details": null,
                                    "plan_type_title": ""
                                }
                            ]
                        }
                    }
                }
            },
            "customerId": "sftrj5ty4tg4gtfsd4",
            "orderId": "1749026515",
            "returnUrl": "https://sandbox.juspay.in/end",
            "currency": "INR",
            "customerPhone": "9652xxx486",
            "service": "in.juspay.hyperpay",
            "emailAddress": "test007@gmail.com",
            "description": "test",
            "environment": "sandbox",
            "lastName": "Wick",
            "merchantId": "your_merchantID",
            "amount": "20000.0",
            "clientAuthTokenExpiry": "2025-06-04T08:56:55Z",
            "clientAuthToken": "tkn_90e7ae9f0cab4b90xxxxa4da10dd6e6cc",
            "action": "paymentPage",
            "collectAvsInfo": false
        },
        "expiry": "2025-06-11T08:41:55Z"
    },
    "order_expiry": "2025-06-11T08:41:55Z"
}
```

## Body Parameters:
### :

#### order_id:
- Description: Your order ID
- Value: value
- Tags: Mandatory, Required

#### first_name:
- Description: First name of the customer

#### last_name:
- Description: Last name of the customer

#### customer_phone:
- Description: Customer’s phone number

#### payment_page_client_id:
- Description: Client ID in case of Hypercheckout merchant

#### service:
- Value:  in.juspay.hyperpay

#### merchant_id:
- Description: your_merchantID
- Tags: String, Mandatory

#### amount:
- Description: order amount
- Tags: String, Mandatory

#### payment_rules:
- Description: This key is an object that holds part payment information. Refer to the sample curl. Payment Rules key is an object which contains additional information including the part payment plan details which are explained below.
- Tags: Required, Refer to sample curl for keys
### Payment Rules:

#### payment_flows:
- Description: It is an object which defines this as a part payment order. This key takes value as `part_payment`
- Value: value
- Tags: String, Mandatory, Required

#### part_payment:
- Description: This key is a value to `payment_flows` which determines if the order is a part payment order. It is an object
- Tags: String, Mandatory, Required

#### status:
- Description: This key tells us if the part payment will be available as an optional or a required payment type. If value is sent as `OPTIONAL`, then other payment methods will be available to users to choose from, choosing this will make the order full swipe. In case the status value is sent as `REQUIRED`, then only part payment will be available as an option to make payment.
- Tags: String, Mandatory, Required

#### info:
- Description: This key contains information about the payment flow defined above
- Tags: String, Mandatory, Required

#### plan_info:
- Description: This is an array which contains information about the plan types in the part payment options
- Tags: Mandatory, Required

#### plan_type:
- Description: It can take values as `FIXED/EDITABLE`. If the plan is fixed payment plan (predefined amount of each parts and due dates, then choose value as `FIXED`. If you wish for users to choose the amount and make payment in parts, then `EDITABLE` can be sent.
- Tags: String, Mandatory, Required

#### fixed_plan_details:
- Description: This key will come in case `plan_type` is choosen as `FIXED`. It contains keys to define plan conditions like `plan_id`, `no_of_parts` and `parts_info`. 
- Tags: String, Mandatory, Required

#### plan_id:
- Description: This is the plan ID set by the merchant.
- Tags: String, Mandatory, Required

#### no_of_parts:
- Description: This defines the number parts present in the fixed plan details. This key is only to be sent in case of fixed plan.
- Tags: String, Mandatory, Required

#### parts_info:
- Description: This is an array which contains informarion about each parts in a fixed plan
- Tags: Mandatory, Required

#### amount:
- Description: Inside `parts_info`, this is the amount of each parts set in the fixed plan
- Tags: String, Mandatory, Required

#### due_date:
- Description: Inside `parts_info`, this defines the expiry date of that particular part. Send the values in EPOCH timestamp
- Tags: String, Mandatory, Required

#### part_number:
- Description: This is the part number of the fixed plan. Value also needs to be sent in the transaction call to denote which part the user is trying to make the payment for.
- Tags: Int, Mandatory, Required

#### plan_due_date:
- Description: This is the plan expiry date. If user chooses this plan, then that plan’s due date becomes the expiry date of the order.
- Tags: String, Mandatory, Required

#### editable_plan_details:
- Description: In case you wish to let user decide the part amounts, then `EDITABLE` can be sent in the `plan_type`. The above key defines the details of the editable plan.
- Tags: String, Mandatory, Required

#### minimum_part_amount:
- Description: For editable plans, you must define the minimum amount which user must choose to make payment of each part.
- Tags: String, Mandatory, Required

#### maximum_no_of_parts:
- Description: For editable plans, you must also define the total maximum number of parts in which user should make the complete payment of the order.
- Tags: String, Mandatory, Required
## API Responses:
### 200:

#### status:
- Value: NEW
- Tags: String

#### id:
- Value: ordeh_0bf87dee38ff444d82f37a225a9d2638
- Tags: String

#### order_id:
- Value: 1749026515
- Tags: String

#### payment_links:
- Value:
  - **Web**:
    - Value: https://sandbox.assets.juspay.in/payment-page/order/ordeh_0bf87dee38ff444d82f37a225a9d2638
    - Tags: String
  - **Expiry**:
    - Value: 2025-06-11T08:41:55Z
    - Tags: String
- Tags: Object

#### sdk_payload:
- Value:
  - **RequestId**:
    - Value: ee2cca9e5bd1414885bf3ac4e8870c14
    - Tags: String
  - **Service**:
    - Value: in.juspay.hyperpay
    - Tags: String
  - **Payload**:
    - Value:
      - **Metadata.JUSPAY:gatewayReferenceId**:
        - Value: testmode
        - Tags: String
      - **FirstName**:
        - Value: John
        - Tags: String
      - **ClientId**:
        - Value: your_clientID
        - Tags: String
      - **PaymentRules**:
        - Value:
          - **Payment_flows**:
            - Value:
              - **Part_payment**:
                - Value:
                  - **Status**:
                    - Value: OPTIONAL
                    - Tags: String
                  - **Info**:
                    - Value:
                      - **Plan_info**:
                        - Tags: Array
                    - Tags: Object
                - Tags: Object
            - Tags: Object
        - Tags: Object
      - **CustomerId**:
        - Value: sftrj5ty4tg4gtfsd4
        - Tags: String
      - **OrderId**:
        - Value: 1749026515
        - Tags: String
      - **ReturnUrl**:
        - Value: https://sandbox.juspay.in/end
        - Tags: String
      - **Currency**:
        - Value: INR
        - Tags: String
      - **CustomerPhone**:
        - Value: 965234xxxx
        - Tags: String
      - **Service**:
        - Value: in.juspay.hyperpay
        - Tags: String
      - **GatewayId**:
        - Value: 23
        - Tags: String
      - **EmailAddress**:
        - Value: test007@gmail.com
        - Tags: String
      - **Description**:
        - Value: test
        - Tags: String
      - **Environment**:
        - Value: sandbox
        - Tags: String
      - **LastName**:
        - Value: Wick
        - Tags: String
      - **MerchantId**:
        - Value: your_merchantID
        - Tags: String
      - **Amount**:
        - Value: 20000.0
        - Tags: String
      - **ClientAuthTokenExpiry**:
        - Value: 2025-06-04T08:56:55Z
        - Tags: String
      - **ClientAuthToken**:
        - Value: tkn_90e7ae9f0cab4b90874a4da10dd6e6cc
        - Tags: String
      - **Action**:
        - Value: paymentPage
        - Tags: String
      - **CollectAvsInfo**:
        - Value: false
        - Tags: Boolean
    - Tags: Object
  - **Expiry**:
    - Value: 2025-06-11T08:41:55Z
    - Tags: String
- Tags: Object

#### order_expiry:
- Value: 2025-06-11T08:41:55Z
- Tags: String
