---
title: "Update Order"
method: POST
path: "/orders/{id}"
tags: ["Order Management"]
---

# Update Order

`POST /orders/{id}`

**Purpose:**

Updates order information before capture.  

- Adding an external code that represents the order ID of the merchant if not already submitted previously.
- Changes the order amount associated with the order.

**Preconditions:** 

- `id`: The unique identifier of the order
- order is in `state` `created` and does not already has ane `external_code` for an update of 'external_code`
- order is in `state` `created` or `partially_shipped` for an update of the order amount

**Success: **

- Response Code: HTTP 204

**Attention:**

- The value provided under `external_code` (the order number from your backend) will be used by Billie in communication with the buyer after capture.
- If an `external_code` was provided at *create order* or *confirm session* call the uptade order call will fail, if it is a different `external_code`.
- Lowering the values under the `amount` object to equal the sum of all partial captures will result in the order state to transition from `partially_shipped` to `shipped`.
- If the update order call increases the amount of the order, the increased amount will be subject to all checks and validations as a newly created order.
- If any part of the update order call is failing, no changes to the original order will be applied.

## Path parameters

- `id` string, uuid, required

## Request body

- UpdateOrderRequest
  - `amount` AmountDTO — The amount object with split values for net, gross and tax
    - `gross` number, float, required — Value greater than 0, with max. 2 decimals. It should equal to net + tax.
    - `net` number, float, required — Value greater than 0, with max. 2 decimals.
    - `tax` number, float, required — Value greater than or equal to 0, with max. 2 decimals.
  - `external_code` string

## Response `204`

Order successfully updated

## Other responses

- `400` — Invalid Request Data
- `401` — Unauthorized request or invalid credentials
- `404` — Resource Not Found
- `500` — Unexpected Server Error

---

[API](https://skmtc.net/billie/apis/billie-direct-api.md) · [All operations](https://skmtc.net/billie/apis/billie-direct-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/billie/billie-direct-api/versions/8cce15617825/schema)
