# Order

**Important**: This endpoint only works with the following carriers:

- AustraliaPost
- DHLExpress
- DPD
- DPDUK
- Fastway
- FedEx
- UPS
- Purolator
- LoomisExpress

The `Order` object represents a collection of packages and is intended only for multi-parcel shipping; please use `Shipments` for single-parcel shipping.
Like a single `Shipment`, each `Order` consists of a `to_address` and `from_address`, to be used for each `Shipment` within the `Order`.
These `Address` objects will be copied to each `Shipment`, so there is no need to specify them multiple times.
Each `Shipment` must then specify its `Parcel`, `Options`, and `CustomsInfo`.

  **Note**: The `customs_info` field within the `Order` object is no longer used.
  Always specify `CustomsInfo` within each
  `Shipment` instead.

An `Order` created with a valid `Address` pair and `Parcel` nested within the `Order`'s `Shipment` object will automatically retrieve available shipping `Rate` options.

---

## Order object

| Property | Type | Description |
|----------|------|-------------|
| id | string | Unique, begins with "order_" |
| object | string | "Order" |
| mode | string | "test" or "production" |
| to_address | Address | The destination address |
| from_address | Address | The origin address |
| return_address | Address | The shipper's address, defaults to from_address |
| buyer_address | Address | The buyer's address, defaults to to_address |
| shipments | Shipment array | All associated Shipment objects. Maximum of 100. |
| customs_info | deprecated | The customs_info field at the order level is deprecated and should not be used. Specify CustomsInfo within each individual Shipment object instead. |
| rates | Rate array | All associated Rate objects |
| messages | Message array | Any carrier errors encountered during rating |
| is_return | boolean | Set true to create as a return. |
| created_at | datetime | When the Order was created |
| updated_at | datetime | When the Order was last updated |

Example Object:

