# Easyship

> Read shipments, addresses, couriers and tracking information in Easyship.

App · 14 actions. Web page: https://docs.lodol.com/docs/integrations/easyship

## Actions

### Get courier

Get courier.

**Inputs**

- Courier (`courier_id`, text, required): Courier account ID

**Outputs**

- `data` (object): Single courier with all its details

**Example output**

```json
{
  "data": {
    "courier": {
      "account_number": "example",
      "auth": {
        "state": "unverified"
      },
      "created_at": "example",
      "customer_reference_id": "example",
      "ddp_handling_fee": 1.0,
      "easyship_courier": false,
      "filtered_account_details": {},
      "icon_url": "example",
      "id": "example",
      "logo_url": "example",
      "nickname": "example",
      "origin_country_alpha2": "AD",
      "pickup_fee": 1.0,
      "state": "pending",
      "umbrella_name": "example"
    },
    "meta": {
      "messages": [],
      "request_id": "example"
    }
  }
}
```

### Get shipment

Get shipment.

**Inputs**

- Easyship shipment (`easyship_shipment_id`, text, required): Easyship Shipment ID provided when creating the shipment
- Format (`format`, text): Document format (Options: `URL`, `PDF`, `PNG`). `URL` will be a link to a .pdf file, `PNG` and `PDF` will be an array of base64 encoded strings.
- Label (`label`, text): Label page size (Options: `A4`, `A5`, `letter`, `4x6`). Some couriers only offer A4 labels.
- Commercial invoice (`commercial_invoice`, text): Commercial invoice page size (Options: `A4`, `letter`, `4x6`). An invoice will only be provided if necessary. Some couriers offer a paperless invoice service.
- Packing slip (`packing_slip`, text): Packing slip page size (Options: `none`, `A4`, `letter`, `4x6`).

**Outputs**

- `data` (object): Single shipment with all its details

**Example output**

```json
{
  "data": {
    "meta": {
      "request_id": "example",
      "status": "example",
      "unavailable_couriers": []
    },
    "shipment": {
      "buyer_regulatory_identifiers": {
        "ein": "example",
        "ssn": "example",
        "vat_number": "example"
      },
      "consignee_tax_id": "example",
      "courier_service": {
        "courier_id": "example",
        "easyship_courier_service": false,
        "id": "example",
        "name": "example",
        "umbrella_name": "example"
      },
      "created_at": "example",
      "currency": "AED",
      "delivery_state": "not_created",
      "destination_address": {
        "city": "example",
        "company_name": "example",
        "contact_email": "example",
        "contact_name": "example",
        "contact_phone": "example",
        "country_alpha2": "AD",
        "delivery_instructions": "example",
        "line_1": "example",
        "line_2": "example",
        "line_3": "example",
        "postal_code": "example",
        "state": "example"
      },
      "easyship_shipment_id": "example",
      "eei_reference": "example",
      "incoterms": "DDU",
      "insurance": {
        "insured_amount": 1.0,
        "insured_currency": {},
        "is_insured": false
      },
      "label_generated_at": "example",
      "label_paid_at": "example",
      "label_state": "not_created",
      "last_failure_http_response_messages": [],
      "metadata": {},
      "order_data": {
        "buyer_notes": "example",
        "buyer_selected_courier_name": "example",
        "order_created_at": "example",
        "order_tag_list": [],
        "platform_name": "example",
        "platform_order_number": "example",
        "seller_notes": "example"
      },
      "origin_address": {
        "city": "example",
        "company_name": "example",
        "contact_email": "example",
        "contact_name": "example",
        "contact_phone": "example",
        "country_alpha2": "AD",
        "line_1": "example",
        "line_2": "example",
        "line_3": "example",
        "postal_code": "example",
        "state": "example"
      },
      "original_easyship_shipment_id": "example",
      "parcels": [],
      "pickup_state": "example",
      "rates": [],
      "regulatory_identifiers": {
        "eori": "example",
        "ioss": "example",
        "vat_number": "example"
      },
      "return": false,
      "return_address": {
        "city": "example",
        "company_name": "example",
        "contact_email": "example",
        "contact_name": "example",
        "contact_phone": "example",
        "country_alpha2": "AD",
        "line_1": "example",
        "line_2": "example",
        "line_3": "example",
        "postal_code": "example",
        "state": "example"
      },
      "sender_address": {
        "city": "example",
        "company_name": "example",
        "contact_email": "example",
        "contact_name": "example",
        "contact_phone": "example",
        "country_alpha2": "AD",
        "line_1": "example",
        "line_2": "example",
        "line_3": "example",
        "postal_code": "example",
        "state": "example"
      },
      "set_as_residential": false,
      "shipment_state": "created",
      "shipping_documents": [],
      "shipping_settings": {
        "b13a_filing": {
          "option": "not_required",
          "option_export_compliance_statement": "example",
          "permit_number": "example"
        },
        "label_customization_fields": [],
        "scheduled_ship_date": "example"
      },
      "total_actual_weight": 1.0,
      "total_customs_value": 1.0,
      "tracking_page_url": "example",
      "trackings": [],
      "updated_at": "example",
      "warehouse_code": "example",
      "warehouse_state": "none"
    }
  }
}
```

