Skip to main content

Create Order with Previously Created Label

Create a new fulfillment order by providing a previously created shipping label. This endpoint also allows you to attach order-related files in PDF format that will be included in the shipment.

Request Format

This endpoint uses multipart/form-data instead of JSON. Make sure to configure your HTTP client correctly.

POST/shipment/create_with_label

This endpoint allows you to create a new fulfillment order by providing a previously created shipping label. You must include the Bearer token obtained previously in the request header.

Headers

ParameterTypeRequiredDescription
Authorizationstringβœ… YesBearer token obtained from /token/generate endpoint
Content-Typestringβœ… YesMust be multipart/form-data
Acceptstringβœ… YesMust be application/json

Body Parameters

ParameterTypeRequiredDescription
codbooleanβœ… YesDefine if the order is COD (cash on delivery) or regular
unique_order_numberstringβœ… YesIdentification code provided by the seller (max: 12)
invoicestring❌ NoDefines the invoice number for the order (max: 45)
shipping_servicestringβœ… YesName of the shipping service with which the label was previously generated (max: 20)
warehouse_idintegerβœ… YesThe ID of the warehouse from which the order will be fulfilled (max: 10)
shipment_numberstringβœ… YesGuide number for the order provided by the shipping service (max: 45)
labelfileβœ… YesPNG guide file provided by the shipping service (max. 3MB)
consignee_namestringβœ… YesCustomer's name (max: 70)
consignee_countrystringβœ… YesCustomer's country of origin, Mexico by default (max: 20)
consignee_statestringβœ… YesCustomer's city/state of residence (max: 45)
consignee_municipalitystringβœ… YesCustomer's municipality address (max: 35)
consignee_neighborhoodstring❌ NoCustomer's neighborhood address (max: 35)
consignee_streetstringβœ… YesCustomer's street address (max: 25)
consignee_external_numberstringβœ… YesCustomer's apartment or house external number (max: 5)
consignee_internal_numberstring❌ NoCustomer's apartment or house internal number (max: 5)
consignee_zipcodestringβœ… YesCustomer's zip code (max: 10)
consignee_emailstring❌ NoCustomer's email (max: 80)
consignee_phonestring❌ NoCustomer's phone (max: 15)
consignee_commentsstring❌ NoCustomer comments about the order (max: 80)
order_detailsstringβœ… YesA JSON in STRING format will be added in this field with the order details
total_pricefloatβœ… YesTotal order price, the total amount of the shipment must be entered (max: 5)
attached_files[]array❌ NoAn array of order-related files in PDF format (max. 5 files)

Examples

curl -X POST https://apisandbox.eonwms.com/shipment/create_with_label \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json" \
-F "cod=false" \
-F "unique_order_number=TESTORDER02" \
-F "invoice=invoice01" \
-F "shipping_service=FEDEX" \
-F "warehouse_id=1" \
-F "shipment_number=0000000001" \
-F "label=@/path/to/your/label.png" \
-F "consignee_name=TEST CLIENT" \
-F "consignee_country=Mexico" \
-F "consignee_state=Mexico City" \
-F "consignee_municipality=Benito Juarez" \
-F "consignee_neighborhood=Del Valle" \
-F "consignee_street=Insurgentes Sur" \
-F "consignee_external_number=100" \
-F "consignee_internal_number=" \
-F "consignee_zipcode=03100" \
-F "consignee_email=test@test.com" \
-F "consignee_phone=5555555555" \
-F "consignee_comments=Deliver to reception" \
-F 'order_details=[{"quantity":1,"sku":"PRODUCT01","unit_price":100.0}]' \
-F "total_price=100.0" \
-F "attached_files[]=@/path/to/invoice.pdf"

Responses

200Success - Order created with label

{
"status": "PLACED",
"message": "The order has been created with the provided label"
}

401Unauthorized - Invalid token

{
"v": "EON_V2.0",
"fault": {
"arguments": {
"Authorization": "invalid"
},
"type": "InvalidAuthorizationException",
"message": "The request is unauthorized, the access token is invalid."
}
}

422Unprocessable Entity - Validation error

{
"fault": {
"error": "invalid_label",
"error_description": "The label file is invalid or exceeds the maximum size"
}
}

Important Considerations​

order_details Format

The order_details field must be valid JSON but sent as a STRING. Example:

"[{\"quantity\":1,\"sku\":\"PRODUCT01\",\"unit_price\":100.0}]"
Attached Files
  • The label must be in PNG format with a maximum size of 3MB
  • Attached files must be PDF
  • You can attach up to 5 additional PDF files
  • Attached files will be physically included in the package
Differences with regular endpoint

This endpoint is useful when:

  • You already have a label generated by the carrier
  • You need to include physical documents in the shipment
  • You manage your own carrier integration

Use Case Example​

This endpoint is ideal for situations where:

  1. Direct carrier integration: You already have a direct account with FedEx, UPS, etc., and generate your own labels
  2. Special documentation: You need to include invoices, permits, or physical customs documentation
  3. Reshipments: When you need to use a previously generated label for a reshipment

Validations​

  • The guide number (shipment_number) must be unique
  • The label must be readable and in PNG format
  • The shipping service must match the label's carrier
  • PDF files must not exceed 5MB each