```json
{
  "mode": "test",
  "reference": "",
  "is_return": false,
  "options": {
    "currency": "USD",
    "payment": {
      "type": "SENDER"
    }
  },
  "messages": [],
  "created_at": "2025-05-09T20:48:00Z",
  "updated_at": "2025-05-09T20:48:00Z",
  "customs_info": null,
  "from_address": {
    "id": "adr_e51506082d1611f0b9823cecef1b359e",
    "object": "Address",
    "created_at": "2025-05-09T20:48:00+00:00",
    "updated_at": "2025-05-09T20:48:00+00:00",
    "name": "EasyPost",
    "company": null,
    "street1": "417 Montgomery Street",
    "street2": "5th Floor",
    "city": "San Francisco",
    "state": "CA",
    "zip": "94104",
    "country": "US",
    "phone": "4153334445",
    "email": "support@easypost.com",
    "mode": "test",
    "carrier_facility": null,
    "residential": null,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {}
  },
  "to_address": {
    "id": "adr_e51381df2d1611f0b9803cecef1b359e",
    "object": "Address",
    "created_at": "2025-05-09T20:48:00+00:00",
    "updated_at": "2025-05-09T20:48:01+00:00",
    "name": "DR. STEVE BRULE",
    "company": null,
    "street1": "179 N HARBOR DR",
    "street2": "",
    "city": "REDONDO BEACH",
    "state": "CA",
    "zip": "90277-2506",
    "country": "US",
    "phone": "8573875756",
    "email": "DR_STEVE_BRULE@GMAIL.COM",
    "mode": "test",
    "carrier_facility": null,
    "residential": false,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {
      "zip4": {
        "success": true,
        "errors": [],
        "details": null
      },
      "delivery": {
        "success": true,
        "errors": [],
        "details": {
          "latitude": 33.8436,
          "longitude": -118.39177,
          "time_zone": "America/Los_Angeles"
        }
      }
    }
  },
  "buyer_address": {
    "id": "adr_e51381df2d1611f0b9803cecef1b359e",
    "object": "Address",
    "created_at": "2025-05-09T20:48:00+00:00",
    "updated_at": "2025-05-09T20:48:01+00:00",
    "name": "DR. STEVE BRULE",
    "company": null,
    "street1": "179 N HARBOR DR",
    "street2": "",
    "city": "REDONDO BEACH",
    "state": "CA",
    "zip": "90277-2506",
    "country": "US",
    "phone": "8573875756",
    "email": "DR_STEVE_BRULE@GMAIL.COM",
    "mode": "test",
    "carrier_facility": null,
    "residential": false,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {
      "zip4": {
        "success": true,
        "errors": [],
        "details": null
      },
      "delivery": {
        "success": true,
        "errors": [],
        "details": {
          "latitude": 33.8436,
          "longitude": -118.39177,
          "time_zone": "America/Los_Angeles"
        }
      }
    }
  },
  "return_address": {
    "id": "adr_e51506082d1611f0b9823cecef1b359e",
    "object": "Address",
    "created_at": "2025-05-09T20:48:00+00:00",
    "updated_at": "2025-05-09T20:48:00+00:00",
    "name": "EasyPost",
    "company": null,
    "street1": "417 Montgomery Street",
    "street2": "5th Floor",
    "city": "San Francisco",
    "state": "CA",
    "zip": "94104",
    "country": "US",
    "phone": "4153334445",
    "email": "support@easypost.com",
    "mode": "test",
    "carrier_facility": null,
    "residential": null,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {}
  },
  "shipments": [
    {
      "id": "shp_dc956f485e2540889b7f7eab7d668b88",
      "created_at": "2025-05-09T20:48:00Z",
      "is_return": false,
      "messages": [],
      "mode": "test",
      "options": {
        "currency": "USD",
        "payment": {
          "type": "SENDER"
        },
        "date_advance": 0
      },
      "reference": null,
      "status": "unknown",
      "tracking_code": "9400100208303109837512",
      "updated_at": "2025-05-09T20:48:01Z",
      "batch_id": null,
      "batch_status": null,
      "batch_message": null,
      "customs_info": null,
      "from_address": {
        "id": "adr_e51506082d1611f0b9823cecef1b359e",
        "object": "Address",
        "created_at": "2025-05-09T20:48:00+00:00",
        "updated_at": "2025-05-09T20:48:00+00:00",
        "name": "EasyPost",
        "company": null,
        "street1": "417 Montgomery Street",
        "street2": "5th Floor",
        "city": "San Francisco",
        "state": "CA",
        "zip": "94104",
        "country": "US",
        "phone": "4153334445",
        "email": "support@easypost.com",
        "mode": "test",
        "carrier_facility": null,
        "residential": null,
        "federal_tax_id": null,
        "state_tax_id": null,
        "verifications": {}
      },
      "insurance": null,
      "order_id": "order_dae84134c5d54a01a57ff6eab32c34a2",
      "parcel": {
        "id": "prcl_dbd3f85ebce547f3baf9285545bc86cf",
        "object": "Parcel",
        "created_at": "2025-05-09T20:48:00Z",
        "updated_at": "2025-05-09T20:48:00Z",
        "length": null,
        "width": null,
        "height": null,
        "predefined_package": null,
        "weight": 10.2,
        "mode": "test"
      },
      "postage_label": {
        "object": "PostageLabel",
        "id": "pl_ec778bac45c848ffb010782a8ac9d794",
        "created_at": "2025-05-09T20:48:01Z",
        "updated_at": "2025-05-09T20:48:01Z",
        "date_advance": 0,
        "integrated_form": "none",
        "label_date": "2025-05-09T20:48:01Z",
        "label_resolution": 300,
        "label_size": "4x6",
        "label_type": "default",
        "label_file_type": "image/png",
        "label_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250509/e811f9e30a55d8495691c382633bd1de27.png",
        "label_pdf_url": null,
        "label_zpl_url": null,
        "label_epl2_url": null,
        "label_file": null
      },
      "rates": [
        {
          "id": "rate_76b94a6a12e4451ebd2c83d643499e52",
          "object": "Rate",
          "created_at": "2025-05-09T20:48:00Z",
          "updated_at": "2025-05-09T20:48:00Z",
          "mode": "test",
          "service": "Express",
          "carrier": "USPS",
          "rate": "34.15",
          "currency": "USD",
          "retail_rate": "39.10",
          "retail_currency": "USD",
          "list_rate": "34.15",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 2,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 2,
          "shipment_id": "shp_dc956f485e2540889b7f7eab7d668b88",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_f5162cf3d5404cde8b9152111f35f691",
          "object": "Rate",
          "created_at": "2025-05-09T20:48:00Z",
          "updated_at": "2025-05-09T20:48:00Z",
          "mode": "test",
          "service": "Priority",
          "carrier": "USPS",
          "rate": "7.42",
          "currency": "USD",
          "retail_rate": "9.90",
          "retail_currency": "USD",
          "list_rate": "8.34",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 2,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 2,
          "shipment_id": "shp_dc956f485e2540889b7f7eab7d668b88",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_d7494d4d8044411ab025bf44a7bb5400",
          "object": "Rate",
          "created_at": "2025-05-09T20:48:00Z",
          "updated_at": "2025-05-09T20:48:00Z",
          "mode": "test",
          "service": "GroundAdvantage",
          "carrier": "USPS",
          "rate": "5.21",
          "currency": "USD",
          "retail_rate": "7.00",
          "retail_currency": "USD",
          "list_rate": "5.21",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_dc956f485e2540889b7f7eab7d668b88",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        }
      ],
      "refund_status": null,
      "scan_form": null,
      "selected_rate": {
        "id": "rate_d7494d4d8044411ab025bf44a7bb5400",
        "object": "Rate",
        "created_at": "2025-05-09T20:48:01Z",
        "updated_at": "2025-05-09T20:48:01Z",
        "mode": "test",
        "service": "GroundAdvantage",
        "carrier": "USPS",
        "rate": "5.21",
        "currency": "USD",
        "retail_rate": "7.00",
        "retail_currency": "USD",
        "list_rate": "5.21",
        "list_currency": "USD",
        "billing_type": "easypost",
        "delivery_days": 3,
        "delivery_date": null,
        "delivery_date_guaranteed": false,
        "est_delivery_days": 3,
        "shipment_id": "shp_dc956f485e2540889b7f7eab7d668b88",
        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
      },
      "tracker": {
        "id": "trk_82b8af6bc0ed482f957360e0a592caaa",
        "object": "Tracker",
        "mode": "test",
        "tracking_code": "9400100208303109837512",
        "status": "unknown",
        "status_detail": "unknown",
        "created_at": "2025-05-09T20:48:02Z",
        "updated_at": "2025-05-09T20:48:02Z",
        "signed_by": null,
        "weight": null,
        "est_delivery_date": null,
        "shipment_id": "shp_dc956f485e2540889b7f7eab7d668b88",
        "carrier": "USPS",
        "tracking_details": [],
        "fees": [],
        "carrier_detail": null,
        "public_url": "https://track.easypost.com/djE6dHJrXzgyYjhhZjZiYzBlZDQ4MmY5NTczNjBlMGE1OTJjYWFh"
      },
      "to_address": {
        "id": "adr_e51381df2d1611f0b9803cecef1b359e",
        "object": "Address",
        "created_at": "2025-05-09T20:48:00+00:00",
        "updated_at": "2025-05-09T20:48:01+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": "",
        "city": "REDONDO BEACH",
        "state": "CA",
        "zip": "90277-2506",
        "country": "US",
        "phone": "8573875756",
        "email": "DR_STEVE_BRULE@GMAIL.COM",
        "mode": "test",
        "carrier_facility": null,
        "residential": false,
        "federal_tax_id": null,
        "state_tax_id": null,
        "verifications": {
          "zip4": {
            "success": true,
            "errors": [],
            "details": null
          },
          "delivery": {
            "success": true,
            "errors": [],
            "details": {
              "latitude": 33.8436,
              "longitude": -118.39177,
              "time_zone": "America/Los_Angeles"
            }
          }
        }
      },
      "usps_zone": 4,
      "return_address": {
        "id": "adr_e51506082d1611f0b9823cecef1b359e",
        "object": "Address",
        "created_at": "2025-05-09T20:48:00+00:00",
        "updated_at": "2025-05-09T20:48:00+00:00",
        "name": "EasyPost",
        "company": null,
        "street1": "417 Montgomery Street",
        "street2": "5th Floor",
        "city": "San Francisco",
        "state": "CA",
        "zip": "94104",
        "country": "US",
        "phone": "4153334445",
        "email": "support@easypost.com",
        "mode": "test",
        "carrier_facility": null,
        "residential": null,
        "federal_tax_id": null,
        "state_tax_id": null,
        "verifications": {}
      },
      "buyer_address": {
        "id": "adr_e51381df2d1611f0b9803cecef1b359e",
        "object": "Address",
        "created_at": "2025-05-09T20:48:00+00:00",
        "updated_at": "2025-05-09T20:48:01+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": "",
        "city": "REDONDO BEACH",
        "state": "CA",
        "zip": "90277-2506",
        "country": "US",
        "phone": "8573875756",
        "email": "DR_STEVE_BRULE@GMAIL.COM",
        "mode": "test",
        "carrier_facility": null,
        "residential": false,
        "federal_tax_id": null,
        "state_tax_id": null,
        "verifications": {
          "zip4": {
            "success": true,
            "errors": [],
            "details": null
          },
          "delivery": {
            "success": true,
            "errors": [],
            "details": {
              "latitude": 33.8436,
              "longitude": -118.39177,
              "time_zone": "America/Los_Angeles"
            }
          }
        }
      },
      "forms": [],
      "fees": [
        {
          "object": "Fee",
          "type": "PostageFee",
          "amount": "5.21000",
          "charged": true,
          "refunded": false
        }
      ],
      "object": "Shipment"
    },
    {
      "id": "shp_fe48581e16154012b1e51ad5606d34c1",
      "created_at": "2025-05-09T20:48:00Z",
      "is_return": false,
      "messages": [],
      "mode": "test",
      "options": {
        "currency": "USD",
        "payment": {
          "type": "SENDER"
        },
        "date_advance": 0
      },
      "reference": null,
      "status": "unknown",
      "tracking_code": "9434600208303109842303",
      "updated_at": "2025-05-09T20:48:02Z",
      "batch_id": null,
      "batch_status": null,
      "batch_message": null,
      "customs_info": null,
      "from_address": {
        "id": "adr_e51506082d1611f0b9823cecef1b359e",
        "object": "Address",
        "created_at": "2025-05-09T20:48:00+00:00",
        "updated_at": "2025-05-09T20:48:00+00:00",
        "name": "EasyPost",
        "company": null,
        "street1": "417 Montgomery Street",
        "street2": "5th Floor",
        "city": "San Francisco",
        "state": "CA",
        "zip": "94104",
        "country": "US",
        "phone": "4153334445",
        "email": "support@easypost.com",
        "mode": "test",
        "carrier_facility": null,
        "residential": null,
        "federal_tax_id": null,
        "state_tax_id": null,
        "verifications": {}
      },
      "insurance": null,
      "order_id": "order_dae84134c5d54a01a57ff6eab32c34a2",
      "parcel": {
        "id": "prcl_69844696fd314ceeb78bb9969034a102",
        "object": "Parcel",
        "created_at": "2025-05-09T20:48:00Z",
        "updated_at": "2025-05-09T20:48:00Z",
        "length": null,
        "width": null,
        "height": null,
        "predefined_package": null,
        "weight": 17.5,
        "mode": "test"
      },
      "postage_label": {
        "object": "PostageLabel",
        "id": "pl_417029731e9d45c8b7e2750043a3517d",
        "created_at": "2025-05-09T20:48:01Z",
        "updated_at": "2025-05-09T20:48:02Z",
        "date_advance": 0,
        "integrated_form": "none",
        "label_date": "2025-05-09T20:48:01Z",
        "label_resolution": 300,
        "label_size": "4x6",
        "label_type": "default",
        "label_file_type": "image/png",
        "label_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250509/e864b415157bbf4709a37a07e9a5cd1550.png",
        "label_pdf_url": null,
        "label_zpl_url": null,
        "label_epl2_url": null,
        "label_file": null
      },
      "rates": [
        {
          "id": "rate_cc10630499d943208164f119319612a2",
          "object": "Rate",
          "created_at": "2025-05-09T20:48:00Z",
          "updated_at": "2025-05-09T20:48:00Z",
          "mode": "test",
          "service": "Priority",
          "carrier": "USPS",
          "rate": "8.22",
          "currency": "USD",
          "retail_rate": "12.65",
          "retail_currency": "USD",
          "list_rate": "9.07",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 2,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 2,
          "shipment_id": "shp_fe48581e16154012b1e51ad5606d34c1",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_270b4cbb74434de5883abdd54d308788",
          "object": "Rate",
          "created_at": "2025-05-09T20:48:00Z",
          "updated_at": "2025-05-09T20:48:00Z",
          "mode": "test",
          "service": "GroundAdvantage",
          "carrier": "USPS",
          "rate": "6.53",
          "currency": "USD",
          "retail_rate": "11.40",
          "retail_currency": "USD",
          "list_rate": "8.05",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_fe48581e16154012b1e51ad5606d34c1",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_5ec54c14e6a147ada7d670f294a40a1b",
          "object": "Rate",
          "created_at": "2025-05-09T20:48:00Z",
          "updated_at": "2025-05-09T20:48:00Z",
          "mode": "test",
          "service": "Express",
          "carrier": "USPS",
          "rate": "38.40",
          "currency": "USD",
          "retail_rate": "44.15",
          "retail_currency": "USD",
          "list_rate": "38.40",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 2,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 2,
          "shipment_id": "shp_fe48581e16154012b1e51ad5606d34c1",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        }
      ],
      "refund_status": null,
      "scan_form": null,
      "selected_rate": {
        "id": "rate_270b4cbb74434de5883abdd54d308788",
        "object": "Rate",
        "created_at": "2025-05-09T20:48:01Z",
        "updated_at": "2025-05-09T20:48:01Z",
        "mode": "test",
        "service": "GroundAdvantage",
        "carrier": "USPS",
        "rate": "6.53",
        "currency": "USD",
        "retail_rate": "11.40",
        "retail_currency": "USD",
        "list_rate": "8.05",
        "list_currency": "USD",
        "billing_type": "easypost",
        "delivery_days": 3,
        "delivery_date": null,
        "delivery_date_guaranteed": false,
        "est_delivery_days": 3,
        "shipment_id": "shp_fe48581e16154012b1e51ad5606d34c1",
        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
      },
      "tracker": {
        "id": "trk_545fffdf10084dab8a56046d00b08ad7",
        "object": "Tracker",
        "mode": "test",
        "tracking_code": "9434600208303109842303",
        "status": "unknown",
        "status_detail": "unknown",
        "created_at": "2025-05-09T20:48:02Z",
        "updated_at": "2025-05-09T20:48:02Z",
        "signed_by": null,
        "weight": null,
        "est_delivery_date": null,
        "shipment_id": "shp_fe48581e16154012b1e51ad5606d34c1",
        "carrier": "USPS",
        "tracking_details": [],
        "fees": [],
        "carrier_detail": null,
        "public_url": "https://track.easypost.com/djE6dHJrXzU0NWZmZmRmMTAwODRkYWI4YTU2MDQ2ZDAwYjA4YWQ3"
      },
      "to_address": {
        "id": "adr_e51381df2d1611f0b9803cecef1b359e",
        "object": "Address",
        "created_at": "2025-05-09T20:48:00+00:00",
        "updated_at": "2025-05-09T20:48:01+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": "",
        "city": "REDONDO BEACH",
        "state": "CA",
        "zip": "90277-2506",
        "country": "US",
        "phone": "8573875756",
        "email": "DR_STEVE_BRULE@GMAIL.COM",
        "mode": "test",
        "carrier_facility": null,
        "residential": false,
        "federal_tax_id": null,
        "state_tax_id": null,
        "verifications": {
          "zip4": {
            "success": true,
            "errors": [],
            "details": null
          },
          "delivery": {
            "success": true,
            "errors": [],
            "details": {
              "latitude": 33.8436,
              "longitude": -118.39177,
              "time_zone": "America/Los_Angeles"
            }
          }
        }
      },
      "usps_zone": 4,
      "return_address": {
        "id": "adr_e51506082d1611f0b9823cecef1b359e",
        "object": "Address",
        "created_at": "2025-05-09T20:48:00+00:00",
        "updated_at": "2025-05-09T20:48:00+00:00",
        "name": "EasyPost",
        "company": null,
        "street1": "417 Montgomery Street",
        "street2": "5th Floor",
        "city": "San Francisco",
        "state": "CA",
        "zip": "94104",
        "country": "US",
        "phone": "4153334445",
        "email": "support@easypost.com",
        "mode": "test",
        "carrier_facility": null,
        "residential": null,
        "federal_tax_id": null,
        "state_tax_id": null,
        "verifications": {}
      },
      "buyer_address": {
        "id": "adr_e51381df2d1611f0b9803cecef1b359e",
        "object": "Address",
        "created_at": "2025-05-09T20:48:00+00:00",
        "updated_at": "2025-05-09T20:48:01+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": "",
        "city": "REDONDO BEACH",
        "state": "CA",
        "zip": "90277-2506",
        "country": "US",
        "phone": "8573875756",
        "email": "DR_STEVE_BRULE@GMAIL.COM",
        "mode": "test",
        "carrier_facility": null,
        "residential": false,
        "federal_tax_id": null,
        "state_tax_id": null,
        "verifications": {
          "zip4": {
            "success": true,
            "errors": [],
            "details": null
          },
          "delivery": {
            "success": true,
            "errors": [],
            "details": {
              "latitude": 33.8436,
              "longitude": -118.39177,
              "time_zone": "America/Los_Angeles"
            }
          }
        }
      },
      "forms": [],
      "fees": [
        {
          "object": "Fee",
          "type": "PostageFee",
          "amount": "6.53000",
          "charged": true,
          "refunded": false
        }
      ],
      "object": "Shipment"
    }
  ],
  "rates": [
    {
      "id": "rate_76b94a6a12e4451ebd2c83d643499e52",
      "object": "Rate",
      "created_at": null,
      "updated_at": null,
      "mode": "test",
      "service": "Express",
      "carrier": "USPS",
      "rate": "72.55",
      "currency": "USD",
      "retail_rate": "83.25",
      "retail_currency": "USD",
      "list_rate": "72.55",
      "list_currency": "USD",
      "billing_type": "easypost",
      "delivery_days": 2,
      "delivery_date": null,
      "delivery_date_guaranteed": false,
      "est_delivery_days": 2,
      "shipment_id": "shp_dc956f485e2540889b7f7eab7d668b88",
      "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
    },
    {
      "id": "rate_f5162cf3d5404cde8b9152111f35f691",
      "object": "Rate",
      "created_at": null,
      "updated_at": null,
      "mode": "test",
      "service": "Priority",
      "carrier": "USPS",
      "rate": "15.64",
      "currency": "USD",
      "retail_rate": "22.55",
      "retail_currency": "USD",
      "list_rate": "17.41",
      "list_currency": "USD",
      "billing_type": "easypost",
      "delivery_days": 2,
      "delivery_date": null,
      "delivery_date_guaranteed": false,
      "est_delivery_days": 2,
      "shipment_id": "shp_dc956f485e2540889b7f7eab7d668b88",
      "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
    },
    {
      "id": "rate_d7494d4d8044411ab025bf44a7bb5400",
      "object": "Rate",
      "created_at": null,
      "updated_at": null,
      "mode": "test",
      "service": "GroundAdvantage",
      "carrier": "USPS",
      "rate": "11.74",
      "currency": "USD",
      "retail_rate": "18.40",
      "retail_currency": "USD",
      "list_rate": "13.26",
      "list_currency": "USD",
      "billing_type": "easypost",
      "delivery_days": 3,
      "delivery_date": null,
      "delivery_date_guaranteed": false,
      "est_delivery_days": 3,
      "shipment_id": "shp_dc956f485e2540889b7f7eab7d668b88",
      "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
    }
  ],
  "id": "order_dae84134c5d54a01a57ff6eab32c34a2",
  "object": "Order"
}
```

