# Update order line **⚠️ We no longer recommend using the Orders API. Please refer to the [Payments API](payments-api) instead.** Update an order line belonging to an order. Only lines with status `created`, `pending`, or `authorized` can be updated. This endpoint is useful for cases where specific details of an order line are changed. For example, if a customer changes a red shirt for a blue one of the same model. In this case only specific properties of the order line need to be updated, such as the `name`, the `imageUrl`, and perhaps the `amount`. To swap out an order line for an entirely new order line, use the [Manage order lines](manage-order-lines) endpoint instead. For an in-depth explanation of each parameter, refer to the `lines` parameter of the [Create order](create-order) endpoint. > 🔑 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/{orderlineId}": { "parameters": [ { "name": "orderId", "description": "Provide the ID of the related order.", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^ord_.+$", "example": "ord_5B8cwPMGnU" } }, { "name": "orderlineId", "description": "Provide the ID of the related order.", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^odl_.+$", "example": "odl_5B8cwPMGnU" } } ], "patch": { "deprecated": true, "summary": "Update order line", "tags": [ "Orders API" ], "operationId": "update-order-line", "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\nUpdate an order line belonging to an order. Only lines with status `created`, `pending`, or `authorized` can be updated.\n\nThis endpoint is useful for cases where specific details of an order line are changed. For example, if a customer changes a red shirt for a blue one of the same model. In this case only specific properties of the order line need to be updated, such as the `name`, the `imageUrl`, and perhaps the `amount`.\n\nTo swap out an order line for an entirely new order line, use the [Manage order lines](manage-order-lines) endpoint instead.\n\nFor an in-depth explanation of each parameter, refer to the `lines` parameter of the [Create order](create-order) endpoint.\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": { "name": { "type": "string", "description": "A description of the line item. For example *LEGO 4440 Forest Police Station*.", "example": "Ready Player One" }, "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 }, "sku": { "type": "string", "description": "The SKU, EAN, ISBN or UPC of the product sold.", "maxLength": 64, "example": "978-1524763282" }, "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." }, "quantity": { "description": "Required when a `unitPrice`, `discountAmount`, `totalAmount`, `vatAmount`, or `vatRate` is also provided in the same request.", "type": "integer", "minimum": 1, "example": 2 }, "unitPrice": { "description": "Required when a `quantity`, `discountAmount`, `totalAmount`, `vatAmount`, or `vatRate` is also provided in the same request.", "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": { "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" } } }, "totalAmount": { "description": "Required when a `quantity`, `unitPrice`, `discountAmount`, `vatAmount`, or `vatRate` is also provided in the same request.", "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" } } }, "vatAmount": { "description": "Required when a `quantity`, `unitPrice`, `discountAmount`, `totalAmount`, or `vatRate` is also provided in the same request.", "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": { "description": "Required when a `quantity`, `unitPrice`, `discountAmount`, `totalAmount`, or `vatAmount` is also provided in the same request.", "type": "string", "example": 25 }, "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 } } } } } }, "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": { "update-order-line-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": "physical", "name": "LEGO 71043 Hogwarts Castle", "quantity": 2, "vatRate": "21.00", "unitPrice": { "currency": "EUR", "value": "349.00" }, "totalAmount": { "currency": "EUR", "value": "698.00" }, "vatAmount": { "currency": "EUR", "value": "121.14" }, "sku": "48297102", "status": "created", "isCancelable": false, "orderId": "ord_pbjz8x", "createdAt": "2023-08-02T09:29:56+00:00" } ], "amount": { "currency": "EUR", "value": "1296.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" } } } }, "update-order-line-200-2": { "summary": "Change quantity and resend amounts", "x-request": "./requests.yaml#/api-change-quantity-and-resend-amounts", "value": { "resource": "order", "id": "ord_efu0tw", "profileId": "pfl_85dxyKqNHa", "method": "ideal", "amount": { "value": "289.00", "currency": "EUR" }, "status": "created", "isCancelable": true, "metadata": { "someProperty": "someValue", "anotherProperty": "anotherValue" }, "createdAt": "2021-12-30T13:38:46+00:00", "expiresAt": "2022-01-27T13:38:46+00:00", "mode": "test", "locale": "en_US", "billingAddress": { "streetAndNumber": "corrected address", "postalCode": "corrected ", "city": "corrected city", "region": "Noord-Holland", "country": "NL", "title": "Dhr.", "givenName": "Piet", "familyName": "Mondriaan", "email": "test@mollie.com", "phone": "+3130920207" }, "shopperCountryMustMatchBillingCountry": false, "consumerDateOfBirth": "1958-01-31", "orderNumber": "1337", "shippingAddress": { "organizationName": "Mollie B.V.", "streetAndNumber": "Keizersgracht 126", "streetAdditional": "4th floor", "postalCode": "5678AB", "city": "Haarlem", "region": "Noord-Holland", "country": "NL", "title": "Mr.", "givenName": "Chuck", "familyName": "Norris", "email": "test@mollie.com" }, "redirectUrl": "https://example.com/landing_page", "webhookUrl": "https://example.com/redirect", "lines": [ { "resource": "orderline", "id": "odl_1.q28flc", "orderId": "ord_efu0tw", "name": "order line number 1", "sku": "5702016116977", "type": "physical", "status": "created", "metadata": null, "isCancelable": false, "quantity": 2, "quantityShipped": 0, "amountShipped": { "value": "0.00", "currency": "EUR" }, "quantityRefunded": 0, "amountRefunded": { "value": "0.00", "currency": "EUR" }, "quantityCanceled": 0, "amountCanceled": { "value": "0.00", "currency": "EUR" }, "shippableQuantity": 0, "refundableQuantity": 0, "cancelableQuantity": 0, "unitPrice": { "value": "89.00", "currency": "EUR" }, "vatRate": "21.00", "vatAmount": { "value": "29.16", "currency": "EUR" }, "totalAmount": { "value": "168.00", "currency": "EUR" }, "createdAt": "2021-12-30T13:38:46+00:00", "discountAmount": { "value": "10.00", "currency": "EUR" } }, { "resource": "orderline", "id": "odl_1.w48z1e", "orderId": "ord_efu0tw", "name": "order line number 2", "sku": "5702016116977", "type": "physical", "status": "created", "metadata": null, "isCancelable": false, "quantity": 1, "quantityShipped": 0, "amountShipped": { "value": "0.00", "currency": "EUR" }, "quantityRefunded": 0, "amountRefunded": { "value": "0.00", "currency": "EUR" }, "quantityCanceled": 0, "amountCanceled": { "value": "0.00", "currency": "EUR" }, "shippableQuantity": 0, "refundableQuantity": 0, "cancelableQuantity": 0, "unitPrice": { "value": "121.00", "currency": "EUR" }, "vatRate": "21.00", "vatAmount": { "value": "21.00", "currency": "EUR" }, "totalAmount": { "value": "121.00", "currency": "EUR" }, "createdAt": "2021-12-30T13:38:46+00:00" } ], "_links": { "self": { "href": "...", "type": "application/hal+json" }, "dashboard": { "href": "https://www.mollie.com/dashboard/org_13514547/orders/ord_efu0tw", "type": "text/html" }, "checkout": { "href": "https://www.mollie.com/checkout/order/efu0tw", "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" } } } } } }, "422": { "description": "The request contains issues. For example, if you are trying to update an order line that can no longer be updated.", "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": 422, "title": "Unprocessable Entity", "detail": "Update authorization not allowed", "_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/odl_jp31jz \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM\" \\\n -d \"name=LEGO 71043 Hogwarts Castle\" \\\n -d \"quantity=2\" \\\n -d \"unitPrice[currency]=EUR\" \\\n -d \"unitPrice[value]=349.00\" \\\n -d \"totalAmount[currency]=EUR\" \\\n -d \"totalAmount[value]=698.00\" \\\n -d \"vatAmount[currency]=EUR\" \\\n -d \"vatAmount[value]=121.14\"\n -d \"vatRate=21.00\"" }, { "language": "php", "code": "setApiKey(\"live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM\");\n\n$mollie->orderLines->update(\"ord_pbjz8x\", \"odl_jp31jz\", [\n \"name\" => \"LEGO 71043 Hogwarts Castle\",\n \"quantity\" => 2,\n \"unitPrice\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"349.00\",\n ],\n \"totalAmount\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"698.00\",\n ],\n \"vatAmount\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"121.14\",\n ],\n \"vatRate\" => \"21.00\",\n]);", "install": "composer require mollie/mollie-api-php" }, { "language": "node", "code": "const { createMollieClient } = require('@mollie/api-client');\nconst mollieClient = createMollieClient({ apiKey: 'live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' });\n\nconst order = await mollieClient.orderLines.update('odl_dgtxyl', {\n orderId: 'ord_pbjz8x',\n name: 'LEGO 71043 Hogwarts Castle',\n quantity: 2,\n unitPrice: {\n currency: 'EUR',\n value: '349.00',\n },\n totalAmount: {\n currency: 'EUR',\n value: '698.00',\n },\n vatAmount: {\n currency: 'EUR',\n value: '121.14',\n },\n vatRate: '21.00'\n});", "install": "npm install @mollie/api-client" }, { "language": "python", "code": "from mollie.api.client import Client\n\nmollie_client = Client()\nmollie_client.set_api_key(\"live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM\")\n\norder = mollie_client.orders.get(\"ord_pbjz8x\")\norder = order.lines.update(\"odl_dgtxyl\", {\n \"name\": \"LEGO 71043 Hogwarts Castle\",\n \"quantity\": 2,\n \"unitPrice\": {\n \"currency\": \"EUR\",\n \"value\": \"349.00\",\n },\n \"totalAmount\": {\n \"currency\": \"EUR\",\n \"value\": \"698.00\",\n },\n \"vatAmount\": {\n \"currency\": \"EUR\",\n \"value\": \"121.14\",\n },\n \"vatRate\": \"21.00\",\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" ] } } ```