Skip to main content

API Guide: Generate a Carrier Label by License Plate

Use the Logiwa IO Open API to generate a carrier label for a packed LP with its measured weight and dimensions, and reject mis-packed LPs with the Label Weight Tolerance check.

Overview

The carrierlabel/by/licenseplate endpoint lets an automation system (print-and-apply line, pack automation) generate a carrier label for a packed LP with one call. You send the LP number with its final weight and dimensions. Logiwa IO takes the carrier, shipping option, carrier setup and addresses from the LP's shipment order. The endpoint works with every carrier setup type: integrated carriers, multi-carrier connections, and custom carriers.

Optionally, Logiwa IO compares the measured weight to the expected weight of the LP before buying a label. A package outside the allowed tolerance is rejected, so mis-packed or short-packed LPs never get a label.

When to use it

  • An automation line weighs and measures packages and needs to print the carrier label without anyone using the web app.

  • You want to stop LPs whose weight doesn't match their packed contents before a label is purchased.

  • Your integration needs to safely retry label requests without buying duplicate labels.

Prerequisites

  • The LP is a closed package on a shipment order that is not Shipped or Cancelled.

  • The shipment order has a carrier and shipping option assigned.

  • Your Open API token has access to the client that owns the LP.

  • To use the weight check: a Label Weight Tolerance (%) is set on the order's Shipment Order Type (see below), every product in the LP has a weight, and the LP Type has an empty weight.


Endpoint details

URL: v3.1/ShipmentOrder/carrierlabel/by/licenseplate Method: POST

Request body parameters

Parameter

Type

Required

Description

licensePlateNumber

String

Yes

The LP to label. Max 50 characters.

weight

Decimal

Yes

Measured weight. Greater than 0, up to 2 decimals, in the warehouse/client default weight unit.

length

Decimal

Yes

Greater than 0, up to 2 decimals, in the default dimension unit.

width

Decimal

Yes

Same as length.

height

Decimal

Yes

Same as length.

existingLabelAction

String

No

ReturnExisting (default) or VoidAndRecreate. See below.

The weight and dimensions are saved to the LP when a label is created.

Existing label handling

Value

LP has an active label

LP has no active label

ReturnExisting (default)

Returns the existing label. No carrier call and no weight check. labelAction = ReturnedExisting.

Runs the weight check, then creates a label. labelAction = Created.

VoidAndRecreate

Runs the weight check first. If it passes, voids the old label and creates a new one. labelAction = Recreated.

Runs the weight check, then creates a label. labelAction = Created.

💡 Use ReturnExisting when your automation may retry a request. Retries return the same label instead of buying a second one.


Weight tolerance check

Turn it on

Set Label Weight Tolerance (%) on the Shipment Order Type:

  1. Go to Data Setup → Shipment Order Type.

  2. Click Create New SO Type, or open an existing type to update it.

  3. Enter a value between 0 and 100 (up to 2 decimals) in Label Weight Tolerance (%).

  4. Click Save.

Leave the field empty or enter 0 to turn the check off. Existing Shipment Order Types are empty by default, so their behavior doesn't change. The field is also available as labelWeightTolerancePercent on the Shipment Order Type Open API (Data Setup) endpoints. It is optional, so existing integrations keep working.

How it works

Expected weight = Σ (product unit weight × quantity in the LP) + empty weight of the LP Type. All weights are converted to the request's weight unit before the calculation.

The check passes when the measured weight is within the tolerance of the expected weight. Boundary values pass.

Example: Products weigh 6.50 LB and the LP Type empty weight is 0.50 LB, so the expected weight is 7.00 LB. With a 10% tolerance, weights from 6.30 to 7.70 LB pass. A weight of 9.40 LB or 5.00 LB is rejected.

When the check runs

  • Only when the tolerance is greater than 0, and only when a label would be created (see the table above).

  • After the LP, access, carrier and order status validations, and before any void, LP update, or carrier call.

When it fails, no label is created, no void is sent, and the LP's weight and dimensions are not updated. Nothing is logged on the Carrier Errors page, because no carrier was called.


Example request

{
"licensePlateNumber": "LPN-0012345",
"weight": 7.1,
"length": 4.2,
"width": 5.3,
"height": 6.4,
"existingLabelAction": "ReturnExisting"
}

Responses

Success: 200 OK

{
"shipmentOrderCode": "SO-000123",
"licensePlateNumber": "LPN-0012345",
"trackingNumber": "1ZXXXXXXXXXXXXXXXX",
"carrier": "FedEx",
"labelUrl": "https://
",
"labelFormat": "ZPL",
"labelAction": "Created"
}
  • labelFormat (ZPL, PDF or PNG) comes from the carrier setup's label settings.

  • labelAction is Created, ReturnedExisting or Recreated, so you know whether a new label was bought.

Failure: 4xx

{
"licensePlateNumber": "LPN-0012345",
"isSuccess": false,
"errors": [
{
"code": "WEIGHT_OUT_OF_TOLERANCE",
"message": "Carrier label could not be created because the measured weight 9.40 LB for license plate LPN-0012345 is outside the allowed range 6.30–7.70 LB (expected 7.00 LB ±10%). Please check the package contents and re-weigh before retrying."
}
]
}

Error codes

Code

Meaning and what to do

REQUIRED_FIELD_MISSING

A required field is missing. Add it to the request body.

INVALID_VALUE

A numeric field is not greater than 0.

INVALID_EXISTING_LABEL_ACTION

Use ReturnExisting or VoidAndRecreate.

LICENSE_PLATE_NOT_FOUND

The LP isn't in your account. Check the number.

CLIENT_ACCESS_DENIED

Your token can't access the client that owns the LP. Contact your account administrator.

LICENSE_PLATE_NOT_PACKED

The LP isn't a closed package on a shipment order. Complete packing first.

CARRIER_NOT_ASSIGNED

The order has no carrier or shipping option. Assign them and retry.

INVALID_ORDER_STATUS

The order is Shipped or Cancelled.

EXPECTED_WEIGHT_UNAVAILABLE

A product or the LP Type has no weight, so the expected weight can't be calculated. Add the missing weight in product or LP Type setup.

WEIGHT_OUT_OF_TOLERANCE

The measured weight is outside the allowed range. Check the contents and re-weigh.

VOID_FAILED

The carrier rejected the void for VoidAndRecreate. The old label stays active. Review the Carrier Errors page.

CARRIER_ERROR

The carrier returned an error. Review the Carrier Errors page, correct the shipment data and retry.


Common questions

Where do I find labels created through this endpoint? In the Shipment Label section of the Shipment Order detail page, linked to the LP, and through the existing carrier label GET and list endpoints.

Does it work for multi-box orders? Yes. Only the LP you send gets a label, and its expected weight is calculated only from that LP's contents.

Is the weight check applied when an active label already exists? Not with ReturnExisting. The existing label is returned as is. With VoidAndRecreate, the check runs before anything is voided.

What if two requests arrive at the same time for the same LP? With ReturnExisting, only one label is created and both responses return the same tracking number.

Where do I see carrier failures? On the Carrier Errors page under label generation. See Understanding the Carrier Errors Page.

Related articles

Did this answer your question?