---

## Create an Order

### Example: POST /orders

#### cURL

```shell
curl -X POST https://api.easypost.com/v2/orders \
  -u "EASYPOST_API_KEY": \
  -H 'Content-Type: application/json' \
  -d '{
    "order": {
      "to_address": {
        "id": "adr_..."
      },
      "from_address": {
        "id": "adr_..."
      },
      "shipments": [
        {
          "parcel": {
            "weight": "10.2"
          }
        },
        {
          "parcel": {
            "predefined_package": "FedExBox",
            "weight": "17.5"
          }
        }
      ]
    }
  }'
```

#### Go

```go
package example

import (
	"fmt"

	"github.com/EasyPost/easypost-go/v5"
)

func create() {
	client := easypost.New("EASYPOST_API_KEY")

	toAddress, _ := client.GetAddress("adr_...")
	fromAddress, _ := client.GetAddress("adr_...")
	firstShipment := &easypost.Shipment{
		Parcel: &easypost.Parcel{
			Weight: 10.2,
		},
	}
	secondShipment := &easypost.Shipment{
		Parcel: &easypost.Parcel{
			PredefinedPackage: "FedExBox",
			Weight:            17.5,
		},
	}

	order, _ := client.CreateOrder(
		&easypost.Order{
			ToAddress:   toAddress,
			FromAddress: fromAddress,
			Shipments: []*easypost.Shipment{
				firstShipment,
				secondShipment,
			},
		},
	)

	fmt.Println(order)
}
```

