# Manage order lines **⚠️ 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) > > [Organization access token with **orders.write**](/reference/authentication) > > [OAuth access with **orders.write**](/reference/authentication) # OpenAPI definition ```json { "openapi": "3.1.0", "info": { "title": "Receiving orders", "version": "1.0.0", "license": { "name": "Attribution-NonCommercial-ShareAlike 4.0 International", "identifier": "CC-BY-NC-SA-4.0" } }, "servers": [ { "url": "https://api.mollie.com/v2" } ], "security": [ { "apiKey": [] }, { "organizationAccessToken": [] }, { "oAuth": [] } ], "paths": { "/orders/{orderId}/lines": { "parameters": [ { "name": "orderId", "description": "Provide the ID of the related order.", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^ord_.+$", "example": "ord_5B8cwPMGnU" } } ], "patch": { "deprecated": true, "summary": "Manage order lines", "tags": [ "Orders API" ], "operationId": "manage-order-lines", "security": [ { "apiKey": [] }, { "organizationAccessToken": [ "orders.write" ] }, { "oAuth": [ "orders.write" ] } ], "description": "**⚠️ We no longer recommend using the Orders API. Please refer to the [Payments API](payments-api) instead.**\n\n Use this endpoint to update, cancel, or add one or more order lines of a `created`, `pending`, or `authorized` order.\n\n For an already authorized order, updating the order lines will trigger an additional authorization request to the payment method provider.\n\n For example, your customer placed an order that contains two order lines:\n\n * Order line A contains two items and amounts to €100.00.\n * Order line B contains a discount of 10% applicable to the items in order line A, which amounts to -€10.00.\n\n The order total is €90.00.\n\n 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.\n\n Using this endpoint, you can create a request to update the order lines, where:\n\n * Order line A is updated to quantity 1.\n * Order line B is updated to discount amount -€5.00.\n * Order line C is added with amount €40.00.\n\n The updated order totals €85.00.\n\n> 🔑 Access with\n>\n> [API key](/reference/authentication)\n>\n> [Organization access token with **orders.write**](/reference/authentication)\n>\n> [OAuth access with **orders.write**](/reference/authentication)", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "operations": { "type": "array", "description": "List of operations to be performed on the order's line items.", "items": { "type": "object", "properties": { "operation": { "type": "string", "description": "Type of operation.\n\nPossible values: `add` `update` `cancel`", "example": "update" }, "data": { "type": "object", "description": "Operation data depending on the type of operation.\n\nFor an `add` operation, provide the fields for the new order line in the same format as in the [Create order](create-order) endpoint.\n\nFor an `update` operation, provide the `id` of the order line, along with any fields you would like to update.\n\nFor 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.", "properties": { "id": { "type": "string", "description": "Required for `update` and `cancel` operations. For example: `odl_dgtxyl`.", "example": "odl_5B8cwPMGnU", "readOnly": false }, "resource": { "type": "string", "description": "Indicates the response contains an order line object. Will always contain the string `orderline`.", "readOnly": true, "default": "orderline" }, "type": { "description": "The type of product purchased. For example, a physical or a digital product.\n\nPossible values: `physical` `digital` `discount` `shipping_fee` `store_credit` `gift_card` `surcharge` (default: `physical`)", "type": "string", "example": "physical" }, "name": { "type": "string", "description": "A description of the line item. For example *LEGO 4440 Forest Police Station*.", "example": "Ready Player One" }, "quantity": { "type": "integer", "description": "The number of items.", "minimum": 1, "example": 2 }, "quantityShipped": { "type": "integer", "description": "The number of items shipped.", "example": 1 }, "amountShipped": { "description": "The amount shipped.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "quantityRefunded": { "type": "integer", "description": "The number of items refunded.", "example": 1 }, "amountRefunded": { "description": "The amount refunded.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "quantityCanceled": { "type": "integer", "description": "The number of items canceled.", "example": 1 }, "amountCanceled": { "description": "The amount canceled.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "shippableQuantity": { "type": "integer", "description": "The number of items that can be shipped.", "example": 1 }, "refundableQuantity": { "type": "integer", "description": "The number of items that can be refunded.", "example": 1 }, "cancelableQuantity": { "type": "integer", "description": "The number of items that can be canceled.", "example": 1 }, "unitPrice": { "description": "The price of a single item including VAT.\n\nFor example: `{\"currency\":\"EUR\", \"value\":\"89.00\"}` if the box of LEGO costs €89.00 each.\n\nFor types `discount`, `store_credit`, and `gift_card`, the unit price must be negative.\n\nThe unit price can be zero in case of free items.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "discountAmount": { "description": "Any line-specific discounts, as a positive amount. Not relevant if the line itself is already a discount type.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "totalAmount": { "description": "The total amount of the line, including VAT and discounts.\n\nShould match the following formula: `(unitPrice × quantity) - discountAmount`.\n\nThe sum of all `totalAmount` values of all order lines should be equal to the full payment amount.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "vatRate": { "type": "string", "description": "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.", "example": 25 }, "vatAmount": { "description": "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))`.\n\nAny deviations from this will result in an error.\n\nFor 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`.", "example": 2, "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "sku": { "type": "string", "description": "The SKU, EAN, ISBN or UPC of the product sold.", "maxLength": 64, "example": "978-1524763282" }, "category": { "allOf": [ { "type": "string", "enum": [ "eco", "gift", "meal", "sport_culture", "additional", "consume" ], "example": "eco" } ], "description": "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.", "writeOnly": true }, "status": { "allOf": [ { "type": "string", "enum": [ "created", "authorized", "paid", "canceled", "shipping", "completed" ], "example": "created" } ], "description": "The status of the order line.", "readOnly": true }, "isCancelable": { "type": "boolean", "description": "Whether the order line can still be canceled.", "example": true, "readOnly": true }, "metadata": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "array", "items": { "type": "string" } }, { "type": "null" } ], "description": "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." }, "orderId": { "allOf": [ { "type": "string", "pattern": "^ord_.+$", "example": "ord_5B8cwPMGnU" } ], "description": "The unique identifier of the order this order line belongs to. For example: `ord_8wmqcHMN4U`.", "readOnly": true }, "imageUrl": { "type": "string", "description": "A link pointing to an image of the product sold.", "example": "https://www.example.com/image", "writeOnly": true }, "productUrl": { "type": "string", "description": "A link pointing to the product page in your web shop of the product sold.", "example": "https://www.example.com/product", "writeOnly": true }, "createdAt": { "type": "string", "description": "The entity's date and time of creation, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.", "readOnly": true, "example": "2024-03-20T09:13:37+00:00" }, "_links": { "type": "object", "description": "An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.", "properties": { "self": { "type": "object", "description": "In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } }, "imageUrl": { "description": "A link pointing to an image of the product sold.", "type": "object", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } }, "productUrl": { "description": "A link pointing to the product page in your web shop of the product sold.", "type": "object", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } } }, "readOnly": true } } } }, "required": [ "operation", "data" ] } }, "testmode": { "type": "boolean", "description": "Whether the entity was created in test mode or live mode. This field does not update the mode of the entity.\n\nMost 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`.", "writeOnly": true, "example": false } }, "required": [ "operations" ] } } } }, "responses": { "200": { "description": "The updated order object.", "content": { "application/hal+json": { "schema": { "type": "object", "properties": { "resource": { "type": "string", "description": "Indicates the response contains an order object. Will always contain the string `order` for this endpoint.", "readOnly": true, "default": "order" }, "id": { "allOf": [ { "type": "string", "pattern": "^ord_.+$", "example": "ord_5B8cwPMGnU" } ], "description": "The identifier uniquely referring to this order. Mollie assigns this identifier at payment creation time. Mollie will always refer to the order by this ID. Example: `ord_vsKJpSsabw`.", "readOnly": true }, "mode": { "type": "string", "description": "Whether this entity was created in live mode or in test mode.\n\nPossible values: `live` `test`", "readOnly": true, "example": "live" }, "orderNumber": { "type": "string", "description": "The order number for this order. We recommend each order number to be unique.", "example": 1337 }, "amount": { "description": "The amount that you want to charge, e.g. `{currency:\"EUR\", value:\"1000.00\"}` if you would want to charge €1000.00.\n\nYou can find the minimum and maximum amounts per payment method in our help center. Additionally, they can be retrieved using the Get method endpoint.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "amountRefunded": { "allOf": [ { "type": "object", "description": "In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } } ], "description": "The total amount that is already refunded. Only available when refunds are available for this order.", "readOnly": true }, "amountCaptured": { "allOf": [ { "type": "object", "description": "In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } } ], "description": "The total amount that is already captured for this order. Only available when this order supports captures.", "readOnly": true }, "redirectUrl": { "type": [ "string", "null" ], "description": "The URL your customer will be redirected to after the payment process.\n\nIt could make sense for the redirectUrl to contain a unique identifier – like your order ID – so you can show the right page referencing the order when your customer returns.\n\nThe parameter is normally required, but can be omitted for recurring payments (`sequenceType: recurring`) and for Apple Pay payments with an `applePayPaymentToken`.", "example": "https://www.example.com/redirect" }, "cancelUrl": { "type": "string", "description": "The URL your customer will be redirected to when the customer explicitly cancels the payment. If this URL is not provided, the customer will be redirected to the `redirectUrl` instead — see above.\n\nMollie will always give you status updates via webhooks, including for the canceled status. This parameter is therefore entirely optional, but can be useful when implementing a dedicated customer-facing flow to handle payment cancellations.", "example": "https://www.example.com/cancel" }, "webhookUrl": { "type": "string", "description": "The webhook URL where we will send order status updates to.\n\nThe webhookUrl is optional, but without a webhook you will miss out on important status changes to your order.\n\nThe webhookUrl must be reachable from Mollie's point of view, so you cannot use `localhost`. If you want to use webhook during development on `localhost`, you must use a tool like ngrok to have the webhooks delivered to your local machine.", "example": "https://www.example.com/webhook" }, "billingAddress": { "description": "The customer's billing address details. The billing address is required, unless a fast checkout method like PayPal Express Checkout is providing the billing address.", "type": "object", "properties": { "title": { "type": "string", "description": "The title of the person, for example *Mr.* or *Mrs.*.", "example": "Mr." }, "givenName": { "type": "string", "description": "The given name (first name) of the person should be at least two characters and cannot contain only numbers.", "example": "John" }, "familyName": { "type": "string", "description": "The given family name (surname) of the person should be at least two characters and cannot contain only numbers.", "example": "Doe" }, "organizationName": { "type": "string", "description": "The name of the organization, in case the addressee is an organization.", "example": "Mollie B.V." }, "streetAndNumber": { "type": "string", "description": "A street and street number.", "example": "Keizersgracht 126" }, "streetAdditional": { "type": "string", "description": "Any additional addressing details, for example an apartment number.", "example": "4th floor" }, "postalCode": { "type": "string", "description": "A postal code. This field may be required if the provided country has a postal code system.", "example": "5678AB" }, "email": { "type": "string", "example": "example@email.com" }, "phone": { "type": "string", "description": "If provided, it must be in the [E.164](https://en.wikipedia.org/wiki/E.164) format. For example: +31208202070.", "example": 3130920207 }, "city": { "type": "string", "example": "Amsterdam" }, "region": { "type": "string", "example": "Noord-Holland" }, "country": { "type": "string", "description": "A country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.", "example": "NL" } } }, "shippingAddress": { "description": "The customer's shipping address details. We advise to provide these details to improve fraud protection and conversion. This is particularly relevant for card payments.", "type": "object", "properties": { "title": { "type": "string", "description": "The title of the person, for example *Mr.* or *Mrs.*.", "example": "Mr." }, "givenName": { "type": "string", "description": "The given name (first name) of the person should be at least two characters and cannot contain only numbers.", "example": "John" }, "familyName": { "type": "string", "description": "The given family name (surname) of the person should be at least two characters and cannot contain only numbers.", "example": "Doe" }, "organizationName": { "type": "string", "description": "The name of the organization, in case the addressee is an organization.", "example": "Mollie B.V." }, "streetAndNumber": { "type": "string", "description": "A street and street number.", "example": "Keizersgracht 126" }, "streetAdditional": { "type": "string", "description": "Any additional addressing details, for example an apartment number.", "example": "4th floor" }, "postalCode": { "type": "string", "description": "A postal code. This field may be required if the provided country has a postal code system.", "example": "5678AB" }, "email": { "type": "string", "example": "example@email.com" }, "phone": { "type": "string", "description": "If provided, it must be in the [E.164](https://en.wikipedia.org/wiki/E.164) format. For example: +31208202070.", "example": 3130920207 }, "city": { "type": "string", "example": "Amsterdam" }, "region": { "type": "string", "example": "Noord-Holland" }, "country": { "type": "string", "description": "A country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.", "example": "NL" } } }, "locale": { "type": "string", "description": "Allows you to preset the language to be used in the hosted payment pages shown to the customer. Setting a locale is highly recommended and will greatly improve your conversion rate. When this parameter is omitted the browser language will be used instead if supported by the payment method. You can provide any `xx_XX` format ISO 15897 locale, but our hosted payment pages currently only support the specified languages.\n\nFor bank transfer payments specifically, the locale will determine the target bank account the customer has to transfer the money to. We have dedicated bank accounts for Belgium, Germany, and The Netherlands. Having the customer use a local bank account greatly increases the conversion and speed of payment.\n\nPossible values: `en_US` `en_GB` `nl_NL` `nl_BE` `de_DE` `de_AT` `de_CH` `fr_FR` `fr_BE` `es_ES` `ca_ES` `pt_PT` `it_IT` `nb_NO` `sv_SE` `fi_FI` `da_DK` `is_IS` `hu_HU` `pl_PL` `lv_LV` `lt_LT` `null`", "example": "en_US" }, "method": { "type": [ "string", "null" ], "description": "Normally, a payment method screen is shown. However, when using this parameter, you can choose a specific payment method and your customer will skip the selection screen and is sent directly to the chosen payment method. The parameter enables you to fully integrate the payment method selection into your website.\n\nYou can also specify the methods in an array. By doing so we will still show the payment method selection screen but will only show the methods specified in the array. For example, you can use this functionality to only show payment methods from a specific country to your customer `['bancontact', 'belfius']`.\n\nPossible values: `applepay` `bancomatpay` `bancontact` `banktransfer` `belfius` `billie` `creditcard` `directdebit` `eps` `giftcard` `ideal` `in3` `kbc` `klarna` `klarnapaylater` `klarnapaynow` `klarnasliceit` `mybank` `paypal` `paysafecard` `przelewy24` `riverty` `satispay` `trustly` `twint` `voucher`", "example": "creditcard" }, "shopperCountryMustMatchBillingCountry": { "type": "boolean", "description": "For digital goods, you must make sure to apply the VAT rate from your customer's country in most jurisdictions. You can use this parameter to restrict the payment methods available to your customer to methods from the billing country only.\n\nThis field is similar to the `restrictPaymentMethodsToCountry` field in the Payments API.", "example": true }, "metadata": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "array", "items": { "type": "string" } }, { "type": "null" } ], "description": "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." }, "status": { "allOf": [ { "type": "string", "description": "The order's status. Refer to the [documentation regarding statuses](order-status-changes) for more info about which statuses occur at what point.\n\nPossible values: `created` `pending` `authorized` `paid` `shipping` `canceled` `expired` `completed`", "example": "created" } ], "readOnly": true }, "isCancelable": { "type": "boolean", "description": "Whether the order can be canceled. This parameter is omitted if the order reaches a final state.", "example": true, "readOnly": true }, "profileId": { "description": "The identifier referring to the [profile](get-profile) this entity belongs to.\n\nMost API credentials are linked to a single profile. In these cases the `profileId` must not be sent in the creation request. For organization-level credentials such as OAuth access tokens however, the `profileId` parameter is required.", "type": "string", "pattern": "^pfl_.+$", "example": "pfl_5B8cwPMGnU" }, "createdAt": { "type": "string", "description": "The entity's date and time of creation, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.", "readOnly": true, "example": "2024-03-20T09:13:37+00:00" }, "authorizedAt": { "type": "string", "description": "The date and time the order became authorized, in ISO 8601 format. This parameter is omitted if the order is not authorized (yet).", "example": "2025-04-03T14:03:17+00:00", "readOnly": true }, "paidAt": { "type": "string", "description": "The date and time the order became paid, in ISO 8601 format. This parameter is omitted if the order is not completed (yet).", "example": "2025-04-03T14:03:17+00:00", "readOnly": true }, "canceledAt": { "type": "string", "description": "The date and time the order was canceled, in ISO 8601 format. This parameter is omitted if the order is not canceled (yet).", "example": "2025-04-03T14:03:17+00:00", "readOnly": true }, "expiresAt": { "type": "string", "description": "The date the order should expire in `YYYY-MM-DD` format. The minimum date is tomorrow and the maximum date is 100 days after tomorrow.\n\nIt is not possible to use Klarna when your expiry date is more than 28 days in the future, unless you agreed on a different maximum with Klarna.", "example": "2025-01-01" }, "expiredAt": { "type": "string", "description": "The date and time the order was expired, in ISO 8601 format. This parameter is omitted if the order did not expire (yet).", "example": "2025-04-03T14:03:17+00:00", "readOnly": true }, "completedAt": { "type": "string", "description": "The date and time the order was completed, in ISO 8601 format. This parameter is omitted if the order is not completed (yet).", "example": "2025-04-03T14:03:17+00:00", "readOnly": true }, "consumerDateOfBirth": { "type": "string", "description": "The date of birth of the consumer in `YYYY-MM-DD` format.", "example": "2000-01-01" }, "testmode": { "type": [ "boolean", "null" ], "description": "Whether to create the entity in test mode or live mode.\n\nMost 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`.", "writeOnly": true, "example": false }, "lines": { "type": "array", "description": "The order lines for the order. Each line contains details such as a description of the item ordered and its price.\n\nAll lines must have the same currency as the payment.", "items": { "type": "object", "required": [ "name", "quantity", "unitPrice", "totalAmount" ], "properties": { "resource": { "type": "string", "description": "Indicates the response contains an order line object. Will always contain the string `orderline`.", "readOnly": true, "default": "orderline" }, "id": { "allOf": [ { "type": "string", "pattern": "^odl_.+$", "example": "odl_5B8cwPMGnU" } ], "description": "The identifier uniquely referring to this order line. Mollie assigns this identifier at order line creation time. Example: `odl_jp31jz`.", "readOnly": true }, "type": { "description": "The type of product purchased. For example, a physical or a digital product.\n\nPossible values: `physical` `digital` `discount` `shipping_fee` `store_credit` `gift_card` `surcharge` (default: `physical`)", "type": "string", "example": "physical" }, "name": { "type": "string", "description": "A description of the line item. For example *LEGO 4440 Forest Police Station*.", "example": "Ready Player One" }, "quantity": { "type": "integer", "description": "The number of items.", "minimum": 1, "example": 2 }, "quantityShipped": { "type": "integer", "description": "The number of items shipped.", "example": 1 }, "amountShipped": { "description": "The amount shipped.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "quantityRefunded": { "type": "integer", "description": "The number of items refunded.", "example": 1 }, "amountRefunded": { "description": "The amount refunded.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "quantityCanceled": { "type": "integer", "description": "The number of items canceled.", "example": 1 }, "amountCanceled": { "description": "The amount canceled.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "shippableQuantity": { "type": "integer", "description": "The number of items that can be shipped.", "example": 1 }, "refundableQuantity": { "type": "integer", "description": "The number of items that can be refunded.", "example": 1 }, "cancelableQuantity": { "type": "integer", "description": "The number of items that can be canceled.", "example": 1 }, "unitPrice": { "description": "The price of a single item including VAT.\n\nFor example: `{\"currency\":\"EUR\", \"value\":\"89.00\"}` if the box of LEGO costs €89.00 each.\n\nFor types `discount`, `store_credit`, and `gift_card`, the unit price must be negative.\n\nThe unit price can be zero in case of free items.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "discountAmount": { "description": "Any line-specific discounts, as a positive amount. Not relevant if the line itself is already a discount type.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "totalAmount": { "description": "The total amount of the line, including VAT and discounts.\n\nShould match the following formula: `(unitPrice × quantity) - discountAmount`.\n\nThe sum of all `totalAmount` values of all order lines should be equal to the full payment amount.", "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "vatRate": { "type": "string", "description": "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.", "example": 25 }, "vatAmount": { "description": "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))`.\n\nAny deviations from this will result in an error.\n\nFor 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`.", "example": 2, "type": "object", "required": [ "currency", "value" ], "properties": { "currency": { "type": "string", "description": "A three-character ISO 4217 currency code.", "example": "EUR" }, "value": { "type": "string", "description": "A string containing an exact monetary amount in the given currency.", "example": "10.00" } } }, "sku": { "type": "string", "description": "The SKU, EAN, ISBN or UPC of the product sold.", "maxLength": 64, "example": "978-1524763282" }, "category": { "allOf": [ { "type": "string", "enum": [ "eco", "gift", "meal", "sport_culture", "additional", "consume" ], "example": "eco" } ], "description": "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.", "writeOnly": true }, "status": { "allOf": [ { "type": "string", "enum": [ "created", "authorized", "paid", "canceled", "shipping", "completed" ], "example": "created" } ], "description": "The status of the order line.", "readOnly": true }, "isCancelable": { "type": "boolean", "description": "Whether the order line can still be canceled.", "example": true, "readOnly": true }, "metadata": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "object", "properties": {}, "additionalProperties": true }, { "type": "array", "items": { "type": "string" } }, { "type": "null" } ], "description": "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." }, "orderId": { "allOf": [ { "type": "string", "pattern": "^ord_.+$", "example": "ord_5B8cwPMGnU" } ], "description": "The unique identifier of the order this order line belongs to. For example: `ord_8wmqcHMN4U`.", "readOnly": true }, "imageUrl": { "type": "string", "description": "A link pointing to an image of the product sold.", "example": "https://www.example.com/image", "writeOnly": true }, "productUrl": { "type": "string", "description": "A link pointing to the product page in your web shop of the product sold.", "example": "https://www.example.com/product", "writeOnly": true }, "createdAt": { "type": "string", "description": "The entity's date and time of creation, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.", "readOnly": true, "example": "2024-03-20T09:13:37+00:00" }, "_links": { "type": "object", "description": "An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.", "properties": { "self": { "type": "object", "description": "In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } }, "imageUrl": { "description": "A link pointing to an image of the product sold.", "type": "object", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } }, "productUrl": { "description": "A link pointing to the product page in your web shop of the product sold.", "type": "object", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } } }, "readOnly": true } } } }, "_links": { "type": "object", "description": "An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.", "properties": { "self": { "type": "object", "description": "In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } }, "checkout": { "description": "The URL your customer should visit to make the payment. This is where you should redirect the customer to.", "type": [ "object", "null" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } }, "dashboard": { "description": "Direct link to the order in the Mollie dashboard.", "type": "object", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } }, "documentation": { "type": "object", "description": "In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "description": "The actual URL string.", "example": "https://..." }, "type": { "type": "string", "description": "The content type of the page or endpoint the URL points to.", "example": "application/hal+json" } } } }, "readOnly": true } } }, "examples": { "manage-order-lines-200-1": { "summary": "The updated order object", "value": { "resource": "order", "id": "ord_pbjz8x", "mode": "live", "orderNumber": "34629", "lines": [ { "resource": "orderline", "id": "odl_1.1l9vx0", "type": "physical", "name": "LEGO 42083 Bugatti Chiron", "quantity": 2, "vatRate": "21.00", "unitPrice": { "currency": "EUR", "value": "399.00" }, "totalAmount": { "currency": "EUR", "value": "698.00" }, "discountAmount": { "currency": "EUR", "value": "100.00" }, "vatAmount": { "currency": "EUR", "value": "121.14" }, "sku": "5702016116977", "status": "created", "isCancelable": false, "orderId": "ord_pbjz8x", "createdAt": "2023-08-02T09:29:56+00:00" }, { "resource": "orderline", "id": "odl_jp31jz", "type": "digital", "name": "New order line", "quantity": 2, "vatRate": "0.00", "unitPrice": { "currency": "EUR", "value": "15.00" }, "totalAmount": { "currency": "EUR", "value": "30.00" }, "vatAmount": { "currency": "EUR", "value": "0.00" }, "sku": "48297102", "status": "created", "isCancelable": false, "orderId": "ord_pbjz8x", "createdAt": "2023-08-02T09:36:19+00:00" } ], "amount": { "currency": "EUR", "value": "728.00" }, "billingAddress": {}, "redirectUrl": "https://example.org/redirect", "webhookUrl": "https://example.org/webhook", "profileId": "pfl_URR55HPMGx", "status": "created", "isCancelable": true, "createdAt": "2023-08-02T09:29:56+00:00", "expiresAt": "2023-08-30T09:29:56+00:00", "_links": { "self": { "href": "...", "type": "application/hal+json" }, "checkout": { "href": "https://www.mollie.com/checkout/select-method/7UhSN1zuXS", "type": "text/html" }, "dashboard": { "href": "https://www.mollie.com/dashboard/org_123456789/orders/ord_pbjz8x", "type": "text/html" }, "documentation": { "href": "...", "type": "text/html" } } } } } } } }, "404": { "description": "No entity with this ID exists.", "content": { "application/hal+json": { "schema": { "type": "object", "description": "An error response object.", "required": [ "status", "title", "detail", "_links" ], "properties": { "status": { "type": "integer", "description": "The status code of the error message. This is always the same code as the status code of the HTTP message itself.", "minimum": 400, "maximum": 599, "example": 404 }, "title": { "type": "string", "description": "The HTTP reason phrase of the error. For example, for a `404` error, the `title` will be `Not Found`.", "example": "Not Found" }, "detail": { "type": "string", "description": "A detailed human-readable description of the error that occurred.", "example": "The resource does not exist" }, "field": { "type": "string", "description": "If the error was caused by a value provided by you in a specific field, the `field` property will contain the name of the field that caused the issue.", "example": "description" }, "_links": { "type": "object", "required": [ "documentation" ], "properties": { "documentation": { "type": "object", "description": "The URL to the generic Mollie API error handling guide.", "required": [ "href", "type" ], "properties": { "href": { "type": "string", "example": "https://docs.mollie.com/errors" }, "type": { "type": "string", "example": "text/html" } } } } } } }, "example": { "status": 404, "title": "Not Found", "detail": "No entity exists with token 'uct_abcDEFghij123456789'", "_links": { "documentation": { "href": "...", "type": "text/html" } } } } } } }, "x-readme": { "code-samples": [ { "language": "shell", "code": "curl -X PATCH https://api.mollie.com/v2/orders/ord_pbjz8x/lines \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM\" \\\n -d \"operations[0][operation]=update\" \\\n -d \"operations[0][data][id]=odl_1.1l9vx0\" \\\n -d \"operations[0][data][name]=LEGO 42083 Bugatti Chiron\" \\\n -d \"operations[1][operation]=cancel\" \\\n -d \"operations[1][data][id]=odl_1.4hqjw6\" \\\n -d \"operations[2][operation]=add\" \\\n -d \"operations[2][data][name]=New order line\" \\\n -d \"operations[2][data][quantity]=2\" \\\n -d \"operations[2][data][sku]=48297102\" \\\n -d \"operations[2][data][totalAmount][currency]=EUR\" \\\n -d \"operations[2][data][totalAmount][value]=30.00\" \\\n -d \"operations[2][data][type]=digital\" \\\n -d \"operations[2][data][unitPrice][currency]=EUR\" \\\n -d \"operations[2][data][unitPrice][value]=15.00\" \\\n -d \"operations[2][data][vatAmount][currency]=EUR\" \\\n -d \"operations[2][data][vatAmount][value]=0.00\" \\\n -d \"operations[2][data][vatRate]=0.00\"" }, { "language": "php", "code": "setApiKey(\"live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM\");\n\n$mollie->orderLines->updateMultiple(\"ord_pbjz8x\", [\n [\n \"operation\" => \"update\",\n \"data\" => [\n \"id\" => \"odl_1.1l9vx0\",\n \"name\" => \"LEGO 42083 Bugatti Chiron\",\n ],\n ],\n [\n \"operation\" => \"cancel\",\n \"data\" => [\n \"id\" => \"odl_1.4hqjw6\",\n ],\n ],\n [\n \"operation\" => \"add\",\n \"data\" => [\n \"name\" => \"New order line\",\n \"quantity\" => \"2\",\n \"sku\" => \"48297102\",\n \"totalAmount\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"30.00\",\n ],\n \"type\" => \"digital\",\n \"unitPrice\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"15.00\",\n ],\n \"vatAmount\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"30.00\",\n ],\n \"vatRate\" => \"0.00\",\n ],\n ],\n]);", "install": "composer require mollie/mollie-api-php" }, { "language": "node", "code": "/*\nWe don't have a Node.js code example for this\nAPI call yet.\n\nIf you have some time to spare, feel free to\nshare suggestions on our Discord:\nhttps://discord.gg/VaTVkXB4aQ\n*/", "install": "npm install @mollie/api-client" }, { "language": "python", "code": "'''\nWe don't have a Python code example for this\nAPI call yet.\n\nIf you have some time to spare, feel free to\nshare suggestions on our Discord:\nhttps://discord.gg/VaTVkXB4aQ\n'''", "install": "pip install mollie-api-python" }, { "language": "ruby", "code": "# We don't have a Ruby code example for this\n# API call yet.\n#\n# If you have some time to spare, feel free to\n# share suggestions on our Discord:\n# https://discord.gg/VaTVkXB4aQ", "install": "gem install mollie-api-ruby" } ] } } } }, "components": { "securitySchemes": { "apiKey": { "type": "http", "scheme": "bearer", "x-default": "live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" }, "organizationAccessToken": { "type": "http", "scheme": "bearer", "x-default": "access_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" }, "oAuth": { "type": "oauth2", "flows": { "authorizationCode": { "authorizationUrl": "https://my.mollie.com/oauth2/authorize", "tokenUrl": "https://api.mollie.com/oauth2/tokens", "scopes": {} } } } } }, "x-readme": { "explorer-enabled": false, "samples-languages": [ "shell", "php", "node", "python", "ruby" ] } } ```