> ## Documentation Index
> Fetch the complete documentation index at: https://docs.liquid.tf/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit Buy Orders

> Update price, quantity, or status of existing buy orders

## Overview

Edits one or more existing buy orders. You can update the price, quantity, and active status. Max 100 buy orders per request.

## Authentication

<ParamField header="X-API-Key" type="string" required>
  Your site API key
</ParamField>

## Rate Limit

**5 requests per minute**

## Request Body

<ParamField body="items" type="array" required>
  Array of buy orders to edit (max 100 items)

  <Expandable title="Item Object">
    <ParamField body="sku" type="string" required>
      Item SKU of the buy order to edit
    </ParamField>

    <ParamField body="price" type="integer" required>
      New price per unit (in cents)
    </ParamField>

    <ParamField body="quantity" type="integer" required>
      New quantity you want to buy
    </ParamField>

    <ParamField body="active" type="integer" required>
      Active status: `1` = active, `0` = inactive
    </ParamField>

    <ParamField body="user_note" type="string">
      Custom note to display on the buy order (max 180 characters). Visible to sellers.
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Returns `true` if buy orders were successfully updated
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH "https://api.liquid.tf/api/dev/buy_order" \
    -H "Content-Type: application/json" \
    -H "X-API-Key: YOUR_SITE_API_KEY" \
    -d '{
      "items": [{
        "sku": "5021;6",
        "price": 17000,
        "quantity": 8,
        "active": 1,
        "user_note": "Updated price - looking for quick sale"
      }]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.liquid.tf/api/dev/buy_order', {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': 'YOUR_SITE_API_KEY'
    },
    body: JSON.stringify({
      items: [{
        sku: '5021;6',
        price: 17000,
        quantity: 8,
        active: 1,
        user_note: 'Updated price - looking for quick sale'
      }]
    })
  });

  const data = await response.json();
  ```

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

  response = requests.patch(
      'https://api.liquid.tf/api/dev/buy_order',
      headers={'X-API-Key': 'YOUR_SITE_API_KEY'},
      json={
          'items': [{
              'sku': '5021;6',
              'price': 17000,
              'quantity': 8,
              'active': 1,
              'user_note': 'Updated price - looking for quick sale'
          }]
      }
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true
  }
  ```
</ResponseExample>

## Balance Validation

When editing a buy order:

* The system checks if you have sufficient balance for the new quantity
* If partially filled, the system validates you can cover the remaining quantity
* If insufficient balance, the request will fail

<Warning>
  Increasing quantity requires additional balance. Ensure you have enough funds before updating.
</Warning>

## Active Status

<AccordionGroup>
  <Accordion title="Active (1)">
    Buy order is visible to sellers and can be fulfilled. Funds remain reserved.
  </Accordion>

  <Accordion title="Inactive (0)">
    Buy order is hidden from sellers and cannot be fulfilled. Funds remain reserved but order is paused.
  </Accordion>
</AccordionGroup>

<Tip>
  Use `active: 0` to temporarily pause a buy order without deleting it. This is useful when adjusting prices or waiting for market conditions.
</Tip>

## Common Use Cases

<CardGroup cols={2}>
  <Card title="Price Adjustments" icon="chart-line">
    Compete with other buyers by updating your price
  </Card>

  <Card title="Quantity Changes" icon="hashtag">
    Increase or decrease how many items you want
  </Card>

  <Card title="Pause Orders" icon="pause">
    Set `active: 0` to temporarily stop fulfillment
  </Card>

  <Card title="Resume Orders" icon="play">
    Set `active: 1` to reactivate a paused order
  </Card>
</CardGroup>

## User Notes

<Note>
  You can update the user note when editing a buy order. User notes are visible to all sellers and can help provide additional context.
</Note>

User notes are limited to **180 characters** and will be automatically filtered for profanity.