#### Java

```java
package order;

import com.easypost.exception.EasyPostException;
import com.easypost.model.Order;
import com.easypost.service.EasyPostClient;

import java.util.ArrayList;
import java.util.HashMap;

public class Create {
    public static void main(String[] args) throws EasyPostException {
        EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

        HashMap<String, Object> toAddress = new HashMap<String, Object>();
        toAddress.put("id", "adr_...");

        HashMap<String, Object> fromAddress = new HashMap<String, Object>();
        fromAddress.put("id", "adr_...");

        HashMap<String, Object> parcel1 = new HashMap<String, Object>();
        parcel1.put("weight", 10.2);

        HashMap<String, Object> parcel2 = new HashMap<String, Object>();
        parcel2.put("weight", 17.5);
        parcel2.put("predefined_package", "FedExBox");

        ArrayList<HashMap<String, Object>> parcels = new ArrayList<HashMap<String, Object>>();
        parcels.add(parcel1);
        parcels.add(parcel2);

        HashMap<String, Object> params = new HashMap<String, Object>();
        params.put("to_address", toAddress);
        params.put("from_address", fromAddress);
        params.put("shipments", parcels);

        Order order = client.order.create(params);

        System.out.println(order);
    }
}
```

#### C#

```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
    public class Examples
    {
        public static async Task Main()
        {
            var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

            EasyPost.Parameters.Order.Create parameters = new()
            {
                ToAddress = new EasyPost.Parameters.Address.Create
                {
                    Name = "Dr. Steve Brule",
                    Street1 = "417 Montgomery Street",
                    Street2 = "5th Floor",
                    City = "San Francisco",
                    State = "CA",
                    Country = "US",
                    Zip = "94104"
                },
                FromAddress = new EasyPost.Parameters.Address.Create
                {
                    Company = "EasyPost",
                    Street1 = "417 Montgomery Street",
                    Street2 = "Floor 5",
                    City = "San Francisco",
                    State = "CA",
                    Country = "US",
                    Zip = "94104"
                },
                Shipments = new List<EasyPost.Parameters.IShipmentParameter>
                {
                    new EasyPost.Parameters.Shipment.Create()
                    {
                        Parcel = new EasyPost.Parameters.Parcel.Create
                        {
                            Weight = 10.2
                        }
                    },
                    new EasyPost.Parameters.Shipment.Create()
                    {
                        Parcel = new EasyPost.Parameters.Parcel.Create
                        {
                            PredefinedPackage = "FedExBox",
                            Weight = 17.5
                        }
                    }
                },
            };

            EasyPost.Models.API.Order order = await client.Order.Create(parameters);

            Console.WriteLine(JsonConvert.SerializeObject(order, Formatting.Indented));
        }
    }
}
```

