Skip to main content

Flexport Data Source

The Flexport connector enables you to ingest logistics and supply chain data from your Flexport account into Nexla, including shipments, orders, inbound inventory, events, bundles, parcels, invoices, and more. Follow the instructions below to create a new data flow that ingests data from a Flexport source in Nexla.
flexport_api.png

Flexport

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the Flexport connector tile from the list of available connectors. Then, select the credential that will be used to connect to the Flexport instance, and click Next; or, create a new Flexport credential for use in this flow.

  3. In Nexla, Flexport data sources can be created using pre-built endpoint templates, which expedite source setup for common Flexport endpoints. Each template is designed specifically for the corresponding Flexport API endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    Flexport sources can also be configured manually, allowing you to ingest data from Flexport API endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Flexport endpoints. Each template is designed specifically for the corresponding Flexport API endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

List Companies

Returns a paginated list of companies associated with your Flexport account. Use this endpoint to retrieve account-level company records, which can be useful for auditing your organization's Flexport network, cross-referencing company data with internal systems, or building reporting pipelines around partner and customer profiles.

  • No additional parameters are required for this endpoint. Once selected, Nexla will automatically paginate through all available company records using Flexport's page-based pagination.
  • This endpoint calls the Flexport API at https://api.flexport.com/companies and retrieves up to 100 records per page by default.

This endpoint uses the base URL configured in your Flexport credential. Ensure your credential's Base URL is set to https://api.flexport.com to access company records through the Flexport freight forwarding API.

List Shipments

Returns a paginated list of all shipments in your Flexport account. Use this endpoint to build pipelines that track the status and details of freight shipments, feed shipment data into analytics or reporting tools, or sync Flexport shipment records with other systems in your organization.

  • No additional parameters are required for this endpoint. Nexla automatically paginates through all available shipment records using Flexport's page-based pagination.
  • This endpoint calls the Flexport API at https://api.flexport.com/shipments and fetches up to 100 records per page.

This endpoint uses the base URL configured in your Flexport credential. Ensure your credential's Base URL is set to https://api.flexport.com to access shipment data through the freight forwarding API. For Logistics API inbound shipments, use the List Inbound Shipments or Get Inbound Shipment endpoints instead.

Get Bundle

Retrieves the details of a specific product bundle by its Flexport bundle ID. Bundles in Flexport's Logistics API represent sets of SKUs grouped together for sale or fulfillment as a unit. Use this endpoint when you need to retrieve structured data for a single bundle, such as its contents, SKU, title, and metadata.

  • Enter the unique identifier of the bundle you want to retrieve in the Bundle ID field. You can find bundle IDs in the Flexport Seller Portal or through the Flexport Logistics API.

  • This endpoint calls the Flexport Logistics API at https://logistics-api.flexport.com/logistics/api/2023-10/bundles/{bundle_id}.

To retrieve inventory information for a bundle rather than its definition, use the Get Bundle Inventory endpoint.

Get Bundle Inventory

Retrieves current inventory information for a specific product bundle. Use this endpoint to monitor on-hand and available inventory levels for bundled products in Flexport's fulfillment network. This is useful for inventory reconciliation, replenishment planning, or feeding bundle-level stock data into downstream analytics systems.

  • Enter the unique identifier of the bundle whose inventory you want to retrieve in the Bundle ID field.

  • This endpoint calls the Flexport Logistics API at https://logistics-api.flexport.com/logistics/api/2023-10/bundles/{bundle_id}/inventory.

Get Events

Retrieves a paginated list of logistics events from the Flexport Logistics API, with optional filtering by event type, order, shipment, or specific event IDs. Events represent key actions and status changes in the fulfillment lifecycle—such as order receipt, shipment updates, and delivery confirmations. Use this endpoint to build event-driven pipelines, track fulfillment activity, or audit logistics operations.

  • Enter the maximum number of events to return per page in the Limit field. The default value is 100, which is also the maximum supported by Flexport.
  • Optionally, enter one or more event IDs in the Event IDs field to filter results to those specific events.
  • Optionally, enter an event type in the Event Type field to filter events by type. Refer to the Flexport Logistics API documentation for a list of supported event types.
  • Optionally, enter an Order ID in the Order ID field to retrieve only events associated with a specific fulfillment order.
  • Optionally, enter a Shipment ID in the Shipment ID field to retrieve only events associated with a specific shipment.
  • Optionally, enter a pagination cursor token in the After field to resume fetching events from a specific position in the result set. Nexla manages cursor-based pagination automatically when pulling all available events.

