> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/package-management/package-management-api/api-methods/create-a-new-package.md).

# Create a New Package

Create new packages in the ESW system using the  POST  method. You can create packages for the following types of orders:

* **Checkout**: This indicates orders that are placed through the ESW checkout.
* **Non-checkout**: This indicates orders that are placed through the retailer’s platform but delivered to the shopper by ESW. *(Coming soon)*

{% hint style="info" %}

#### Note

The documentation below covers only **Checkout Orders**.
{% endhint %}

* `tenantCode`, `orderReference`, `packageReference`, and `weight` parameters are required to create a package. If the mandatory request parameters are missing, the API returns a 400 - Bad Request message.
* If the consignee/shopper's address collected at the checkout has changed and needs to be updated, then the consignee object and its required parameters must be included in the request.
* The `packageItems` object is optional if all remaining shippable items in the order are contained in the package. If the package does not contain all remaining shippable items, then the `packageItems` object and its attributes must be included in the request.

## POST /packagemanagement/v1/{tenantCode}/orders/{orderReference}/packages

> Creates a new package for a specified tenant and order reference.

```json
{"openapi":"3.1.1","info":{"title":"Package Management API","version":"1"},"servers":[{"url":"https://api.sandbox.esw.com"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Please insert JWT with Bearer into field"}},"schemas":{"Logistics.PackageManagement.WebApiService.Models.Responses.CreatePackageResponse":{"description":"Represents the response returned after creating a package.","type":"object","properties":{"outcome":{"$ref":"#/components/schemas/Logistics.PackageManagement.Domain.Enums.Outcome"},"status":{"description":"The status of the shipping documentation generation.","type":"string"},"package":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Responses.PackageResponse"}},"additionalProperties":false},"Logistics.PackageManagement.Domain.Enums.Outcome":{"enum":["PackageCreated","PackageAndLabelCreated","PackageCreatedAndLabelError","PackageCreatedAndLabelOnHold","PackageAndLabelUpdated","PackageUpdatedAndLabelError","PackageUpdated"],"type":"string"},"Logistics.PackageManagement.WebApiService.Models.Responses.PackageResponse":{"description":"Represents a packageWithShippingDoc with its associated details.","type":"object","properties":{"tenantCode":{"description":"The tenant code associated with the packageWithShippingDoc.","type":"string"},"orderReference":{"description":"The order reference associated with the packageWithShippingDoc.","type":"string"},"packageReference":{"description":"A unique reference for the packageWithShippingDoc.","type":"string"},"eShopPackageReference":{"description":"A unique eShop packageWithShippingDoc reference.","type":"string"},"eswCarrierIdentifier":{"description":"The carrier identifier used by ESW for the packageWithShippingDoc.","type":"string"},"carrierReference":{"description":"The carrier reference number for the packageWithShippingDoc.","type":"string"},"parcelCarrierReference":{"description":"The parcel carrier reference number for the packageWithShippingDoc.","type":"string"},"weight":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.WeightInfo"},"shippingStatus":{"$ref":"#/components/schemas/Logistics.PackageManagement.Domain.Enums.ShippingStatus"},"goodsDescription":{"description":"A description of the goods contained in the packageWithShippingDoc.","type":"string"},"originFulfillmentCentreCode":{"description":"The code of the origin fulfillment center.","type":"string"},"serviceLevel":{"$ref":"#/components/schemas/Logistics.PackageManagement.Domain.Enums.ServiceLevel"},"dangerousGoods":{"description":"Indicates if the packageWithShippingDoc contains dangerous goods.","type":"boolean"},"dimensionInfo":{"description":"A list of dimensions for the packageWithShippingDoc.","type":"array","items":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Responses.DimensionInfoResponse"}},"holdReleaseStatus":{"$ref":"#/components/schemas/Logistics.PackageManagement.Domain.Enums.HoldReleaseStatus"},"palletIdentifier":{"description":"A unique identifier for the pallet associated with the packageWithShippingDoc.","type":"string"},"trackingUrl":{"format":"uri","description":"The tracking URL for the packageWithShippingDoc.","type":"string"},"consigneeAddress":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.Consignee"},"shippingInfo":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.PriceInfo"},"packageItems":{"description":"A list of items contained in the packageWithShippingDoc.","type":"array","items":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.PackageItem"}},"metaData":{"description":"Additional metadata associated with the packageWithShippingDoc.","type":"string"},"shippingDocumentation":{"description":"Shipping documentation details for the packageWithShippingDoc.","type":"array","items":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Responses.DocumentResponse"}}},"additionalProperties":false},"Logistics.PackageManagement.WebApiService.Models.Common.WeightInfo":{"description":"Represents the weight information of a package or item.","required":["weight","weightUnit"],"type":"object","properties":{"weight":{"format":"double","description":"The weight value of the package or item.","type":"number"},"weightUnit":{"description":"The unit of measurement for the weight (e.g., kg, lb).","type":"string"}},"additionalProperties":false},"Logistics.PackageManagement.Domain.Enums.ShippingStatus":{"enum":["Complete","Pending"],"type":"string"},"Logistics.PackageManagement.Domain.Enums.ServiceLevel":{"enum":["POST","EXP2","PUDO"],"type":"string"},"Logistics.PackageManagement.WebApiService.Models.Responses.DimensionInfoResponse":{"required":["height","length","measurementUnit","width"],"type":"object","properties":{"source":{"description":"The source of the dimension information, such as the carrier or system that provided it.","type":"string","readOnly":true},"length":{"format":"double","description":"The length of the package.","type":"number"},"width":{"format":"double","description":"The width of the package.","type":"number"},"height":{"format":"double","description":"The height of the package.","type":"number"},"measurementUnit":{"description":"The unit of measurement for the dimensions (e.g., cm, inches).","type":"string"},"weight":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.WeightInfo"}},"additionalProperties":false},"Logistics.PackageManagement.Domain.Enums.HoldReleaseStatus":{"enum":["Release","Hold","ReturnToRetailer"],"type":"string"},"Logistics.PackageManagement.WebApiService.Models.Common.Consignee":{"description":"Represents information about the consignee (recipient) of a package.","type":"object","properties":{"firstName":{"description":"The first name of the consignee.","type":"string"},"lastName":{"description":"The last name of the consignee.","type":"string"},"address1":{"description":"The first line of the consignee's address.","type":"string"},"address2":{"description":"The second line of the consignee's address (optional).","type":"string"},"address3":{"description":"The third line of the consignee's address (optional).","type":"string"},"city":{"description":"The city where the consignee resides.","type":"string"},"postalCode":{"description":"The postal or ZIP code of the consignee's address.","type":"string"},"poBox":{"description":"The Post Office (PO) Box number, if applicable.","type":"string"},"region":{"description":"The region or state where the consignee resides.","type":"string"},"countryIso":{"description":"The alpha-2 character ISO code of the country.","type":"string"},"email":{"description":"The email address of the consignee.","type":"string"},"telephone":{"description":"The telephone number of the consignee.","type":"string"}},"additionalProperties":false},"Logistics.PackageManagement.WebApiService.Models.Common.PriceInfo":{"description":"Represents pricing information including amount and currency.","required":["amount","currency"],"type":"object","properties":{"amount":{"format":"decimal","description":"The monetary amount of the price.","type":"number"},"currency":{"description":"The currency code (e.g., USD, EUR) for the price.","type":"string"}},"additionalProperties":false},"Logistics.PackageManagement.WebApiService.Models.Common.PackageItem":{"description":"Represents an individual item within a package.","required":["productCode","quantity"],"type":"object","properties":{"productCode":{"description":"The unique product code for the item.","type":"string"},"lineItemId":{"format":"int32","description":"The line item ID associated with the item, if applicable.","type":"integer"},"quantity":{"format":"int32","description":"The quantity of the item included in the package.","type":"integer"},"productDescription":{"description":"A description of the product.","type":"string"},"productCustomsDescription":{"description":"A description of the product for customs purposes.","type":"string"},"countryOfOriginIso":{"description":"The ISO code of the country where the product originated.","type":"string"},"weight":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.WeightInfo"},"unitPriceInfo":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.PriceInfo"},"dangerousGoods":{"description":"Indicates if the item is classified as dangerous goods.","type":"boolean"},"hsCode":{"description":"The Harmonized System (HS) code for the item.","type":"string"},"metaData":{"format":"json","description":"Additional metaDataParsed associated with the item.","type":"string"}},"additionalProperties":false},"Logistics.PackageManagement.WebApiService.Models.Responses.DocumentResponse":{"description":"Represents the shipping documentation details for a package.","type":"object","properties":{"document":{"description":"The content of the document.","type":"string"},"type":{"$ref":"#/components/schemas/Logistics.PackageManagement.Domain.Enums.DocumentType"},"format":{"$ref":"#/components/schemas/Logistics.PackageManagement.Domain.Enums.LabelFormat"},"link":{"description":"A link to the document, if available.","type":"string"},"documentStatus":{"$ref":"#/components/schemas/Logistics.PackageManagement.Domain.Enums.DocumentStatus"}},"additionalProperties":false},"Logistics.PackageManagement.Domain.Enums.DocumentType":{"enum":["HubHandlingLabel","ShippingLabel","SupportingDocumentation","AdditionalDocumentation"],"type":"string"},"Logistics.PackageManagement.Domain.Enums.LabelFormat":{"enum":["Zpl","Pdf","NoLabel"],"type":"string"},"Logistics.PackageManagement.Domain.Enums.DocumentStatus":{"enum":["Created","Error"],"type":"string"},"Logistics.PackageManagement.WebApiService.Models.Responses.ErrorResponse":{"description":"Represents an error response containing detailed information about validation or server errors.","type":"object","properties":{"errors":{"description":"A collection of errors where the key is the field name and the value is a list of error messages.","type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"type":{"description":"The type of error encountered.","type":"string"},"title":{"description":"A brief title or summary of the error.","type":"string"},"status":{"format":"int32","description":"The HTTP status code associated with the error.","type":"integer"},"detail":{"description":"Detailed information about the error.","type":"string"},"instance":{"description":"An instance identifier for tracing the error.","type":"string"},"additionalProp1":{"description":"Additional property 1, used for custom data.","type":"string"},"additionalProp2":{"description":"Additional property 2, used for custom data.","type":"string"},"additionalProp3":{"description":"Additional property 3, used for custom data.","type":"string"},"traceId":{"description":"A trace identifier for debugging or logging purposes.","type":"string"}},"additionalProperties":false},"Logistics.PackageManagement.WebApiService.Models.Requests.CreatePackageRequest":{"description":"Represents the request payload for creating a package.","required":["packageReference","weight"],"type":"object","properties":{"packageReference":{"description":"The unique reference for the package.","type":"string"},"weight":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.WeightInfo"},"shippingStatus":{"description":"The shipping status of the package.","type":"string"},"goodsDescription":{"description":"A description of the goods in the package.","type":"string"},"serviceLevel":{"description":"The service level for shipping (e.g., standard, express).","type":"string"},"parentOrderReference":{"description":"The reference of the parent order associated with this package.","type":"string"},"eswCarrierIdentifier":{"description":"The identifier for the carrier (e.g., ESW carrier code).","type":"string"},"carrierReference":{"description":"The carrier's reference for the package.","type":"string"},"originFulfillmentCentreCode":{"description":"The code of the origin fulfillment center.","type":"string"},"shippingInfo":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.PriceInfo"},"insuranceInfo":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.PriceInfo"},"dangerousGoodsInfo":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.DangerousGoodsInfo"},"dimensionInfo":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Requests.DimensionInfoRequest"},"consigneeAddress":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.Address"},"packageItems":{"description":"A list of items contained within the package.","type":"array","items":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.PackageItem"}},"metaData":{"format":"json","description":"Additional metadata related to the package.","type":"string"}},"additionalProperties":false},"Logistics.PackageManagement.WebApiService.Models.Common.DangerousGoodsInfo":{"description":"Represents details about dangerous goods contained in the package.","type":"object","properties":{"dangerousGoods":{"description":"Indicates whether the package contains dangerous goods.","type":"boolean"},"dangerousGoodsClassificationCode":{"description":"The classification code for the dangerous goods.","type":"string"},"dangerousGoodsUnNumber":{"description":"The United Nations (UN) number assigned to the dangerous goods.","type":"string"},"dangerousGoodsContentId":{"description":"The content ID associated with the dangerous goods.","type":"string"}},"additionalProperties":false},"Logistics.PackageManagement.WebApiService.Models.Requests.DimensionInfoRequest":{"required":["height","length","measurementUnit","width"],"type":"object","properties":{"length":{"format":"double","description":"The length of the package.","type":"number"},"width":{"format":"double","description":"The width of the package.","type":"number"},"height":{"format":"double","description":"The height of the package.","type":"number"},"measurementUnit":{"description":"The unit of measurement for the dimensions (e.g., cm, inches).","type":"string"},"weight":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Common.WeightInfo"}},"additionalProperties":false},"Logistics.PackageManagement.WebApiService.Models.Common.Address":{"description":"Represents the address information of a consignee.","required":["address1","city","countryIso","email","firstName","lastName","telephone"],"type":"object","properties":{"firstName":{"description":"The first name of the recipient.","type":"string"},"lastName":{"description":"The last name of the recipient.","type":"string"},"address1":{"description":"The first line of the address.","type":"string"},"address2":{"description":"The second line of the address (optional).","type":"string"},"address3":{"description":"The third line of the address (optional).","type":"string"},"city":{"description":"The city of the address.","type":"string"},"poBox":{"description":"The Post Office (PO) Box number, if applicable.","type":"string"},"region":{"description":"The region or state of the address.","type":"string"},"postalCode":{"description":"The postal or ZIP code of the address.","type":"string"},"countryIso":{"description":"The alpha-2 character ISO code of the country.","type":"string"},"email":{"description":"The email address of the recipient.","type":"string"},"telephone":{"description":"The telephone number of the recipient.","type":"string"}},"additionalProperties":false}}},"paths":{"/packagemanagement/v1/{tenantCode}/orders/{orderReference}/packages":{"post":{"tags":["Package"],"summary":"Creates a new package for a specified tenant and order reference.","parameters":[{"schema":{"type":"string"},"in":"path","name":"tenantCode","required":true},{"schema":{"type":"string"},"in":"path","name":"orderReference","required":true}],"responses":{"201":{"description":"Package created successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Responses.CreatePackageResponse"}}}},"400":{"description":"Invalid request payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Responses.ErrorResponse"}}}},"401":{"description":"Unauthenticated client.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Responses.ErrorResponse"}}}},"403":{"description":"Client does not have access rights to the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Responses.ErrorResponse"}}}},"404":{"description":"Requested resource does not exist (tenantCode or orderReference).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Responses.ErrorResponse"}}}},"409":{"description":"Package already exists with the package reference supplied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Responses.ErrorResponse"}}}},"500":{"description":"An unexpected error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Responses.ErrorResponse"}}}}},"requestBody":{"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Requests.CreatePackageRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Requests.CreatePackageRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Requests.CreatePackageRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/Logistics.PackageManagement.WebApiService.Models.Requests.CreatePackageRequest"}}},"description":"The request payload containing package details."}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.esw.com/package-management/package-management-api/api-methods/create-a-new-package.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
