> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-60c89f9a-mintlify-audit-missing-sections-1778528421.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Orders

> You can create [Orders](/payments/orders) and link them to payments. Orders APIs are used to create, update and retrieve details of Orders. Also, you can retrieve details of payments made towards these Orders.

Fork the Razorpay Postman Public Workspace and try the Orders APIs using your [Test API Keys](/payments/dashboard/account-settings/api-keys#generate-api-keys).

[](https://www.postman.com/razorpaydev/workspace/razorpay-public-workspace/folder/12492020-91450029-1c52-4375-8033-39ca4c2d0a8c)

### Related Guides

[About Orders](/payments/orders)
[Set Up Webhooks](/webhooks/setup-edit-payments)
[Webhook Payloads](/webhooks/orders)

### Endpoints

* **post** `/v1/orders` - Create an Order:
  Creates an order by providing basic details such as amount and currency.

<CodeGroup>
  ```javascript Node theme={null}
  var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })

  instance.orders.create({
    amount: 50000,
    currency: "<currency>",
    receipt: "receipt#1",
    notes: {
      key1: "value3",
      key2: "value2"
    }
  })
  ```

  ```python Python theme={null}
  import razorpay

  client = razorpay.Client(auth=("YOUR_KEY_ID", "YOUR_SECRET"))

  client.order.create({
    "amount": 50000,
    "currency": "<currency>",
    "receipt": "receipt#1",
    "notes": {
      "key1": "value3",
      "key2": "value2"
    }
  })
  ```

  ```bash cURL theme={null}
  curl -u YOUR_KEY_ID:YOUR_SECRET \
    -X POST https://api.razorpay.com/v1/orders \
    -H "Content-Type: application/json" \
    -d '{
      "amount": 50000,
      "currency": "<currency>",
      "receipt": "receipt#1",
      "notes": {
        "key1": "value3",
        "key2": "value2"
      }
    }'
  ```
</CodeGroup>

* **get** `/v1/orders` - Fetch All Orders:
  Retrieves details of all the orders.

* **get** `/v1/orders?expand[]=payments` - Fetch All Orders (Example 1):
  Retrieves details of all the orders and expands the payments object.

* **get** `/v1/orders?expand[]=payments.card` - Fetch All Orders (Example 2):
  Retrieves details of all the orders and expands cards parameter in the payments object.

* **get** `/v1/orders/:id` - Fetch Order With ID:
  Retrieves details of a particular order.

* **get** `/v1/orders/:id/payments` - Fetch All Payments for an Order:
  Retrieves all the payments made for an order.

* **patch** `/v1/orders/:id` - Update an Order:
  Modifies an existing order.

[Test External Link](https://www.mintlify.com/docs/test)
