# Flexport

> Track Flexport shipments, containers and milestones, read bookings, purchase orders, invoices and customs entries, manage products and contacts, and send shipment documents.

App · 22 actions. Web page: https://docs.lodol.com/docs/integrations/flexport

## Actions

### Create contact

Add a contact to a company in your Flexport network.

**Inputs**

- Name (`name`, text, required): The contact's name.
- Email (`email`, text, required): The contact's email address.
- Phone number (`phone_number`, text, required): The contact's phone number.
- Company (`company_id`, text): Choose the company the contact works for. Leave empty for your own company.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "company": {},
      "email": "example",
      "id": "example",
      "name": "example",
      "phone_number": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### Create product

Add a product to your Flexport product library.

**Inputs**

- Name (`name`, text, required): The product's name.
- SKU (`sku`, text, required): The product's SKU. SKUs are unique among active products.
- Description (`description`, text): What the product is.
- Category (`product_category`, text): The category to file the product under.
- Verified by us (`client_verified`, true/false): Whether your company has checked this product's details.
- HS codes (`hs_codes`, list): HS codes for the product in one country, such as 8504.40. They replace the product's existing classifications.
- HS code country (`country_code`, text): The country the HS codes are for. One of: `AD` (Andorra), `AE` (United Arab Emirates), `AF` (Afghanistan), `AG` (Antigua & Barbuda), `AI` (Anguilla), `AL` (Albania), `AM` (Armenia), `AO` (Angola), `AQ` (Antarctica), `AR` (Argentina), and 240 more.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "archived_at": "example",
      "classifications": [
        {}
      ],
      "client_verified": true,
      "description": "example",
      "id": 1,
      "name": "example",
      "product_category": "example",
      "product_properties": [
        {}
      ],
      "sku": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### Download document

Get a document's file. It comes back as Base64 text with its media type.

**Inputs**