### Get tracking record

Get tracking record.

**Inputs**

- Tracking (`tracking_id`, text, required): Tracking ID

**Outputs**

- `data` (object): Single tracking with all its details

**Example output**

```json
{
  "data": {
    "meta": {
      "request_id": "example"
    },
    "tracking": {
      "courier_service": {
        "id": "example",
        "umbrella_name": "example"
      },
      "destination_country_alpha2": "AD",
      "easyship_shipment_id": "example",
      "eta_date": "example",
      "id": "example",
      "origin_country_alpha2": "AD",
      "platform_order_number": "example",
      "source": "easyship",
      "status": "Created",
      "tracking_number": "example",
      "tracking_page_url": "example",
      "tracking_state": "created"
    }
  }
}
```

### Get webhook

Get webhook.

**Inputs**

- Webhook (`webhook_id`, text, required): Webhook ID

**Outputs**

- `data` (object): Webhook details

**Example output**

```json
{
  "data": {
    "meta": {
      "request_id": "example"
    },
    "webhook": {}
  }
}
```

### List addresses

List addresses.

**Inputs**

- Page (`page`, number): Page number to fetch, default: `1`. At least 1.
- Per page (`per_page`, number): Number of records per page to fetch, default: `20`. From 1 to 100.
- Status (`status`, text): Filter by address status. One of: `active`, `inactive`.
- Default addresses (`default_addresses`, true/false): Select default addresses or not

**Outputs**

- `data` (object): List of Addresses

**Example output**

```json
{
  "data": {
    "addresses": [],
    "meta": {
      "pagination": {
        "count": 1,
        "next": 1,
        "page": 1
      },
      "request_id": "example"
    }
  }
}
```

### List courier services

List courier services.

**Inputs**

- Page (`page`, number): Page number to fetch, default: `1`. At least 1.
- Per page (`per_page`, number): Number of records per page to fetch, default: `20`. From 1 to 100.
- Sort by (`sort_by`, text): Sort records by listed columns. Default: `created_at`. One of: `origin_country_id` (Origin country id), `courier_name` (Courier name), `created_at` (Created at).
- Sort direction (`sort_direction`, text): Set the sort direction. Default: `DESC`. One of: `ASC`, `DESC`.
- Country alpha2 (`country_alpha2`, list): Filter records by country code: Alpha-2 format (ISO 3166-1). One or more of: `AD`, `AE`, `AF`, `AG`, `AI`, `AL`, `AM`, `AN`, `AO`, `AQ`, and 240 more.
- Umbrella name (`umbrella_name`, text): Filter records by courier umbrella name
- Customer reference id (`customer_reference_id`, text): An identifier for a customer (available only for selected customers)
- Accepts (`accepts`, list): Filter records by acceptance criteria. One or more of: `outbounds`, `prepaid_returns` (Prepaid returns), `pay_on_scan_returns` (Pay on scan returns), `pi965_batteries` (Pi965 batteries), `pi966_batteries` (Pi966 batteries), `pi967_batteries` (Pi967 batteries), `liquids`, `documents`, `parcels`, `specific_dangerous_goods` (Specific dangerous goods).
- Supported incoterms (`supported_incoterms`, list): Filter records if the courier supports DDUs, DDPs or both. One or more of: `DDU`, `DDP`.
- International (`international`, true/false): Filter records if the courier is an international service
- Domestic (`domestic`, true/false): Filter records if the courier is an domestic service

**Outputs**

- `data` (object): List of couriers service

**Example output**

```json
{
  "data": {
    "courier_services": [],
    "meta": {
      "pagination": {
        "count": 1,
        "next": 1,
        "page": 1
      },
      "request_id": "example"
    }
  }
}
```

### List couriers

List couriers.

**Inputs**

