> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.trysend.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.trysend.com/_mcp/server.

# Create a parcel quote (get rates)

POST https://api.trysend.com/v1/parcel_quotes
Content-Type: application/json

Create a parcel quote. Choose **direction** (`import` | `export`) and **transport\_mode** (`air` | `ocean`).

### Customer identification

Identify the sender with **one** of (all resolve the same parcel customer record):

* `address_suffix` — customer **unique ID** (recommended), e.g. `YSDX-UGTE-1234` or `1234` (business prefix applied automatically)
* `parcel_customer_token` — internal customer token **or** the same unique ID (`YSDX-UGTE-1234` or short `1234`)
* `sender.name` — same value as the unique ID
* Full `sender` object — name, phone, email, and address (no link required)

Do not send both `address_suffix` and `parcel_customer_token`; if both are present, `parcel_customer_token` wins.

**Export** requires a full **`sender`** (name, phone, origin address) — customer ID alone is for **import** only. Pickup is scheduled separately after booking, not in the quote request.

Parcel-customer accounts must send one customer identifier or `sender.name` (unique ID) on **import**.

### Delivery (last mile)

`recipient` is always required. It defines where cargo is delivered:

* **Last mile on** — customer's full delivery address (name, phone, email, street, city, state, postal code, country)
* **Last mile off** — your business address in Nigeria (same as the booking link when last mile is disabled)

### Flow matrix

| direction | transport\_mode | Quote status | Next step                                                                                    |
| --------- | --------------- | ------------ | -------------------------------------------------------------------------------------------- |
| `export`  | `air`           | `pending`    | Pick a rate from `rates[]`, then `POST /v1/packages/{id}/create_shipment`                    |
| `import`  | `air`           | `pending`    | Confirm with `POST /v1/packages/{id}/create_shipment`; no carrier purchase                   |
| `import`  | `ocean`         | `pending`    | One `Ocean Freight` rate in `rates[]`; confirm with `POST /v1/packages/{id}/create_shipment` |
| `export`  | `ocean`         | `pending`    | One `Ocean Freight` rate in `rates[]`; confirm with `POST /v1/packages/{id}/create_shipment` |

### Pricing

* **`estimated_price`** — NGN total from `selected_rate.rate` when present. For pending ocean, use the single `rates[]` row until it is confirmed. Final amount may change at warehouse receive; customer payment is invoiced separately.
* **`booked_at`** — when the quote became `booked`. **`purchased_at`** is the same timestamp (legacy field).

**Request shape:** use flat fields (`dest_*`, etc.) — same as the Send dashboard — **or** nested `sender` / `recipient` objects. Import ocean does not require `origin_*` when using `parcel_customer_token` or `address_suffix`.

**Export air** uses the `package` object (weight, dimensions, `item_description`).

**Import air** uses `packages[]` — one row per cargo unit:

```json
"packages": [
  {
    "package_type": "Pallet",
    "weight": 120,
    "length": 120,
    "width": 100,
    "height": 80
  }
]
```

**Ocean** uses `packages[]` — one row per cargo type. Fixed containers use the exact values `20'`, `40'`, `40' HC`, `40' REEF`, or `20' REEF` and are priced per container. LCL is priced per CBM. Ro-Ro and Breakbulk are priced per RT (the greater of CBM and metric tonnes):

```json
"packages": [
  {
    "container_size": "40'",
    "quantity": 2,
    "commodity": "Textiles"
  }
]
```

Import ocean origin (China warehouse) and sender contact are applied automatically from the linked parcel customer — do not send `origin_*` or `origin_mobile` unless overriding.

Import ocean FCL pricing uses baseline USD rates per container, converted to NGN. LCL is priced per CBM. Ro-Ro and Breakbulk are priced per RT.

**Rate validity:** pending **export air** and **ocean** rates include a `created_at` timestamp on each rate. After **one hour**, `GET` the quote again to refresh pricing. `create_shipment` returns `QUOTE_RATE_OUTDATED` if you use a stale `rate_id`.

**Ocean transit:** ocean rates return `estimated_delivery_days: 11` and `estimated_delivery_date`. Typical door-to-door transit is 10–12 days (best \~7, worst case up to 14).

Reference: https://docs.trysend.com/api-reference/send-parcels-api/parcel-quotes/create-parcel-quote

## Authentication

- `X-Api-Key` header (required)

## Request

### Body (application/json)

