# Create shipment Create a shipment for specific order lines of an order. When using Klarna, using this endpoint is mandatory for the order amount to be captured. A [capture](get-capture) will automatically be created for the shipment. The word 'shipment' is used in the figurative sense here. It can also mean that a service was provided or digital content was delivered. > 🔑 Access with > > [API key](/reference/authentication) > > [Organization access token with **shipments.write**](/reference/authentication) > > [OAuth access with **shipments.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}/shipments": { "parameters": [ { "name": "orderId", "description": "Provide the ID of the related order.", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^ord_.+$", "example": "ord_5B8cwPMGnU" } } ], "post": { "deprecated": true, "summary": "Create shipment", "tags": [ "Shipments API" ], "operationId": "create-shipment", "security": [ { "apiKey": [] }, { "organizationAccessToken": [ "shipments.write" ] }, { "oAuth": [ "shipments.write" ] } ], "description": "Create a shipment for specific order lines of an order.\n\nWhen using Klarna, using this endpoint is mandatory for the order amount to be captured. A [capture](get-capture) will automatically be created for the shipment.\n\nThe word 'shipment' is used in the figurative sense here. It can also mean that a service was provided or digital content was delivered.\n\n> 🔑 Access with\n>\n> [API key](/reference/authentication)\n>\n> [Organization access token with **shipments.write**](/reference/authentication)\n>\n> [OAuth access with **shipments.write**](/reference/authentication)", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "resource": { "type": "string", "description": "Indicates the response contains a shipment object. Will always contain the string `shipment` for this endpoint.", "readOnly": true, "default": "shipment" }, "id": { "allOf": [ { "type": "string", "pattern": "^shp_.+$", "example": "shp_5x4xQJDWGNcY3tKGL7X5J" } ], "description": "The identifier uniquely referring to this shipment. Example: `shp_gNapNy9qQTUFZYnCrCF7J`.", "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" }, "orderId": { "allOf": [ { "type": "string", "pattern": "^ord_.+$", "example": "ord_5B8cwPMGnU" } ], "description": "The unique identifier of the order this shipment was created for. For example: `ord_8wmqcHMN4U`.", "readOnly": 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" }, "tracking": { "type": "object", "description": "Shipment tracking details. Can be omitted if tracking details are not available or not applicable.", "properties": { "carrier": { "type": "string", "description": "The name of the postal carrier.", "example": "PostNL" }, "code": { "type": "string", "description": "The track-and-trace code for the shipment.", "example": "3SKABA000000000" }, "url": { "type": "string", "description": "The URL where your customer can track the shipment.", "example": "http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1015CW&D=NL&T=C" } } }, "routing": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "The identifier uniquely referring to this route. Mollie will always refer to the route by this ID. Example: `rt_5B8cwPMGnU6qLbRvo7qEZo`.", "type": "string", "pattern": "^rt_.+$", "example": "rt_5B8cwPMGnU" }, "amount": { "description": "The portion of the total payment amount being routed.", "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" } } }, "destination": { "type": "object", "description": "The destination of this portion of the payment.", "properties": { "type": { "type": "string", "description": "The type of destination. Currently only the destination type `organization` is supported.\n\nPossible values: `organization`", "example": "organization" }, "organizationId": { "description": "Required for destination type `organization`. The ID of the connected organization the funds should be routed to.", "type": "string", "pattern": "^org_.+$", "example": "org_1234567" } } } } }, "readOnly": true }, "lines": { "type": "array", "description": "The order lines that are being fulfilled with this shipment. If left blank, all open order lines will be considered fulfilled.", "items": { "type": "object", "required": [ "resource", "id", "orderId", "name", "sku", "type", "status", "metadata", "isCancelable", "quantity", "unitPrice", "vatRate", "vatAmount", "totalAmount", "createdAt", "_links" ], "properties": { "resource": { "type": "string", "readOnly": true, "example": "orderline" }, "id": { "description": "The ID of the order line you wish to refund. For example: `odl_jp31y97yjz`.", "type": "string", "pattern": "^odl_.+$", "example": "odl_5B8cwPMGnU" }, "orderId": { "allOf": [ { "type": "string", "pattern": "^ord_.+$", "example": "ord_5B8cwPMGnU" } ], "readOnly": true }, "name": { "type": "string", "example": "Chess Board" }, "sku": { "type": [ "string", "null" ], "example": 5702016116977 }, "type": { "type": "string", "enum": [ "physical", "digital", "discount", "shipping_fee", "store_credit", "gift_card", "surcharge" ], "example": "physical", "default": "physical" }, "status": { "type": "string", "enum": [ "created", "authorized", "paid", "canceled", "shipping", "completed" ], "example": "created" }, "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." }, "isCancelable": { "type": "boolean", "example": false }, "quantity": { "type": "integer", "description": "The number of items that should be refunded for this order line. When this parameter is omitted, the whole order line will be refunded.\n\nMust be less than the number of items already refunded for this order line.", "example": 1 }, "quantityShipped": { "type": "integer", "example": 0 }, "amountShipped": { "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" } } }, "quantityRefunded": { "type": "integer", "example": 0 }, "amountRefunded": { "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" } } }, "quantityCanceled": { "type": "integer", "example": 0 }, "amountCanceled": { "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" } } }, "amount": { "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 amount that you want to refund. In almost all cases, Mollie can determine the amount automatically.\n\nThe amount is required only if you are partially refunding an order line which has a non-zero `discountAmount`.\n\nThe amount you can refund depends on various properties of the order line and the create order refund request. The maximum that can be refunded is `unit price x quantity to ship`.\n\nThe minimum amount depends on the discount applied to the line, the quantity already refunded or shipped, the amounts already refunded or shipped and the quantity you want to refund.\n\nIf you do not send an amount, Mollie will determine the amount automatically or respond with an error if the amount cannot be determined automatically. The error will contain the `extra.minimumAmount` and `extra.maximumAmount` properties that allow you pick the right amount.", "writeOnly": true }, "shippableQuantity": { "type": "integer", "example": 0 }, "refundableQuantity": { "type": "integer", "example": 0 }, "cancelableQuantity": { "type": "integer", "example": 0 }, "unitPrice": { "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" } } } ], "readOnly": true }, "totalAmount": { "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" } } } ], "readOnly": true }, "vatRate": { "type": "string", "example": "21.00" }, "vatAmount": { "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" } } } ], "readOnly": true }, "createdAt": { "type": "string", "example": "2025-03-28T16:42:12+00:00" }, "discountedAmount": { "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" } } } ], "readOnly": true }, "_links": { "type": "object", "description": "An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.", "properties": { "productUr": { "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": { "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 } } } }, "_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" } } }, "order": { "description": "The API resource URL of the [order](get-order) that this shipment belongs to.", "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 } } } } } }, "responses": { "201": { "description": "The newly created shipment object.", "content": { "application/hal+json": { "schema": { "type": "object", "properties": { "resource": { "type": "string", "description": "Indicates the response contains a shipment object. Will always contain the string `shipment` for this endpoint.", "readOnly": true, "default": "shipment" }, "id": { "allOf": [ { "type": "string", "pattern": "^shp_.+$", "example": "shp_5x4xQJDWGNcY3tKGL7X5J" } ], "description": "The identifier uniquely referring to this shipment. Example: `shp_gNapNy9qQTUFZYnCrCF7J`.", "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" }, "orderId": { "allOf": [ { "type": "string", "pattern": "^ord_.+$", "example": "ord_5B8cwPMGnU" } ], "description": "The unique identifier of the order this shipment was created for. For example: `ord_8wmqcHMN4U`.", "readOnly": 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" }, "tracking": { "type": "object", "description": "Shipment tracking details. Can be omitted if tracking details are not available or not applicable.", "properties": { "carrier": { "type": "string", "description": "The name of the postal carrier.", "example": "PostNL" }, "code": { "type": "string", "description": "The track-and-trace code for the shipment.", "example": "3SKABA000000000" }, "url": { "type": "string", "description": "The URL where your customer can track the shipment.", "example": "http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1015CW&D=NL&T=C" } } }, "routing": { "type": "array", "items": { "type": "object", "properties": { "id": { "description": "The identifier uniquely referring to this route. Mollie will always refer to the route by this ID. Example: `rt_5B8cwPMGnU6qLbRvo7qEZo`.", "type": "string", "pattern": "^rt_.+$", "example": "rt_5B8cwPMGnU" }, "amount": { "description": "The portion of the total payment amount being routed.", "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" } } }, "destination": { "type": "object", "description": "The destination of this portion of the payment.", "properties": { "type": { "type": "string", "description": "The type of destination. Currently only the destination type `organization` is supported.\n\nPossible values: `organization`", "example": "organization" }, "organizationId": { "description": "Required for destination type `organization`. The ID of the connected organization the funds should be routed to.", "type": "string", "pattern": "^org_.+$", "example": "org_1234567" } } } } }, "readOnly": true }, "lines": { "type": "array", "description": "The order lines that are being fulfilled with this shipment. If left blank, all open order lines will be considered fulfilled.", "items": { "type": "object", "required": [ "resource", "id", "orderId", "name", "sku", "type", "status", "metadata", "isCancelable", "quantity", "unitPrice", "vatRate", "vatAmount", "totalAmount", "createdAt", "_links" ], "properties": { "resource": { "type": "string", "readOnly": true, "example": "orderline" }, "id": { "description": "The ID of the order line you wish to refund. For example: `odl_jp31y97yjz`.", "type": "string", "pattern": "^odl_.+$", "example": "odl_5B8cwPMGnU" }, "orderId": { "allOf": [ { "type": "string", "pattern": "^ord_.+$", "example": "ord_5B8cwPMGnU" } ], "readOnly": true }, "name": { "type": "string", "example": "Chess Board" }, "sku": { "type": [ "string", "null" ], "example": 5702016116977 }, "type": { "type": "string", "enum": [ "physical", "digital", "discount", "shipping_fee", "store_credit", "gift_card", "surcharge" ], "example": "physical", "default": "physical" }, "status": { "type": "string", "enum": [ "created", "authorized", "paid", "canceled", "shipping", "completed" ], "example": "created" }, "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." }, "isCancelable": { "type": "boolean", "example": false }, "quantity": { "type": "integer", "description": "The number of items that should be refunded for this order line. When this parameter is omitted, the whole order line will be refunded.\n\nMust be less than the number of items already refunded for this order line.", "example": 1 }, "quantityShipped": { "type": "integer", "example": 0 }, "amountShipped": { "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" } } }, "quantityRefunded": { "type": "integer", "example": 0 }, "amountRefunded": { "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" } } }, "quantityCanceled": { "type": "integer", "example": 0 }, "amountCanceled": { "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" } } }, "amount": { "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 amount that you want to refund. In almost all cases, Mollie can determine the amount automatically.\n\nThe amount is required only if you are partially refunding an order line which has a non-zero `discountAmount`.\n\nThe amount you can refund depends on various properties of the order line and the create order refund request. The maximum that can be refunded is `unit price x quantity to ship`.\n\nThe minimum amount depends on the discount applied to the line, the quantity already refunded or shipped, the amounts already refunded or shipped and the quantity you want to refund.\n\nIf you do not send an amount, Mollie will determine the amount automatically or respond with an error if the amount cannot be determined automatically. The error will contain the `extra.minimumAmount` and `extra.maximumAmount` properties that allow you pick the right amount.", "writeOnly": true }, "shippableQuantity": { "type": "integer", "example": 0 }, "refundableQuantity": { "type": "integer", "example": 0 }, "cancelableQuantity": { "type": "integer", "example": 0 }, "unitPrice": { "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" } } } ], "readOnly": true }, "totalAmount": { "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" } } } ], "readOnly": true }, "vatRate": { "type": "string", "example": "21.00" }, "vatAmount": { "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" } } } ], "readOnly": true }, "createdAt": { "type": "string", "example": "2025-03-28T16:42:12+00:00" }, "discountedAmount": { "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" } } } ], "readOnly": true }, "_links": { "type": "object", "description": "An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.", "properties": { "productUr": { "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": { "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 } } } }, "_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" } } }, "order": { "description": "The API resource URL of the [order](get-order) that this shipment belongs to.", "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": { "get-shipment-200-1": { "summary": "The shipment object", "value": { "resource": "shipment", "id": "shp_gNapNy9qQTUFZYnCrCF7J", "mode": "live", "orderId": "ord_pbjz8x", "tracking": { "carrier": "PostNL", "code": "3SKABA000000000", "url": "http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1015CW&D=NL&T=C" }, "createdAt": "2023-08-09T14:33:54+00:00", "lines": [ { "resource": "orderline", "id": "odl_dgtxyl", "type": "physical", "name": "LEGO 42083 Bugatti Chiron", "quantity": 1, "unitPrice": { "currency": "EUR", "value": "399.00" }, "totalAmount": { "currency": "EUR", "value": "399.00" }, "vatRate": "21.00", "vatAmount": { "currency": "EUR", "value": "69.24" }, "sku": "5702016116977", "status": "shipping", "orderId": "ord_pbjz8x", "createdAt": "2023-08-02T09:29:56+00:00" }, { "resource": "orderline", "id": "odl_jp31jz", "type": "physical", "name": "LEGO 42056 Porsche 911 GT3 RS", "quantity": 1, "unitPrice": { "currency": "EUR", "value": "329.99" }, "totalAmount": { "currency": "EUR", "value": "329.99" }, "vatRate": "21.00", "vatAmount": { "currency": "EUR", "value": "57.27" }, "sku": "5702015594028", "status": "completed", "orderId": "ord_pbjz8x", "createdAt": "2023-08-02T09:29:56+00:00" } ], "_links": { "self": { "href": "...", "type": "application/hal+json" }, "order": { "href": "https://api.mollie.com/v2/orders/ord_pbjz8x", "type": "application/hal+json" }, "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 an order line ID is missing.", "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": "Cannot create a shipment or cancelation for these lines, as none of the\nlines can be shipped or canceled.", "field": "lines", "_links": { "documentation": { "href": "...", "type": "text/html" } } } } } } }, "x-readme": { "code-samples": [ { "language": "shell", "code": "curl -X POST https://api.mollie.com/v2/payments/ord_pbjz8x/shipments \\\n -H \"Authorization: Bearer live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM\" \\\n -d \"lines[0][id]=odl_dgtxyl\" \\\n -d \"lines[0][quantity]=1\" \\\n -d \"lines[1][id]=odl_jp31jz\" \\\n -d \"tracking[carrier]=PostNL\" \\\n -d \"tracking[code]=3SKABA000000000\" \\\n -d \"tracking[url]=http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1015CW&D=NL&T=C\"" }, { "language": "php", "code": "setApiKey(\"live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM\");\n\n$order = $mollie->orders->get(\"ord_pbjz8x\");\n$shipment = $order->createShipment([\n \"lines\" => [\n [\n // You can set the quantity to partially ship an order line\n \"id\" => \"odl_dgtxyl\",\n \"quantity\" => 1,\n ],\n [\n // Or, omit the quantity to ship the full order line\n \"id\" => \"odl_jp31jz\",\n ],\n ],\n [\n \"tracking\" => [\n \"carrier\" => \"PostNL\",\n \"code\" => \"3SKABA000000000\",\n \"url\" => \"http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1015CW&D=NL&T=C\"\n ],\n]);\n\n// Alternative notation for shipping all remaining order lines\n$shipment = $order->shipAll([\n \"tracking\" => [\n \"carrier\" => \"PostNL\",\n \"code\" => \"3SKABA000000000\",\n \"url\" => \"http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1015CW&D=NL&T=C\"\n ],\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 shipment = await mollieClient.orderShipments.create({\n orderId: 'ord_pbjz8x',\n lines: [\n {\n // You can set the quantity to partially ship an order line\n id: 'odl_dgtxyl',\n quantity: 1\n },\n {\n // Or, omit the quantity to ship the full order line\n id: 'odl_jp31jz'\n }\n ],\n tracking: {\n carrier: 'PostNL',\n code: '3SKABA000000000',\n url: 'http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1015CW&D=NL&T=C'\n }\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\")\nshipment = order.shipments.create({\n \"lines\": [\n {\n # You can set the quantity to partially ship an order line\n \"id\": \"odl_dgtxyl\",\n \"quantity\": 1,\n },\n {\n # Or, omit the quantity to ship the full order line\n \"id\": \"odl_jp31jz\",\n }\n ],\n \"tracking\": {\n \"carrier\": \"PostNL\",\n \"code\": \"3SKABA000000000\",\n \"url\": \"http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1015CW&D=NL&T=C\",\n }\n})\n\n# Alternative notation for shipping all remaining order lines\nshipment = order.create_shipment({\n \"tracking\": {\n \"carrier\": \"PostNL\",\n \"code\": \"3SKABA000000000\",\n \"url\": \"http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1015CW&D=NL&T=C\",\n }\n})\n\n# Or, when no tracking is specified\nshipment = order.shipments.create()", "install": "pip install mollie-api-python" }, { "language": "ruby", "code": "require 'mollie-api-ruby'\n\nMollie::Client.configure do |config|\n config.api_key = 'live_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'\nend\n\nshipment = Mollie::Order::Shipment.create(\n order_id: 'ord_pbjz8x',\n lines: [\n {\n # You can set the quantity to partially ship an order line\n id: 'odl_dgtxyl',\n quantity: 1\n },\n {\n # Or, omit the quantity to ship the full order line\n id: 'odl_jp31jz'\n }\n ],\n tracking: {\n carrier: 'PostNL',\n code: '3SKABA000000000',\n url: 'http://postnl.nl/tracktrace/?B=3SKABA000000000&P=1015CW&D=NL&T=C'\n }\n)", "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" ] } } ```