- Document ID (`document_id`, text, required): The document's Flexport ID, from List documents.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "content_base64": "example",
    "content_type": "example"
  }
}
```

### Get booking

Get a booking's details, including its cargo and the shipment it became.

**Inputs**

- Booking ID (`booking_id`, number, required): The booking's Flexport ID.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "cargo_ready_date": "example",
      "created_at": "example",
      "delivery_date": "example",
      "id": 1,
      "metadata": {},
      "name": "example",
      "quote_status": "example",
      "shipment": {},
      "status": "example",
      "transportation_mode": "example",
      "updated_at": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### Get invoice

Get an invoice with its line items, totals and balance.

**Inputs**

- Invoice ID (`invoice_id`, text, required): The invoice's Flexport ID.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "balance": {
        "_object": "example",
        "amount": "example",
        "currency_code": "example"
      },
      "due_date": "example",
      "id": "example",
      "invoice_type": "example",
      "issued_at": "example",
      "items": [
        {}
      ],
      "last_updated_at": "example",
      "name": "example",
      "status": "example",
      "total": {
        "_object": "example",
        "amount": "example",
        "currency_code": "example"
      },
      "type": "example",
      "voided_at": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### Get my company

Get your own company's Flexport profile, with its legal entities.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "editable": true,
      "entities": [
        {}
      ],
      "id": "example",
      "name": "example",
      "ref": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### Get product

Get a product from your product library, with its HS codes.

**Inputs**

- Product (`product_id`, text, required): Choose a product, or enter its Flexport ID.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "archived_at": "example",
      "classifications": [
        {}
      ],
      "client_verified": true,
      "description": "example",
      "id": 1,
      "name": "example",
      "product_category": "example",
      "product_properties": [
        {}
      ],
      "sku": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### Get purchase order

Get a purchase order's details: its parties, dates and terms.

**Inputs**

- Purchase order ID (`purchase_order_id`, number, required): The purchase order's Flexport ID.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "archived_at": "example",
      "cargo_ready_date": "example",
      "created_at": "example",
      "id": 1,
      "incoterm": "example",
      "issue_date": "example",
      "memo": "example",
      "metadata": {},
      "must_arrive_date": "example",
      "name": "example",
      "order_class": "example",
      "order_type": "example",
      "parties": [
        {}
      ],
      "priority": "example",
      "status": "example",
      "transportation_mode": "example",
      "updated_at": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### Get shipment

Get a shipment's details: its status, dates, parties and cargo.

**Inputs**

- Shipment (`shipment_id`, text, required): Choose a shipment, or enter its Flexport ID.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "actual_arrival_date": "example",
      "actual_delivered_in_full_date": "example",
      "actual_departure_date": "example",
      "booking": {},
      "cargo_ready_date": "example",
      "created_date": "example",
      "estimated_arrival_date": "example",
      "estimated_delivered_in_full_date": "example",
      "estimated_departure_date": "example",
      "freight_type": "example",
      "id": 1,
      "incoterm": "example",
      "metadata": {},
      "name": "example",
      "pieces": 1,
      "priority": "example",
      "status": "example",
      "target_delivery_date": "example",
      "transportation_mode": "example",
      "updated_at": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### List bookings

List booking requests, filtered by status, shipment or dates.

**Inputs**

- Status (`status`, text): Only bookings with this status. One of: `submitted`, `booked`.
- Shipment (`shipment_id`, number): Choose a shipment, or enter its Flexport ID.
- Cargo ready from (`cargo_ready_from`, date): Only bookings whose cargo is ready on or after this date.
- Cargo ready until (`cargo_ready_to`, date): Only bookings whose cargo is ready on or before this date.
- Created after (`created_after`, date and time): Only bookings made after this time.
- Sort by (`sort`, text): What to sort the bookings by. One of: `created_at` (Created at), `cargo_ready_date` (Cargo ready date).
- Order (`direction`, text): Newest or largest first (desc) or oldest or smallest first (asc). One of: `desc`, `asc`.
- Page (`page`, number): Which page of results to read, starting at 1. At least 1.
- Results per page (`per`, number): How many results to read per page, up to 100. Flexport sends 20 when this is empty. From 1 to 100.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "data": [
        {
          "_object": "example",
          "cargo_ready_date": "example",
          "created_at": "example",
          "delivery_date": "example",
          "id": 1,
          "metadata": {},
          "name": "example",
          "quote_status": "example",
          "shipment": {},
          "status": "example",
          "transportation_mode": "example",
          "updated_at": "example"
        }
      ],
      "next": "example",
      "prev": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### List contacts

List the contacts in your Flexport network, for one company or all.

**Inputs**

- Company (`company_id`, text): Choose a company in your network, or enter its Flexport ID.
- Page (`page`, number): Which page of results to read, starting at 1. At least 1.
- Results per page (`per`, number): How many results to read per page, up to 100. Flexport sends 20 when this is empty. From 1 to 100.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "data": [
        {
          "_object": "example",
          "company": {},
          "email": "example",
          "id": "example",
          "name": "example",
          "phone_number": "example"
        }
      ],
      "next": "example",
      "prev": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### List containers

List ocean containers, newest first, for a shipment or a container number.

**Inputs**

- Shipment (`shipment_id`, number): Choose a shipment, or enter its Flexport ID.
- Container number (`container_number`, text): Only the container with this number.
- Page (`page`, number): Which page of results to read, starting at 1. At least 1.
- Results per page (`per`, number): How many results to read per page, up to 100. Flexport sends 20 when this is empty. From 1 to 100.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "data": [
        {
          "_object": "example",
          "actual_arrival_date": "example",
          "actual_delivery_date": "example",
          "actual_departure_date": "example",
          "container_number": "example",
          "container_size": "example",
          "container_type": "example",
          "estimated_arrival_date": "example",
          "estimated_delivery_date": "example",
          "estimated_departure_date": "example",
          "id": 1,
          "last_free_day_date": "example",
          "seal_number": "example",
          "shipment": {}
        }
      ],
      "next": "example",
      "prev": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### List customs entries

List customs entries and their release status, for one shipment or all.

**Inputs**

- Shipment (`shipment_id`, text): Choose a shipment, or enter its Flexport ID.
- Page (`page`, number): Which page of results to read, starting at 1. At least 1.
- Results per page (`per`, number): How many results to read per page, up to 100. Flexport sends 20 when this is empty. From 1 to 100.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "data": [
        {
          "_object": "example",
          "entry_number": "example",
          "id": "example",
          "release_date": "example",
          "release_status": "example",
          "shipment": {}
        }
      ],
      "next": "example",
      "prev": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### List documents

List shipment documents, filtered by shipment, type or upload time.

**Inputs**

- Shipment (`shipment_id`, number): Choose a shipment, or enter its Flexport ID.
- Document type (`document_type`, text): Only documents of this type. One of: `commercial_invoice` (Commercial invoice), `packing_list` (Packing list), `commercial_invoice_packing_list` (Commercial invoice packing list), `bill_of_lading` (Bill of lading), `house_bill_of_lading_draft` (House bill of lading draft), `air_waybill` (Air waybill), `arrival_notice` (Arrival notice), `certificate_of_origin` (Certificate of origin), `certificate_of_insurance` (Certificate of insurance), `material_safety_data_sheet_msds` (Material safety data sheet msds), and 6 more.
- Uploaded after (`uploaded_after`, date and time): Only documents uploaded on or after this time.
- Page (`page`, number): Which page of results to read, starting at 1. At least 1.
- Results per page (`per`, number): How many results to read per page, up to 100. Flexport sends 20 when this is empty. From 1 to 100.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "data": [
        {
          "_object": "example",
          "archived_at": "example",
          "document_type": "example",
          "file_link": "example",
          "file_metadata": {},
          "file_name": "example",
          "id": "example",
          "memo": "example",
          "shipment": {}
        }
      ],
      "next": "example",
      "prev": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### List events

List the milestone events Flexport has sent to your webhooks, such as a departure, an arrival or an invoice payment.

**Inputs**

- Event type (`type`, text): Only events of this type, such as /shipment_leg#arrived.
- Happened after (`occurred_after`, date and time): Only events that happened on or after this time.
- Happened before (`occurred_before`, date and time): Only events that happened on or before this time.
- Shipment (`shipment_id`, number): Choose a shipment, or enter its Flexport ID.
- Page (`page`, number): Which page of results to read, starting at 1. At least 1.
- Results per page (`per`, number): How many results to read per page, up to 100. Flexport sends 20 when this is empty. From 1 to 100.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "data": [
        {
          "_object": "example",
          "created_at": "example",
          "data": {},
          "id": 1,
          "occurred_at": "example",
          "type": "example",
          "version": 1
        }
      ],
      "next": "example",
      "prev": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### List invoices

List Flexport's invoices to you, filtered by status, shipment or dates.

**Inputs**

- Status (`status`, text): Only invoices with this status. One of: `outstanding`, `past_due` (Past due), `paid`, `void`.
- Shipment (`shipment_id`, number): Choose a shipment, or enter its Flexport ID.
- Issued after (`issued_after`, date and time): Only invoices issued after this time.
- Issued before (`issued_before`, date and time): Only invoices issued before this time.
- Updated after (`updated_after`, date and time): Only invoices changed after this time.
- Sort by (`sort`, text): Sort the invoices by due date. One of: `due_date` (Due date).
- Order (`direction`, text): Newest or largest first (desc) or oldest or smallest first (asc). One of: `desc`, `asc`.
- Page (`page`, number): Which page of results to read, starting at 1. At least 1.
- Results per page (`per`, number): How many results to read per page, up to 100. Flexport sends 20 when this is empty. From 1 to 100.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "data": [
        {
          "_object": "example",
          "balance": {
            "_object": "example",
            "amount": "example",
            "currency_code": "example"
          },
          "due_date": "example",
          "id": "example",
          "invoice_type": "example",
          "issued_at": "example",
          "items": [
            {}
          ],
          "last_updated_at": "example",
          "name": "example",
          "status": "example",
          "total": {
            "_object": "example",
            "amount": "example",
            "currency_code": "example"
          },
          "type": "example",
          "voided_at": "example"
        }
      ],
      "next": "example",
      "prev": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### List products

List the products in your Flexport product library.

**Inputs**

- SKU (`sku`, text): Only the product with this SKU.
- Archived (`archived`, true/false): Turn on for archived products only, off for active ones only.
- Page (`page`, number): Which page of results to read, starting at 1. At least 1.
- Results per page (`per`, number): How many results to read per page, up to 100. Flexport sends 20 when this is empty. From 1 to 100.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "data": [
        {
          "_object": "example",
          "archived_at": "example",
          "classifications": [
            {}
          ],
          "client_verified": true,
          "description": "example",
          "id": 1,
          "name": "example",
          "product_category": "example",
          "product_properties": [
            {}
          ],
          "sku": "example"
        }
      ],
      "next": "example",
      "prev": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### List purchase orders

List purchase orders, filtered by status, name, shipment or dates.

**Inputs**

- Status (`status`, text): Only purchase orders with this status. One of: `open`, `closed`, `cancelled`.
- Name (`name`, text): Only the purchase order with this name.
- Shipment (`shipment_id`, number): Choose a shipment, or enter its Flexport ID.
- Archived (`archived`, true/false): Turn on for archived purchase orders only, off for active ones only.
- Updated after (`updated_after`, date and time): Only purchase orders changed after this time.
- Created after (`created_after`, date and time): Only purchase orders created after this time.
- Sort by (`sort`, text): Sort the purchase orders by their Flexport ID. One of: `id`.
- Order (`direction`, text): Newest or largest first (desc) or oldest or smallest first (asc). One of: `desc`, `asc`.
- Page (`page`, number): Which page of results to read, starting at 1. At least 1.
- Results per page (`per`, number): How many results to read per page, up to 100. Flexport sends 20 when this is empty. From 1 to 100.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "data": [
        {
          "_object": "example",
          "archived_at": "example",
          "cargo_ready_date": "example",
          "created_at": "example",
          "id": 1,
          "incoterm": "example",
          "issue_date": "example",
          "memo": "example",
          "metadata": {},
          "must_arrive_date": "example",
          "name": "example",
          "order_class": "example",
          "order_type": "example",
          "parties": [
            {}
          ],
          "priority": "example",
          "status": "example",
          "transportation_mode": "example",
          "updated_at": "example"
        }
      ],
      "next": "example",
      "prev": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### List shipments

List shipments, filtered by status, mode, container, purchase order or SKU.

**Inputs**

- Status (`status`, text): Only shipments at this stage. One of: `seller_location` (Seller location), `origin_stop_off` (Origin stop off), `in_transit_to_departure_port` (In transit to departure port), `departure_port` (Departure port), `in_transit_to_intermediary_port` (In transit to intermediary port), `intermediary_port` (Intermediary port), `in_transit_to_arrival_port` (In transit to arrival port), `arrival_port` (Arrival port), `deconsolidation`, `in_transit_to_final_destination` (In transit to final destination), and 3 more.
- Transportation mode (`transportation_mode`, text): Only shipments that travel this way. One of: `ocean`, `air`, `barge`, `truck`, `rail`, `unknown_transportation` (Unknown transportation), `ocean_air` (Ocean air), `truck_intl` (Truck intl), `warehouse_storage` (Warehouse storage).
- Container number (`container_number`, text): Only shipments carrying this container number.
- Purchase order number (`purchase_order`, text): Only shipments for this purchase order number.
- SKU (`sku`, text): Only shipments carrying the product with this SKU.
- Master bill number (`master_bill_number`, text): Only shipments with this master bill of lading number.
- House bill number (`house_bill_number`, text): Only shipments with this house bill of lading number.
- Sort by (`sort`, text): What to sort the shipments by. One of: `id`, `updated_at` (Updated at), `status`, `transportation_mode` (Transportation mode), `archived_at` (Archived at).
- Order (`direction`, text): Newest or largest first (desc) or oldest or smallest first (asc). One of: `desc`, `asc`.
- Page (`page`, number): Which page of results to read, starting at 1. At least 1.
- Results per page (`per`, number): How many results to read per page, up to 100. Flexport sends 20 when this is empty. From 1 to 100.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "data": [
        {
          "_object": "example",
          "actual_arrival_date": "example",
          "actual_delivered_in_full_date": "example",
          "actual_departure_date": "example",
          "booking": {},
          "cargo_ready_date": "example",
          "created_date": "example",
          "estimated_arrival_date": "example",
          "estimated_delivered_in_full_date": "example",
          "estimated_departure_date": "example",
          "freight_type": "example",
          "id": 1,
          "incoterm": "example",
          "metadata": {},
          "name": "example",
          "pieces": 1,
          "priority": "example",
          "status": "example",
          "target_delivery_date": "example",
          "transportation_mode": "example",
          "updated_at": "example"
        }
      ],
      "next": "example",
      "prev": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### Update contact

Change a contact's name, email or phone number. Fields left empty stay as they are.

**Inputs**

- Contact (`contact_id`, text, required): Choose a contact, or enter its Flexport ID.
- Name (`name`, text): The contact's new name.
- Email (`email`, text): The contact's new email address.
- Phone number (`phone_number`, text): The contact's new phone number.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "company": {},
      "email": "example",
      "id": "example",
      "name": "example",
      "phone_number": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### Update product

Change a product in your product library. Fields left empty stay as they are.

**Inputs**

- Product (`product_id`, text, required): Choose a product, or enter its Flexport ID.
- Name (`name`, text): The product's name.
- SKU (`sku`, text): The product's SKU. SKUs are unique among active products.
- Description (`description`, text): What the product is.
- Category (`product_category`, text): The category to file the product under.
- Verified by us (`client_verified`, true/false): Whether your company has checked this product's details.
- HS codes (`hs_codes`, list): HS codes for the product in one country, such as 8504.40. They replace the product's existing classifications.
- HS code country (`country_code`, text): The country the HS codes are for. One of: `AD` (Andorra), `AE` (United Arab Emirates), `AF` (Afghanistan), `AG` (Antigua & Barbuda), `AI` (Anguilla), `AL` (Albania), `AM` (Armenia), `AO` (Angola), `AQ` (Antarctica), `AR` (Argentina), and 240 more.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "archived_at": "example",
      "classifications": [
        {}
      ],
      "client_verified": true,
      "description": "example",
      "id": 1,
      "name": "example",
      "product_category": "example",
      "product_properties": [
        {}
      ],
      "sku": "example"
    },
    "self": "example",
    "version": 1
  }
}
```