#### Node.js

```javascript
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const order = await client.Order.create({
    to_address: { id: 'adr_...' },
    from_address: { id: 'adr_...' },
    shipments: [
      {
        parcel: {
          weight: 10.2,
        },
      },
      {
        parcel: {
          predefined_package: 'FedExBox',
          weight: 17.5,
        },
      },
    ],
  });

  console.log(order);
})();
```

#### PHP

```php
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$order = $client->order->create([
    'to_address' => ['id' => 'adr_...'],
    'from_address' => ['id' => 'adr_...'],
    'shipments' => [
        [
            'parcel' => [
                'weight' => 10.2
            ]
        ],
        [
            'parcel' => [
                'predefined_package' => 'FedExBox',
                'weight' => 17.5
            ]
        ],
    ],
]);

echo $order;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

order = client.order.create(
    to_address={"id": "adr_..."},
    from_address={"id": "adr_..."},
    shipments=[
        {
            "parcel": {
                "weight": 10.2,
            }
        },
        {
            "parcel": {
                "predefined_package": "FedExBox",
                "weight": 17.5,
            }
        },
    ],
)

print(order)
```

#### Ruby

```ruby
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

order = client.order.create(
  to_address: {
    id: 'adr_...',
  },
  from_address: {
    id: 'adr_...',
  },
  shipments: [
    {
      parcel: {
        weight: 10.2,
      },
    },
    {
      parcel: {
        predefined_package: 'FedExBox',
        weight: 17.5,
      },
    },
  ],
)

puts order
```