- `parcel` (object, required)
  - `direction` (enum, optional, default: export) — Trade direction. Defaults to `export`.
    - Allowed values: `import`, `export`
  - `transport_mode` (enum, optional, default: air) — Use `air` with `package`; use `ocean` with `packages[]`.
    - Allowed values: `air`, `ocean`
  - `address_suffix` (string, optional) — Customer **unique ID** for an existing parcel customer. Same person as `parcel_customer_token`. Short form (`1234`) is prefixed with your business suffix automatically.
  - `parcel_customer_token` (string, optional) — Parcel customer internal token **or** unique ID (full or short form). Same person as `address_suffix`. If both are sent, this field takes precedence.
  - `sender_name` (string, optional)
  - `sender_email` (string, optional)
  - `origin_mobile` (string, optional)
  - `origin_address` (string, optional)
  - `origin_city` (string, optional)
  - `origin_zip_code` (string, optional)
  - `origin_state` (string, optional)
  - `origin_country` (string, optional)
  - `dest_name` (string, optional)
  - `dest_email` (string, optional)
  - `dest_mobile` (string, optional)
  - `dest_address` (string, optional)
  - `dest_city` (string, optional)
  - `dest_zip_code` (string, optional)
  - `dest_state` (string, optional)
  - `destination_country` (string, optional)
  - `declared_weight` (double, optional)
  - `length` (double, optional)
  - `width` (double, optional)
  - `height` (double, optional)
  - `description` (string, optional)
  - `sender` (object, optional) — Alternative to flat origin fields. Required for export (full origin contact and address).
    - `name` (string, optional)
    - `email` (string, optional)
    - `phone` (string, optional)
    - `address` (object, optional)
      - `street` (string, optional)
      - `city` (string, optional)
      - `state` (string, optional)
      - `postal_code` (string, optional)
      - `country` (string, optional) — ISO-2/ISO-3 country code or country name. For example, `US`, `USA`, and `United States` are accepted.
  - `recipient` (object, optional) — Alternative to flat destination fields. Customer address for last mile, or your business address when last mile is off.
    - `name` (string, optional)
    - `email` (string, optional)
    - `phone` (string, optional)
    - `address` (object, optional)
      - `street` (string, optional)
      - `city` (string, optional)
      - `state` (string, optional)
      - `postal_code` (string, optional)
      - `country` (string, optional) — ISO-2/ISO-3 country code or country name. For example, `US`, `USA`, and `United States` are accepted.
  - `package` (object, optional) — Export air — weight, dimensions, and item_description.
    - `weight` (double, optional)
    - `length` (double, optional)
    - `width` (double, optional)
    - `height` (double, optional)
    - `item_description` (string, optional)
  - `packages` (list of object or object, optional) — Required for ocean quotes. Measurement requirements depend on container_size; see OceanPackageInput.
    - AirCargoPackageInput
      - `package_type` (string, optional) — Cargo unit type (e.g. Pallet, Carton, Crate).
      - `weight` (double, optional) — Weight in kg.
      - `length` (double, optional)
      - `width` (double, optional)
      - `height` (double, optional)
    - OceanPackageInput
      - `container_size` (enum, optional) — Exact ocean pricing key. Fixed containers are priced per container; LCL per CBM; Ro-Ro and Breakbulk per RT.
        - Allowed values: `20'`, `40'`, `40' HC`, `40' REEF`, `20' REEF`, `LCL`, `Ro-Ro`, `Breakbulk`
      - `quantity` (integer, optional) — Number of containers or cargo units.
      - `commodity` (string, optional)
      - `weight` (double, optional) — Weight in kg. Required for Ro-Ro and Breakbulk.
      - `length` (double, optional) — Length in cm. May be supplied with width and height instead of volume.
      - `width` (double, optional) — Width in cm. May be supplied with length and height instead of volume.
      - `height` (double, optional) — Height in cm. May be supplied with length and width instead of volume.
      - `volume` (double, optional) — Volume in CBM. Used directly for LCL and to calculate RT for Ro-Ro/Breakbulk. Required for those cargo types unless complete dimensions are supplied.

## Response

### 201

Created

- `parcel_quote_id` (string, optional)
- `status` (enum, optional)
  - Allowed values: `pending`, `booked`
- `source` (string, optional)
- `direction` (string, optional)
- `reference` (string, optional)
- `rates` (list of object, optional)
  - `id` (string, optional)
  - `carrier` (string, optional)
  - `service` (string, optional)
  - `rate` (string, optional)
  - `currency` (string, optional)
  - `estimated_delivery_days` (integer, optional, nullable) — Estimated transit days. Ocean rates return 11; typical 10–12, worst case up to 14.
  - `estimated_delivery_date` (date, optional, nullable) — Estimated delivery date (ISO date). Ocean uses today + 11 calendar days.