This endpoint uses cursor-based (token) pagination. Nexla automatically handles pagination and will continue fetching pages until no more results are available.

List Inbound Shipments

Retrieves a paginated list of inbound inventory shipments from the Flexport Logistics API, with optional filtering by shipment IDs and statuses. Inbound shipments represent inventory being sent to Flexport's fulfillment centers. Use this endpoint to monitor inbound supply, reconcile inventory receipts, or feed inbound shipment data into warehouse management or ERP systems.

  • Optionally, enter one or more shipment IDs in the Shipment IDs field to filter results to specific inbound shipments.
  • Optionally, enter one or more shipment statuses in the Statuses field to filter results by status. For a list of supported statuses, refer to the Flexport Logistics API documentation.
  • Enter the maximum number of records to return per page in the Limit field. The default value is 100.
  • Enter the number of records to skip (offset) in the Offset field. The default value is 0. Nexla manages offset-based pagination automatically when pulling all available records.

This endpoint uses offset-based pagination. Nexla automatically increments the offset and continues fetching pages until no more results are returned.

Get Inbound Shipment

Retrieves detailed information for a single inbound shipment by its ID. Use this endpoint when you need complete detail about a specific inbound inventory shipment—such as origin address, item list, packaging details, prep instructions, and current status—for downstream processing, validation, or integration with a warehouse management system.

  • Enter the unique identifier of the inbound shipment in the Shipment ID field. Shipment IDs can be obtained from the Flexport Seller Portal or via the List Inbound Shipments endpoint.

Get Shipment Document

Retrieves a shipping document—such as a label or manifest—for a specific inbound shipment. Use this endpoint to programmatically access shipping labels and manifests generated by Flexport, enabling automated document retrieval workflows or integration with printing and labeling systems.

  • Enter the unique identifier of the shipment for which you want to retrieve a document in the Shipment ID field.
  • Enter the type of document to retrieve in the Document Option field (for example, label or manifest). Refer to the Flexport Logistics API documentation for a full list of supported document options.
  • Enter the desired file format for the document in the Document Format field (for example, PDF or PNG).

Get Shipment Quotes

Retrieves shipping quotes and available carrier rates for a specific inbound shipment. Use this endpoint to pull rate information programmatically—enabling cost analysis, carrier comparison, or automated quote selection workflows.

  • Enter the unique identifier of the inbound shipment for which you want to retrieve quotes in the Shipment ID field.

Shipping quotes are generated after an inbound shipment is created and submitted to Flexport. Ensure the shipment has been created and is in a state that supports quoting before using this endpoint. To purchase a selected quote, use the Purchase a selected shipping quote for an inbound shipment destination endpoint.

Get Order

Retrieves detailed information about a specific fulfillment order using its Flexport order ID. Use this endpoint to pull order-level data for downstream processing, such as syncing order status with an OMS, building fulfillment dashboards, or triggering business logic based on order state changes.

  • Enter the Flexport-assigned order ID in the Id field. This is the internal Flexport identifier for the fulfillment order, distinct from any seller-assigned external order ID.

To retrieve an order using a seller-assigned external ID instead of the Flexport internal ID, use the Retrieve an order by seller-assigned external ID endpoint.

Get Parcel by ID

Retrieves detailed information about a specific parcel using its Flexport parcel ID. Parcels represent individual packages in the Flexport Logistics API. Use this endpoint to track parcel-level details, such as tracking numbers, carrier assignments, status, and dimensions, for downstream reporting or integration with carrier tracking systems.

  • Enter the unique identifier of the parcel in the Id field. Parcel IDs are assigned by Flexport when a parcel shipping label is created.