Creating an `Order` is intended only for multi-parcel shipping; please use `Shipments` for single-parcel shipping.
An `Order` is almost exclusively a container for other objects, and thus an `Order` may reuse many of these objects.
Alternatively, all the objects contained within an `Order` may be created at the same time.

You can limit the `CarrierAccounts` to use for rating by passing the `carrier_accounts` parameter.

[Note: This object is immutable after creation. Review the rendered documentation for details.]

---

## Buy an Order

### Example: POST /orders/:id/buy

#### cURL

```shell
curl -X POST https://api.easypost.com/v2/orders \
  -u "EASYPOST_API_KEY": \
  -H 'Content-Type: application/json' \
  -d '{
    "order": {
      "to_address": {
        "id": "adr_..."
      },
      "from_address": {
        "id": "adr_..."
      },
      "shipments": [
        {
          "parcel": {
            "weight": "10.2"
          }
        },
        {
          "parcel": {
            "predefined_package": "FedExBox",
            "weight": "17.5"
          }
        }
      ]
    }
  }'
```

#### Go

```go
package example

import (
	"fmt"

	"github.com/EasyPost/easypost-go/v5"
)

func create() {
	client := easypost.New("EASYPOST_API_KEY")

	toAddress, _ := client.GetAddress("adr_...")
	fromAddress, _ := client.GetAddress("adr_...")
	firstShipment := &easypost.Shipment{
		Parcel: &easypost.Parcel{
			Weight: 10.2,
		},
	}
	secondShipment := &easypost.Shipment{
		Parcel: &easypost.Parcel{
			PredefinedPackage: "FedExBox",
			Weight:            17.5,
		},
	}

	order, _ := client.CreateOrder(
		&easypost.Order{
			ToAddress:   toAddress,
			FromAddress: fromAddress,
			Shipments: []*easypost.Shipment{
				firstShipment,
				secondShipment,
			},
		},
	)

	fmt.Println(order)
}
```

#### Java

```java
package order;

import com.easypost.exception.EasyPostException;
import com.easypost.model.Order;
import com.easypost.service.EasyPostClient;

import java.util.ArrayList;
import java.util.HashMap;

public class Create {
    public static void main(String[] args) throws EasyPostException {
        EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

        HashMap<String, Object> toAddress = new HashMap<String, Object>();
        toAddress.put("id", "adr_...");

        HashMap<String, Object> fromAddress = new HashMap<String, Object>();
        fromAddress.put("id", "adr_...");

        HashMap<String, Object> parcel1 = new HashMap<String, Object>();
        parcel1.put("weight", 10.2);

        HashMap<String, Object> parcel2 = new HashMap<String, Object>();
        parcel2.put("weight", 17.5);
        parcel2.put("predefined_package", "FedExBox");

        ArrayList<HashMap<String, Object>> parcels = new ArrayList<HashMap<String, Object>>();
        parcels.add(parcel1);
        parcels.add(parcel2);

        HashMap<String, Object> params = new HashMap<String, Object>();
        params.put("to_address", toAddress);
        params.put("from_address", fromAddress);
        params.put("shipments", parcels);

        Order order = client.order.create(params);

        System.out.println(order);
    }
}
```