- `sender` (object, optional)
  - `name` (string, optional)
  - `email` (string, optional)
  - `phone` (string, optional)
  - `address` (object, optional)
    - `street` (string, optional)
    - `city` (string, optional)
    - `state` (string, optional)
    - `postal_code` (string, optional)
    - `country` (string, optional) — ISO-2/ISO-3 country code or country name. For example, `US`, `USA`, and `United States` are accepted.
- `recipient` (object, optional)
  - `name` (string, optional)
  - `email` (string, optional)
  - `phone` (string, optional)
  - `address` (object, optional)
    - `street` (string, optional)
    - `city` (string, optional)
    - `state` (string, optional)
    - `postal_code` (string, optional)
    - `country` (string, optional) — ISO-2/ISO-3 country code or country name. For example, `US`, `USA`, and `United States` are accepted.
- `package` (object, optional) — Air weight/dimensions, or ocean `packages[]` nested under `package` in responses.
  - `weight` (double, optional)
  - `length` (double, optional)
  - `width` (double, optional)
  - `height` (double, optional)
  - `item_description` (string, optional)
- `cargo_volume` (string, optional) — Human-readable cargo summary, e.g. `2 x 40'` (ocean) or `5 kg` (air).
- `origin_details` (object, optional)
- `dest_details` (object, optional)
- `parcel_details` (object, optional)
- `tracking_code` (string, optional, nullable)
- `label_url` (string, optional, nullable)
- `selected_rate` (object, optional, nullable)
- `tracker_id` (string, optional, nullable)
- `purchased_at` (datetime, optional, nullable) — Legacy booking timestamp when status is `booked`. Same moment as `booked_at`. Not payment confirmation for ocean/import intake quotes.
- `booked_at` (datetime, optional, nullable) — When the quote became `booked`. Null while `pending`.
- `estimated_price` (double, optional, nullable) — NGN total from `selected_rate.rate`. For ocean/import intake, provisional until warehouse receive; customer payment is invoiced separately.
- `created_at` (datetime, optional)

## Examples

### Export air quote with rates

**Request**

```json
{
  "parcel": {
    "direction": "export",
    "transport_mode": "air",
    "sender": {
      "name": "John Sender",
      "email": "sender@example.com",
      "phone": "+1234567890",
      "address": {
        "street": "123 Main St",
        "city": "New York",
        "state": "NY",
        "postal_code": "10001",
        "country": "US"
      }
    },
    "recipient": {
      "name": "Jane Receiver",
      "email": "receiver@example.com",
      "phone": "+0987654321",
      "address": {
        "street": "456 Oak Ave",
        "city": "Los Angeles",
        "state": "CA",
        "postal_code": "90001",
        "country": "US"
      }
    },
    "package": {
      "weight": 5,
      "length": 10,
      "width": 8,
      "height": 6,
      "item_description": "Electronics"
    }
  }
}
```

**Response**

```json
{
  "parcel_quote_id": "string",
  "status": "pending",
  "source": "string",
  "direction": "string",
  "reference": "string",
  "rates": [
    {
      "id": "string",
      "carrier": "string",
      "service": "string",
      "rate": "string",
      "currency": "string",
      "estimated_delivery_days": 1,
      "estimated_delivery_date": "2023-01-15"
    }
  ],
  "sender": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "recipient": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "package": {
    "weight": 5,
    "length": 10,
    "width": 8,
    "height": 6,
    "item_description": "Electronics"
  },
  "cargo_volume": "1 x 40'",
  "origin_details": {},
  "dest_details": {},
  "parcel_details": {},
  "tracking_code": "string",
  "label_url": "string",
  "selected_rate": {},
  "tracker_id": "string",
  "purchased_at": "2024-01-15T09:30:00Z",
  "booked_at": "2024-01-15T09:30:00Z",
  "estimated_price": 6246625,
  "created_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python Export air quote with rates
import requests

url = "https://api.trysend.com/v1/parcel_quotes"

payload = { "parcel": {
        "direction": "export",
        "transport_mode": "air",
        "sender": {
            "name": "John Sender",
            "email": "sender@example.com",
            "phone": "+1234567890",
            "address": {
                "street": "123 Main St",
                "city": "New York",
                "state": "NY",
                "postal_code": "10001",
                "country": "US"
            }
        },
        "recipient": {
            "name": "Jane Receiver",
            "email": "receiver@example.com",
            "phone": "+0987654321",
            "address": {
                "street": "456 Oak Ave",
                "city": "Los Angeles",
                "state": "CA",
                "postal_code": "90001",
                "country": "US"
            }
        },
        "package": {
            "weight": 5,
            "length": 10,
            "width": 8,
            "height": 6,
            "item_description": "Electronics"
        }
    } }
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```ruby Export air quote with rates
require 'uri'
require 'net/http'

