Endpoints relating to BookingLineItem objects. The Booking Line Item endpoints need special permission to access. Please contact your Flexport Sales representative if you are interested in using these endpoints.
Returns a list of booking line items linked to submitted bookings
Success
{- "_object": "/api/response",
- "version": 2,
- "data": {
- "_object": "/api/collections/paginated",
- "next": null,
- "data": [
- {
- "_object": "/purchase_orders/booking_line_item",
- "id": 123456,
- "booking": {
- "_object": "/api/refs/object",
- "ref_type": "/booking",
- "id": 9876
}, - "purchase_order_line_item": {
- "_object": "/api/refs/object",
- "ref_type": "/purchase_orders/line_item",
- "id": 112358
}, - "units": 200
}
]
}
}Creates and returns a booking line item.
When a request fails validation, the API returns a 400 with an error object. error.code is invalid_param for malformed/invalid input or bad_request for business-rule violations, and error.message describes the specific problem. The table below lists the errors you may encounter, their cause, and how to resolve them.
| Error message | Code | Cause | Suggested fix |
|---|---|---|---|
Null values are not allowed for property booking_id |
invalid_param |
booking_id was sent as null or omitted from the request body. |
Provide a non-null integer booking_id in the request. |
Either units or decimal_units must be set |
invalid_param |
Neither units nor decimal_units was provided, or both were provided simultaneously. |
Provide exactly one of units (integer) or decimal_units (decimal string), not both and not neither. |
Missing property units |
invalid_param |
units was not provided and the decimal_units feature is not enabled for your account. |
Include units as a positive integer in the request. |
booking could not be found |
bad_request |
The booking_id does not resolve to a booking accessible by the authenticated account. |
Verify the booking_id belongs to a booking in your account. |
Cannot create booking line items for a draft booking |
bad_request |
The referenced booking is in DRAFT stage and has not been submitted. | Submit the booking first before attaching line items. |
the po line item could not be found |
bad_request |
The purchase_order_line_item_id does not resolve to an accessible PO line item. |
Verify the purchase_order_line_item_id exists and belongs to a PO in your account. |
Could not find the specified shipment |
bad_request |
The booking's associated shipment is not accessible to the authenticated user. | Ensure your account has access to the booking's associated shipment. |
decimal_units Units of measure '<uom>' does not support decimal values |
bad_request |
The PO line item's unit of measure only supports whole-number quantities but a decimal value was supplied. | Provide a whole number for decimal_units/units for unit-of-measure types that do not support fractions. |
The created booking line item
error
{- "purchase_order_line_item_id": 112358,
- "booking_id": 9876,
- "units": 200
}Success
{- "_object": "/api/response",
- "version": 2,
- "data": {
- "_object": "/purchase_orders/booking_line_item",
- "id": 123456,
- "booking": {
- "_object": "/api/refs/object",
- "ref_type": "/booking",
- "id": 9876
}, - "purchase_order_line_item": {
- "_object": "/api/refs/object",
- "ref_type": "/purchase_orders/line_item",
- "id": 112358
}, - "units": 200
}
}Returns a list of booking line items
A collection of booking line items
error
Success
{- "_object": "/api/response",
- "version": 2,
- "data": {
- "_object": "/purchase_orders/booking_line_item",
- "id": 123456,
- "booking": {
- "_object": "/api/refs/object",
- "ref_type": "/booking",
- "id": 9876
}, - "purchase_order_line_item": {
- "_object": "/api/refs/object",
- "ref_type": "/purchase_orders/line_item",
- "id": 112358
}, - "units": 200
}
}