#### C#

```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
    public class Examples
    {
        public static async Task Main()
        {
            var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

            EasyPost.Parameters.Order.Create parameters = new()
            {
                ToAddress = new EasyPost.Parameters.Address.Create
                {
                    Name = "Dr. Steve Brule",
                    Street1 = "417 Montgomery Street",
                    Street2 = "5th Floor",
                    City = "San Francisco",
                    State = "CA",
                    Country = "US",
                    Zip = "94104"
                },
                FromAddress = new EasyPost.Parameters.Address.Create
                {
                    Company = "EasyPost",
                    Street1 = "417 Montgomery Street",
                    Street2 = "Floor 5",
                    City = "San Francisco",
                    State = "CA",
                    Country = "US",
                    Zip = "94104"
                },
                Shipments = new List<EasyPost.Parameters.IShipmentParameter>
                {
                    new EasyPost.Parameters.Shipment.Create()
                    {
                        Parcel = new EasyPost.Parameters.Parcel.Create
                        {
                            Weight = 10.2
                        }
                    },
                    new EasyPost.Parameters.Shipment.Create()
                    {
                        Parcel = new EasyPost.Parameters.Parcel.Create
                        {
                            PredefinedPackage = "FedExBox",
                            Weight = 17.5
                        }
                    }
                },
            };

            EasyPost.Models.API.Order order = await client.Order.Create(parameters);

            Console.WriteLine(JsonConvert.SerializeObject(order, Formatting.Indented));
        }
    }
}
```

#### Node.js

```javascript
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const order = await client.Order.create({
    to_address: { id: 'adr_...' },
    from_address: { id: 'adr_...' },
    shipments: [
      {
        parcel: {
          weight: 10.2,
        },
      },
      {
        parcel: {
          predefined_package: 'FedExBox',
          weight: 17.5,
        },
      },
    ],
  });

  console.log(order);
})();
```

#### PHP

```php
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$order = $client->order->create([
    'to_address' => ['id' => 'adr_...'],
    'from_address' => ['id' => 'adr_...'],
    'shipments' => [
        [
            'parcel' => [
                'weight' => 10.2
            ]
        ],
        [
            'parcel' => [
                'predefined_package' => 'FedExBox',
                'weight' => 17.5
            ]
        ],
    ],
]);

echo $order;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

order = client.order.create(
    to_address={"id": "adr_..."},
    from_address={"id": "adr_..."},
    shipments=[
        {
            "parcel": {
                "weight": 10.2,
            }
        },
        {
            "parcel": {
                "predefined_package": "FedExBox",
                "weight": 17.5,
            }
        },
    ],
)

print(order)
```

#### Ruby

```ruby
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

order = client.order.create(
  to_address: {
    id: 'adr_...',
  },
  from_address: {
    id: 'adr_...',
  },
  shipments: [
    {
      parcel: {
        weight: 10.2,
      },
    },
    {
      parcel: {
        predefined_package: 'FedExBox',
        weight: 17.5,
      },
    },
  ],
)

puts order
```

To purchase an `Order`, you only need to specify the `carrier` and `service`. This operation populates the `tracking_code` and `postage_label` attributes of each `Shipment` in the order.

---

## Buy an Order without rating (One-Call Buy)

### Example: POST /orders (One-Call Buy)

#### cURL

```shell
curl -X POST https://api.easypost.com/v2/orders \
  -u "EASYPOST_API_KEY": \
  -H 'Content-Type: application/json' \
  -d '{
    "order": {
      "to_address": {
        "id": "adr_..."
      },
      "from_address": {
        "id": "adr_..."
      },
      "shipments": [
        {
          "parcel": {
            "weight": "10.2"
          }
        },
        {
          "parcel": {
            "predefined_package": "FedExBox",
            "weight": "17.5"
          }
        }
      ]
    }
  }'
```

#### Go

```go
package example

import (
	"fmt"

	"github.com/EasyPost/easypost-go/v5"
)

func create() {
	client := easypost.New("EASYPOST_API_KEY")

	toAddress, _ := client.GetAddress("adr_...")
	fromAddress, _ := client.GetAddress("adr_...")
	firstShipment := &easypost.Shipment{
		Parcel: &easypost.Parcel{
			Weight: 10.2,
		},
	}
	secondShipment := &easypost.Shipment{
		Parcel: &easypost.Parcel{
			PredefinedPackage: "FedExBox",
			Weight:            17.5,
		},
	}

	order, _ := client.CreateOrder(
		&easypost.Order{
			ToAddress:   toAddress,
			FromAddress: fromAddress,
			Shipments: []*easypost.Shipment{
				firstShipment,
				secondShipment,
			},
		},
	)

	fmt.Println(order)
}
```

#### Java

```java
package order;

import com.easypost.exception.EasyPostException;
import com.easypost.model.Order;
import com.easypost.service.EasyPostClient;

import java.util.ArrayList;
import java.util.HashMap;

public class Create {
    public static void main(String[] args) throws EasyPostException {
        EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

        HashMap<String, Object> toAddress = new HashMap<String, Object>();
        toAddress.put("id", "adr_...");

        HashMap<String, Object> fromAddress = new HashMap<String, Object>();
        fromAddress.put("id", "adr_...");

        HashMap<String, Object> parcel1 = new HashMap<String, Object>();
        parcel1.put("weight", 10.2);

        HashMap<String, Object> parcel2 = new HashMap<String, Object>();
        parcel2.put("weight", 17.5);
        parcel2.put("predefined_package", "FedExBox");

        ArrayList<HashMap<String, Object>> parcels = new ArrayList<HashMap<String, Object>>();
        parcels.add(parcel1);
        parcels.add(parcel2);

        HashMap<String, Object> params = new HashMap<String, Object>();
        params.put("to_address", toAddress);
        params.put("from_address", fromAddress);
        params.put("shipments", parcels);

        Order order = client.order.create(params);

        System.out.println(order);
    }
}
```