url = URI("https://api.trysend.com/v1/parcel_quotes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"parcel\": {\n    \"direction\": \"export\",\n    \"transport_mode\": \"air\",\n    \"sender\": {\n      \"name\": \"John Sender\",\n      \"email\": \"sender@example.com\",\n      \"phone\": \"+1234567890\",\n      \"address\": {\n        \"street\": \"123 Main St\",\n        \"city\": \"New York\",\n        \"state\": \"NY\",\n        \"postal_code\": \"10001\",\n        \"country\": \"US\"\n      }\n    },\n    \"recipient\": {\n      \"name\": \"Jane Receiver\",\n      \"email\": \"receiver@example.com\",\n      \"phone\": \"+0987654321\",\n      \"address\": {\n        \"street\": \"456 Oak Ave\",\n        \"city\": \"Los Angeles\",\n        \"state\": \"CA\",\n        \"postal_code\": \"90001\",\n        \"country\": \"US\"\n      }\n    },\n    \"package\": {\n      \"weight\": 5,\n      \"length\": 10,\n      \"width\": 8,\n      \"height\": 6,\n      \"item_description\": \"Electronics\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
```

### Import air quote intake

**Request**

```json
{
  "parcel": {
    "direction": "import",
    "transport_mode": "air",
    "address_suffix": "YSDX-UGTE-1234",
    "recipient": {
      "name": "Jane Receiver",
      "email": "receiver@example.com",
      "phone": "+2348012345678",
      "address": {
        "street": "1 Warehouse Road",
        "city": "Lagos",
        "state": "Lagos",
        "postal_code": "100001",
        "country": "NG"
      }
    },
    "packages": [
      {
        "height": 80,
        "length": 120,
        "package_type": "Pallet",
        "weight": 120,
        "width": 100
      }
    ]
  }
}
```

**Response**

```json
{
  "parcel_quote_id": "string",
  "status": "pending",
  "source": "string",
  "direction": "string",
  "reference": "string",
  "rates": [
    {
      "id": "string",
      "carrier": "string",
      "service": "string",
      "rate": "string",
      "currency": "string",
      "estimated_delivery_days": 1,
      "estimated_delivery_date": "2023-01-15"
    }
  ],
  "sender": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "recipient": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "package": {
    "weight": 5,
    "length": 10,
    "width": 8,
    "height": 6,
    "item_description": "Electronics"
  },
  "cargo_volume": "1 x 40'",
  "origin_details": {},
  "dest_details": {},
  "parcel_details": {},
  "tracking_code": "string",
  "label_url": "string",
  "selected_rate": {},
  "tracker_id": "string",
  "purchased_at": "2024-01-15T09:30:00Z",
  "booked_at": "2024-01-15T09:30:00Z",
  "estimated_price": 6246625,
  "created_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python Import air quote intake
import requests

url = "https://api.trysend.com/v1/parcel_quotes"

payload = { "parcel": {
        "direction": "import",
        "transport_mode": "air",
        "address_suffix": "YSDX-UGTE-1234",
        "recipient": {
            "name": "Jane Receiver",
            "email": "receiver@example.com",
            "phone": "+2348012345678",
            "address": {
                "street": "1 Warehouse Road",
                "city": "Lagos",
                "state": "Lagos",
                "postal_code": "100001",
                "country": "NG"
            }
        },
        "packages": [
            {
                "height": 80,
                "length": 120,
                "package_type": "Pallet",
                "weight": 120,
                "width": 100
            }
        ]
    } }
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```ruby Import air quote intake
require 'uri'
require 'net/http'

url = URI("https://api.trysend.com/v1/parcel_quotes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"parcel\": {\n    \"direction\": \"import\",\n    \"transport_mode\": \"air\",\n    \"address_suffix\": \"YSDX-UGTE-1234\",\n    \"recipient\": {\n      \"name\": \"Jane Receiver\",\n      \"email\": \"receiver@example.com\",\n      \"phone\": \"+2348012345678\",\n      \"address\": {\n        \"street\": \"1 Warehouse Road\",\n        \"city\": \"Lagos\",\n        \"state\": \"Lagos\",\n        \"postal_code\": \"100001\",\n        \"country\": \"NG\"\n      }\n    },\n    \"packages\": [\n      {\n        \"height\": 80,\n        \"length\": 120,\n        \"package_type\": \"Pallet\",\n        \"weight\": 120,\n        \"width\": 100\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

### Import ocean — full sender + last-mile delivery

**Request**

```json
{
  "parcel": {
    "direction": "import",
    "transport_mode": "ocean",
    "sender": {
      "name": "John Sender",
      "email": "john@example.com",
      "phone": "+862155551234",
      "address": {
        "street": "88 Port Road",
        "city": "Shanghai",
        "state": "Shanghai",
        "postal_code": "200000",
        "country": "CN"
      }
    },
    "recipient": {
      "name": "Jane Receiver",
      "email": "jane@example.com",
      "phone": "+2348012345678",
      "address": {
        "street": "2 Marina",
        "city": "Lagos",
        "state": "Lagos",
        "postal_code": "100001",
        "country": "NG"
      }
    },
    "packages": [
      {
        "commodity": "Textiles",
        "container_size": "40'",
        "quantity": 1
      }
    ]
  }
}
```

**Response**

```json
{
  "parcel_quote_id": "string",
  "status": "pending",
  "source": "string",
  "direction": "string",
  "reference": "string",
  "rates": [
    {
      "id": "string",
      "carrier": "string",
      "service": "string",
      "rate": "string",
      "currency": "string",
      "estimated_delivery_days": 1,
      "estimated_delivery_date": "2023-01-15"
    }
  ],
  "sender": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "recipient": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "package": {
    "weight": 5,
    "length": 10,
    "width": 8,
    "height": 6,
    "item_description": "Electronics"
  },
  "cargo_volume": "1 x 40'",
  "origin_details": {},
  "dest_details": {},
  "parcel_details": {},
  "tracking_code": "string",
  "label_url": "string",
  "selected_rate": {},
  "tracker_id": "string",
  "purchased_at": "2024-01-15T09:30:00Z",
  "booked_at": "2024-01-15T09:30:00Z",
  "estimated_price": 6246625,
  "created_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python Import ocean — full sender + last-mile delivery
import requests

url = "https://api.trysend.com/v1/parcel_quotes"

payload = { "parcel": {
        "direction": "import",
        "transport_mode": "ocean",
        "sender": {
            "name": "John Sender",
            "email": "john@example.com",
            "phone": "+862155551234",
            "address": {
                "street": "88 Port Road",
                "city": "Shanghai",
                "state": "Shanghai",
                "postal_code": "200000",
                "country": "CN"
            }
        },
        "recipient": {
            "name": "Jane Receiver",
            "email": "jane@example.com",
            "phone": "+2348012345678",
            "address": {
                "street": "2 Marina",
                "city": "Lagos",
                "state": "Lagos",
                "postal_code": "100001",
                "country": "NG"
            }
        },
        "packages": [
            {
                "commodity": "Textiles",
                "container_size": "40'",
                "quantity": 1
            }
        ]
    } }
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```ruby Import ocean — full sender + last-mile delivery
require 'uri'
require 'net/http'

url = URI("https://api.trysend.com/v1/parcel_quotes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"parcel\": {\n    \"direction\": \"import\",\n    \"transport_mode\": \"ocean\",\n    \"sender\": {\n      \"name\": \"John Sender\",\n      \"email\": \"john@example.com\",\n      \"phone\": \"+862155551234\",\n      \"address\": {\n        \"street\": \"88 Port Road\",\n        \"city\": \"Shanghai\",\n        \"state\": \"Shanghai\",\n        \"postal_code\": \"200000\",\n        \"country\": \"CN\"\n      }\n    },\n    \"recipient\": {\n      \"name\": \"Jane Receiver\",\n      \"email\": \"jane@example.com\",\n      \"phone\": \"+2348012345678\",\n      \"address\": {\n        \"street\": \"2 Marina\",\n        \"city\": \"Lagos\",\n        \"state\": \"Lagos\",\n        \"postal_code\": \"100001\",\n        \"country\": \"NG\"\n      }\n    },\n    \"packages\": [\n      {\n        \"commodity\": \"Textiles\",\n        \"container_size\": \"40'\",\n        \"quantity\": 1\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

### Import ocean — address_suffix (unique ID) + last-mile delivery

**Request**

```json
{
  "parcel": {
    "direction": "import",
    "transport_mode": "ocean",
    "address_suffix": "YSDX-UGTE-1234",
    "recipient": {
      "name": "Jane Receiver",
      "email": "jane@example.com",
      "phone": "+2348012345678",
      "address": {
        "street": "2 Marina",
        "city": "Lagos",
        "state": "Lagos",
        "postal_code": "100001",
        "country": "NG"
      }
    },
    "packages": [
      {
        "commodity": "Textiles",
        "container_size": "40'",
        "quantity": 1
      }
    ]
  }
}
```

**Response**

```json
{
  "parcel_quote_id": "string",
  "status": "pending",
  "source": "string",
  "direction": "string",
  "reference": "string",
  "rates": [
    {
      "id": "string",
      "carrier": "string",
      "service": "string",
      "rate": "string",
      "currency": "string",
      "estimated_delivery_days": 1,
      "estimated_delivery_date": "2023-01-15"
    }
  ],
  "sender": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "recipient": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "package": {
    "weight": 5,
    "length": 10,
    "width": 8,
    "height": 6,
    "item_description": "Electronics"
  },
  "cargo_volume": "1 x 40'",
  "origin_details": {},
  "dest_details": {},
  "parcel_details": {},
  "tracking_code": "string",
  "label_url": "string",
  "selected_rate": {},
  "tracker_id": "string",
  "purchased_at": "2024-01-15T09:30:00Z",
  "booked_at": "2024-01-15T09:30:00Z",
  "estimated_price": 6246625,
  "created_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python Import ocean — address_suffix (unique ID) + last-mile delivery
import requests

url = "https://api.trysend.com/v1/parcel_quotes"

payload = { "parcel": {
        "direction": "import",
        "transport_mode": "ocean",
        "address_suffix": "YSDX-UGTE-1234",
        "recipient": {
            "name": "Jane Receiver",
            "email": "jane@example.com",
            "phone": "+2348012345678",
            "address": {
                "street": "2 Marina",
                "city": "Lagos",
                "state": "Lagos",
                "postal_code": "100001",
                "country": "NG"
            }
        },
        "packages": [
            {
                "commodity": "Textiles",
                "container_size": "40'",
                "quantity": 1
            }
        ]
    } }
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```ruby Import ocean — address_suffix (unique ID) + last-mile delivery
require 'uri'
require 'net/http'

url = URI("https://api.trysend.com/v1/parcel_quotes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"parcel\": {\n    \"direction\": \"import\",\n    \"transport_mode\": \"ocean\",\n    \"address_suffix\": \"YSDX-UGTE-1234\",\n    \"recipient\": {\n      \"name\": \"Jane Receiver\",\n      \"email\": \"jane@example.com\",\n      \"phone\": \"+2348012345678\",\n      \"address\": {\n        \"street\": \"2 Marina\",\n        \"city\": \"Lagos\",\n        \"state\": \"Lagos\",\n        \"postal_code\": \"100001\",\n        \"country\": \"NG\"\n      }\n    },\n    \"packages\": [\n      {\n        \"commodity\": \"Textiles\",\n        \"container_size\": \"40'\",\n        \"quantity\": 1\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

### Import ocean — address_suffix, delivery to business/warehouse

**Request**

```json
{
  "parcel": {
    "direction": "import",
    "transport_mode": "ocean",
    "address_suffix": "1234",
    "recipient": {
      "name": "Your Business Ltd",
      "email": "business@example.com",
      "phone": "+2348012345678",
      "address": {
        "street": "1 Warehouse Road",
        "city": "Lagos",
        "state": "Lagos",
        "postal_code": "100001",
        "country": "NG"
      }
    },
    "packages": [
      {
        "commodity": "Textiles",
        "container_size": "40'",
        "quantity": 1
      }
    ]
  }
}
```

**Response**

```json
{
  "parcel_quote_id": "string",
  "status": "pending",
  "source": "string",
  "direction": "string",
  "reference": "string",
  "rates": [
    {
      "id": "string",
      "carrier": "string",
      "service": "string",
      "rate": "string",
      "currency": "string",
      "estimated_delivery_days": 1,
      "estimated_delivery_date": "2023-01-15"
    }
  ],
  "sender": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "recipient": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "package": {
    "weight": 5,
    "length": 10,
    "width": 8,
    "height": 6,
    "item_description": "Electronics"
  },
  "cargo_volume": "1 x 40'",
  "origin_details": {},
  "dest_details": {},
  "parcel_details": {},
  "tracking_code": "string",
  "label_url": "string",
  "selected_rate": {},
  "tracker_id": "string",
  "purchased_at": "2024-01-15T09:30:00Z",
  "booked_at": "2024-01-15T09:30:00Z",
  "estimated_price": 6246625,
  "created_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python Import ocean — address_suffix, delivery to business/warehouse
import requests

url = "https://api.trysend.com/v1/parcel_quotes"

payload = { "parcel": {
        "direction": "import",
        "transport_mode": "ocean",
        "address_suffix": "1234",
        "recipient": {
            "name": "Your Business Ltd",
            "email": "business@example.com",
            "phone": "+2348012345678",
            "address": {
                "street": "1 Warehouse Road",
                "city": "Lagos",
                "state": "Lagos",
                "postal_code": "100001",
                "country": "NG"
            }
        },
        "packages": [
            {
                "commodity": "Textiles",
                "container_size": "40'",
                "quantity": 1
            }
        ]
    } }
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```ruby Import ocean — address_suffix, delivery to business/warehouse
require 'uri'
require 'net/http'

url = URI("https://api.trysend.com/v1/parcel_quotes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"parcel\": {\n    \"direction\": \"import\",\n    \"transport_mode\": \"ocean\",\n    \"address_suffix\": \"1234\",\n    \"recipient\": {\n      \"name\": \"Your Business Ltd\",\n      \"email\": \"business@example.com\",\n      \"phone\": \"+2348012345678\",\n      \"address\": {\n        \"street\": \"1 Warehouse Road\",\n        \"city\": \"Lagos\",\n        \"state\": \"Lagos\",\n        \"postal_code\": \"100001\",\n        \"country\": \"NG\"\n      }\n    },\n    \"packages\": [\n      {\n        \"commodity\": \"Textiles\",\n        \"container_size\": \"40'\",\n        \"quantity\": 1\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

### Import ocean — flat fields (Send dashboard / API v1)

**Request**

```json
{
  "parcel": {
    "direction": "import",
    "transport_mode": "ocean",
    "parcel_customer_token": "pc_tok_abc123",
    "dest_name": "ExpressFirst",
    "dest_email": "ops@example.com",
    "dest_mobile": "+2348012345678",
    "dest_address": "1 Warehouse Road",
    "dest_city": "Lagos",
    "dest_state": "Lagos",
    "destination_country": "Nigeria",
    "packages": [
      {
        "commodity": "Textiles",
        "container_size": "40'",
        "quantity": 2
      }
    ]
  }
}
```

**Response**

```json
{
  "parcel_quote_id": "string",
  "status": "pending",
  "source": "string",
  "direction": "string",
  "reference": "string",
  "rates": [
    {
      "id": "string",
      "carrier": "string",
      "service": "string",
      "rate": "string",
      "currency": "string",
      "estimated_delivery_days": 1,
      "estimated_delivery_date": "2023-01-15"
    }
  ],
  "sender": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "recipient": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "package": {
    "weight": 5,
    "length": 10,
    "width": 8,
    "height": 6,
    "item_description": "Electronics"
  },
  "cargo_volume": "1 x 40'",
  "origin_details": {},
  "dest_details": {},
  "parcel_details": {},
  "tracking_code": "string",
  "label_url": "string",
  "selected_rate": {},
  "tracker_id": "string",
  "purchased_at": "2024-01-15T09:30:00Z",
  "booked_at": "2024-01-15T09:30:00Z",
  "estimated_price": 6246625,
  "created_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python Import ocean — flat fields (Send dashboard / API v1)
import requests

url = "https://api.trysend.com/v1/parcel_quotes"

payload = { "parcel": {
        "direction": "import",
        "transport_mode": "ocean",
        "parcel_customer_token": "pc_tok_abc123",
        "dest_name": "ExpressFirst",
        "dest_email": "ops@example.com",
        "dest_mobile": "+2348012345678",
        "dest_address": "1 Warehouse Road",
        "dest_city": "Lagos",
        "dest_state": "Lagos",
        "destination_country": "Nigeria",
        "packages": [
            {
                "commodity": "Textiles",
                "container_size": "40'",
                "quantity": 2
            }
        ]
    } }
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```ruby Import ocean — flat fields (Send dashboard / API v1)
require 'uri'
require 'net/http'

url = URI("https://api.trysend.com/v1/parcel_quotes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"parcel\": {\n    \"direction\": \"import\",\n    \"transport_mode\": \"ocean\",\n    \"parcel_customer_token\": \"pc_tok_abc123\",\n    \"dest_name\": \"ExpressFirst\",\n    \"dest_email\": \"ops@example.com\",\n    \"dest_mobile\": \"+2348012345678\",\n    \"dest_address\": \"1 Warehouse Road\",\n    \"dest_city\": \"Lagos\",\n    \"dest_state\": \"Lagos\",\n    \"destination_country\": \"Nigeria\",\n    \"packages\": [\n      {\n        \"commodity\": \"Textiles\",\n        \"container_size\": \"40'\",\n        \"quantity\": 2\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

### Export ocean — pending estimate

**Request**

```json
{
  "parcel": {
    "direction": "export",
    "transport_mode": "ocean",
    "sender": {
      "name": "Lagos Exports Ltd",
      "email": "export@example.com",
      "phone": "+2348012345678",
      "address": {
        "street": "10 Export Zone",
        "city": "Lagos",
        "state": "Lagos",
        "postal_code": "100001",
        "country": "NG"
      }
    },
    "recipient": {
      "name": "Overseas Buyer",
      "email": "buyer@example.com",
      "phone": "+442079460958",
      "address": {
        "street": "456 Elm Street",
        "city": "London",
        "state": "Greater London",
        "postal_code": "SW1A 1AA",
        "country": "GB"
      }
    },
    "packages": [
      {
        "commodity": "Machinery",
        "container_size": "40'",
        "quantity": 1
      }
    ]
  }
}
```

**Response**

```json
{
  "parcel_quote_id": "string",
  "status": "pending",
  "source": "string",
  "direction": "string",
  "reference": "string",
  "rates": [
    {
      "id": "string",
      "carrier": "string",
      "service": "string",
      "rate": "string",
      "currency": "string",
      "estimated_delivery_days": 1,
      "estimated_delivery_date": "2023-01-15"
    }
  ],
  "sender": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "recipient": {
    "name": "John Sender",
    "email": "sender@example.com",
    "phone": "+1234567890",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  },
  "package": {
    "weight": 5,
    "length": 10,
    "width": 8,
    "height": 6,
    "item_description": "Electronics"
  },
  "cargo_volume": "1 x 40'",
  "origin_details": {},
  "dest_details": {},
  "parcel_details": {},
  "tracking_code": "string",
  "label_url": "string",
  "selected_rate": {},
  "tracker_id": "string",
  "purchased_at": "2024-01-15T09:30:00Z",
  "booked_at": "2024-01-15T09:30:00Z",
  "estimated_price": 6246625,
  "created_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python Export ocean — pending estimate
import requests

url = "https://api.trysend.com/v1/parcel_quotes"

payload = { "parcel": {
        "direction": "export",
        "transport_mode": "ocean",
        "sender": {
            "name": "Lagos Exports Ltd",
            "email": "export@example.com",
            "phone": "+2348012345678",
            "address": {
                "street": "10 Export Zone",
                "city": "Lagos",
                "state": "Lagos",
                "postal_code": "100001",
                "country": "NG"
            }
        },
        "recipient": {
            "name": "Overseas Buyer",
            "email": "buyer@example.com",
            "phone": "+442079460958",
            "address": {
                "street": "456 Elm Street",
                "city": "London",
                "state": "Greater London",
                "postal_code": "SW1A 1AA",
                "country": "GB"
            }
        },
        "packages": [
            {
                "commodity": "Machinery",
                "container_size": "40'",
                "quantity": 1
            }
        ]
    } }
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```ruby Export ocean — pending estimate
require 'uri'
require 'net/http'

url = URI("https://api.trysend.com/v1/parcel_quotes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"parcel\": {\n    \"direction\": \"export\",\n    \"transport_mode\": \"ocean\",\n    \"sender\": {\n      \"name\": \"Lagos Exports Ltd\",\n      \"email\": \"export@example.com\",\n      \"phone\": \"+2348012345678\",\n      \"address\": {\n        \"street\": \"10 Export Zone\",\n        \"city\": \"Lagos\",\n        \"state\": \"Lagos\",\n        \"postal_code\": \"100001\",\n        \"country\": \"NG\"\n      }\n    },\n    \"recipient\": {\n      \"name\": \"Overseas Buyer\",\n      \"email\": \"buyer@example.com\",\n      \"phone\": \"+442079460958\",\n      \"address\": {\n        \"street\": \"456 Elm Street\",\n        \"city\": \"London\",\n        \"state\": \"Greater London\",\n        \"postal_code\": \"SW1A 1AA\",\n        \"country\": \"GB\"\n      }\n    },\n    \"packages\": [\n      {\n        \"commodity\": \"Machinery\",\n        \"container_size\": \"40'\",\n        \"quantity\": 1\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```