For additional reference, see the Flexport Parcels API documentation.

Get a Single Return Order by ID

Retrieves information about a specific return order using its Flexport return ID. Use this endpoint to programmatically access return order details for reconciliation, refund workflows, or integration with reverse logistics systems.

  • Enter the unique identifier of the return order in the Return ID field. This field is required. Return IDs can be found in the Flexport Seller Portal or via the Flexport Logistics API returns endpoints.

List and Filter Freight/Logistics Invoices

Retrieves a list of freight and logistics invoices from the Flexport Logistics API. Use this endpoint to pull invoice data for financial reconciliation, accounts payable workflows, or building cost analytics pipelines that track logistics spend over time.

  • No additional parameters are required for this endpoint. Once selected, Nexla will retrieve all available invoices from the Flexport Logistics API.
  • The response data is extracted from the invoices array in the API response.

For additional information about working with Flexport freight invoices, see the Flexport Freight Invoices API Tutorial.

Retrieve All Successfully Purchased Quotes for an Inbound Shipment

Retrieves all shipping quotes that have been successfully purchased for a specific inbound shipment. Use this endpoint to confirm which carrier and rate was selected for a shipment, audit shipping spend, or track purchased quotes for reconciliation against invoices.

  • Enter the unique identifier of the inbound shipment in the Shipment ID field. This field is required.

  • The response data is extracted from the quotes array in the API response.

Retrieve an Order by Seller-Assigned External ID

Retrieves a fulfillment order using the seller-assigned external ID—the ID from the seller's own order management system rather than Flexport's internal ID. Use this endpoint to look up order status and details using your own order reference numbers, making it easy to cross-reference Flexport fulfillment data with your internal systems.

  • Enter the seller-assigned external order ID in the External Order ID field. This field is required and must match the external ID assigned when the order was created in Flexport.

Endpoint Testing

Once the selected endpoint template has been configured, Nexla can retrieve a sample of the data that will be fetched according to the current settings. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Configure Manually

Flexport data sources can be manually configured to ingest data from any valid Flexport API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex Flexport sources, such as sources that use chained API calls to fetch data from multiple endpoints or sources that require custom request parameters.

API Method

  1. To manually configure this source, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the Flexport API from the Method pulldown menu. The most common methods are:

    • GET: For retrieving data from the API (most Flexport read operations)
    • POST: For submitting data or triggering actions (for example, creating shipments or requesting quotes)