- Page (`page`, number): Page number to fetch, default: `1`. At least 1.
- Per page (`per_page`, number): Number of records per page to fetch, default: `20`. From 1 to 100.
- Sort by (`sort_by`, text): Sort records by listed columns. Default: `created_at`. One of: `customer_reference_id` (Customer reference id), `umbrella_name` (Umbrella name), `country_alpha2` (Country alpha2), `created_at` (Created at).
- Sort direction (`sort_direction`, text): Set the sort direction. Default: `DESC`. One of: `ASC`, `DESC`.
- Country alpha2 (`country_alpha2`, list): Filter records by country code: Alpha-2 format (ISO 3166-1). One or more of: `AD`, `AE`, `AF`, `AG`, `AI`, `AL`, `AM`, `AN`, `AO`, `AQ`, and 240 more.
- Customer reference id (`customer_reference_id`, text): An identifier for a customer (available only for selected customers)
- Auth state (`auth_state`, list): Filter records by auth state. One or more of: `unverified`, `verified`, `partially_verified` (Partially verified), `failed`.
- State (`state`, list): Filter records by courier state. One or more of: `pending`, `pending_upgrade` (Pending upgrade), `active`, `inactive`.
- Umbrella name (`umbrella_name`, text): Filter records by umbrella name.
- Active courier services (`active_courier_services`, true/false): Filter records to only those with available courier services.
- Easyship courier (`easyship_courier`, true/false): Whether the courier belongs to Easyship or not.

**Outputs**

- `data` (object): List of Couriers

**Example output**

```json
{
  "data": {
    "couriers": [],
    "meta": {
      "pagination": {
        "count": 1,
        "next": 1,
        "page": 1
      },
      "request_id": "example"
    }
  }
}
```

### List external tracking couriers

List external tracking couriers.

**Inputs**

- Page (`page`, number): Page number to fetch, default: `1`. At least 1.
- Per page (`per_page`, number): Number of records per page to fetch, default: `20`. From 1 to 100.
- Origin country alpha2 (`origin_country_alpha2`, text): Filter records by origin country code: Alpha-2 format (ISO 3166-1).
- Name (`name`, text): Filter records by courier service name

**Outputs**

- `data` (object): List of External Courier Services

**Example output**

```json
{
  "data": {
    "courier_services": [],
    "meta": {
      "pagination": {
        "count": 1,
        "next": 1,
        "page": 1
      },
      "request_id": "example"
    }
  }
}
```

### List shipment tracking

List shipment tracking.

**Inputs**

- Page (`page`, number): Page number to fetch, default: `1`. At least 1.
- Per page (`per_page`, number): Number of records per page to fetch, default: `20`. From 1 to 100.
- Easyship shipment (`easyship_shipment_id`, list): Easyship Shipment ID provided when creating the shipment.
- Platform order number (`platform_order_number`, list): Order number on the sales platform. You can choose to use either `easyship_shipment_id` or `platform_order_number`.
- Include checkpoints (`include_checkpoints`, true/false): Include checkpoints in the response.

**Outputs**

- `data` (object): List of Shipments with tracking info

**Example output**

```json
{
  "data": {
    "meta": {
      "pagination": {
        "count": 1,
        "next": 1,
        "page": 1
      },
      "request_id": "example"
    },
    "shipments": []
  }
}
```

### List shipments

List shipments.

**Inputs**

