---
page_title: Create Order for Split Settlement
product: API Reference
page_source: https://juspay.io/in/docs/api-reference/docs/split-settlement/create-order-for-split-settlement
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fapi-reference%2Fdocs%2Fsplit-settlement%2Fcreate-order-for-split-settlement
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 for Split Settlement



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

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

## Request Type: 
POST

## Headers:

#### Content-Type:
application/x-www-form-urlencoded
- Tags: string, Required

#### Authorization:
Basic of Base64 encoded API key
- Tags: string, Required

#### 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 'Content-Type: application/x-www-form-urlencoded' \
--header 'x-routing-id: customer_1122'\
--header 'Authorization: Basic <base64 of Merchant API Key>' \
--data-urlencode 'order_id=splitsettlement_1619009418_test' \
--data-urlencode 'amount=5' \
--data-urlencode 'return_url=https://www.google.co.in' \
--data-urlencode 'metadata.split_settlement_details={"marketplace":{"amount":0},"mdr_borne_by":"ALL","vendor":{"split":[{"amount":3,"merchant_commission":0,"sub_mid":"Vendor1"},{"amount":2,"merchant_commission":0,"sub_mid":"Vendor2"}]}}'

```

### Sample Response:

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

## Body Parameters:
### Parameters:

#### order_id:
- Description: A unique Identifier for the order.
- Tags: string, Mandatory

#### amount:
- Description: The total order amount. Will accept double values with upto two decimal places.
- Tags: number, Mandatory

#### return_url:
- Description: A fully qualified URL such as [http://shop.merchant.com/](http://shop.merchant.com/) to which the customer will be redirected after payment completion. This URL shouldn’t contain any query parameters. This URL takes higher precedence over the common return URL configured in your account settings.
- Tags: string

#### metadata:
- Value:
  - **Split_settlement_details**:
    - Description: This field describes how much amount is to be settled into the resepctive sub account ids. Summation of amount for all the sub account ids has to be equal to the original order amount.
    - Value:
      - **Marketplace**:
        - Description: Marketplace (Parent merchant account ID) specific data to be passed
        - Value:
          - **Amount**:
            - Description: Amount to be settled in parent merchant settlement account
            - Tags: Number, Mandatory
        - Tags: JSON, Conditional
      - **Mdr_borne_by**:
        - Value: MARKETPLACE/ VENDOR/ ALL
        - Tags: String, Conditional
      - **Vendor**:
        - Description: Vendor (Sub account IDs) specific data to be passed
        - Value:
          - **Split**:
            - Description: Split settlement information to be passed
            - Value:
              - **Sub_mid**:
                - Description: Sub Account ID (maintained at JusPay’s end) to be passed.
                - Tags: String, Mandatory
              - **Amount**:
                - Description: Amount to be settled in the sub account
                - Tags: Number, Mandatory
              - **Merchant_commission**:
                - Description: Merchant commission to be borne by sub account IDs
                - Tags: Number, Mandatory
              - **Notes**:
                - Description: To pass custom parameters
                - Value:
                  - **Note**:
                    - Description: To pass custom information to be passed on to the gateway (NOTE: For Razorpay all values passed within the block are passed)
                    - Value:
                      - **JuspayVendorId**:
                        - Description: Required for Mapping the gateway transaction id for the vendor
                        - Tags: String, Mandatory
                    - Tags: String, Mandatory
                - Tags: String
            - Tags: array, Conditional
        - Tags: JSON, Conditional
    - Tags: string, Mandatory
- Tags: object
## API Responses:
### 200:

#### status:
- Description: CREATED
- Tags: string

#### status_id:
- Tags: integer

#### id:
- Description: ordeh_06a7c87b83d7453191ba6a4f9919860c
- Tags: string

#### order_id:
- Description: splitsettlement_1619009418_test
- Tags: string

#### payment_links:
- Value:
  - **Iframe**:
    - Description: https://api.juspay.in/merchant/ipay/ordeh_06a7c87b83d7453191ba6a4f9919860c
    - Tags: string
  - **Web**:
    - Description: https://api.juspay.in/merchant/pay/ordeh_06a7c87b83d7453191ba6a4f9919860c
    - Tags: string
  - **Mobile**:
    - Description: https://api.juspay.in/merchant/pay/ordeh_06a7c87b83d7453191ba6a4f9919860c?mobile=true
    - Tags: string
- Tags: object
### 400:

#### status:
- Description: ERROR
- Tags: string

#### error_code:
- Description: invalid_request
- Tags: string

#### error_message:
- Description: Split settlement amount is not equal to order amount
- Tags: string

#### status_id:


---

## See Also

- [Split Settlement](https://juspay.io/in/docs/api-reference/docs/split-settlement/split-settlement)
- [Order Status for Split Settlement](https://juspay.io/in/docs/api-reference/docs/split-settlement/order-status-for-split-settlement)