API Endpoint URL

  1. Enter the URL of the Flexport API endpoint from which this source will fetch data in the Set API URL field. This should be the complete URL including the protocol (https://) and any required path parameters.

Flexport operates two primary API base URLs. Use https://api.flexport.com for freight forwarding, shipments, and company endpoints. Use https://logistics-api.flexport.com/logistics/api/2023-10 for fulfillment, orders, inbounds, parcels, products, and returns endpoints. Ensure the URL matches the base URL configured in your Flexport credential.

Date/Time Macros (API URL)

Optional

Optionally, the API URL can be customized using macros—all macros added to the API URL will be converted into values when Nexla executes the API call. Macros are dynamic placeholders that allow you to create flexible API endpoints that can adapt to different time periods or data requirements.

Date/time macros are particularly useful for Flexport endpoints that support date-range filtering parameters, allowing you to automatically pull data for rolling time windows without manual updates.

  1. To add a macro, type { at the appropriate position in the API URL (within the Set API URL field), and select the desired macro from the dropdown list.

    • {now} – The current datetime
    • {now-1} – The datetime one time unit before the current datetime
    • {now+1} – The datetime one time unit after the current datetime
    • custom – Datetime macros can reference any number of time units before or after the current datetime—for example, enter (now-4) to indicate the datetime four time units before the current datetime
  2. Select the format that will be applied to datetime macros from the Date Format for Date/Time Macro pulldown menu. This format will be applied to the base datetime value of the macro—i.e., the value of {now} in {now-1}.

  3. Select the datetime unit that will be used to perform mathematical operations in the included macro(s) from the Time Unit for Operations pulldown menu—for example, for the macro {now-1}, when Day is selected, {now-1} will be converted to the datetime one day before the current datetime.

Lookup-Based Macros (API URL)

Optional

Column values from existing lookups can also be included as macros in the API URL. Lookup-based macros allow you to reference data from previously configured data sources or lookups, enabling dynamic API endpoints that can adapt based on existing data.

Lookup-based macros are useful when you need to iterate over a list of Flexport entity IDs—such as order IDs or shipment IDs—sourced from another Nexla dataset, to dynamically retrieve records for each ID.

  1. To include a lookup column value macro, select the relevant lookup from the Add Lookups to Supported Macros pulldown menu.

  2. Type { at the appropriate position in the API URL, and select the lookup column-based macro from the dropdown list. Lookup-based macros are automatically populated into the macro list when a lookup is selected in the Add Lookups to Supported Macros pulldown menu.

Path to Data

Optional

If only a subset of the data returned by the Flexport API endpoint is needed, you can designate the part of the response that should be included in the Nexsets produced from this source by specifying the path to the relevant data within the response.

For example, most Flexport list endpoints return results in a nested structure such as $.data.data[*] (for the shipments endpoint) or $.data[*] (for events and inbound shipments). By entering the appropriate path, you configure Nexla to treat each element of the returned array as an individual record.

Specifying the correct Path to Data is essential for Flexport API responses, which typically wrap result arrays in one or more levels of nesting. Without specifying the correct path, Nexla may not be able to properly parse and organize the response data into usable records.

  • To specify which data should be treated as relevant in responses from this source, enter the path to the relevant data in the Set Path to Data in Response field.

    • For responses in JSON format, enter the JSON path that points to the object or array that should be treated as relevant data. JSON paths use dot notation (e.g., $.data.data[*] to access the nested data array in Flexport shipment responses).
    Path to Data Examples for Flexport:
    • Shipments list response: $.data.data[*]
    • Events list response: $.data[*]
    • Inbound shipments list response: $.data[*]
    • Single resource (order, bundle, parcel): $ or $.data
    • Invoices list: $.invoices[*]
Autogenerate Path Suggestions

Nexla can also autogenerate data path suggestions based on the response from the API endpoint. These suggested paths can be used as-is or modified to exactly suit your needs.

  • To use this feature, click the Test button next to the Set API URL field to fetch a sample response from the API endpoint. Suggested data paths generated based on the content & format of the response will be displayed in the Suggestions box below the Set Path to Data in Response field.

  • Click on a suggestion to automatically populate the Set Path to Data in Response field with the corresponding path. The populated path can be modified directly within the field if further customization is needed.

    PathSuggestions.png

Metadata

If metadata is included in the response but is located outside of the defined path to relevant data, you can configure Nexla to include this data as common metadata in each record.

For example, Flexport list endpoints often return pagination information—such as pageInfo tokens or total count values—alongside the results array. If this contextual information is needed in your records, you can specify a path to include it with each record in the generated Nexsets.

Metadata paths are particularly useful for preserving Flexport pagination tokens, request timestamps, or summary statistics that apply to all records in the response.

  • To specify the location of metadata that should be included with each record, enter the path to the relevant metadata in the Path to Metadata in Response field.

    • For responses in JSON format, enter the JSON path to the object or array that contains the metadata.

Request Headers

Optional
  • If Nexla should include any additional request headers in API calls to this source, enter the headers & corresponding values as comma-separated pairs in the Request Headers field (e.g., header1:value1,header2:value2). The Flexport API requires a Flexport-Version header for some endpoints.

    You do not need to include the Authorization header here, as it is automatically applied by Nexla using the API key from your Flexport credential. If a specific Flexport API version header is required, add it in the format Flexport-Version:3.

Endpoint Testing

After configuring all settings for the selected endpoint, Nexla can retrieve a sample of the data that will be fetched according to the current configuration. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Save & Activate the Source

  1. Once all of the relevant steps in the above sections have been completed, click the Create button in the upper right corner of the screen to save and create the new Flexport data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.