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

# Update order

> Partially update a payment order. Arrays merge by index; subscription_payment_config shallow-merges with the stored object.

<ParamField header="x-api-key" type="string" required placeholder="your-api-key">
  Your StarkFi API key. You can find it in your [dashboard](https://app.starkfi.io).
</ParamField>

<ParamField path="order_id" type="string" required>
  Order CUID to update.
</ParamField>

<ParamField body="from_currency_symbol" type="string">
  When present, must pass enabled-fiat validation.
</ParamField>

<ParamField body="amount_from" type="string" />

<ParamField body="to_currency_symbol" type="string" />

<ParamField body="on_ramp" type="boolean" />

<ParamField body="gateway_method" type="enum<string>">
  `direct` or `subs`.
</ParamField>

<ParamField body="executor_id" type="string" />

<ParamField body="payment_method_allowed" type="object">
  Same shape as create order; at least one `true` when the object is sent.
</ParamField>

<ParamField body="order_items" type="array">
  Partial items merged **by index** with existing `order_items`.
</ParamField>

<ParamField body="split_payment_config" type="array">
  Merged **by index** with existing split config.
</ParamField>

<ParamField body="subscription_payment_config" type="object">
  Shallow-merged with the stored subscription object.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url https://api.starkfi.io/order/clxxxxxxxxxxxxxxxxxxxxxxxx \
    --header 'Content-Type: application/json' \
    --header 'x-api-key: <api_key>' \
    --data '{"amount_from": "150.00"}'
  ```

  ```javascript Node.js theme={null}
  const orderId = "clxxxxxxxxxxxxxxxxxxxxxxxx";
  const response = await fetch(
    `https://api.starkfi.io/order/${orderId}`,
    {
      method: "PATCH",
      headers: {
        "Content-Type": "application/json",
        "x-api-key": "<api_key>",
      },
      body: JSON.stringify({ amount_from: "150.00" }),
    }
  );
  const data = await response.json();
  ```

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

  order_id = "clxxxxxxxxxxxxxxxxxxxxxxxx"
  response = requests.patch(
      f"https://api.starkfi.io/order/{order_id}",
      headers={"Content-Type": "application/json", "x-api-key": "<api_key>"},
      json={"amount_from": "150.00"},
  )
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "statusCode": 200,
    "success": true,
    "status": "order_updated",
    "message": "Order updated successfully.",
    "data": {
      "id": "clxxxxxxxxxxxxxxxxxxxxxxxx",
      "amount_from": "150.00"
    }
  }
  ```

  ```json 400 - Bad Request theme={null}
  {
    "statusCode": 400,
    "success": false,
    "status": "no_fields_to_update",
    "message": "No fields provided to update."
  }
  ```

  ```json 404 - Not Found theme={null}
  {
    "statusCode": 404,
    "success": false,
    "status": "order_not_found",
    "message": "Order not found."
  }
  ```
</ResponseExample>

### Response

<ResponseField name="data" type="object" required>
  Full updated `payment_orders` row.
</ResponseField>