- Page (`page`, number): Page number to fetch, default: `1`. At least 1.
- Per page (`per_page`, number): Number of records per page to fetch, default: `20`. From 1 to 100.
- Easyship shipment (`easyship_shipment_id`, list): Easyship Shipment ID provided when creating the shipment.
- Platform order number (`platform_order_number`, text): Order number on the sales platform.
- Created at from (`created_at_from`, date and time): Search for shipments created since this date: ISO8601 date format.
- Created at to (`created_at_to`, date and time): Search for shipments created before this date: ISO8601 date format.
- Updated at from (`updated_at_from`, date and time): Search for shipments updated since this date: ISO8601 date format.
- Updated at to (`updated_at_to`, date and time): Search for shipments updated before this date: ISO8601 date format.
- Label paid at from (`label_paid_at_from`, date and time): Search for shipments where the labels were paid for since this date: ISO8601 date format.
- Label paid at to (`label_paid_at_to`, date and time): Search for shipments where the labels were paid for before this date: ISO8601 date format.
- Label generated at from (`label_generated_at_from`, date and time): Search for labels generated since this date: ISO8601 date format.
- Label generated at to (`label_generated_at_to`, date and time): Search for labels generated before this date: ISO8601 date format.
- Shipment state (`shipment_state`, text): Search by current status of shipment. One of: `created`, `cancelled`.
- Label state (`label_state`, list): Search by current label status of shipment. One or more of: `not_created` (Not created), `pending`, `generating`, `generated`, `printed`, `failed`, `technical_failed` (Technical failed), `reported`.
- Pickup state (`pickup_state`, list): Search by current pickup status of shipment. One or more of: `not_requested` (Not requested), `pending_confirmation` (Pending confirmation), `pending_drop_off` (Pending drop off), `request_failed` (Request failed), `requested`, `completed`, `cancelled`.
- Delivery state (`delivery_state`, list): Search by current delivery status of shipment. One or more of: `not_created` (Not created), `pending`, `info_received` (Info received), `in_transit_to_customer` (In transit to customer), `out_for_delivery` (Out for delivery), `delivered`, `failed_attempt` (Failed attempt), `exception`, `expired`, `lost_by_courier` (Lost by courier), `returned_to_shipper` (Returned to shipper).
- Warehouse state (`warehouse_state`, list): For eFulfilment only. Search by current warehouse status of shipment. One or more of: `pending`, `created`, `packed`, `shipped`.
- Origin country alpha2 (`origin_country_alpha2`, list): Search by the shipment origin country code: Alpha-2 format (ISO 3166-1).
- Destination country alpha2 (`destination_country_alpha2`, list): Search by shipment destination country code: Alpha-2 format (ISO 3166-1).
- Return shipment (`return_shipment`, text): Search by shipment whether the shipment is return shipment or not.

**Outputs**

- `data` (object): List of shipments

**Example output**

```json
{
  "data": {
    "meta": {
      "pagination": {
        "count": 1,
        "next": 1,
        "page": 1
      },
      "request_id": "example"
    },
    "shipments": []
  }
}
```

### List supported tracking couriers

List supported tracking couriers.

**Inputs**

- Page (`page`, number): Page number to fetch, default: `1`. At least 1.
- Per page (`per_page`, number): Number of records per page to fetch, default: `20`. From 1 to 100.
- Origin country alpha2 (`origin_country_alpha2`, list): Filter records by origin country code: Alpha-2 format (ISO 3166-1).
- Umbrella name (`umbrella_name`, text): Filter records by courier umbrella name

**Outputs**

- `data` (object): List of Supported Courier Services

**Example output**

```json
{
  "data": {
    "courier_services": [],
    "meta": {
      "pagination": {
        "count": 1,
        "next": 1,
        "page": 1
      },
      "request_id": "example"
    }
  }
}
```

### List tracking records

List tracking records.

**Inputs**

- Page (`page`, number): Page number to fetch, default: `1`. At least 1.
- Per page (`per_page`, number): Number of records per page to fetch, default: `20`. From 1 to 100.
- Origin country alpha2 (`origin_country_alpha2`, text): Filter records by origin country using alpha2 format
- Destination country alpha2 (`destination_country_alpha2`, text): Filter records by destination country using alpha2 format
- Source (`source`, text): Filter records by the source of record. Only "easyship" and "external" that are acceptable
- Tracking state (`tracking_state`, text): Filter records by the state of the tracking. One of: `created`, `active`, `pending`, `completed`, `overwritten_by_admin` (Overwritten by admin).

**Outputs**

- `data` (object): List of third party trackings

**Example output**

```json
{
  "data": {
    "meta": {
      "pagination": {
        "count": 1,
        "next": 1,
        "page": 1
      },
      "request_id": "example"
    },
    "trackings": []
  }
}
```

### List webhooks

List webhooks.

**Inputs**

- Page (`page`, number): Page number to fetch, default: `1`. At least 1.
- Per page (`per_page`, number): Number of records per page to fetch, default: `20`. From 1 to 100.

**Outputs**

- `data` (object): List of Webhooks

**Example output**

```json
{
  "data": {
    "meta": {
      "pagination": {
        "count": 1,
        "next": 1,
        "page": 1
      },
      "request_id": "example"
    },
    "webhooks": []
  }
}
```

### Validate address

Check whether a street address is valid for shipping.

**Inputs**

- Street address (`line_1`, text, required): Street address.
- City (`city`, text, required): City.
- Country code (`country_alpha2`, text, required): Two-letter ISO country code. One of: `AD`, `AE`, `AF`, `AG`, `AI`, `AL`, `AM`, `AO`, `AQ`, `AR`, and 240 more.
- State or province (`state`, text): State or province.
- Postal code (`postal_code`, text): Postal code.
- Apartment or suite (`line_2`, text): Apartment or suite.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "address": {},
    "meta": {}
  }
}
```
