---
title: "Manage order lines"
method: PATCH
path: "/orders/{orderId}/lines"
tags: ["Orders API"]
deprecated: true
---

# Manage order lines

`PATCH /orders/{orderId}/lines`

> **Deprecated.**

**⚠️ We no longer recommend using the Orders API. Please refer to the [Payments API](payments-api) instead.**

 Use this endpoint to update, cancel, or add one or more order lines of a `created`, `pending`, or `authorized` order.

 For an already authorized order, updating the order lines will trigger an additional authorization request to the payment method provider.

 For example, your customer placed an order that contains two order lines:

 * Order line A contains two items and amounts to €100.00.
 * Order line B contains a discount of 10% applicable to the items in order line A, which amounts to -€10.00.

 The order total is €90.00.

 You only have one item of type A left, and therefore contact your customer to find another solution. The customer opts to replace one of order line A's items with item C. Item C costs €40.00, however, discount B does not apply to item C.

 Using this endpoint, you can create a request to update the order lines, where:

 * Order line A is updated to quantity 1.
 * Order line B is updated to discount amount -€5.00.
 * Order line C is added with amount €40.00.

 The updated order totals €85.00.

> 🔑 Access with
>
> [API key](/reference/authentication)
>
> [Advanced access token with **orders.write**](/reference/authentication)
>
> [OAuth access with **orders.write**](/reference/authentication)

## Request body

- object
  - `operations` object[], required — List of operations to be performed on the order's line items.
    - `operation` string, required — Type of operation. Possible values: `add` `update` `cancel`
    - `data` object, required — Operation data depending on the type of operation. For an `add` operation, provide the fields for the new order line in the same format as in the [Create order](create-order) endpoint. For an `update` operation, provide the `id` of the order line, along with any fields you would like to update. For a `cancel` operation, provide the `id` of the order line. Optionally, a `quantity` or `amount` can be provided to only partially cancel an order line.
      - `id` string — Required for `update` and `cancel` operations. For example: `odl_dgtxyl`.
      - `resource` string — Indicates the response contains an order line object. Will always contain the string `orderline`.
      - `type` string — The type of product purchased. For example, a physical or a digital product. Possible values: `physical` `digital` `discount` `shipping_fee` `store_credit` `gift_card` `surcharge` (default: `physical`)
      - `name` string — A description of the line item. For example *LEGO 4440 Forest Police Station*.
      - `quantity` integer — The number of items.
      - `quantityShipped` integer — The number of items shipped.
      - `amountShipped` object — The amount shipped.
        - `currency` string, required — A three-character ISO 4217 currency code.
        - `value` string, required — A string containing an exact monetary amount in the given currency.
      - `quantityRefunded` integer — The number of items refunded.
      - `amountRefunded` object — The amount refunded.
        - `currency` string, required — A three-character ISO 4217 currency code.
        - `value` string, required — A string containing an exact monetary amount in the given currency.
      - `quantityCanceled` integer — The number of items canceled.
      - `amountCanceled` object — The amount canceled.
        - `currency` string, required — A three-character ISO 4217 currency code.
        - `value` string, required — A string containing an exact monetary amount in the given currency.
      - `shippableQuantity` integer — The number of items that can be shipped.
      - `refundableQuantity` integer — The number of items that can be refunded.
      - `cancelableQuantity` integer — The number of items that can be canceled.
      - `unitPrice` object — The price of a single item including VAT. For example: `{"currency":"EUR", "value":"89.00"}` if the box of LEGO costs €89.00 each. For types `discount`, `store_credit`, and `gift_card`, the unit price must be negative. The unit price can be zero in case of free items.
        - `currency` string, required — A three-character ISO 4217 currency code.
        - `value` string, required — A string containing an exact monetary amount in the given currency.
      - `discountAmount` object — Any line-specific discounts, as a positive amount. Not relevant if the line itself is already a discount type.
        - `currency` string, required — A three-character ISO 4217 currency code.
        - `value` string, required — A string containing an exact monetary amount in the given currency.
      - `totalAmount` object — The total amount of the line, including VAT and discounts. Should match the following formula: `(unitPrice × quantity) - discountAmount`. The sum of all `totalAmount` values of all order lines should be equal to the full payment amount.
        - `currency` string, required — A three-character ISO 4217 currency code.
        - `value` string, required — A string containing an exact monetary amount in the given currency.
      - `vatRate` string — The VAT rate applied to the line, for example `21.00` for 21%. The vatRate should be passed as a string and not as a float, to ensure the correct number of decimals are passed.
      - `vatAmount` object — The amount of value-added tax on the line. The `totalAmount` field includes VAT, so the `vatAmount` can be calculated with the formula `totalAmount × (vatRate / (100 + vatRate))`. Any deviations from this will result in an error. For example, for a `totalAmount` of SEK 100.00 with a 25.00% VAT rate, we expect a VAT amount of `SEK 100.00 × (25 / 125) = SEK 20.00`.
        - `currency` string, required — A three-character ISO 4217 currency code.
        - `value` string, required — A string containing an exact monetary amount in the given currency.
      - `sku` string — The SKU, EAN, ISBN or UPC of the product sold.
      - `category` 'eco' | 'gift' | 'meal' | 'sport_culture' | 'additional' | 'consume' — The voucher category, in case of an order line eligible for a voucher. See the [Integrating Vouchers](https://docs.mollie.com/docs/integrating-vouchers/) guide for more information.
      - `status` 'created' | 'authorized' | 'paid' | 'canceled' | 'shipping' | 'completed' — The status of the order line.
      - `isCancelable` boolean — Whether the order line can still be canceled.
      - `metadata` union — Provide any data you like, for example a string or a JSON object. We will save the data alongside the entity. Whenever you fetch the entity with our API, we will also include the metadata. You can use up to approximately 1kB.
        - string
        - number
        - object
        - string[]
      - `orderId` string — The unique identifier of the order this order line belongs to. For example: `ord_8wmqcHMN4U`.
      - `imageUrl` string — A link pointing to an image of the product sold.
      - `productUrl` string — A link pointing to the product page in your web shop of the product sold.
      - `createdAt` string — The entity's date and time of creation, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
      - `_links` object — An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.
        - `self` object — In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.
          - `href` string, required — The actual URL string.
          - `type` string, required — The content type of the page or endpoint the URL points to.
        - `imageUrl` object — A link pointing to an image of the product sold.
          - `href` string, required — The actual URL string.
          - `type` string, required — The content type of the page or endpoint the URL points to.
        - `productUrl` object — A link pointing to the product page in your web shop of the product sold.
          - `href` string, required — The actual URL string.
          - `type` string, required — The content type of the page or endpoint the URL points to.
  - `testmode` boolean — Whether the entity was created in test mode or live mode. This field does not update the mode of the entity. Most API credentials are specifically created for either live mode or test mode, in which case this parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting `testmode` to `true`.

## Response `200`

The updated order object.

## Other responses

- `404` — No entity with this ID exists.
- `429` — Rate Limit has been reached.

---

[API](https://skmtc.net/mollie/apis/accepting-payments.md) · [All operations](https://skmtc.net/mollie/apis/accepting-payments/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mollie/accepting-payments/revisions/4b45df3039ef/schema)