### Upload document

Attach a document, such as a commercial invoice or packing list, to a shipment.

**Inputs**

- Shipment (`shipment_id`, number, required): Choose the shipment the document belongs to, or enter its Flexport ID.
- Document type (`document_type`, text, required): What kind of document this is. One of: `commercial_invoice` (Commercial invoice), `packing_list` (Packing list), `commercial_invoice_packing_list` (Commercial invoice packing list), `bill_of_lading` (Bill of lading), `house_bill_of_lading_draft` (House bill of lading draft), `air_waybill` (Air waybill), `arrival_notice` (Arrival notice), `certificate_of_origin` (Certificate of origin), `certificate_of_insurance` (Certificate of insurance), `material_safety_data_sheet_msds` (Material safety data sheet msds), and 6 more.
- File (`file`, text, required): Upload a file, choose one from an earlier step, or enter a link to one.
- File name (`file_name`, text): The name Flexport shows for the file. Leave empty to keep the file's own name.
- Memo (`memo`, text): A note to go with the document.

**Outputs**

- `data` (object): The response from Flexport.

**Example output**

```json
{
  "data": {
    "_object": "example",
    "data": {
      "_object": "example",
      "archived_at": "example",
      "document_type": "example",
      "file_link": "example",
      "file_metadata": {},
      "file_name": "example",
      "id": "example",
      "memo": "example",
      "shipment": {}
    },
    "self": "example",
    "version": 1
  }
}
```