#### C#

```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
    public class Examples
    {
        public static async Task Main()
        {
            var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

            EasyPost.Parameters.Order.Create parameters = new()
            {
                ToAddress = new EasyPost.Parameters.Address.Create
                {
                    Name = "Dr. Steve Brule",
                    Street1 = "417 Montgomery Street",
                    Street2 = "5th Floor",
                    City = "San Francisco",
                    State = "CA",
                    Country = "US",
                    Zip = "94104"
                },
                FromAddress = new EasyPost.Parameters.Address.Create
                {
                    Company = "EasyPost",
                    Street1 = "417 Montgomery Street",
                    Street2 = "Floor 5",
                    City = "San Francisco",
                    State = "CA",
                    Country = "US",
                    Zip = "94104"
                },
                Shipments = new List<EasyPost.Parameters.IShipmentParameter>
                {
                    new EasyPost.Parameters.Shipment.Create()
                    {
                        Parcel = new EasyPost.Parameters.Parcel.Create
                        {
                            Weight = 10.2
                        }
                    },
                    new EasyPost.Parameters.Shipment.Create()
                    {
                        Parcel = new EasyPost.Parameters.Parcel.Create
                        {
                            PredefinedPackage = "FedExBox",
                            Weight = 17.5
                        }
                    }
                },
            };

            EasyPost.Models.API.Order order = await client.Order.Create(parameters);

            Console.WriteLine(JsonConvert.SerializeObject(order, Formatting.Indented));
        }
    }
}
```

#### Node.js

```javascript
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const order = await client.Order.create({
    to_address: { id: 'adr_...' },
    from_address: { id: 'adr_...' },
    shipments: [
      {
        parcel: {
          weight: 10.2,
        },
      },
      {
        parcel: {
          predefined_package: 'FedExBox',
          weight: 17.5,
        },
      },
    ],
  });

  console.log(order);
})();
```

#### PHP

```php
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$order = $client->order->create([
    'to_address' => ['id' => 'adr_...'],
    'from_address' => ['id' => 'adr_...'],
    'shipments' => [
        [
            'parcel' => [
                'weight' => 10.2
            ]
        ],
        [
            'parcel' => [
                'predefined_package' => 'FedExBox',
                'weight' => 17.5
            ]
        ],
    ],
]);

echo $order;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

order = client.order.create(
    to_address={"id": "adr_..."},
    from_address={"id": "adr_..."},
    shipments=[
        {
            "parcel": {
                "weight": 10.2,
            }
        },
        {
            "parcel": {
                "predefined_package": "FedExBox",
                "weight": 17.5,
            }
        },
    ],
)

print(order)
```

#### Ruby

```ruby
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

order = client.order.create(
  to_address: {
    id: 'adr_...',
  },
  from_address: {
    id: 'adr_...',
  },
  shipments: [
    {
      parcel: {
        weight: 10.2,
      },
    },
    {
      parcel: {
        predefined_package: 'FedExBox',
        weight: 17.5,
      },
    },
  ],
)

puts order
```

There is an alternative way to purchase orders that is known as the "one-call buy" method. This method is often used if you have a flat-rate set with a mail carrier for a given service level, or if you know your desired service level without needing to see the rate first.

Utilizing the "one-call buy" method can improve the performance of your integration, because it cuts out an API call from our standard "create order" then "buy order" workflow.
In order to achieve this behavior, all you have to do is add a `carrier_account` and `service` name to your creation API call.

---

## Retrieve an Order

### Example: GET /orders/:id

#### cURL

```shell
curl -X GET https://api.easypost.com/v2/orders/order_... \
  -u "EASYPOST_API_KEY":
```

#### Go

```go
package example

import (
	"fmt"

	"github.com/EasyPost/easypost-go/v5"
)

func retrieve() {
	client := easypost.New("EASYPOST_API_KEY")

	order, _ := client.GetOrder("order_...")

	fmt.Println(order)
}
```

#### Java

```java
package order;

import com.easypost.exception.EasyPostException;
import com.easypost.model.Order;
import com.easypost.service.EasyPostClient;

public class Retrieve {
    public static void main(String[] args) throws EasyPostException {
        EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

        Order order = client.order.retrieve("order_...");

        System.out.println(order);
    }
}
```

#### C#

```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
    public class Examples
    {
        public static async Task Main()
        {
            var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

            EasyPost.Models.API.Order order = await client.Order.Retrieve("order_...");

            Console.WriteLine(JsonConvert.SerializeObject(order, Formatting.Indented));
        }
    }
}
```

#### Node.js

```javascript
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const order = await client.Order.retrieve('order_...');

  console.log(order);
})();
```

#### PHP

```php
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$order = $client->order->retrieve('order_...');

echo $order;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

order = client.order.retrieve("order_...")

print(order)
```

#### Ruby

```ruby
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

order = client.order.retrieve('order_...')

puts order
```

An `Order` can be retrieved by either its `id` or `reference`. However it is recommended to use EasyPost's provided identifiers because uniqueness on `reference` is not enforced.