BookingLineItem

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.

List all booking line items

Returns a list of booking line items linked to submitted bookings

Request
query Parameters
page
integer >= 1
Default: 1

Page number of the page to retrieve

Example: page=1
per
integer [ 1 .. 100 ]
Default: 20

Count of items in each page. Should be between 1 and 100 (inclusive)

Example: per=20
direction
string
Default: "desc"

Set sort order. Allows "asc" (ascending) or "desc" (descending)

Enum: "asc" "desc"
f.purchase_order.id
integer

Filters for all booking line items from a purchase order

Example: f.purchase_order.id=123
f.booking.id
integer

Filters for all booking line items from a specific booking

Example: f.booking.id=54321
f.purchase_order_line_item.id
integer

Filters for all booking line items from a specific purchase order line item.

Example: f.purchase_order_line_item.id=54321
Responses
200

collection of booking line items

Response Schema: application/json
_object
string
self
string
version
integer
object
_object
string
prev
string or null
next
string or null
Array of objects (BookingLineItem)
400

error

get/booking_line_items
Response samples
application/json

Success

{}

Create a booking line item

Creates and returns a booking line item.

Errors

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.
Request
Request Body schema: application/json
required
purchase_order_line_item_id
required
integer

Always required. The identifier of the PO line item to book

booking_id
required
integer

Always required. The identifier of the booking to add the PO line item to

units
required
integer

Always required. Number of units to book

user_email
string

Not required. Email of the user that the booking line item should be attributed to as creator. The user must belong to your company. If omitted, it defaults to your company's admin.

Responses
200

The created booking line item

Response Schema: application/json
_object
string
self
string
version
integer
object (BookingLineItem)
_object
string

Type of the object

id
integer

Unique identifier for the booking line item

object (BookingRef)
object (PurchaseOrderLineItemRef)
units
integer

Number of units of purchase_order_line_item booked on booking

400

error

post/booking_line_items
Request samples
application/json
{
  • "purchase_order_line_item_id": 112358,
  • "booking_id": 9876,
  • "units": 200
}
Response samples
application/json

Success

{}

Retrieves the details of a single booking line item.

Returns a list of booking line items

Request
path Parameters
id
required
integer

The unique id for the booking line item to be retrieved

Responses
200

A collection of booking line items

Response Schema: application/json
_object
string
self
string
version
integer
object (BookingLineItem)
_object
string

Type of the object

id
integer

Unique identifier for the booking line item

object (BookingRef)
object (PurchaseOrderLineItemRef)
units
integer

Number of units of purchase_order_line_item booked on booking

400

error

get/booking_line_items/{id}
Response samples
application/json

Success

{}