Explore this content on our NEW Developer Docs website.

API Documentation

Authentication

Authentication and identification to the EasyPost API is done by providing an API Key on every request as your Basic Auth username (no password is required). EasyPost requires that all communication with the API is secured using TLS v1.2. Requests made over HTTP or without a proper API Key will fail.

EasyPost provides two types of API Key: Test and Production. You can test all EasyPost functionality using your Test key, for free, immediately after signing up.

You can manage your API Keys from your account.

EasyPost Objects

The EasyPost API consists of many object types. There are several attributes that are consistent across all objects:

  • id: Every EasyPost Object that can be created through the API has an id field that is used to refer to the object in other API calls. An id consists of a prefix based on the object type (e.g. Shipments have the prefix "shp_") followed by 32 hex characters. These id values may be used in many API endpoints to refer to an existing object rather than specifying the full object definition; for instance in Shipment creation, you may specify the to_address either with all fields (street1, city, zip, etc.) filled, or you may reuse an existing Address by specifying only the id field value as the matching Address's id, omitting all other fields.
  • object: Every first-class EasyPost object includes an object value. This can be useful for identifying the types of nested objects, or for cases like webhook Event which can contain many different types of result. For objects where there are many variant types, such as Fee, the object value represents the supertype, and the type represents the subtype for that object.
  • reference: Many API objects also have an optional reference field that may be assigned during creation. The reference values you assign may be used in place of id values in many API endpoints, but we recommend using the EasyPost-assigned id instead because ids are guaranteed to be unique within the system, while reference uniqueness is not enforced. If your system does not enforce uniqueness on the references you submit, this may result in the wrong one of many objects with the same reference being picked in EasyPost's handling of your API request.
  • created_at/updated_at: Most API objects also include values for created_at and updated_at. These two fields respectively specify the time the object in question was created and most recently updated. These datetime fields are formatted according to ISO 8601.

Errors

In the event of a client or server error, the response will contain the standard 4xx or 5xx respectively, accompanied by a well-formed JSON body describing the issue, e.g., a required field was omitted, a purchase failed, etc.

Each client library will encapsulate these errors and raise an exception, in addition to other exceptional cases, such as network failures. It is recommended to handle exceptions gracefully and to report any issues to support@easypost.com.

Full List of Error Codes

Error Object

attributetypespecification
codestringMachine readable description of the problem
messagestringHuman readable description of the problem
errorsFieldError arrayBreakdown of errors for specific fields in the request

FieldError Object

attributetypespecification
fieldstringField of the request that the error describes
messagestringHuman readable description of the problem

Common HTTP Status Codes

codereason-phrasedescription
200OKThe request was successful
201CreatedThe request was successful and one or more resources was created
400Bad RequestRequest not processed due to client error
401UnauthorizedAuthentication is required and has failed
402Payment RequiredLack of billing information or insufficient funds
404Not FoundThe requested resource could not be found
422Unprocessable EntityThe request was well-formed but unable to process the contained instructions

Pagination

Most "retrieve all" object responses from EasyPost are paginated. The request accepts a variety of parameters which can be used to modify the scope. The has_more attribute indicates whether or not additional pages can be requested. Records are returned in descending order (most recent first). The recommended way of paginating is to use either the before_id and after_id or start_datetime and end_datetime parameters to specify where the next page begins. Alternatively, you can use the optional page_size parameter that accepts an integer of how many records you would like per page. We limit the number of records per page to 100, most endpoints default to 20. Default page sizes and support for the before_id, after_id, start_datetime, and end_datetime parameters vary by endpoint.

If you need to retrieve a successive page when the has_more key is present, make another "retrieve all" request as before and set the before_id to the ID of the last item returned. Let's look at an example. If you were retrieving a shipment and your page_size was set to 20 but you had 140 results, there would be 7 pages of 20 results each. To get to page 2, you would need to set the before_id to the response['shipments'][19]['id']. To get to the next page, you would continue to request an additional page while specifying the last ID of the previous request. If you needed all results for a particular object, you would continue retrieving pages until the has_more key returns as false, indicating that all results have been retrieved.

Request Parameters
paramexampleinfo
collectionshipmentsA collection that contains a results page
page_size30The number of records to return on each page. The maximum value is 100, and default is 20.
Example
package shipments;

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

import java.util.HashMap;

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

        // Get the first page of results
        HashMap<String, Object> params = new HashMap<>();
        params.put("page_size", 5);

        ShipmentCollection shipments = client.shipment.all(params);

        // Provide the previous results page to move onto the next page
        ShipmentCollection nextPage = client.shipment.getNextPage(shipments);

        System.out.println(nextPage);
    }
}
{
  "shipments": [
    {
      "created_at": "2024-01-24T00:07:32Z",
      "is_return": false,
      "messages": [],
      "mode": "test",
      "options": {
        "currency": "USD",
        "payment": {
          "type": "SENDER"
        },
        "date_advance": 0
      },
      "reference": null,
      "status": "delivered",
      "tracking_code": "9434600207552011812848",
      "updated_at": "2024-01-24T00:12:41Z",
      "batch_id": null,
      "batch_status": null,
      "batch_message": null,
      "customs_info": {
        "id": "cstinfo_fd42061296ef450285b451ef66f9b9d5",
        "object": "CustomsInfo",
        "created_at": "2024-01-24T00:07:32Z",
        "updated_at": "2024-01-24T00:07:32Z",
        "contents_explanation": "",
        "contents_type": "merchandise",
        "customs_certify": true,
        "customs_signer": "Steve Brule",
        "eel_pfc": "NOEEI 30.37(a)",
        "non_delivery_option": "return",
        "restriction_comments": null,
        "restriction_type": "none",
        "mode": "test",
        "declaration": null,
        "customs_items": [
          {
            "id": "cstitem_f7de527850e34f018ef41e9f69be6758",
            "object": "CustomsItem",
            "created_at": "2024-01-24T00:07:32Z",
            "updated_at": "2024-01-24T00:07:32Z",
            "description": "T-shirt",
            "hs_tariff_number": "123456",
            "origin_country": "US",
            "quantity": 1,
            "value": "10.0",
            "weight": 5.0,
            "code": "123",
            "mode": "test",
            "manufacturer": null,
            "currency": null,
            "eccn": null,
            "printed_commodity_identifier": null
          }
        ]
      },
      "from_address": {
        "id": "adr_91fa95f1ba4c11ee8c59ac1f6bc53342",
        "object": "Address",
        "created_at": "2024-01-24T00:07:32+00:00",
        "updated_at": "2024-01-24T00:07:32+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": "249.99",
      "order_id": null,
      "parcel": {
        "id": "prcl_a5e317e47ac9442988d338cb2a0fde17",
        "object": "Parcel",
        "created_at": "2024-01-24T00:07:32Z",
        "updated_at": "2024-01-24T00:07:32Z",
        "length": 20.2,
        "width": 10.9,
        "height": 5.0,
        "predefined_package": null,
        "weight": 65.9,
        "mode": "test"
      },
      "postage_label": {
        "object": "PostageLabel",
        "id": "pl_51b80cc8523d4fc28c4ab710594e0913",
        "created_at": "2024-01-24T00:07:33Z",
        "updated_at": "2024-01-24T00:07:33Z",
        "date_advance": 0,
        "integrated_form": "none",
        "label_date": "2024-01-24T00:07:33Z",
        "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/20240124/e81cecd85b82d749a19cf38dae0e30fc53.png",
        "label_pdf_url": null,
        "label_zpl_url": null,
        "label_epl2_url": null,
        "label_file": null
      },
      "rates": [
        {
          "id": "rate_6366c70cbea94c60b8d282ccf0f60ce0",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:32Z",
          "updated_at": "2024-01-24T00:07:32Z",
          "mode": "test",
          "service": "GroundAdvantage",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_7dd1fb53702d473bbb9eeaf53d7a72d7",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:32Z",
          "updated_at": "2024-01-24T00:07:32Z",
          "mode": "test",
          "service": "First",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_263930dcc1ef4331b9a16313f55c47d6",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:32Z",
          "updated_at": "2024-01-24T00:07:32Z",
          "mode": "test",
          "service": "ParcelSelect",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_bd7a2aa312224b43b15d56b2e818e946",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:32Z",
          "updated_at": "2024-01-24T00:07:32Z",
          "mode": "test",
          "service": "Express",
          "carrier": "USPS",
          "rate": "49.60",
          "currency": "USD",
          "retail_rate": "57.40",
          "retail_currency": "USD",
          "list_rate": "49.60",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": null,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": null,
          "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_6ec39e90cf6b4f2d97aab43d7c946559",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:32Z",
          "updated_at": "2024-01-24T00:07:32Z",
          "mode": "test",
          "service": "Priority",
          "carrier": "USPS",
          "rate": "7.33",
          "currency": "USD",
          "retail_rate": "15.20",
          "retail_currency": "USD",
          "list_rate": "10.89",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 2,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 2,
          "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        }
      ],
      "refund_status": null,
      "scan_form": null,
      "selected_rate": {
        "id": "rate_6366c70cbea94c60b8d282ccf0f60ce0",
        "object": "Rate",
        "created_at": "2024-01-24T00:07:33Z",
        "updated_at": "2024-01-24T00:07:33Z",
        "mode": "test",
        "service": "GroundAdvantage",
        "carrier": "USPS",
        "rate": "6.79",
        "currency": "USD",
        "retail_rate": "13.15",
        "retail_currency": "USD",
        "list_rate": "9.41",
        "list_currency": "USD",
        "billing_type": "easypost",
        "delivery_days": 3,
        "delivery_date": null,
        "delivery_date_guaranteed": false,
        "est_delivery_days": 3,
        "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
      },
      "tracker": {
        "id": "trk_814a807c3fae4203a4d61293b2b0b3dc",
        "object": "Tracker",
        "mode": "test",
        "tracking_code": "9434600207552011812848",
        "status": "delivered",
        "status_detail": "arrived_at_destination",
        "created_at": "2024-01-24T00:07:34Z",
        "updated_at": "2024-01-24T00:10:34Z",
        "signed_by": "John Tester",
        "weight": null,
        "est_delivery_date": "2024-01-24T00:10:34Z",
        "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
        "carrier": "USPS",
        "tracking_details": [
          {
            "object": "TrackingDetail",
            "message": "Pre-Shipment Info Sent to USPS",
            "description": "",
            "status": "pre_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-24T00:10:34Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": null,
              "state": null,
              "country": null,
              "zip": null
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Shipping Label Created",
            "description": "",
            "status": "pre_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-24T12:47:34Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "HOUSTON",
              "state": "TX",
              "country": null,
              "zip": "77063"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at USPS Origin Facility",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-24T22:52:34Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "NORTH HOUSTON",
              "state": "TX",
              "country": null,
              "zip": "77315"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at USPS Facility",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-26T00:28:34Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "COLUMBIA",
              "state": "SC",
              "country": null,
              "zip": "29201"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at Post Office",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-26T03:19:34Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Sorting Complete",
            "description": "",
            "status": "in_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-26T08:59:34Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Out for Delivery",
            "description": "",
            "status": "out_for_delivery",
            "status_detail": "out_for_delivery",
            "datetime": "2023-12-26T09:09:34Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Delivered",
            "description": "",
            "status": "delivered",
            "status_detail": "arrived_at_destination",
            "datetime": "2023-12-26T14:01:34Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          }
        ],
        "fees": [],
        "carrier_detail": {
          "object": "CarrierDetail",
          "service": "First-Class Package Service",
          "container_type": null,
          "est_delivery_date_local": null,
          "est_delivery_time_local": null,
          "origin_location": "HOUSTON TX, 77001",
          "origin_tracking_location": {
            "object": "TrackingLocation",
            "city": "NORTH HOUSTON",
            "state": "TX",
            "country": null,
            "zip": "77315"
          },
          "destination_location": "CHARLESTON SC, 29401",
          "destination_tracking_location": {
            "object": "TrackingLocation",
            "city": "CHARLESTON",
            "state": "SC",
            "country": null,
            "zip": "29407"
          },
          "guaranteed_delivery_date": null,
          "alternate_identifier": null,
          "initial_delivery_attempt": "2023-12-26T14:01:34Z"
        },
        "public_url": "https://track.easypost.com/djE6dHJrXzgxNGE4MDdjM2ZhZTQyMDNhNGQ2MTI5M2IyYjBiM2Rj"
      },
      "to_address": {
        "id": "adr_91f7ca0fba4c11eeb731ac1f6bc539aa",
        "object": "Address",
        "created_at": "2024-01-24T00:07:32+00:00",
        "updated_at": "2024-01-24T00:07:33+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": null,
        "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_91fa95f1ba4c11ee8c59ac1f6bc53342",
        "object": "Address",
        "created_at": "2024-01-24T00:07:32+00:00",
        "updated_at": "2024-01-24T00:07:32+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_91f7ca0fba4c11eeb731ac1f6bc539aa",
        "object": "Address",
        "created_at": "2024-01-24T00:07:32+00:00",
        "updated_at": "2024-01-24T00:07:33+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": null,
        "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": "LabelFee",
          "amount": "0.00000",
          "charged": true,
          "refunded": false
        },
        {
          "object": "Fee",
          "type": "PostageFee",
          "amount": "6.79000",
          "charged": true,
          "refunded": false
        },
        {
          "object": "Fee",
          "type": "InsuranceFee",
          "amount": "1.24995",
          "charged": true,
          "refunded": false
        }
      ],
      "id": "shp_56b10c708daa4c25b5895c5354758aaf",
      "object": "Shipment"
    },
    {
      "created_at": "2024-01-24T00:07:28Z",
      "is_return": false,
      "messages": [],
      "mode": "test",
      "options": {
        "currency": "USD",
        "payment": {
          "type": "SENDER"
        },
        "date_advance": 0
      },
      "reference": null,
      "status": "delivered",
      "tracking_code": "9405500207552011812825",
      "updated_at": "2024-01-24T00:12:32Z",
      "batch_id": "batch_83009a1272fa48ffb1a3d29074a16960",
      "batch_status": "postage_purchased",
      "batch_message": null,
      "customs_info": {
        "id": "cstinfo_916710a3039140c5a6e7f2f812ef83d7",
        "object": "CustomsInfo",
        "created_at": "2024-01-24T00:07:28Z",
        "updated_at": "2024-01-24T00:07:28Z",
        "contents_explanation": "",
        "contents_type": "merchandise",
        "customs_certify": true,
        "customs_signer": "Steve Brule",
        "eel_pfc": "NOEEI 30.37(a)",
        "non_delivery_option": "return",
        "restriction_comments": null,
        "restriction_type": "none",
        "mode": "test",
        "declaration": null,
        "customs_items": [
          {
            "id": "cstitem_eead7973a2d644189ebd7c8f11f9647a",
            "object": "CustomsItem",
            "created_at": "2024-01-24T00:07:28Z",
            "updated_at": "2024-01-24T00:07:28Z",
            "description": "T-shirt",
            "hs_tariff_number": "123456",
            "origin_country": "US",
            "quantity": 1,
            "value": "10.0",
            "weight": 5.0,
            "code": "123",
            "mode": "test",
            "manufacturer": null,
            "currency": null,
            "eccn": null,
            "printed_commodity_identifier": null
          }
        ]
      },
      "from_address": {
        "id": "adr_8f5e7e74ba4c11ee8bd0ac1f6bc53342",
        "object": "Address",
        "created_at": "2024-01-24T00:07:28+00:00",
        "updated_at": "2024-01-24T00:07:28+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": null,
      "parcel": {
        "id": "prcl_bba0f7cc48d64a299938fef3a3e0b9a0",
        "object": "Parcel",
        "created_at": "2024-01-24T00:07:28Z",
        "updated_at": "2024-01-24T00:07:28Z",
        "length": 20.2,
        "width": 10.9,
        "height": 5.0,
        "predefined_package": null,
        "weight": 65.9,
        "mode": "test"
      },
      "postage_label": {
        "object": "PostageLabel",
        "id": "pl_9562571fa39b4e49892a8c60f12be255",
        "created_at": "2024-01-24T00:07:28Z",
        "updated_at": "2024-01-24T00:07:28Z",
        "date_advance": 0,
        "integrated_form": "none",
        "label_date": "2024-01-24T00:07:28Z",
        "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/20240124/e8a95864fe9ec34eeabf5fc2ad415fda5d.png",
        "label_pdf_url": null,
        "label_zpl_url": null,
        "label_epl2_url": null,
        "label_file": null
      },
      "rates": [
        {
          "id": "rate_15a03f25e00d49a098da8d40c8e1719e",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:28Z",
          "updated_at": "2024-01-24T00:07:28Z",
          "mode": "test",
          "service": "Express",
          "carrier": "USPS",
          "rate": "49.60",
          "currency": "USD",
          "retail_rate": "57.40",
          "retail_currency": "USD",
          "list_rate": "49.60",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": null,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": null,
          "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_edd7e3cedd9d4aa9bd21eb23a740af7d",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:28Z",
          "updated_at": "2024-01-24T00:07:28Z",
          "mode": "test",
          "service": "Priority",
          "carrier": "USPS",
          "rate": "7.33",
          "currency": "USD",
          "retail_rate": "15.20",
          "retail_currency": "USD",
          "list_rate": "10.89",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 2,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 2,
          "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_bc0979e7fa314d2b935d8fee9312c766",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:28Z",
          "updated_at": "2024-01-24T00:07:28Z",
          "mode": "test",
          "service": "GroundAdvantage",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_418622e2edeb4015b8bbd72fbe2d3ff6",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:28Z",
          "updated_at": "2024-01-24T00:07:28Z",
          "mode": "test",
          "service": "First",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_699f9b847989489891a0db1489c6c0f2",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:28Z",
          "updated_at": "2024-01-24T00:07:28Z",
          "mode": "test",
          "service": "ParcelSelect",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        }
      ],
      "refund_status": null,
      "scan_form": {
        "id": "sf_589e52186e9249669c7806912a6ab766",
        "object": "ScanForm",
        "created_at": "2024-01-24T00:07:29Z",
        "updated_at": "2024-01-24T00:07:29Z",
        "tracking_codes": ["9405500207552011812825"],
        "address": {
          "id": "adr_8f5e7e74ba4c11ee8bd0ac1f6bc53342",
          "object": "Address",
          "created_at": "2024-01-24T00:07:28+00:00",
          "updated_at": "2024-01-24T00:07:28+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": {}
        },
        "status": "created",
        "message": null,
        "form_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240124/e82a4cb71096604dc7bd773b1285d7e9db.pdf",
        "form_file_type": null,
        "batch_id": "batch_83009a1272fa48ffb1a3d29074a16960",
        "confirmation": null
      },
      "selected_rate": {
        "id": "rate_edd7e3cedd9d4aa9bd21eb23a740af7d",
        "object": "Rate",
        "created_at": "2024-01-24T00:07:28Z",
        "updated_at": "2024-01-24T00:07:28Z",
        "mode": "test",
        "service": "Priority",
        "carrier": "USPS",
        "rate": "7.33",
        "currency": "USD",
        "retail_rate": "15.20",
        "retail_currency": "USD",
        "list_rate": "10.89",
        "list_currency": "USD",
        "billing_type": "easypost",
        "delivery_days": 2,
        "delivery_date": null,
        "delivery_date_guaranteed": false,
        "est_delivery_days": 2,
        "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
      },
      "tracker": {
        "id": "trk_c64aa4ee22804cceab41586397c4b833",
        "object": "Tracker",
        "mode": "test",
        "tracking_code": "9405500207552011812825",
        "status": "delivered",
        "status_detail": "arrived_at_destination",
        "created_at": "2024-01-24T00:07:28Z",
        "updated_at": "2024-01-24T00:10:29Z",
        "signed_by": "John Tester",
        "weight": null,
        "est_delivery_date": "2024-01-24T00:10:29Z",
        "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
        "carrier": "USPS",
        "tracking_details": [
          {
            "object": "TrackingDetail",
            "message": "Pre-Shipment Info Sent to USPS",
            "description": "",
            "status": "pre_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-24T00:10:29Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": null,
              "state": null,
              "country": null,
              "zip": null
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Shipping Label Created",
            "description": "",
            "status": "pre_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-24T12:47:29Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "HOUSTON",
              "state": "TX",
              "country": null,
              "zip": "77063"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at USPS Origin Facility",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-24T22:52:29Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "NORTH HOUSTON",
              "state": "TX",
              "country": null,
              "zip": "77315"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at USPS Facility",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-26T00:28:29Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "COLUMBIA",
              "state": "SC",
              "country": null,
              "zip": "29201"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at Post Office",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-26T03:19:29Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Sorting Complete",
            "description": "",
            "status": "in_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-26T08:59:29Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Out for Delivery",
            "description": "",
            "status": "out_for_delivery",
            "status_detail": "out_for_delivery",
            "datetime": "2023-12-26T09:09:29Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Delivered",
            "description": "",
            "status": "delivered",
            "status_detail": "arrived_at_destination",
            "datetime": "2023-12-26T14:01:29Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          }
        ],
        "fees": [],
        "carrier_detail": {
          "object": "CarrierDetail",
          "service": "First-Class Package Service",
          "container_type": null,
          "est_delivery_date_local": null,
          "est_delivery_time_local": null,
          "origin_location": "HOUSTON TX, 77001",
          "origin_tracking_location": {
            "object": "TrackingLocation",
            "city": "NORTH HOUSTON",
            "state": "TX",
            "country": null,
            "zip": "77315"
          },
          "destination_location": "CHARLESTON SC, 29401",
          "destination_tracking_location": {
            "object": "TrackingLocation",
            "city": "CHARLESTON",
            "state": "SC",
            "country": null,
            "zip": "29407"
          },
          "guaranteed_delivery_date": null,
          "alternate_identifier": null,
          "initial_delivery_attempt": "2023-12-26T14:01:29Z"
        },
        "public_url": "https://track.easypost.com/djE6dHJrX2M2NGFhNGVlMjI4MDRjY2VhYjQxNTg2Mzk3YzRiODMz"
      },
      "to_address": {
        "id": "adr_8f5bb1f5ba4c11eeb6a1ac1f6bc539aa",
        "object": "Address",
        "created_at": "2024-01-24T00:07:28+00:00",
        "updated_at": "2024-01-24T00:07:28+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": null,
        "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_8f5e7e74ba4c11ee8bd0ac1f6bc53342",
        "object": "Address",
        "created_at": "2024-01-24T00:07:28+00:00",
        "updated_at": "2024-01-24T00:07:28+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_8f5bb1f5ba4c11eeb6a1ac1f6bc539aa",
        "object": "Address",
        "created_at": "2024-01-24T00:07:28+00:00",
        "updated_at": "2024-01-24T00:07:28+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": null,
        "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": "LabelFee",
          "amount": "0.00000",
          "charged": true,
          "refunded": false
        },
        {
          "object": "Fee",
          "type": "PostageFee",
          "amount": "7.33000",
          "charged": true,
          "refunded": false
        }
      ],
      "id": "shp_8631f00640ba4d62b9131da3852a26e4",
      "object": "Shipment"
    },
    {
      "created_at": "2024-01-24T00:07:26Z",
      "is_return": false,
      "messages": [],
      "mode": "test",
      "options": {
        "currency": "USD",
        "payment": {
          "type": "SENDER"
        },
        "date_advance": 0
      },
      "reference": null,
      "status": "delivered",
      "tracking_code": "9405500207552011812801",
      "updated_at": "2024-01-24T00:12:47Z",
      "batch_id": "batch_78507c9db0574b02813cf08bd52357b5",
      "batch_status": "postage_purchased",
      "batch_message": null,
      "customs_info": {
        "id": "cstinfo_69ebc90449834b8eb70fa2e37fa35616",
        "object": "CustomsInfo",
        "created_at": "2024-01-24T00:07:25Z",
        "updated_at": "2024-01-24T00:07:25Z",
        "contents_explanation": "",
        "contents_type": "merchandise",
        "customs_certify": true,
        "customs_signer": "Steve Brule",
        "eel_pfc": "NOEEI 30.37(a)",
        "non_delivery_option": "return",
        "restriction_comments": null,
        "restriction_type": "none",
        "mode": "test",
        "declaration": null,
        "customs_items": [
          {
            "id": "cstitem_bde92ba44c8a4287ac0fc973f210924d",
            "object": "CustomsItem",
            "created_at": "2024-01-24T00:07:25Z",
            "updated_at": "2024-01-24T00:07:25Z",
            "description": "T-shirt",
            "hs_tariff_number": "123456",
            "origin_country": "US",
            "quantity": 1,
            "value": "10.0",
            "weight": 5.0,
            "code": "123",
            "mode": "test",
            "manufacturer": null,
            "currency": null,
            "eccn": null,
            "printed_commodity_identifier": null
          }
        ]
      },
      "from_address": {
        "id": "adr_8e182c46ba4c11ee8b51ac1f6bc53342",
        "object": "Address",
        "created_at": "2024-01-24T00:07:25+00:00",
        "updated_at": "2024-01-24T00:07:25+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": null,
      "parcel": {
        "id": "prcl_8947f119938944beab9e38a20bf28065",
        "object": "Parcel",
        "created_at": "2024-01-24T00:07:25Z",
        "updated_at": "2024-01-24T00:07:25Z",
        "length": 20.2,
        "width": 10.9,
        "height": 5.0,
        "predefined_package": null,
        "weight": 65.9,
        "mode": "test"
      },
      "postage_label": {
        "object": "PostageLabel",
        "id": "pl_a659d7cf76ca4355afc44434e33f05d3",
        "created_at": "2024-01-24T00:07:26Z",
        "updated_at": "2024-01-24T00:07:26Z",
        "date_advance": 0,
        "integrated_form": "none",
        "label_date": "2024-01-24T00:07:26Z",
        "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/20240124/e8cad15c8172b44e2e980a0516615cfba9.png",
        "label_pdf_url": null,
        "label_zpl_url": null,
        "label_epl2_url": null,
        "label_file": null
      },
      "rates": [
        {
          "id": "rate_c714eae3a1fc48a1bd85e49c3f96c005",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:26Z",
          "updated_at": "2024-01-24T00:07:26Z",
          "mode": "test",
          "service": "Express",
          "carrier": "USPS",
          "rate": "49.60",
          "currency": "USD",
          "retail_rate": "57.40",
          "retail_currency": "USD",
          "list_rate": "49.60",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": null,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": null,
          "shipment_id": "shp_208d189a9f1f4295887b82aaa7b109e9",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_0b93175feadd47039abe963dde90444b",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:26Z",
          "updated_at": "2024-01-24T00:07:26Z",
          "mode": "test",
          "service": "Priority",
          "carrier": "USPS",
          "rate": "7.33",
          "currency": "USD",
          "retail_rate": "15.20",
          "retail_currency": "USD",
          "list_rate": "10.89",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 2,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 2,
          "shipment_id": "shp_208d189a9f1f4295887b82aaa7b109e9",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_1e8880da5f074d6ca2dfcf7bc0c1e5e6",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:26Z",
          "updated_at": "2024-01-24T00:07:26Z",
          "mode": "test",
          "service": "GroundAdvantage",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_208d189a9f1f4295887b82aaa7b109e9",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_4d551632239948f0abd18400a5c65452",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:26Z",
          "updated_at": "2024-01-24T00:07:26Z",
          "mode": "test",
          "service": "First",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_208d189a9f1f4295887b82aaa7b109e9",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_d0d1de3a02ad419fa6079eb2dfb48e27",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:26Z",
          "updated_at": "2024-01-24T00:07:26Z",
          "mode": "test",
          "service": "ParcelSelect",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_208d189a9f1f4295887b82aaa7b109e9",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        }
      ],
      "refund_status": null,
      "scan_form": {
        "id": "sf_e79db685aecd4c7286471ff06a27a121",
        "object": "ScanForm",
        "created_at": "2024-01-24T00:07:27Z",
        "updated_at": "2024-01-24T00:07:27Z",
        "tracking_codes": ["9405500207552011812801"],
        "address": {
          "id": "adr_8e182c46ba4c11ee8b51ac1f6bc53342",
          "object": "Address",
          "created_at": "2024-01-24T00:07:25+00:00",
          "updated_at": "2024-01-24T00:07:25+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": {}
        },
        "status": "created",
        "message": null,
        "form_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240124/e872ec72373078434880f49a17e5788dcc.pdf",
        "form_file_type": null,
        "batch_id": "batch_78507c9db0574b02813cf08bd52357b5",
        "confirmation": null
      },
      "selected_rate": {
        "id": "rate_0b93175feadd47039abe963dde90444b",
        "object": "Rate",
        "created_at": "2024-01-24T00:07:26Z",
        "updated_at": "2024-01-24T00:07:26Z",
        "mode": "test",
        "service": "Priority",
        "carrier": "USPS",
        "rate": "7.33",
        "currency": "USD",
        "retail_rate": "15.20",
        "retail_currency": "USD",
        "list_rate": "10.89",
        "list_currency": "USD",
        "billing_type": "easypost",
        "delivery_days": 2,
        "delivery_date": null,
        "delivery_date_guaranteed": false,
        "est_delivery_days": 2,
        "shipment_id": "shp_208d189a9f1f4295887b82aaa7b109e9",
        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
      },
      "tracker": {
        "id": "trk_93626d9d84f949588508785ad04af706",
        "object": "Tracker",
        "mode": "test",
        "tracking_code": "9405500207552011812801",
        "status": "delivered",
        "status_detail": "arrived_at_destination",
        "created_at": "2024-01-24T00:07:27Z",
        "updated_at": "2024-01-24T00:10:27Z",
        "signed_by": "John Tester",
        "weight": null,
        "est_delivery_date": "2024-01-24T00:10:27Z",
        "shipment_id": "shp_208d189a9f1f4295887b82aaa7b109e9",
        "carrier": "USPS",
        "tracking_details": [
          {
            "object": "TrackingDetail",
            "message": "Pre-Shipment Info Sent to USPS",
            "description": "",
            "status": "pre_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-24T00:10:27Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": null,
              "state": null,
              "country": null,
              "zip": null
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Shipping Label Created",
            "description": "",
            "status": "pre_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-24T12:47:27Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "HOUSTON",
              "state": "TX",
              "country": null,
              "zip": "77063"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at USPS Origin Facility",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-24T22:52:27Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "NORTH HOUSTON",
              "state": "TX",
              "country": null,
              "zip": "77315"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at USPS Facility",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-26T00:28:27Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "COLUMBIA",
              "state": "SC",
              "country": null,
              "zip": "29201"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at Post Office",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-26T03:19:27Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Sorting Complete",
            "description": "",
            "status": "in_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-26T08:59:27Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Out for Delivery",
            "description": "",
            "status": "out_for_delivery",
            "status_detail": "out_for_delivery",
            "datetime": "2023-12-26T09:09:27Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Delivered",
            "description": "",
            "status": "delivered",
            "status_detail": "arrived_at_destination",
            "datetime": "2023-12-26T14:01:27Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          }
        ],
        "fees": [],
        "carrier_detail": {
          "object": "CarrierDetail",
          "service": "First-Class Package Service",
          "container_type": null,
          "est_delivery_date_local": null,
          "est_delivery_time_local": null,
          "origin_location": "HOUSTON TX, 77001",
          "origin_tracking_location": {
            "object": "TrackingLocation",
            "city": "NORTH HOUSTON",
            "state": "TX",
            "country": null,
            "zip": "77315"
          },
          "destination_location": "CHARLESTON SC, 29401",
          "destination_tracking_location": {
            "object": "TrackingLocation",
            "city": "CHARLESTON",
            "state": "SC",
            "country": null,
            "zip": "29407"
          },
          "guaranteed_delivery_date": null,
          "alternate_identifier": null,
          "initial_delivery_attempt": "2023-12-26T14:01:27Z"
        },
        "public_url": "https://track.easypost.com/djE6dHJrXzkzNjI2ZDlkODRmOTQ5NTg4NTA4Nzg1YWQwNGFmNzA2"
      },
      "to_address": {
        "id": "adr_8e15a60dba4c11ee8b50ac1f6bc53342",
        "object": "Address",
        "created_at": "2024-01-24T00:07:25+00:00",
        "updated_at": "2024-01-24T00:07:26+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": null,
        "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_8e182c46ba4c11ee8b51ac1f6bc53342",
        "object": "Address",
        "created_at": "2024-01-24T00:07:25+00:00",
        "updated_at": "2024-01-24T00:07:25+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_8e15a60dba4c11ee8b50ac1f6bc53342",
        "object": "Address",
        "created_at": "2024-01-24T00:07:25+00:00",
        "updated_at": "2024-01-24T00:07:26+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": null,
        "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": "LabelFee",
          "amount": "0.00000",
          "charged": true,
          "refunded": false
        },
        {
          "object": "Fee",
          "type": "PostageFee",
          "amount": "7.33000",
          "charged": true,
          "refunded": false
        }
      ],
      "id": "shp_208d189a9f1f4295887b82aaa7b109e9",
      "object": "Shipment"
    },
    {
      "created_at": "2024-01-24T00:07:21Z",
      "is_return": false,
      "messages": [],
      "mode": "test",
      "options": {
        "currency": "USD",
        "payment": {
          "type": "SENDER"
        },
        "date_advance": 0
      },
      "reference": null,
      "status": "delivered",
      "tracking_code": "9405500207552011812764",
      "updated_at": "2024-01-24T00:12:37Z",
      "batch_id": null,
      "batch_status": null,
      "batch_message": null,
      "customs_info": {
        "id": "cstinfo_a44c00ad084a4e49b36a578c7ad12b3c",
        "object": "CustomsInfo",
        "created_at": "2024-01-24T00:07:21Z",
        "updated_at": "2024-01-24T00:07:21Z",
        "contents_explanation": "",
        "contents_type": "merchandise",
        "customs_certify": true,
        "customs_signer": "Steve Brule",
        "eel_pfc": "NOEEI 30.37(a)",
        "non_delivery_option": "return",
        "restriction_comments": null,
        "restriction_type": "none",
        "mode": "test",
        "declaration": null,
        "customs_items": [
          {
            "id": "cstitem_b649f3eb9b274f258949128a27f09216",
            "object": "CustomsItem",
            "created_at": "2024-01-24T00:07:21Z",
            "updated_at": "2024-01-24T00:07:21Z",
            "description": "T-shirt",
            "hs_tariff_number": "123456",
            "origin_country": "US",
            "quantity": 1,
            "value": "10.0",
            "weight": 5.0,
            "code": "123",
            "mode": "test",
            "manufacturer": null,
            "currency": null,
            "eccn": null,
            "printed_commodity_identifier": null
          }
        ]
      },
      "from_address": {
        "id": "adr_8b3ce1a8ba4c11ee9cceac1f6bc539ae",
        "object": "Address",
        "created_at": "2024-01-24T00:07:21+00:00",
        "updated_at": "2024-01-24T00:07:21+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": null,
      "parcel": {
        "id": "prcl_87da9db943434645bf7ea1610147ac67",
        "object": "Parcel",
        "created_at": "2024-01-24T00:07:21Z",
        "updated_at": "2024-01-24T00:07:21Z",
        "length": 20.2,
        "width": 10.9,
        "height": 5.0,
        "predefined_package": null,
        "weight": 65.9,
        "mode": "test"
      },
      "postage_label": {
        "object": "PostageLabel",
        "id": "pl_34135cc591ac4f1a808376739352bc39",
        "created_at": "2024-01-24T00:07:21Z",
        "updated_at": "2024-01-24T00:07:22Z",
        "date_advance": 0,
        "integrated_form": "none",
        "label_date": "2024-01-24T00:07:21Z",
        "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/20240124/e889e96a35fb8f4ae5adfbf0be34ed5540.png",
        "label_pdf_url": null,
        "label_zpl_url": null,
        "label_epl2_url": null,
        "label_file": null
      },
      "rates": [
        {
          "id": "rate_0c0663b91d934929996da5f9f28b746a",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:21Z",
          "updated_at": "2024-01-24T00:07:21Z",
          "mode": "test",
          "service": "Priority",
          "carrier": "USPS",
          "rate": "7.33",
          "currency": "USD",
          "retail_rate": "15.20",
          "retail_currency": "USD",
          "list_rate": "10.89",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 2,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 2,
          "shipment_id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_4ba349e49b554887af64f77dbb11a7ed",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:21Z",
          "updated_at": "2024-01-24T00:07:21Z",
          "mode": "test",
          "service": "GroundAdvantage",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_0836612f559b43c0b6a10953d9ba6cf1",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:21Z",
          "updated_at": "2024-01-24T00:07:21Z",
          "mode": "test",
          "service": "First",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_8491f22e06134c738c6f596f40c73f55",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:21Z",
          "updated_at": "2024-01-24T00:07:21Z",
          "mode": "test",
          "service": "ParcelSelect",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_378eb83c9ae54608990f4e048377f2c2",
          "object": "Rate",
          "created_at": "2024-01-24T00:07:21Z",
          "updated_at": "2024-01-24T00:07:21Z",
          "mode": "test",
          "service": "Express",
          "carrier": "USPS",
          "rate": "49.60",
          "currency": "USD",
          "retail_rate": "57.40",
          "retail_currency": "USD",
          "list_rate": "49.60",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": null,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": null,
          "shipment_id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        }
      ],
      "refund_status": "submitted",
      "scan_form": null,
      "selected_rate": {
        "id": "rate_0c0663b91d934929996da5f9f28b746a",
        "object": "Rate",
        "created_at": "2024-01-24T00:07:21Z",
        "updated_at": "2024-01-24T00:07:21Z",
        "mode": "test",
        "service": "Priority",
        "carrier": "USPS",
        "rate": "7.33",
        "currency": "USD",
        "retail_rate": "15.20",
        "retail_currency": "USD",
        "list_rate": "10.89",
        "list_currency": "USD",
        "billing_type": "easypost",
        "delivery_days": 2,
        "delivery_date": null,
        "delivery_date_guaranteed": false,
        "est_delivery_days": 2,
        "shipment_id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc",
        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
      },
      "tracker": {
        "id": "trk_81d0206395de4e288057266dd3870591",
        "object": "Tracker",
        "mode": "test",
        "tracking_code": "9405500207552011812764",
        "status": "delivered",
        "status_detail": "arrived_at_destination",
        "created_at": "2024-01-24T00:07:22Z",
        "updated_at": "2024-01-24T00:10:22Z",
        "signed_by": "John Tester",
        "weight": null,
        "est_delivery_date": "2024-01-24T00:10:22Z",
        "shipment_id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc",
        "carrier": "USPS",
        "tracking_details": [
          {
            "object": "TrackingDetail",
            "message": "Pre-Shipment Info Sent to USPS",
            "description": "",
            "status": "pre_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-24T00:10:22Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": null,
              "state": null,
              "country": null,
              "zip": null
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Shipping Label Created",
            "description": "",
            "status": "pre_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-24T12:47:22Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "HOUSTON",
              "state": "TX",
              "country": null,
              "zip": "77063"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at USPS Origin Facility",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-24T22:52:22Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "NORTH HOUSTON",
              "state": "TX",
              "country": null,
              "zip": "77315"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at USPS Facility",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-26T00:28:22Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "COLUMBIA",
              "state": "SC",
              "country": null,
              "zip": "29201"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at Post Office",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-26T03:19:22Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Sorting Complete",
            "description": "",
            "status": "in_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-26T08:59:22Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Out for Delivery",
            "description": "",
            "status": "out_for_delivery",
            "status_detail": "out_for_delivery",
            "datetime": "2023-12-26T09:09:22Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Delivered",
            "description": "",
            "status": "delivered",
            "status_detail": "arrived_at_destination",
            "datetime": "2023-12-26T14:01:22Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          }
        ],
        "fees": [],
        "carrier_detail": {
          "object": "CarrierDetail",
          "service": "First-Class Package Service",
          "container_type": null,
          "est_delivery_date_local": null,
          "est_delivery_time_local": null,
          "origin_location": "HOUSTON TX, 77001",
          "origin_tracking_location": {
            "object": "TrackingLocation",
            "city": "NORTH HOUSTON",
            "state": "TX",
            "country": null,
            "zip": "77315"
          },
          "destination_location": "CHARLESTON SC, 29401",
          "destination_tracking_location": {
            "object": "TrackingLocation",
            "city": "CHARLESTON",
            "state": "SC",
            "country": null,
            "zip": "29407"
          },
          "guaranteed_delivery_date": null,
          "alternate_identifier": null,
          "initial_delivery_attempt": "2023-12-26T14:01:22Z"
        },
        "public_url": "https://track.easypost.com/djE6dHJrXzgxZDAyMDYzOTVkZTRlMjg4MDU3MjY2ZGQzODcwNTkx"
      },
      "to_address": {
        "id": "adr_8b3a39beba4c11eeb55cac1f6bc539aa",
        "object": "Address",
        "created_at": "2024-01-24T00:07:21+00:00",
        "updated_at": "2024-01-24T00:07:21+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": null,
        "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_8b3ce1a8ba4c11ee9cceac1f6bc539ae",
        "object": "Address",
        "created_at": "2024-01-24T00:07:21+00:00",
        "updated_at": "2024-01-24T00:07:21+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_8b3a39beba4c11eeb55cac1f6bc539aa",
        "object": "Address",
        "created_at": "2024-01-24T00:07:21+00:00",
        "updated_at": "2024-01-24T00:07:21+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": null,
        "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": "LabelFee",
          "amount": "0.00000",
          "charged": true,
          "refunded": false
        },
        {
          "object": "Fee",
          "type": "PostageFee",
          "amount": "7.33000",
          "charged": true,
          "refunded": false
        }
      ],
      "id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc",
      "object": "Shipment"
    },
    {
      "created_at": "2024-01-24T00:06:31Z",
      "is_return": false,
      "messages": [],
      "mode": "test",
      "options": {
        "currency": "USD",
        "payment": {
          "type": "SENDER"
        },
        "date_advance": 0
      },
      "reference": null,
      "status": "delivered",
      "tracking_code": "9405500207552011812689",
      "updated_at": "2024-01-24T00:11:52Z",
      "batch_id": "batch_98bf92c4f230400d93a24fa4298cc025",
      "batch_status": "postage_purchased",
      "batch_message": null,
      "customs_info": {
        "id": "cstinfo_b9b6f403171a449a9700bb4ff5171578",
        "object": "CustomsInfo",
        "created_at": "2024-01-24T00:06:31Z",
        "updated_at": "2024-01-24T00:06:31Z",
        "contents_explanation": "",
        "contents_type": "merchandise",
        "customs_certify": true,
        "customs_signer": "Steve Brule",
        "eel_pfc": "NOEEI 30.37(a)",
        "non_delivery_option": "return",
        "restriction_comments": null,
        "restriction_type": "none",
        "mode": "test",
        "declaration": null,
        "customs_items": [
          {
            "id": "cstitem_b67e595b6cea459a9b8e7aeafd4b0edd",
            "object": "CustomsItem",
            "created_at": "2024-01-24T00:06:31Z",
            "updated_at": "2024-01-24T00:06:31Z",
            "description": "T-shirt",
            "hs_tariff_number": "123456",
            "origin_country": "US",
            "quantity": 1,
            "value": "10.0",
            "weight": 5.0,
            "code": "123",
            "mode": "test",
            "manufacturer": null,
            "currency": null,
            "eccn": null,
            "printed_commodity_identifier": null
          }
        ]
      },
      "from_address": {
        "id": "adr_6d94f4a7ba4c11eeacf7ac1f6bc539aa",
        "object": "Address",
        "created_at": "2024-01-24T00:06:31+00:00",
        "updated_at": "2024-01-24T00:06:31+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": null,
      "parcel": {
        "id": "prcl_c5968ce204d445acbe344bc4d6dc34ce",
        "object": "Parcel",
        "created_at": "2024-01-24T00:06:31Z",
        "updated_at": "2024-01-24T00:06:31Z",
        "length": 20.2,
        "width": 10.9,
        "height": 5.0,
        "predefined_package": null,
        "weight": 65.9,
        "mode": "test"
      },
      "postage_label": {
        "object": "PostageLabel",
        "id": "pl_49ea349da25e40e7b870e8f8dac5fa6e",
        "created_at": "2024-01-24T00:06:31Z",
        "updated_at": "2024-01-24T00:06:32Z",
        "date_advance": 0,
        "integrated_form": "none",
        "label_date": "2024-01-24T00:06:31Z",
        "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/20240124/e8be1ac5443dae47fb8321d0a5e3494b81.png",
        "label_pdf_url": null,
        "label_zpl_url": null,
        "label_epl2_url": null,
        "label_file": null
      },
      "rates": [
        {
          "id": "rate_e5722f0f792e4866b366ed45364bd485",
          "object": "Rate",
          "created_at": "2024-01-24T00:06:31Z",
          "updated_at": "2024-01-24T00:06:31Z",
          "mode": "test",
          "service": "Priority",
          "carrier": "USPS",
          "rate": "7.33",
          "currency": "USD",
          "retail_rate": "15.20",
          "retail_currency": "USD",
          "list_rate": "10.89",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 2,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 2,
          "shipment_id": "shp_436a1adad9ac4a0d888b27f82b284dee",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_cb7874a83d4745908619c1b51a1eeb0e",
          "object": "Rate",
          "created_at": "2024-01-24T00:06:31Z",
          "updated_at": "2024-01-24T00:06:31Z",
          "mode": "test",
          "service": "GroundAdvantage",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_436a1adad9ac4a0d888b27f82b284dee",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_0de7dcafef7f40d0a1669140ab42d952",
          "object": "Rate",
          "created_at": "2024-01-24T00:06:31Z",
          "updated_at": "2024-01-24T00:06:31Z",
          "mode": "test",
          "service": "First",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_436a1adad9ac4a0d888b27f82b284dee",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_314fe5c039f84dfeba7d8fe218d771f6",
          "object": "Rate",
          "created_at": "2024-01-24T00:06:31Z",
          "updated_at": "2024-01-24T00:06:31Z",
          "mode": "test",
          "service": "ParcelSelect",
          "carrier": "USPS",
          "rate": "6.79",
          "currency": "USD",
          "retail_rate": "13.15",
          "retail_currency": "USD",
          "list_rate": "9.41",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": 3,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": 3,
          "shipment_id": "shp_436a1adad9ac4a0d888b27f82b284dee",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        },
        {
          "id": "rate_bbee837039494bccb186b3f2eb9bc0e7",
          "object": "Rate",
          "created_at": "2024-01-24T00:06:31Z",
          "updated_at": "2024-01-24T00:06:31Z",
          "mode": "test",
          "service": "Express",
          "carrier": "USPS",
          "rate": "49.60",
          "currency": "USD",
          "retail_rate": "57.40",
          "retail_currency": "USD",
          "list_rate": "49.60",
          "list_currency": "USD",
          "billing_type": "easypost",
          "delivery_days": null,
          "delivery_date": null,
          "delivery_date_guaranteed": false,
          "est_delivery_days": null,
          "shipment_id": "shp_436a1adad9ac4a0d888b27f82b284dee",
          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
        }
      ],
      "refund_status": null,
      "scan_form": null,
      "selected_rate": {
        "id": "rate_e5722f0f792e4866b366ed45364bd485",
        "object": "Rate",
        "created_at": "2024-01-24T00:06:32Z",
        "updated_at": "2024-01-24T00:06:32Z",
        "mode": "test",
        "service": "Priority",
        "carrier": "USPS",
        "rate": "7.33",
        "currency": "USD",
        "retail_rate": "15.20",
        "retail_currency": "USD",
        "list_rate": "10.89",
        "list_currency": "USD",
        "billing_type": "easypost",
        "delivery_days": 2,
        "delivery_date": null,
        "delivery_date_guaranteed": false,
        "est_delivery_days": 2,
        "shipment_id": "shp_436a1adad9ac4a0d888b27f82b284dee",
        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
      },
      "tracker": {
        "id": "trk_10e194da76924301a4f3ce47056db085",
        "object": "Tracker",
        "mode": "test",
        "tracking_code": "9405500207552011812689",
        "status": "delivered",
        "status_detail": "arrived_at_destination",
        "created_at": "2024-01-24T00:06:32Z",
        "updated_at": "2024-01-24T00:09:32Z",
        "signed_by": "John Tester",
        "weight": null,
        "est_delivery_date": "2024-01-24T00:09:32Z",
        "shipment_id": "shp_436a1adad9ac4a0d888b27f82b284dee",
        "carrier": "USPS",
        "tracking_details": [
          {
            "object": "TrackingDetail",
            "message": "Pre-Shipment Info Sent to USPS",
            "description": "",
            "status": "pre_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-24T00:09:32Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": null,
              "state": null,
              "country": null,
              "zip": null
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Shipping Label Created",
            "description": "",
            "status": "pre_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-24T12:46:32Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "HOUSTON",
              "state": "TX",
              "country": null,
              "zip": "77063"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at USPS Origin Facility",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-24T22:51:32Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "NORTH HOUSTON",
              "state": "TX",
              "country": null,
              "zip": "77315"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at USPS Facility",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-26T00:27:32Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "COLUMBIA",
              "state": "SC",
              "country": null,
              "zip": "29201"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Arrived at Post Office",
            "description": "",
            "status": "in_transit",
            "status_detail": "arrived_at_facility",
            "datetime": "2023-12-26T03:18:32Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Sorting Complete",
            "description": "",
            "status": "in_transit",
            "status_detail": "status_update",
            "datetime": "2023-12-26T08:58:32Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Out for Delivery",
            "description": "",
            "status": "out_for_delivery",
            "status_detail": "out_for_delivery",
            "datetime": "2023-12-26T09:08:32Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          },
          {
            "object": "TrackingDetail",
            "message": "Delivered",
            "description": "",
            "status": "delivered",
            "status_detail": "arrived_at_destination",
            "datetime": "2023-12-26T14:00:32Z",
            "source": "USPS",
            "carrier_code": "",
            "tracking_location": {
              "object": "TrackingLocation",
              "city": "CHARLESTON",
              "state": "SC",
              "country": null,
              "zip": "29407"
            }
          }
        ],
        "fees": [],
        "carrier_detail": {
          "object": "CarrierDetail",
          "service": "First-Class Package Service",
          "container_type": null,
          "est_delivery_date_local": null,
          "est_delivery_time_local": null,
          "origin_location": "HOUSTON TX, 77001",
          "origin_tracking_location": {
            "object": "TrackingLocation",
            "city": "NORTH HOUSTON",
            "state": "TX",
            "country": null,
            "zip": "77315"
          },
          "destination_location": "CHARLESTON SC, 29401",
          "destination_tracking_location": {
            "object": "TrackingLocation",
            "city": "CHARLESTON",
            "state": "SC",
            "country": null,
            "zip": "29407"
          },
          "guaranteed_delivery_date": null,
          "alternate_identifier": null,
          "initial_delivery_attempt": "2023-12-26T14:00:32Z"
        },
        "public_url": "https://track.easypost.com/djE6dHJrXzEwZTE5NGRhNzY5MjQzMDFhNGYzY2U0NzA1NmRiMDg1"
      },
      "to_address": {
        "id": "adr_6d931952ba4c11eeacf5ac1f6bc539aa",
        "object": "Address",
        "created_at": "2024-01-24T00:06:31+00:00",
        "updated_at": "2024-01-24T00:06:31+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": null,
        "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_6d94f4a7ba4c11eeacf7ac1f6bc539aa",
        "object": "Address",
        "created_at": "2024-01-24T00:06:31+00:00",
        "updated_at": "2024-01-24T00:06:31+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_6d931952ba4c11eeacf5ac1f6bc539aa",
        "object": "Address",
        "created_at": "2024-01-24T00:06:31+00:00",
        "updated_at": "2024-01-24T00:06:31+00:00",
        "name": "DR. STEVE BRULE",
        "company": null,
        "street1": "179 N HARBOR DR",
        "street2": null,
        "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": "LabelFee",
          "amount": "0.00000",
          "charged": true,
          "refunded": false
        },
        {
          "object": "Fee",
          "type": "PostageFee",
          "amount": "7.33000",
          "charged": true,
          "refunded": false
        }
      ],
      "id": "shp_436a1adad9ac4a0d888b27f82b284dee",
      "object": "Shipment"
    }
  ],
  "has_more": true
}

Addresses

Address objects are used to represent people, places, and organizations in a number of contexts. For example, a Shipment requires a to_address and from_address to accurately calculate rates and generate postage.

Additionally, EasyPost offers several verification tools that can be used to detect deliverability issues, correct minor errors in spelling/formatting, and determine if an Address is residential or not (which has a significant effect on Shipment rating for many carriers).

Address Object

attributetypespecification
idstringUnique identifier, begins with "adr_"
objectstring"Address"
modestringSet based on which api-key you used, either "test" or "production"
street1stringFirst line of the address
street2stringSecond line of the address
citystringCity the address is located in
statestringState or province the address is located in
zipstringZIP or postal code the address is located in
countrystringISO 3166 country code for the country the address is located in
residentialbooleanWhether or not this address would be considered residential
carrier_facilitystringThe specific designation for the address (only relevant if the address is a carrier facility)
namestringName of the person. Both name and company can be included
companystringName of the organization. Both name and company can be included
phonestringPhone number to reach the person or organization
emailstringEmail to reach the person or organization
federal_tax_idstringFederal tax identifier of the person or organization
state_tax_idstringState tax identifier of the person or organization
verificationsVerificationsThe result of any verifications requested

Verifications Object

attributetypespecification
zip4VerificationOnly applicable to US addresses - checks and sets the ZIP+4
deliveryVerificationChecks that the address is deliverable and makes minor corrections to spelling/format. US addresses will also have their "residential" status checked and set.

Verification Object

attributetypespecification
successbooleanThe success of the verification
errorsFieldError arrayAll errors that caused the verification to fail
detailsVerificationDetailsExtra data related to the verification

VerificationDetails Object

attributetypespecification
latitudenumberThe latitude
longitudenumberThe longitude
time_zoneTZ(string)The time zone the address is located in, IE: America/Los_Angeles

Address Verification by Country

Our address verification service supports 240+ countries. See our full listing to see which verification level is available for each country. We are constantly working to expand our coverage of addresses worldwide.

Full List of Countries & Levels

POST/addresses

Create and Verify Addresses

Depending on your use case an Address can be used in many different ways. Certain carriers allow rating between two zip codes, but full addresses are required to purchase postage. It is recommended to provide as much information as possible during creation and to reuse these objects whenever possible.

Address objects can also be created inline while creating another object, for example during Shipment Creation.

Verify an Address

Verifying an Address before you ship is a great way to reduce issues with delivery.

Creating a verified Address is as simple as providing verify or verify_strict in the parameters. If any of the strict verification checks fail, an error will be returned from the API. The example below demonstrates verifying delivery, which checks that the address is deliverable and sets its residential delivery indicator.

The most effective time to perform address verification is when your customer, or the person entering the delivery address, is present. When designing a shopping cart it is recommended to ask the shopper for their address and verify it on the spot. If verification fails, ask them to double check their input; if they confirm that their data is correct, assume they know their address more correctly than the verification process.

Request Parameters
paramexampleinfo
street1417 Montgomery StFirst line of the address
street2Floor 5Second line of the address
citySan FranciscoFull city name
stateCAState or province
zip94104ZIP or postal code
countryUSISO 3166 country code for the country the address is located in
nameHiro ProtagonistName of attention, if person. Both name and company can be included
companyEasyPostName of attention, if organization. Both name and company can be included
phone415-123-4567Phone number to reach the person or organization
emailexample@example.comEmail to reach the person or organization
residentialfalseResidential delivery indicator
carrier_facilityONDCThe specific designation for the address (only relevant if the address is a carrier facility)
federal_tax_id1234567890Federal tax identifier of the person or organization
state_tax_id9876543210State tax identifier of the person or organization
verifytrueInclude to perform verifications on delivery and zip code. verify_strict takes precedence if also included.
verify_stricttrueInclude to perform strict verifications on delivery and zip code. The failure of any of these verifications causes the whole request to fail.
Example
package addresses;

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

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> params = new HashMap<String, Object>();

        params.put("street1", "417 MONTGOMERY ST");
        params.put("street2", "FLOOR 5");
        params.put("city", "SAN FRANCISCO");
        params.put("state", "CA");
        params.put("zip", "94104");
        params.put("country", "US");
        params.put("company", "EasyPost");
        params.put("phone", "415-123-4567");

        Address address = client.address.create(params);

        System.out.println(address);
    }
}
{
  "id": "adr_3a2086e3bafa11eeb8d4ac1f6bc539ae",
  "object": "Address",
  "created_at": "2024-01-24T20:50:37+00:00",
  "updated_at": "2024-01-24T20:50:37+00:00",
  "name": null,
  "company": "EasyPost",
  "street1": "417 MONTGOMERY ST",
  "street2": "FLOOR 5",
  "city": "SAN FRANCISCO",
  "state": "CA",
  "zip": "94104",
  "country": "US",
  "phone": "4151234567",
  "email": null,
  "mode": "test",
  "carrier_facility": null,
  "residential": null,
  "federal_tax_id": null,
  "state_tax_id": null,
  "verifications": {}
}
package addresses;

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

import java.util.HashMap;

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

        HashMap<String, Object> params = new HashMap<String, Object>();

        params.put("street1", "000 unknown street");
        params.put("city", "Not A City");
        params.put("state", "ZZ");
        params.put("zip", "00001");
        params.put("country", "US");
        params.put("email", "test@example.com");
        params.put("phone", "5555555555");

        Address address = client.address.createAndVerify(params);

        System.out.println(address);
    }
}
{
  "error": {
    "code": "ADDRESS.VERIFY.FAILURE",
    "message": "Unable to verify address.",
    "errors": [
      {
        "code": "E.ADDRESS.NOT_FOUND",
        "field": "address",
        "message": "Address not found",
        "suggestion": null
      }
    ]
  }
}
package addresses;

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

import java.util.HashMap;

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

        HashMap<String, Object> params = new HashMap<String, Object>();

        params.put("street1", "000 unknown street");
        params.put("city", "Not A City");
        params.put("state", "ZZ");
        params.put("zip", "00001");
        params.put("country", "US");
        params.put("email", "test@example.com");
        params.put("phone", "5555555555");
        params.put("verify", true);

        Address address = client.address.create(params);

        System.out.println(address);
    }
}
{
  "id": "adr_3a98ffc7bafa11eeb8fcac1f6bc539ae",
  "object": "Address",
  "created_at": "2024-01-24T20:50:38+00:00",
  "updated_at": "2024-01-24T20:50:38+00:00",
  "name": null,
  "company": "EasyPost",
  "street1": "000 unknown street",
  "street2": null,
  "city": "Not A City",
  "state": "ZZ",
  "zip": "00001",
  "country": "US",
  "phone": "5555555555",
  "email": "test@example.com",
  "mode": "test",
  "carrier_facility": null,
  "residential": null,
  "federal_tax_id": null,
  "state_tax_id": null,
  "verifications": {
    "zip4": {
      "success": false,
      "errors": [
        {
          "code": "E.ADDRESS.NOT_FOUND",
          "field": "address",
          "message": "Address not found",
          "suggestion": null
        }
      ],
      "details": null
    },
    "delivery": {
      "success": false,
      "errors": [
        {
          "code": "E.ADDRESS.NOT_FOUND",
          "field": "address",
          "message": "Address not found",
          "suggestion": null
        }
      ],
      "details": {}
    }
  }
}
package addresses;

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

import java.util.HashMap;

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

        HashMap<String, Object> params = new HashMap<String, Object>();

        params.put("street1", "000 unknown street");
        params.put("city", "Not A City");
        params.put("state", "ZZ");
        params.put("zip", "00001");
        params.put("country", "US");
        params.put("email", "test@example.com");
        params.put("phone", "5555555555");

        Address address = client.address.create(params);

        System.out.println(address);
    }
}
{
  "error": {
    "code": "ADDRESS.VERIFY.FAILURE",
    "message": "Unable to verify address.",
    "errors": [
      {
        "code": "E.ADDRESS.NOT_FOUND",
        "field": "address",
        "message": "Address not found",
        "suggestion": null
      }
    ]
  }
}
package addresses;

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

import java.util.HashMap;

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

        HashMap<String, Object> params = new HashMap<String, Object>();

        params.put("street1", "000 unknown street");
        params.put("city", "Not A City");
        params.put("state", "ZZ");
        params.put("zip", "00001");
        params.put("country", "US");
        params.put("email", "test@example.com");
        params.put("phone", "5555555555");
        params.put("verify_strict", true);

        Address address = client.address.create(params);

        System.out.println(address);
    }
}
{
  "error": {
    "code": "ADDRESS.VERIFY.FAILURE",
    "message": "Unable to verify address.",
    "errors": [
      {
        "code": "E.ADDRESS.NOT_FOUND",
        "field": "address",
        "message": "Address not found",
        "suggestion": null
      }
    ]
  }
}
package addresses;

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

import java.util.HashMap;

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

        HashMap<String, Object> params = new HashMap<String, Object>();

        params.put("street1", "417 Montgomery Street");
        params.put("city", "SF");
        params.put("state", "CA");
        params.put("zip", "94104");
        params.put("country", "US");
        params.put("company", "EasyPost");
        params.put("phone", "415-123-4567");
        params.put("verify_strict", true);

        Address address = client.address.create(params);

        Address verifiedAddress = client.address.verify(address.getId());

        System.out.println(verifiedAddress);
    }
}
{
  "address": {
    "id": "adr_3b15ed39bafa11ee83ed3cecef1b359e",
    "object": "Address",
    "created_at": "2024-01-24T20:50:39+00:00",
    "updated_at": "2024-01-24T20:50:39+00:00",
    "name": null,
    "company": "EASYPOST",
    "street1": "417 MONTGOMERY ST FL 5",
    "street2": "",
    "city": "SAN FRANCISCO",
    "state": "CA",
    "zip": "94104-1129",
    "country": "US",
    "phone": "4151234567",
    "email": null,
    "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": 37.79342,
          "longitude": -122.40288,
          "time_zone": "America/Los_Angeles"
        }
      }
    }
  }
}
GET/addresses

Retrieve a list of Addresses

The Address List is a paginated list of all Address objects associated with the given API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

Request Parameters
paramexampleinfo
before_idadr_...Optional pagination parameter. Only addresses created before the given ID will be included. May not be used with after_id
after_idadr_...Optional pagination parameter. Only addresses created after the given ID will be included. May not be used with before_id
page_size30The number of addresses to return on each page. The maximum value is 100, and default is 20.
Example
package addresses;

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

import java.util.HashMap;

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

        HashMap<String, Object> params = new HashMap<>();

        params.put("page_size", 5);

        AddressCollection addresses = client.address.all(params);

        System.out.println(addresses);
    }
}
{
  "addresses": [
    {
      "id": "adr_3b7de31bbafa11eeb947ac1f6bc539ae",
      "object": "Address",
      "created_at": "2024-01-24T20:50:39+00:00",
      "updated_at": "2024-01-24T20:50:39+00:00",
      "name": null,
      "company": "EasyPost",
      "street1": "417 MONTGOMERY ST",
      "street2": "FLOOR 5",
      "city": "SAN FRANCISCO",
      "state": "CA",
      "zip": "94104",
      "country": "US",
      "phone": "4151234567",
      "email": null,
      "mode": "test",
      "carrier_facility": null,
      "residential": null,
      "federal_tax_id": null,
      "state_tax_id": null,
      "verifications": {}
    }
  ],
  "has_more": true
}
GET/addresses/:id

Retrieve an Address

An Address can be retrieved by its id.

Example
package addresses;

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

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

        Address address = client.address.retrieve("adr_...");

        System.out.println(address);
    }
}
{
  "id": "adr_3b7de31bbafa11eeb947ac1f6bc539ae",
  "object": "Address",
  "created_at": "2024-01-24T20:50:39+00:00",
  "updated_at": "2024-01-24T20:50:39+00:00",
  "name": null,
  "company": "EasyPost",
  "street1": "417 MONTGOMERY ST",
  "street2": "FLOOR 5",
  "city": "SAN FRANCISCO",
  "state": "CA",
  "zip": "94104",
  "country": "US",
  "phone": "4151234567",
  "email": null,
  "mode": "test",
  "carrier_facility": null,
  "residential": null,
  "federal_tax_id": null,
  "state_tax_id": null,
  "verifications": {}
}

Parcels

Parcel objects represent the physical container being shipped. Dimensions can be supplied either as length, width, and height dimensions, or a predefined_package string. Only weight is required, but since many carriers charge different rates for packages with large dimensions, we strongly recommend including all dimensions if available.

Weights are in OUNCES (OZ) and go to one decimal point.

Dimensions are in INCHES (IN) and go to one decimal point.

Parcel Object

attributetypespecification
idstringUnique, begins with "prcl_"
objectstring"Parcel"
modestring"test" or "production"
lengthfloat(inches)Required if width and/or height are present
widthfloat(inches)Required if width and/or height are present
heightfloat(inches)Required if width and/or height are present
predefined_packagestringOptional, one of our predefined_packages
weightfloat(oz)Always required
created_atdatetime
updated_atdatetime

Predefined Packages

If you provide a predefined_package the associated Shipment will fetch rates from carriers for which that is a valid predefined_package. Some carriers share predefined_package names. If you wish to restrict your rating to a specific carrier, we recommend passing the carrier_accounts field when creating a Shipment.

For most predefined_packages it is not necessary to specify parcel dimensions, only weight.

Accurate

No predefined packages for Accurate.

    Amazon MWS

    No predefined packages for Amazon MWS.

      APC

      No predefined packages for APC.

        Asendia USA

        No predefined packages for Asendia USA.

          Australia Post
          • CARTON
          • PALLET
          • SATCHEL
          • BAG
          • ENVELOPE
          • ITEM
          • JIFFYBAG
          • SKID
          AxlehireV3

          No predefined packages for AxlehireV3.

            Better Trucks

            No predefined packages for Better Trucks.

              Canada Post

              No predefined packages for Canada Post.

                Canpar

                No predefined packages for Canpar.

                  CDL Last Mile Solutions

                  No predefined packages for CDL Last Mile Solutions.

                    Chronopost

                    No predefined packages for Chronopost.

                      Cirro E-Commerce

                      No predefined packages for Cirro E-Commerce.

                        CloudSort

                        No predefined packages for CloudSort.

                          Courier Express

                          No predefined packages for Courier Express.

                            Couriers Please

                            No predefined packages for Couriers Please.

                              DAI Post

                              No predefined packages for DAI Post.

                                Deliver-It

                                No predefined packages for Deliver-It.

                                  Deutsche Post

                                  No predefined packages for Deutsche Post.

                                    Deutsche Post UK

                                    No predefined packages for Deutsche Post UK.

                                      DHL eCommerce Solutions

                                      No predefined packages for DHL eCommerce Solutions.

                                        DHL Express
                                        • JumboDocument
                                        • JumboParcel
                                        • Document
                                        • DHLFlyer
                                        • Domestic
                                        • ExpressDocument
                                        • DHLExpressEnvelope
                                        • JumboBox
                                        • JumboJuniorDocument
                                        • JuniorJumboBox
                                        • JumboJuniorParcel
                                        • OtherDHLPackaging
                                        • Parcel
                                        • YourPackaging
                                        DHL Paket

                                        No predefined packages for DHL Paket.

                                          DPD

                                          No predefined packages for DPD.

                                            DPD NL

                                            No predefined packages for DPD NL.

                                              DPD UK
                                              • Parcel
                                              • Pallet
                                              • ExpressPak
                                              • FreightParcel
                                              • Freight
                                              ePostGlobal

                                              No predefined packages for ePostGlobal.

                                                Estafeta
                                                • ENVELOPE
                                                • PARCEL
                                                Evri

                                                No predefined packages for Evri.

                                                  Fastway
                                                  • Parcel
                                                  • A2
                                                  • A3
                                                  • A4
                                                  • A5
                                                  • BOXSML
                                                  • BOXMED
                                                  • BOXLRG
                                                  FedEx
                                                  • FedExEnvelope
                                                  • FedExBox
                                                  • FedExPak
                                                  • FedExTube
                                                  • FedEx10kgBox
                                                  • FedEx25kgBox
                                                  • FedExSmallBox
                                                  • FedExMediumBox
                                                  • FedExLargeBox
                                                  • FedExExtraLargeBox
                                                  FedEx Ground Economy

                                                  No predefined packages for FedEx Ground Economy.

                                                    First Choice

                                                    No predefined packages for First Choice.

                                                      First Mile

                                                      No predefined packages for First Mile.

                                                        Flexport

                                                        No predefined packages for Flexport.

                                                          GSO

                                                          No predefined packages for GSO.

                                                            Hailify

                                                            No predefined packages for Hailify.

                                                              Interlink Express
                                                              • Parcel
                                                              • Pallet
                                                              • ExpressPak
                                                              • FreightParcel
                                                              • Freight
                                                              Jet

                                                              No predefined packages for Jet.

                                                                JP Post

                                                                No predefined packages for JP Post.

                                                                  Kuroneko Yamato

                                                                  No predefined packages for Kuroneko Yamato.

                                                                    La Poste

                                                                    No predefined packages for La Poste.

                                                                      LaserShip
                                                                      • Envelope
                                                                      • Custom
                                                                      Loomis Express

                                                                      No predefined packages for Loomis Express.

                                                                        LSO

                                                                        No predefined packages for LSO.

                                                                          Maergo

                                                                          No predefined packages for Maergo.

                                                                            Newgistics

                                                                            No predefined packages for Newgistics.

                                                                              Ontrac
                                                                              • Letter
                                                                              Optima

                                                                              No predefined packages for Optima.

                                                                                OSM Worldwide
                                                                                • parcel
                                                                                • irregularparcel
                                                                                • softpack
                                                                                Pandion

                                                                                No predefined packages for Pandion.

                                                                                  Parcelforce

                                                                                  No predefined packages for Parcelforce.

                                                                                    Passport

                                                                                    No predefined packages for Passport.

                                                                                      PostNL

                                                                                      No predefined packages for PostNL.

                                                                                        Purolator
                                                                                        • CUSTOMERPACKAGING
                                                                                        • EXPRESSPACK
                                                                                        • EXPRESSBOX
                                                                                        • EXPRESSENVELOPE
                                                                                        Royal Mail
                                                                                        • LARGELETTER
                                                                                        • SMALLPARCEL
                                                                                        • MEDIUMPARCEL
                                                                                        • LETTER
                                                                                        • PRINTEDPAPER
                                                                                        SEKO OmniParcel
                                                                                        • Bag
                                                                                        • Box
                                                                                        • Carton
                                                                                        • Container
                                                                                        • Crate
                                                                                        • Envelope
                                                                                        • Pail
                                                                                        • Pallet
                                                                                        • Satchel
                                                                                        • Tub
                                                                                        Sendle

                                                                                        No predefined packages for Sendle.

                                                                                          SF Express

                                                                                          No predefined packages for SF Express.

                                                                                            SmartKargo

                                                                                            No predefined packages for SmartKargo.

                                                                                              Sonic

                                                                                              No predefined packages for Sonic.

                                                                                                Spee-Dee

                                                                                                No predefined packages for Spee-Dee.

                                                                                                  Swyft

                                                                                                  No predefined packages for Swyft.

                                                                                                    TForce Logistics

                                                                                                    No predefined packages for TForce Logistics.

                                                                                                      Toll

                                                                                                      No predefined packages for Toll.

                                                                                                        UDS

                                                                                                        No predefined packages for UDS.

                                                                                                          UPS
                                                                                                          • UPSLetter
                                                                                                          • UPSExpressBox
                                                                                                          • UPS25kgBox
                                                                                                          • UPS10kgBox
                                                                                                          • Tube
                                                                                                          • Pak
                                                                                                          • SmallExpressBox
                                                                                                          • MediumExpressBox
                                                                                                          • LargeExpressBox
                                                                                                          UPS iParcel

                                                                                                          No predefined packages for UPS iParcel.

                                                                                                            UPS Mail Innovations

                                                                                                            No predefined packages for UPS Mail Innovations.

                                                                                                              USPS

                                                                                                              USPS Flat Rate MappingUSPS Package Restrictions

                                                                                                              • Card
                                                                                                              • Letter
                                                                                                              • Flat
                                                                                                              • FlatRateEnvelope
                                                                                                              • FlatRateLegalEnvelope
                                                                                                              • FlatRatePaddedEnvelope
                                                                                                              • FlatRateWindowEnvelope
                                                                                                              • FlatRateCardboardEnvelope
                                                                                                              • SmallFlatRateEnvelope
                                                                                                              • Parcel
                                                                                                              • SoftPack
                                                                                                              • SmallFlatRateBox
                                                                                                              • MediumFlatRateBox
                                                                                                              • LargeFlatRateBox
                                                                                                              • LargeFlatRateBoxAPOFPO
                                                                                                              • FlatTubTrayBox
                                                                                                              • EMMTrayBox
                                                                                                              • FullTrayBox
                                                                                                              • HalfTrayBox
                                                                                                              • PMODSack
                                                                                                              Veho

                                                                                                              No predefined packages for Veho.

                                                                                                                Yanwen

                                                                                                                No predefined packages for Yanwen.

                                                                                                                  POST/parcels

                                                                                                                  Create a Parcel

                                                                                                                  Include the weight, and either a predefined_package or length, width and height if applicable.

                                                                                                                  Request Parameters
                                                                                                                  paramexample
                                                                                                                  length20.2
                                                                                                                  width10.9
                                                                                                                  height5
                                                                                                                  weight65.9
                                                                                                                  Example
                                                                                                                  package parcels;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Parcel;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  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> params = new HashMap<String, Object>();
                                                                                                                          params.put("height", 5);
                                                                                                                          params.put("width", 10.9);
                                                                                                                          params.put("length", 20.2);
                                                                                                                          params.put("weight", 65.9);
                                                                                                                  
                                                                                                                          Parcel parcel = client.parcel.create(params);
                                                                                                                  
                                                                                                                          System.out.println(parcel);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "id": "prcl_b35e1e715f30402b9eed234372505f7c",
                                                                                                                    "object": "Parcel",
                                                                                                                    "created_at": "2024-01-24T00:06:01Z",
                                                                                                                    "updated_at": "2024-01-24T00:06:01Z",
                                                                                                                    "length": 20.2,
                                                                                                                    "width": 10.9,
                                                                                                                    "height": 5.0,
                                                                                                                    "predefined_package": null,
                                                                                                                    "weight": 65.9,
                                                                                                                    "mode": "test"
                                                                                                                  }
                                                                                                                  GET/parcels/:id

                                                                                                                  Retrieve a Parcel

                                                                                                                  Get a Parcel by its id. In general you should not need to use this in your automated solution. A Parcel's id can be inlined into the creation call to other objects. This allows you to only create one Parcel for each package you will be using.

                                                                                                                  Example
                                                                                                                  package parcels;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Parcel;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  public class Retrieve {
                                                                                                                      public static void main(String[] args) throws EasyPostException {
                                                                                                                          EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                  
                                                                                                                          Parcel parcel = client.parcel.retrieve("prcl_...");
                                                                                                                  
                                                                                                                          System.out.println(parcel);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "id": "prcl_85acf9cc4cb54eeabebda7e6f7a18e99",
                                                                                                                    "object": "Parcel",
                                                                                                                    "created_at": "2024-01-24T00:06:01Z",
                                                                                                                    "updated_at": "2024-01-24T00:06:01Z",
                                                                                                                    "length": 20.2,
                                                                                                                    "width": 10.9,
                                                                                                                    "height": 5.0,
                                                                                                                    "predefined_package": null,
                                                                                                                    "weight": 65.9,
                                                                                                                    "mode": "test"
                                                                                                                  }

                                                                                                                  Insurances

                                                                                                                  An Insurance object represents insurance for packages purchased both via the EasyPost API as well as shipments purchased through third parties and later registered with EasyPost. An Insurance is created automatically whenever you buy a Shipment through EasyPost and pass insurance options during the Buy call or in a later call to Insure a Shipment.

                                                                                                                  Insurance purchased through the Shipment Buy or Insure endpoints is immediately insured - there is no possibility of rejection based on tracking information, as the package was just created. On the other hand, Insurance purchased on shipments purchased outside of EasyPost requires creation with a tracking code so that EasyPost may confirm the package existence and current shipping status at the time of purchase.

                                                                                                                  Standalone insurance is created in a pending state to help distinguish it from insurance purchased for an EasyPost Shipment. Both kinds of Insurance use the Tracking system to receive periodic updates, and will report those updates to any appropriate Webhook on file. Standalone insurance will cancel itself if the tracking information for the given tracking code shows evidence of having been shipped anytime before the insurance was purchased.

                                                                                                                  Unlike Shipments within EasyPost, Insurance objects register To and From Address objects according to the destination and ship-from locations of the package. This means that a Shipment with "is_return: true" actually ships to the listed From Address. Insurance does not have a concept of "is_return", so all insurance records refer to their true package destination as "to_address", regardless of whether or not the shipment is a return.

                                                                                                                  Insurance Object

                                                                                                                  attributetypespecification
                                                                                                                  idstringUnique identifier, begins with "ins_"
                                                                                                                  objectstring"Insurance"
                                                                                                                  modestring"test" or "production"
                                                                                                                  referencestringThe reference for this Insurance, if any
                                                                                                                  amountstringUSD value of insured goods with sub-cent precision
                                                                                                                  providerstringThe insurance provider used by EasyPost
                                                                                                                  provider_idstringAn identifying number for some insurance providers used by EasyPost
                                                                                                                  shipment_idstringThe ID of the Shipment in EasyPost, if postage was purchased via EasyPost
                                                                                                                  tracking_codestringThe tracking code of either the shipment within EasyPost, or provided by you during creation
                                                                                                                  statusstringThe current status of the insurance, possible values are "new", "pending", "purchased", "failed", or "cancelled"
                                                                                                                  trackerTrackerThe associated Tracker object
                                                                                                                  to_addressAddressThe associated Address object for destination (optional)
                                                                                                                  from_addressAddressThe associated Address object for origin (optional)
                                                                                                                  feeFeeThe associated InsuranceFee object if any
                                                                                                                  messagesArray of stringsThe list of errors encountered during attempted purchase of the insurance
                                                                                                                  created_atdatetime
                                                                                                                  updated_atdatetime
                                                                                                                  POST/insurances

                                                                                                                  Create an Insurance

                                                                                                                  An Insurance created via this endpoint must belong to a shipment purchased outside of EasyPost. Insurance for Shipments created within EasyPost must be created via the Shipment Buy or Insure endpoints. When creating Insurance for a non-EasyPost shipment, you must provide tracking_code, carrier, and amount information.

                                                                                                                  Customers must have their own FedEx account to insure FedEx packages.

                                                                                                                  Request Parameters
                                                                                                                  paramexampleinfo
                                                                                                                  to_addressAddressThe destination of the package to be insured (optional).
                                                                                                                  from_addressAddressThe origin of the package to be insured (optional).
                                                                                                                  tracking_code9400110898825022579493The tracking code associated with the non-EasyPost-purchased package you'd like to insure.
                                                                                                                  referenceexternal-order-493An optional value that may be used in place of ID when doing Retrieve calls for this insurance.
                                                                                                                  amount"$100.00"The USD value of contents you would like to insure. Currently the maximum is $5000.
                                                                                                                  carrierUSPSThe carrier associated with the tracking_code you provided. The carrier will get auto-detected if none is provided.
                                                                                                                  Example
                                                                                                                  package insurances;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Insurance;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  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> toAddressMap = new HashMap<String, Object>();
                                                                                                                          toAddressMap.put("id", "adr_...");
                                                                                                                  
                                                                                                                          HashMap<String, Object> fromAddressMap = new HashMap<String, Object>();
                                                                                                                          fromAddressMap.put("id", "adr_...");
                                                                                                                  
                                                                                                                          HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                          params.put("to_address", toAddressMap);
                                                                                                                          params.put("from_address", fromAddressMap);
                                                                                                                          params.put("tracking_code", "9400110898825022579493");
                                                                                                                          params.put("carrier", "USPS");
                                                                                                                          params.put("amount", "100.00");
                                                                                                                          params.put("reference", "InsuranceRef1");
                                                                                                                  
                                                                                                                          Insurance insurance = client.insurance.create(params);
                                                                                                                  
                                                                                                                          System.out.println(insurance);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "id": "ins_2500e29183a64136b84a1e44ff08905f",
                                                                                                                    "object": "Insurance",
                                                                                                                    "mode": "test",
                                                                                                                    "reference": null,
                                                                                                                    "status": "pending",
                                                                                                                    "amount": "100.00000",
                                                                                                                    "provider": "easypost",
                                                                                                                    "provider_id": null,
                                                                                                                    "to_address": {
                                                                                                                      "id": "adr_568c1ebcba4c11ee96cd3cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:52+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"
                                                                                                                          }
                                                                                                                        }
                                                                                                                      }
                                                                                                                    },
                                                                                                                    "from_address": {
                                                                                                                      "id": "adr_56912a8aba4c11ee96cf3cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "name": "EASYPOST",
                                                                                                                      "company": null,
                                                                                                                      "street1": "417 MONTGOMERY ST # 5",
                                                                                                                      "street2": "",
                                                                                                                      "city": "SAN FRANCISCO",
                                                                                                                      "state": "CA",
                                                                                                                      "zip": "94104-1129",
                                                                                                                      "country": "US",
                                                                                                                      "phone": "4153334445",
                                                                                                                      "email": "SUPPORT@EASYPOST.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": 37.79342,
                                                                                                                            "longitude": -122.40288,
                                                                                                                            "time_zone": "America/Los_Angeles"
                                                                                                                          }
                                                                                                                        }
                                                                                                                      }
                                                                                                                    },
                                                                                                                    "shipment_id": null,
                                                                                                                    "tracker": {
                                                                                                                      "id": "trk_0ecad8116b424f00b9acdb15f66867bf",
                                                                                                                      "object": "Tracker",
                                                                                                                      "mode": "test",
                                                                                                                      "tracking_code": "9400110898825022579493",
                                                                                                                      "status": "error",
                                                                                                                      "status_detail": null,
                                                                                                                      "created_at": "2024-01-23T23:57:03Z",
                                                                                                                      "updated_at": "2024-01-23T23:57:03Z",
                                                                                                                      "signed_by": null,
                                                                                                                      "weight": null,
                                                                                                                      "est_delivery_date": null,
                                                                                                                      "shipment_id": null,
                                                                                                                      "carrier": "USPS",
                                                                                                                      "tracking_details": [
                                                                                                                        {
                                                                                                                          "object": "TrackingDetail",
                                                                                                                          "message": "In test mode, only test tracking numbers are valid. Test tracking numbers are EZ1000000001, EZ2000000002, ... , EZ7000000007",
                                                                                                                          "description": "",
                                                                                                                          "status": "error",
                                                                                                                          "status_detail": null,
                                                                                                                          "datetime": "2024-01-23T23:57:03Z",
                                                                                                                          "source": "ProcessingError",
                                                                                                                          "carrier_code": "",
                                                                                                                          "tracking_location": {
                                                                                                                            "object": "TrackingLocation",
                                                                                                                            "city": null,
                                                                                                                            "state": null,
                                                                                                                            "country": null,
                                                                                                                            "zip": null
                                                                                                                          }
                                                                                                                        }
                                                                                                                      ],
                                                                                                                      "carrier_detail": null,
                                                                                                                      "finalized": true,
                                                                                                                      "is_return": false,
                                                                                                                      "public_url": "https://track.easypost.com/djE6dHJrXzBlY2FkODExNmI0MjRmMDBiOWFjZGIxNWY2Njg2N2Jm",
                                                                                                                      "fees": []
                                                                                                                    },
                                                                                                                    "tracking_code": "9400110898825022579493",
                                                                                                                    "fee": {
                                                                                                                      "object": "Fee",
                                                                                                                      "type": "InsuranceFee",
                                                                                                                      "amount": "0.50000",
                                                                                                                      "charged": true,
                                                                                                                      "refunded": false
                                                                                                                    },
                                                                                                                    "messages": [],
                                                                                                                    "created_at": "2024-01-24T00:05:52Z",
                                                                                                                    "updated_at": "2024-01-24T00:05:52Z"
                                                                                                                  }
                                                                                                                  GET/insurances

                                                                                                                  Retrieve a list of Insurances

                                                                                                                  The Insurance List is a paginated list of all Insurance objects associated with the given API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                  Request Parameters
                                                                                                                  paramexampleinfo
                                                                                                                  before_idins_...Optional pagination parameter. Only records created before the given ID will be included. May not be used with after_id
                                                                                                                  after_idins_...Optional pagination parameter. Only records created after the given ID will be included. May not be used with before_id
                                                                                                                  start_datetime2016-01-02T00:00:00ZOnly return records created after this timestamp. Defaults to 1 month ago, or 1 month before a passed end_datetime
                                                                                                                  end_datetime2016-01-02T00:00:00ZOnly return records created before this timestamp. Defaults to end of the current day, or 1 month after a passed start_datetime
                                                                                                                  page_size30The number of records to return on each page. The maximum value is 100, and default is 20.
                                                                                                                  Example
                                                                                                                  package insurances;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.InsuranceCollection;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  import java.util.HashMap;
                                                                                                                  
                                                                                                                  public class All {
                                                                                                                      public static void main(String[] args) throws EasyPostException {
                                                                                                                          EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                  
                                                                                                                          HashMap<String, Object> params = new HashMap<>();
                                                                                                                          params.put("page_size", 5);
                                                                                                                  
                                                                                                                          InsuranceCollection insurances = client.insurance.all(params);
                                                                                                                  
                                                                                                                          System.out.println(insurances);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "insurances": [
                                                                                                                      {
                                                                                                                        "id": "ins_2500e29183a64136b84a1e44ff08905f",
                                                                                                                        "object": "Insurance",
                                                                                                                        "mode": "test",
                                                                                                                        "reference": null,
                                                                                                                        "status": "pending",
                                                                                                                        "amount": "100.00000",
                                                                                                                        "provider": "easypost",
                                                                                                                        "provider_id": null,
                                                                                                                        "to_address": {
                                                                                                                          "id": "adr_568c1ebcba4c11ee96cd3cecef1b359e",
                                                                                                                          "object": "Address",
                                                                                                                          "created_at": "2024-01-24T00:05:52+00:00",
                                                                                                                          "updated_at": "2024-01-24T00:05:52+00:00",
                                                                                                                          "name": "DR. STEVE BRULE",
                                                                                                                          "company": null,
                                                                                                                          "street1": "179 N HARBOR DR",
                                                                                                                          "street2": null,
                                                                                                                          "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"
                                                                                                                              }
                                                                                                                            }
                                                                                                                          }
                                                                                                                        },
                                                                                                                        "from_address": {
                                                                                                                          "id": "adr_56912a8aba4c11ee96cf3cecef1b359e",
                                                                                                                          "object": "Address",
                                                                                                                          "created_at": "2024-01-24T00:05:52+00:00",
                                                                                                                          "updated_at": "2024-01-24T00:05:52+00:00",
                                                                                                                          "name": "EASYPOST",
                                                                                                                          "company": null,
                                                                                                                          "street1": "417 MONTGOMERY ST # 5",
                                                                                                                          "street2": null,
                                                                                                                          "city": "SAN FRANCISCO",
                                                                                                                          "state": "CA",
                                                                                                                          "zip": "94104-1129",
                                                                                                                          "country": "US",
                                                                                                                          "phone": "4153334445",
                                                                                                                          "email": "SUPPORT@EASYPOST.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": 37.79342,
                                                                                                                                "longitude": -122.40288,
                                                                                                                                "time_zone": "America/Los_Angeles"
                                                                                                                              }
                                                                                                                            }
                                                                                                                          }
                                                                                                                        },
                                                                                                                        "shipment_id": null,
                                                                                                                        "tracker": {
                                                                                                                          "id": "trk_48fb9b6e8270488397cabd1ee6feccd6",
                                                                                                                          "object": "Tracker",
                                                                                                                          "mode": "test",
                                                                                                                          "tracking_code": "9400110898825022579493",
                                                                                                                          "status": "error",
                                                                                                                          "status_detail": null,
                                                                                                                          "created_at": "2024-01-24T00:05:52Z",
                                                                                                                          "updated_at": "2024-01-24T00:05:52Z",
                                                                                                                          "signed_by": null,
                                                                                                                          "weight": null,
                                                                                                                          "est_delivery_date": null,
                                                                                                                          "shipment_id": null,
                                                                                                                          "carrier": "USPS",
                                                                                                                          "tracking_details": [
                                                                                                                            {
                                                                                                                              "object": "TrackingDetail",
                                                                                                                              "message": "In test mode, only test tracking numbers are valid. Test tracking numbers are EZ1000000001, EZ2000000002, ... , EZ7000000007",
                                                                                                                              "description": "",
                                                                                                                              "status": "error",
                                                                                                                              "status_detail": null,
                                                                                                                              "datetime": "2024-01-24T00:05:52Z",
                                                                                                                              "source": "ProcessingError",
                                                                                                                              "carrier_code": "",
                                                                                                                              "tracking_location": {
                                                                                                                                "object": "TrackingLocation",
                                                                                                                                "city": null,
                                                                                                                                "state": null,
                                                                                                                                "country": null,
                                                                                                                                "zip": null
                                                                                                                              }
                                                                                                                            }
                                                                                                                          ],
                                                                                                                          "carrier_detail": null,
                                                                                                                          "finalized": true,
                                                                                                                          "is_return": false,
                                                                                                                          "public_url": "https://track.easypost.com/djE6dHJrXzQ4ZmI5YjZlODI3MDQ4ODM5N2NhYmQxZWU2ZmVjY2Q2",
                                                                                                                          "fees": []
                                                                                                                        },
                                                                                                                        "tracking_code": "9400110898825022579493",
                                                                                                                        "fee": {
                                                                                                                          "object": "Fee",
                                                                                                                          "type": "InsuranceFee",
                                                                                                                          "amount": "0.50000",
                                                                                                                          "charged": true,
                                                                                                                          "refunded": false
                                                                                                                        },
                                                                                                                        "messages": [],
                                                                                                                        "created_at": "2024-01-24T00:05:52Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:52Z"
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "has_more": true
                                                                                                                  }
                                                                                                                  GET/insurances/:id

                                                                                                                  Retrieve an Insurance

                                                                                                                  Retrieve an Insurance by id.

                                                                                                                  Request Parameters
                                                                                                                  paramexampleinfo
                                                                                                                  idins_...Unique, starts with "ins_"
                                                                                                                  Example
                                                                                                                  package insurances;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Insurance;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  public class Retrieve {
                                                                                                                      public static void main(String[] args) throws EasyPostException {
                                                                                                                          EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                  
                                                                                                                          Insurance insurance = client.insurance.retrieve("ins_...");
                                                                                                                  
                                                                                                                          System.out.println(insurance);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "id": "ins_2500e29183a64136b84a1e44ff08905f",
                                                                                                                    "object": "Insurance",
                                                                                                                    "mode": "test",
                                                                                                                    "reference": null,
                                                                                                                    "status": "pending",
                                                                                                                    "amount": "100.00000",
                                                                                                                    "provider": "easypost",
                                                                                                                    "provider_id": null,
                                                                                                                    "to_address": {
                                                                                                                      "id": "adr_568c1ebcba4c11ee96cd3cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "name": "DR. STEVE BRULE",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N HARBOR DR",
                                                                                                                      "street2": null,
                                                                                                                      "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"
                                                                                                                          }
                                                                                                                        }
                                                                                                                      }
                                                                                                                    },
                                                                                                                    "from_address": {
                                                                                                                      "id": "adr_56912a8aba4c11ee96cf3cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "name": "EASYPOST",
                                                                                                                      "company": null,
                                                                                                                      "street1": "417 MONTGOMERY ST # 5",
                                                                                                                      "street2": null,
                                                                                                                      "city": "SAN FRANCISCO",
                                                                                                                      "state": "CA",
                                                                                                                      "zip": "94104-1129",
                                                                                                                      "country": "US",
                                                                                                                      "phone": "4153334445",
                                                                                                                      "email": "SUPPORT@EASYPOST.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": 37.79342,
                                                                                                                            "longitude": -122.40288,
                                                                                                                            "time_zone": "America/Los_Angeles"
                                                                                                                          }
                                                                                                                        }
                                                                                                                      }
                                                                                                                    },
                                                                                                                    "shipment_id": null,
                                                                                                                    "tracker": {
                                                                                                                      "id": "trk_48fb9b6e8270488397cabd1ee6feccd6",
                                                                                                                      "object": "Tracker",
                                                                                                                      "mode": "test",
                                                                                                                      "tracking_code": "9400110898825022579493",
                                                                                                                      "status": "error",
                                                                                                                      "status_detail": null,
                                                                                                                      "created_at": "2024-01-24T00:05:52Z",
                                                                                                                      "updated_at": "2024-01-24T00:05:52Z",
                                                                                                                      "signed_by": null,
                                                                                                                      "weight": null,
                                                                                                                      "est_delivery_date": null,
                                                                                                                      "shipment_id": null,
                                                                                                                      "carrier": "USPS",
                                                                                                                      "tracking_details": [
                                                                                                                        {
                                                                                                                          "object": "TrackingDetail",
                                                                                                                          "message": "In test mode, only test tracking numbers are valid. Test tracking numbers are EZ1000000001, EZ2000000002, ... , EZ7000000007",
                                                                                                                          "description": "",
                                                                                                                          "status": "error",
                                                                                                                          "status_detail": null,
                                                                                                                          "datetime": "2024-01-24T00:05:52Z",
                                                                                                                          "source": "ProcessingError",
                                                                                                                          "carrier_code": "",
                                                                                                                          "tracking_location": {
                                                                                                                            "object": "TrackingLocation",
                                                                                                                            "city": null,
                                                                                                                            "state": null,
                                                                                                                            "country": null,
                                                                                                                            "zip": null
                                                                                                                          }
                                                                                                                        }
                                                                                                                      ],
                                                                                                                      "carrier_detail": null,
                                                                                                                      "finalized": true,
                                                                                                                      "is_return": false,
                                                                                                                      "public_url": "https://track.easypost.com/djE6dHJrXzQ4ZmI5YjZlODI3MDQ4ODM5N2NhYmQxZWU2ZmVjY2Q2",
                                                                                                                      "fees": []
                                                                                                                    },
                                                                                                                    "tracking_code": "9400110898825022579493",
                                                                                                                    "fee": {
                                                                                                                      "object": "Fee",
                                                                                                                      "type": "InsuranceFee",
                                                                                                                      "amount": "0.50000",
                                                                                                                      "charged": true,
                                                                                                                      "refunded": false
                                                                                                                    },
                                                                                                                    "messages": [],
                                                                                                                    "created_at": "2024-01-24T00:05:52Z",
                                                                                                                    "updated_at": "2024-01-24T00:05:52Z"
                                                                                                                  }
                                                                                                                  POST/insurances/:id/refund

                                                                                                                  Refund an Insurance

                                                                                                                  Refunding Insurance is only available for standalone insurance purchased through EasyPost. The tracking status for the insurance must be either pre_transit, cancelled, or unknown in order to be eligible.

                                                                                                                  Request Parameters
                                                                                                                  paramexampleinfo
                                                                                                                  idins_...Unique, starts with "ins_"
                                                                                                                  Example
                                                                                                                  package insurances;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Insurance;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  public class Retrieve {
                                                                                                                      public static void main(String[] args) throws EasyPostException {
                                                                                                                          EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                  
                                                                                                                          Insurance insurance = client.insurance.refund("ins_...");
                                                                                                                  
                                                                                                                          System.out.println(insurance);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "id": "ins_2500e29183a64136b84a1e44ff08905f",
                                                                                                                    "object": "Insurance",
                                                                                                                    "mode": "test",
                                                                                                                    "reference": null,
                                                                                                                    "status": "cancelled",
                                                                                                                    "amount": "100.00000",
                                                                                                                    "provider": "easypost",
                                                                                                                    "provider_id": null,
                                                                                                                    "to_address": {
                                                                                                                      "id": "adr_568c1ebcba4c11ee96cd3cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "name": "DR. STEVE BRULE",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N HARBOR DR",
                                                                                                                      "street2": null,
                                                                                                                      "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"
                                                                                                                          }
                                                                                                                        }
                                                                                                                      }
                                                                                                                    },
                                                                                                                    "from_address": {
                                                                                                                      "id": "adr_56912a8aba4c11ee96cf3cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:52+00:00",
                                                                                                                      "name": "EASYPOST",
                                                                                                                      "company": null,
                                                                                                                      "street1": "417 MONTGOMERY ST # 5",
                                                                                                                      "street2": null,
                                                                                                                      "city": "SAN FRANCISCO",
                                                                                                                      "state": "CA",
                                                                                                                      "zip": "94104-1129",
                                                                                                                      "country": "US",
                                                                                                                      "phone": "4153334445",
                                                                                                                      "email": "SUPPORT@EASYPOST.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": 37.79342,
                                                                                                                            "longitude": -122.40288,
                                                                                                                            "time_zone": "America/Los_Angeles"
                                                                                                                          }
                                                                                                                        }
                                                                                                                      }
                                                                                                                    },
                                                                                                                    "shipment_id": null,
                                                                                                                    "tracker": {
                                                                                                                      "id": "trk_48fb9b6e8270488397cabd1ee6feccd6",
                                                                                                                      "object": "Tracker",
                                                                                                                      "mode": "test",
                                                                                                                      "tracking_code": "9400110898825022579493",
                                                                                                                      "status": "error",
                                                                                                                      "status_detail": null,
                                                                                                                      "created_at": "2024-01-24T00:05:52Z",
                                                                                                                      "updated_at": "2024-01-24T00:05:52Z",
                                                                                                                      "signed_by": null,
                                                                                                                      "weight": null,
                                                                                                                      "est_delivery_date": null,
                                                                                                                      "shipment_id": null,
                                                                                                                      "carrier": "USPS",
                                                                                                                      "tracking_details": [
                                                                                                                        {
                                                                                                                          "object": "TrackingDetail",
                                                                                                                          "message": "In test mode, only test tracking numbers are valid. Test tracking numbers are EZ1000000001, EZ2000000002, ... , EZ7000000007",
                                                                                                                          "description": "",
                                                                                                                          "status": "error",
                                                                                                                          "status_detail": null,
                                                                                                                          "datetime": "2024-01-24T00:05:52Z",
                                                                                                                          "source": "ProcessingError",
                                                                                                                          "carrier_code": "",
                                                                                                                          "tracking_location": {
                                                                                                                            "object": "TrackingLocation",
                                                                                                                            "city": null,
                                                                                                                            "state": null,
                                                                                                                            "country": null,
                                                                                                                            "zip": null
                                                                                                                          }
                                                                                                                        }
                                                                                                                      ],
                                                                                                                      "carrier_detail": null,
                                                                                                                      "finalized": true,
                                                                                                                      "is_return": false,
                                                                                                                      "public_url": "https://track.easypost.com/djE6dHJrXzQ4ZmI5YjZlODI3MDQ4ODM5N2NhYmQxZWU2ZmVjY2Q2",
                                                                                                                      "fees": []
                                                                                                                    },
                                                                                                                    "tracking_code": "9400110898825022579493",
                                                                                                                    "fee": {
                                                                                                                      "object": "Fee",
                                                                                                                      "type": "InsuranceFee",
                                                                                                                      "amount": "0.50000",
                                                                                                                      "charged": true,
                                                                                                                      "refunded": false
                                                                                                                    },
                                                                                                                    "messages": ["Insurance was cancelled by the user."],
                                                                                                                    "created_at": "2024-01-24T00:05:52Z",
                                                                                                                    "updated_at": "2024-01-24T00:05:52Z"
                                                                                                                  }

                                                                                                                  Shipments

                                                                                                                  The workhorse of the EasyPost API, a Shipment is made up of a "to" and "from" Address, the Parcel being shipped, and any customs forms required for international deliveries. Once created a Shipment object is used to retrieve shipping Rates and purchase a label.

                                                                                                                  A Shipment created with a valid to_address, from_address, and parcel will automatically populate its rates attribute.

                                                                                                                  Shipment Object

                                                                                                                  attributetypespecification
                                                                                                                  idstringUnique, begins with "shp_"
                                                                                                                  objectstring"Shipment"
                                                                                                                  referencestringAn optional field that may be used in place of id in other API endpoints
                                                                                                                  modestring"test" or "production"
                                                                                                                  to_addressAddressThe destination address
                                                                                                                  from_addressAddressThe origin address
                                                                                                                  return_addressAddressThe shipper's address, defaults to from_address
                                                                                                                  buyer_addressAddressThe buyer's address, defaults to to_address
                                                                                                                  parcelParcelThe dimensions and weight of the package
                                                                                                                  customs_infoCustomsInfoInformation for the processing of customs
                                                                                                                  scan_formScanFormDocument created to manifest and scan multiple shipments
                                                                                                                  formsForm arrayAll associated Form objects
                                                                                                                  insurancestringThe associated Insurance amount
                                                                                                                  ratesRate arrayAll associated Rate objects
                                                                                                                  selected_rateRateThe specific rate purchased for the shipment, or null if unpurchased or purchased through another mechanism
                                                                                                                  postage_labelPostageLabelThe associated PostageLabel object
                                                                                                                  messagesMessage arrayAny carrier errors encountered during rating, discussed in more depth below
                                                                                                                  optionsOptionsAll of the options passed to the shipment, discussed in more depth below
                                                                                                                  is_returnbooleanSet true to create as a return, discussed in more depth below
                                                                                                                  tracking_codestringIf purchased, the tracking code will appear here as well as within the Tracker object
                                                                                                                  usps_zoneintegerThe USPS zone of the shipment, if purchased with USPS
                                                                                                                  statusstringThe current status of the shipment, possible values are "unknown", "pre_transit", "in_transit", "out_for_delivery", "delivered", "available_for_pickup", "return_to_sender", "failure", "cancelled" or "error"
                                                                                                                  trackerTrackerThe associated Tracker object
                                                                                                                  feesFee arrayThe associated Fee objects charged to the billing user account
                                                                                                                  refund_statusstringThe current status of the shipment refund process. Possible values are "submitted", "refunded", "rejected".
                                                                                                                  batch_idstringThe ID of the batch that contains this shipment, if any
                                                                                                                  batch_statusstringThe current status of the associated BatchShipment
                                                                                                                  batch_messagestringThe current message of the associated BatchShipment
                                                                                                                  created_atdatetime
                                                                                                                  updated_atdatetime

                                                                                                                  Form Object

                                                                                                                  attributetypespecification
                                                                                                                  idstringUnique, begins with "form_"
                                                                                                                  objectstring"Form"
                                                                                                                  modestring"test" or "production"
                                                                                                                  form_typestringThe type of form that we returned, can be one of "high_value_report", "commercial_invoice", "cod_return_label", "order_summary", "cn22"
                                                                                                                  form_urlstringThe address we return the form back at
                                                                                                                  submitted_electronicallybooleanIf we have submitted the form to the carrier on behalf of the customer
                                                                                                                  created_atdatetime
                                                                                                                  updated_atdatetime

                                                                                                                  PostageLabel Object

                                                                                                                  attributetypespecification
                                                                                                                  idstringUnique, begins with "pl_"
                                                                                                                  objectstring"PostageLabel"
                                                                                                                  label_datedatetimeThe date that appears on the postage label
                                                                                                                  label_epl2_urlstringThe URL of the EPL2 label file
                                                                                                                  label_file_typestringFile type of the label
                                                                                                                  label_pdf_urlstringThe URL of the PDF label file
                                                                                                                  label_resolutionintegerThe resolution of the label
                                                                                                                  label_sizestringThe size of the label
                                                                                                                  label_typestringThe type of the label
                                                                                                                  label_urlstringThe URL of the label file
                                                                                                                  label_zpl_urlstringThe URL of the ZPL label file
                                                                                                                  created_atdatetime
                                                                                                                  updated_atdatetime
                                                                                                                  POST/shipments

                                                                                                                  Create a Shipment

                                                                                                                  A Shipment is almost exclusively a container for other objects, and thus a Shipment may reuse many of these objects. Additionally, all the objects contained within a Shipment may be created at the same time.

                                                                                                                  The origin/destination Address and Parcel are required for rating. CustomInfo is required to rate an international Shipment, this includes when the destination is a US Territory. The associated Tracker, Fee, and Rates are generated by EasyPost and cannot be modified by the user.

                                                                                                                  You can limit the CarrierAccounts to use for rating by passing the carrier_accounts parameter. If the CarrierAccount IDs provided are invalid or disabled, the shipment creation call will result in an error.

                                                                                                                  Request Parameters
                                                                                                                  paramexampleinfo
                                                                                                                  reference"my-reference"An optional field that may be used in place of id in other API endpoints
                                                                                                                  to_address<Address>Can be specified by ID or attributes to create a new one, and be verified inline. See Create and Verify Address
                                                                                                                  from_address<Address>Can be specified by ID or attributes to create a new one, and be verified inline. See Create and Verify Address
                                                                                                                  parcel<Parcel>The dimensions and weight of the package
                                                                                                                  carrier_accounts["ca_...", ...]List of carrier accounts
                                                                                                                  Example
                                                                                                                  package shipments;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Shipment;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  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> toAddressMap = new HashMap<String, Object>();
                                                                                                                          toAddressMap.put("name", "Dr. Steve Brule");
                                                                                                                          toAddressMap.put("street1", "179 N Harbor Dr");
                                                                                                                          toAddressMap.put("city", "Redondo Beach");
                                                                                                                          toAddressMap.put("state", "CA");
                                                                                                                          toAddressMap.put("country", "US");
                                                                                                                          toAddressMap.put("phone", "8573875756");
                                                                                                                          toAddressMap.put("email", "dr_steve_brule@gmail.com");
                                                                                                                          toAddressMap.put("zip", "90277");
                                                                                                                  
                                                                                                                          HashMap<String, Object> fromAddressMap = new HashMap<String, Object>();
                                                                                                                          fromAddressMap.put("name", "EasyPost");
                                                                                                                          fromAddressMap.put("street1", "417 Montgomery Street");
                                                                                                                          fromAddressMap.put("street2", "5th Floor");
                                                                                                                          fromAddressMap.put("city", "San Francisco");
                                                                                                                          fromAddressMap.put("state", "CA");
                                                                                                                          fromAddressMap.put("zip", "94104");
                                                                                                                          fromAddressMap.put("country", "US");
                                                                                                                          fromAddressMap.put("phone", "4153334445");
                                                                                                                          fromAddressMap.put("email", "support@easypost.com");
                                                                                                                  
                                                                                                                          HashMap<String, Object> parcelMap = new HashMap<String, Object>();
                                                                                                                          parcelMap.put("length", 20.2);
                                                                                                                          parcelMap.put("width", 10.9);
                                                                                                                          parcelMap.put("height", 5);
                                                                                                                          parcelMap.put("weight", 65.9);
                                                                                                                  
                                                                                                                          HashMap<String, Object> customsInfoMap = new HashMap<String, Object>();
                                                                                                                          customsInfoMap.put("id", "cstinfo_...");
                                                                                                                  
                                                                                                                          HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                          params.put("to_address", toAddressMap);
                                                                                                                          params.put("from_address", fromAddressMap);
                                                                                                                          params.put("parcel", parcelMap);
                                                                                                                          params.put("customs_info", customsInfoMap);
                                                                                                                  
                                                                                                                          Shipment shipment = client.shipment.create(params);
                                                                                                                  
                                                                                                                          System.out.println(shipment);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "created_at": "2024-01-24T00:07:30Z",
                                                                                                                    "is_return": false,
                                                                                                                    "messages": [],
                                                                                                                    "mode": "test",
                                                                                                                    "options": {
                                                                                                                      "currency": "USD",
                                                                                                                      "payment": {
                                                                                                                        "type": "SENDER"
                                                                                                                      },
                                                                                                                      "date_advance": 0
                                                                                                                    },
                                                                                                                    "reference": null,
                                                                                                                    "status": "unknown",
                                                                                                                    "tracking_code": null,
                                                                                                                    "updated_at": "2024-01-24T00:07:30Z",
                                                                                                                    "batch_id": null,
                                                                                                                    "batch_status": null,
                                                                                                                    "batch_message": null,
                                                                                                                    "customs_info": {
                                                                                                                      "id": "cstinfo_657b430669ef456584bc4b82b3271084",
                                                                                                                      "object": "CustomsInfo",
                                                                                                                      "created_at": "2024-01-24T00:07:30Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:30Z",
                                                                                                                      "contents_explanation": "",
                                                                                                                      "contents_type": "merchandise",
                                                                                                                      "customs_certify": true,
                                                                                                                      "customs_signer": "Steve Brule",
                                                                                                                      "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                      "non_delivery_option": "return",
                                                                                                                      "restriction_comments": null,
                                                                                                                      "restriction_type": "none",
                                                                                                                      "mode": "test",
                                                                                                                      "declaration": null,
                                                                                                                      "customs_items": [
                                                                                                                        {
                                                                                                                          "id": "cstitem_046758e6b61847f99623c4d2290a26bd",
                                                                                                                          "object": "CustomsItem",
                                                                                                                          "created_at": "2024-01-24T00:07:30Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:30Z",
                                                                                                                          "description": "T-shirt",
                                                                                                                          "hs_tariff_number": "123456",
                                                                                                                          "origin_country": "US",
                                                                                                                          "quantity": 1,
                                                                                                                          "value": "10.0",
                                                                                                                          "weight": 5.0,
                                                                                                                          "code": "123",
                                                                                                                          "mode": "test",
                                                                                                                          "manufacturer": null,
                                                                                                                          "currency": null,
                                                                                                                          "eccn": null,
                                                                                                                          "printed_commodity_identifier": null
                                                                                                                        }
                                                                                                                      ]
                                                                                                                    },
                                                                                                                    "from_address": {
                                                                                                                      "id": "adr_90e0406bba4c11eea7d53cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:30+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:30+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": null,
                                                                                                                    "parcel": {
                                                                                                                      "id": "prcl_4dde100b45af43acbe9c68244fa51851",
                                                                                                                      "object": "Parcel",
                                                                                                                      "created_at": "2024-01-24T00:07:30Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:30Z",
                                                                                                                      "length": 20.2,
                                                                                                                      "width": 10.9,
                                                                                                                      "height": 5.0,
                                                                                                                      "predefined_package": null,
                                                                                                                      "weight": 65.9,
                                                                                                                      "mode": "test"
                                                                                                                    },
                                                                                                                    "postage_label": null,
                                                                                                                    "rates": [
                                                                                                                      {
                                                                                                                        "id": "rate_3cbb8d9c4ea1477588a17b0ee3e0c5b4",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:30Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:30Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Express",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "49.60",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "57.40",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "49.60",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": null,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": null,
                                                                                                                        "shipment_id": "shp_93170d48eb1a413aa5c0d8bf4384a350",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_c9e1a6c4be1e40a7af83b42d1115c550",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:30Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:30Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Priority",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "7.33",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "15.20",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "10.89",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 2,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 2,
                                                                                                                        "shipment_id": "shp_93170d48eb1a413aa5c0d8bf4384a350",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_a39910cfd937402fb77a9eaed223dcfe",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:30Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:30Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "GroundAdvantage",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_93170d48eb1a413aa5c0d8bf4384a350",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_d0b494c33c3e42f893b619d730f24058",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:30Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:30Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "First",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_93170d48eb1a413aa5c0d8bf4384a350",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_dad1a54ef6f64dfc9def001cbbb2b142",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:30Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:30Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "ParcelSelect",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_93170d48eb1a413aa5c0d8bf4384a350",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "refund_status": null,
                                                                                                                    "scan_form": null,
                                                                                                                    "selected_rate": null,
                                                                                                                    "tracker": null,
                                                                                                                    "to_address": {
                                                                                                                      "id": "adr_90dd5fb4ba4c11ee9e88ac1f6bc539ae",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:30+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:30+00:00",
                                                                                                                      "name": "Dr. Steve Brule",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N Harbor Dr",
                                                                                                                      "street2": null,
                                                                                                                      "city": "Redondo Beach",
                                                                                                                      "state": "CA",
                                                                                                                      "zip": "90277",
                                                                                                                      "country": "US",
                                                                                                                      "phone": "8573875756",
                                                                                                                      "email": "dr_steve_brule@gmail.com",
                                                                                                                      "mode": "test",
                                                                                                                      "carrier_facility": null,
                                                                                                                      "residential": null,
                                                                                                                      "federal_tax_id": null,
                                                                                                                      "state_tax_id": null,
                                                                                                                      "verifications": {}
                                                                                                                    },
                                                                                                                    "usps_zone": 4,
                                                                                                                    "return_address": {
                                                                                                                      "id": "adr_90e0406bba4c11eea7d53cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:30+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:30+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_90dd5fb4ba4c11ee9e88ac1f6bc539ae",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:30+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:30+00:00",
                                                                                                                      "name": "Dr. Steve Brule",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N Harbor Dr",
                                                                                                                      "street2": null,
                                                                                                                      "city": "Redondo Beach",
                                                                                                                      "state": "CA",
                                                                                                                      "zip": "90277",
                                                                                                                      "country": "US",
                                                                                                                      "phone": "8573875756",
                                                                                                                      "email": "dr_steve_brule@gmail.com",
                                                                                                                      "mode": "test",
                                                                                                                      "carrier_facility": null,
                                                                                                                      "residential": null,
                                                                                                                      "federal_tax_id": null,
                                                                                                                      "state_tax_id": null,
                                                                                                                      "verifications": {}
                                                                                                                    },
                                                                                                                    "forms": [],
                                                                                                                    "fees": [],
                                                                                                                    "id": "shp_93170d48eb1a413aa5c0d8bf4384a350",
                                                                                                                    "object": "Shipment"
                                                                                                                  }
                                                                                                                  GET/shipments

                                                                                                                  Retrieve a list of Shipments

                                                                                                                  The Shipment List is a paginated list of all Shipment objects associated with the given API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                  Request Parameters
                                                                                                                  paramexampleinfo
                                                                                                                  before_idshp_...Optional pagination parameter. Only shipments created before the given ID will be included. May not be used with after_id
                                                                                                                  after_idshp_...Optional pagination parameter. Only shipments created after the given ID will be included. May not be used with before_id
                                                                                                                  start_datetime2016-01-02T00:00:00ZOnly return Shipments created after this timestamp. Defaults to 1 month ago, or 1 month before a passed end_datetime
                                                                                                                  end_datetime2016-01-02T00:00:00ZOnly return Shipments created before this timestamp. Defaults to end of the current day, or 1 month after a passed start_datetime
                                                                                                                  page_size20The number of shipments to return on each page. The maximum value is 100
                                                                                                                  purchasedtrueOnly include Shipments that have been purchased. Default is true
                                                                                                                  include_childrenfalseAlso include Shipments created by Child Users. Defaults to false
                                                                                                                  Example
                                                                                                                  package shipments;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.ShipmentCollection;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  import java.util.HashMap;
                                                                                                                  
                                                                                                                  public class All {
                                                                                                                      public static void main(String[] args) throws EasyPostException {
                                                                                                                          EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                  
                                                                                                                          HashMap<String, Object> params = new HashMap<>();
                                                                                                                          params.put("page_size", 5);
                                                                                                                  
                                                                                                                          ShipmentCollection shipments = client.shipment.all(params);
                                                                                                                  
                                                                                                                          System.out.println(shipments);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "shipments": [
                                                                                                                      {
                                                                                                                        "created_at": "2024-01-24T00:07:28Z",
                                                                                                                        "is_return": false,
                                                                                                                        "messages": [],
                                                                                                                        "mode": "test",
                                                                                                                        "options": {
                                                                                                                          "currency": "USD",
                                                                                                                          "payment": {
                                                                                                                            "type": "SENDER"
                                                                                                                          },
                                                                                                                          "date_advance": 0
                                                                                                                        },
                                                                                                                        "reference": null,
                                                                                                                        "status": "unknown",
                                                                                                                        "tracking_code": "9405500207552011812825",
                                                                                                                        "updated_at": "2024-01-24T00:07:29Z",
                                                                                                                        "batch_id": "batch_83009a1272fa48ffb1a3d29074a16960",
                                                                                                                        "batch_status": "postage_purchased",
                                                                                                                        "batch_message": null,
                                                                                                                        "customs_info": {
                                                                                                                          "id": "cstinfo_916710a3039140c5a6e7f2f812ef83d7",
                                                                                                                          "object": "CustomsInfo",
                                                                                                                          "created_at": "2024-01-24T00:07:28Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:28Z",
                                                                                                                          "contents_explanation": "",
                                                                                                                          "contents_type": "merchandise",
                                                                                                                          "customs_certify": true,
                                                                                                                          "customs_signer": "Steve Brule",
                                                                                                                          "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                          "non_delivery_option": "return",
                                                                                                                          "restriction_comments": null,
                                                                                                                          "restriction_type": "none",
                                                                                                                          "mode": "test",
                                                                                                                          "declaration": null,
                                                                                                                          "customs_items": [
                                                                                                                            {
                                                                                                                              "id": "cstitem_eead7973a2d644189ebd7c8f11f9647a",
                                                                                                                              "object": "CustomsItem",
                                                                                                                              "created_at": "2024-01-24T00:07:28Z",
                                                                                                                              "updated_at": "2024-01-24T00:07:28Z",
                                                                                                                              "description": "T-shirt",
                                                                                                                              "hs_tariff_number": "123456",
                                                                                                                              "origin_country": "US",
                                                                                                                              "quantity": 1,
                                                                                                                              "value": "10.0",
                                                                                                                              "weight": 5.0,
                                                                                                                              "code": "123",
                                                                                                                              "mode": "test",
                                                                                                                              "manufacturer": null,
                                                                                                                              "currency": null,
                                                                                                                              "eccn": null,
                                                                                                                              "printed_commodity_identifier": null
                                                                                                                            }
                                                                                                                          ]
                                                                                                                        },
                                                                                                                        "from_address": {
                                                                                                                          "id": "adr_8f5e7e74ba4c11ee8bd0ac1f6bc53342",
                                                                                                                          "object": "Address",
                                                                                                                          "created_at": "2024-01-24T00:07:28+00:00",
                                                                                                                          "updated_at": "2024-01-24T00:07:28+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": null,
                                                                                                                        "parcel": {
                                                                                                                          "id": "prcl_bba0f7cc48d64a299938fef3a3e0b9a0",
                                                                                                                          "object": "Parcel",
                                                                                                                          "created_at": "2024-01-24T00:07:28Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:28Z",
                                                                                                                          "length": 20.2,
                                                                                                                          "width": 10.9,
                                                                                                                          "height": 5.0,
                                                                                                                          "predefined_package": null,
                                                                                                                          "weight": 65.9,
                                                                                                                          "mode": "test"
                                                                                                                        },
                                                                                                                        "postage_label": {
                                                                                                                          "object": "PostageLabel",
                                                                                                                          "id": "pl_9562571fa39b4e49892a8c60f12be255",
                                                                                                                          "created_at": "2024-01-24T00:07:28Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:28Z",
                                                                                                                          "date_advance": 0,
                                                                                                                          "integrated_form": "none",
                                                                                                                          "label_date": "2024-01-24T00:07:28Z",
                                                                                                                          "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/20240124/e8a95864fe9ec34eeabf5fc2ad415fda5d.png",
                                                                                                                          "label_pdf_url": null,
                                                                                                                          "label_zpl_url": null,
                                                                                                                          "label_epl2_url": null,
                                                                                                                          "label_file": null
                                                                                                                        },
                                                                                                                        "rates": [
                                                                                                                          {
                                                                                                                            "id": "rate_15a03f25e00d49a098da8d40c8e1719e",
                                                                                                                            "object": "Rate",
                                                                                                                            "created_at": "2024-01-24T00:07:28Z",
                                                                                                                            "updated_at": "2024-01-24T00:07:28Z",
                                                                                                                            "mode": "test",
                                                                                                                            "service": "Express",
                                                                                                                            "carrier": "USPS",
                                                                                                                            "rate": "49.60",
                                                                                                                            "currency": "USD",
                                                                                                                            "retail_rate": "57.40",
                                                                                                                            "retail_currency": "USD",
                                                                                                                            "list_rate": "49.60",
                                                                                                                            "list_currency": "USD",
                                                                                                                            "billing_type": "easypost",
                                                                                                                            "delivery_days": null,
                                                                                                                            "delivery_date": null,
                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                            "est_delivery_days": null,
                                                                                                                            "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                          },
                                                                                                                          {
                                                                                                                            "id": "rate_edd7e3cedd9d4aa9bd21eb23a740af7d",
                                                                                                                            "object": "Rate",
                                                                                                                            "created_at": "2024-01-24T00:07:28Z",
                                                                                                                            "updated_at": "2024-01-24T00:07:28Z",
                                                                                                                            "mode": "test",
                                                                                                                            "service": "Priority",
                                                                                                                            "carrier": "USPS",
                                                                                                                            "rate": "7.33",
                                                                                                                            "currency": "USD",
                                                                                                                            "retail_rate": "15.20",
                                                                                                                            "retail_currency": "USD",
                                                                                                                            "list_rate": "10.89",
                                                                                                                            "list_currency": "USD",
                                                                                                                            "billing_type": "easypost",
                                                                                                                            "delivery_days": 2,
                                                                                                                            "delivery_date": null,
                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                            "est_delivery_days": 2,
                                                                                                                            "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                          },
                                                                                                                          {
                                                                                                                            "id": "rate_bc0979e7fa314d2b935d8fee9312c766",
                                                                                                                            "object": "Rate",
                                                                                                                            "created_at": "2024-01-24T00:07:28Z",
                                                                                                                            "updated_at": "2024-01-24T00:07:28Z",
                                                                                                                            "mode": "test",
                                                                                                                            "service": "GroundAdvantage",
                                                                                                                            "carrier": "USPS",
                                                                                                                            "rate": "6.79",
                                                                                                                            "currency": "USD",
                                                                                                                            "retail_rate": "13.15",
                                                                                                                            "retail_currency": "USD",
                                                                                                                            "list_rate": "9.41",
                                                                                                                            "list_currency": "USD",
                                                                                                                            "billing_type": "easypost",
                                                                                                                            "delivery_days": 3,
                                                                                                                            "delivery_date": null,
                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                            "est_delivery_days": 3,
                                                                                                                            "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                          },
                                                                                                                          {
                                                                                                                            "id": "rate_418622e2edeb4015b8bbd72fbe2d3ff6",
                                                                                                                            "object": "Rate",
                                                                                                                            "created_at": "2024-01-24T00:07:28Z",
                                                                                                                            "updated_at": "2024-01-24T00:07:28Z",
                                                                                                                            "mode": "test",
                                                                                                                            "service": "First",
                                                                                                                            "carrier": "USPS",
                                                                                                                            "rate": "6.79",
                                                                                                                            "currency": "USD",
                                                                                                                            "retail_rate": "13.15",
                                                                                                                            "retail_currency": "USD",
                                                                                                                            "list_rate": "9.41",
                                                                                                                            "list_currency": "USD",
                                                                                                                            "billing_type": "easypost",
                                                                                                                            "delivery_days": 3,
                                                                                                                            "delivery_date": null,
                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                            "est_delivery_days": 3,
                                                                                                                            "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                          },
                                                                                                                          {
                                                                                                                            "id": "rate_699f9b847989489891a0db1489c6c0f2",
                                                                                                                            "object": "Rate",
                                                                                                                            "created_at": "2024-01-24T00:07:28Z",
                                                                                                                            "updated_at": "2024-01-24T00:07:28Z",
                                                                                                                            "mode": "test",
                                                                                                                            "service": "ParcelSelect",
                                                                                                                            "carrier": "USPS",
                                                                                                                            "rate": "6.79",
                                                                                                                            "currency": "USD",
                                                                                                                            "retail_rate": "13.15",
                                                                                                                            "retail_currency": "USD",
                                                                                                                            "list_rate": "9.41",
                                                                                                                            "list_currency": "USD",
                                                                                                                            "billing_type": "easypost",
                                                                                                                            "delivery_days": 3,
                                                                                                                            "delivery_date": null,
                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                            "est_delivery_days": 3,
                                                                                                                            "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                          }
                                                                                                                        ],
                                                                                                                        "refund_status": null,
                                                                                                                        "scan_form": {
                                                                                                                          "id": "sf_589e52186e9249669c7806912a6ab766",
                                                                                                                          "object": "ScanForm",
                                                                                                                          "created_at": "2024-01-24T00:07:29Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:29Z",
                                                                                                                          "tracking_codes": ["9405500207552011812825"],
                                                                                                                          "address": {
                                                                                                                            "id": "adr_8f5e7e74ba4c11ee8bd0ac1f6bc53342",
                                                                                                                            "object": "Address",
                                                                                                                            "created_at": "2024-01-24T00:07:28+00:00",
                                                                                                                            "updated_at": "2024-01-24T00:07:28+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": {}
                                                                                                                          },
                                                                                                                          "status": "created",
                                                                                                                          "message": null,
                                                                                                                          "form_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240124/e82a4cb71096604dc7bd773b1285d7e9db.pdf",
                                                                                                                          "form_file_type": null,
                                                                                                                          "batch_id": "batch_83009a1272fa48ffb1a3d29074a16960",
                                                                                                                          "confirmation": null
                                                                                                                        },
                                                                                                                        "selected_rate": {
                                                                                                                          "id": "rate_edd7e3cedd9d4aa9bd21eb23a740af7d",
                                                                                                                          "object": "Rate",
                                                                                                                          "created_at": "2024-01-24T00:07:28Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:28Z",
                                                                                                                          "mode": "test",
                                                                                                                          "service": "Priority",
                                                                                                                          "carrier": "USPS",
                                                                                                                          "rate": "7.33",
                                                                                                                          "currency": "USD",
                                                                                                                          "retail_rate": "15.20",
                                                                                                                          "retail_currency": "USD",
                                                                                                                          "list_rate": "10.89",
                                                                                                                          "list_currency": "USD",
                                                                                                                          "billing_type": "easypost",
                                                                                                                          "delivery_days": 2,
                                                                                                                          "delivery_date": null,
                                                                                                                          "delivery_date_guaranteed": false,
                                                                                                                          "est_delivery_days": 2,
                                                                                                                          "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
                                                                                                                          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                        },
                                                                                                                        "tracker": {
                                                                                                                          "id": "trk_c64aa4ee22804cceab41586397c4b833",
                                                                                                                          "object": "Tracker",
                                                                                                                          "mode": "test",
                                                                                                                          "tracking_code": "9405500207552011812825",
                                                                                                                          "status": "pre_transit",
                                                                                                                          "status_detail": "status_update",
                                                                                                                          "created_at": "2024-01-24T00:07:28Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:29Z",
                                                                                                                          "signed_by": null,
                                                                                                                          "weight": null,
                                                                                                                          "est_delivery_date": "2024-01-24T00:07:29Z",
                                                                                                                          "shipment_id": "shp_8631f00640ba4d62b9131da3852a26e4",
                                                                                                                          "carrier": "USPS",
                                                                                                                          "tracking_details": [
                                                                                                                            {
                                                                                                                              "object": "TrackingDetail",
                                                                                                                              "message": "Pre-Shipment Info Sent to USPS",
                                                                                                                              "description": "",
                                                                                                                              "status": "pre_transit",
                                                                                                                              "status_detail": "status_update",
                                                                                                                              "datetime": "2023-12-24T00:07:29Z",
                                                                                                                              "source": "USPS",
                                                                                                                              "carrier_code": "",
                                                                                                                              "tracking_location": {
                                                                                                                                "object": "TrackingLocation",
                                                                                                                                "city": null,
                                                                                                                                "state": null,
                                                                                                                                "country": null,
                                                                                                                                "zip": null
                                                                                                                              }
                                                                                                                            },
                                                                                                                            {
                                                                                                                              "object": "TrackingDetail",
                                                                                                                              "message": "Shipping Label Created",
                                                                                                                              "description": "",
                                                                                                                              "status": "pre_transit",
                                                                                                                              "status_detail": "status_update",
                                                                                                                              "datetime": "2023-12-24T12:44:29Z",
                                                                                                                              "source": "USPS",
                                                                                                                              "carrier_code": "",
                                                                                                                              "tracking_location": {
                                                                                                                                "object": "TrackingLocation",
                                                                                                                                "city": "HOUSTON",
                                                                                                                                "state": "TX",
                                                                                                                                "country": null,
                                                                                                                                "zip": "77063"
                                                                                                                              }
                                                                                                                            }
                                                                                                                          ],
                                                                                                                          "fees": [],
                                                                                                                          "carrier_detail": {
                                                                                                                            "object": "CarrierDetail",
                                                                                                                            "service": "First-Class Package Service",
                                                                                                                            "container_type": null,
                                                                                                                            "est_delivery_date_local": null,
                                                                                                                            "est_delivery_time_local": null,
                                                                                                                            "origin_location": "HOUSTON TX, 77001",
                                                                                                                            "origin_tracking_location": {
                                                                                                                              "object": "TrackingLocation",
                                                                                                                              "city": "HOUSTON",
                                                                                                                              "state": "TX",
                                                                                                                              "country": null,
                                                                                                                              "zip": "77063"
                                                                                                                            },
                                                                                                                            "destination_location": "CHARLESTON SC, 29401",
                                                                                                                            "destination_tracking_location": null,
                                                                                                                            "guaranteed_delivery_date": null,
                                                                                                                            "alternate_identifier": null,
                                                                                                                            "initial_delivery_attempt": null
                                                                                                                          },
                                                                                                                          "public_url": "https://track.easypost.com/djE6dHJrX2M2NGFhNGVlMjI4MDRjY2VhYjQxNTg2Mzk3YzRiODMz"
                                                                                                                        },
                                                                                                                        "to_address": {
                                                                                                                          "id": "adr_8f5bb1f5ba4c11eeb6a1ac1f6bc539aa",
                                                                                                                          "object": "Address",
                                                                                                                          "created_at": "2024-01-24T00:07:28+00:00",
                                                                                                                          "updated_at": "2024-01-24T00:07:28+00:00",
                                                                                                                          "name": "DR. STEVE BRULE",
                                                                                                                          "company": null,
                                                                                                                          "street1": "179 N HARBOR DR",
                                                                                                                          "street2": null,
                                                                                                                          "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_8f5e7e74ba4c11ee8bd0ac1f6bc53342",
                                                                                                                          "object": "Address",
                                                                                                                          "created_at": "2024-01-24T00:07:28+00:00",
                                                                                                                          "updated_at": "2024-01-24T00:07:28+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_8f5bb1f5ba4c11eeb6a1ac1f6bc539aa",
                                                                                                                          "object": "Address",
                                                                                                                          "created_at": "2024-01-24T00:07:28+00:00",
                                                                                                                          "updated_at": "2024-01-24T00:07:28+00:00",
                                                                                                                          "name": "DR. STEVE BRULE",
                                                                                                                          "company": null,
                                                                                                                          "street1": "179 N HARBOR DR",
                                                                                                                          "street2": null,
                                                                                                                          "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": "LabelFee",
                                                                                                                            "amount": "0.00000",
                                                                                                                            "charged": true,
                                                                                                                            "refunded": false
                                                                                                                          },
                                                                                                                          {
                                                                                                                            "object": "Fee",
                                                                                                                            "type": "PostageFee",
                                                                                                                            "amount": "7.33000",
                                                                                                                            "charged": true,
                                                                                                                            "refunded": false
                                                                                                                          }
                                                                                                                        ],
                                                                                                                        "id": "shp_8631f00640ba4d62b9131da3852a26e4",
                                                                                                                        "object": "Shipment"
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "has_more": true
                                                                                                                  }
                                                                                                                  GET/shipments/:id

                                                                                                                  Retrieve a Shipment

                                                                                                                  A Shipment 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.

                                                                                                                  Example
                                                                                                                  package shipments;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Shipment;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  public class Retrieve {
                                                                                                                      public static void main(String[] args) throws EasyPostException {
                                                                                                                          EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                  
                                                                                                                          Shipment shipment = client.shipment.retrieve("shp_...");
                                                                                                                  
                                                                                                                          System.out.println(shipment);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "created_at": "2024-01-24T00:07:31Z",
                                                                                                                    "is_return": false,
                                                                                                                    "messages": [],
                                                                                                                    "mode": "test",
                                                                                                                    "options": {
                                                                                                                      "currency": "USD",
                                                                                                                      "payment": {
                                                                                                                        "type": "SENDER"
                                                                                                                      },
                                                                                                                      "date_advance": 0
                                                                                                                    },
                                                                                                                    "reference": null,
                                                                                                                    "status": "unknown",
                                                                                                                    "tracking_code": null,
                                                                                                                    "updated_at": "2024-01-24T00:07:31Z",
                                                                                                                    "batch_id": null,
                                                                                                                    "batch_status": null,
                                                                                                                    "batch_message": null,
                                                                                                                    "customs_info": {
                                                                                                                      "id": "cstinfo_0096afa682bf443d91d2290bc95bb431",
                                                                                                                      "object": "CustomsInfo",
                                                                                                                      "created_at": "2024-01-24T00:07:31Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:31Z",
                                                                                                                      "contents_explanation": "",
                                                                                                                      "contents_type": "merchandise",
                                                                                                                      "customs_certify": true,
                                                                                                                      "customs_signer": "Steve Brule",
                                                                                                                      "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                      "non_delivery_option": "return",
                                                                                                                      "restriction_comments": null,
                                                                                                                      "restriction_type": "none",
                                                                                                                      "mode": "test",
                                                                                                                      "declaration": null,
                                                                                                                      "customs_items": [
                                                                                                                        {
                                                                                                                          "id": "cstitem_4cd92d282b9044e0a5fe4d430e221b04",
                                                                                                                          "object": "CustomsItem",
                                                                                                                          "created_at": "2024-01-24T00:07:31Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:31Z",
                                                                                                                          "description": "T-shirt",
                                                                                                                          "hs_tariff_number": "123456",
                                                                                                                          "origin_country": "US",
                                                                                                                          "quantity": 1,
                                                                                                                          "value": "10.0",
                                                                                                                          "weight": 5.0,
                                                                                                                          "code": "123",
                                                                                                                          "mode": "test",
                                                                                                                          "manufacturer": null,
                                                                                                                          "currency": null,
                                                                                                                          "eccn": null,
                                                                                                                          "printed_commodity_identifier": null
                                                                                                                        }
                                                                                                                      ]
                                                                                                                    },
                                                                                                                    "from_address": {
                                                                                                                      "id": "adr_913347feba4c11eeb701ac1f6bc539aa",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:31+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:31+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": null,
                                                                                                                    "parcel": {
                                                                                                                      "id": "prcl_400658d40a1f40aa9871d002dfdfb68d",
                                                                                                                      "object": "Parcel",
                                                                                                                      "created_at": "2024-01-24T00:07:31Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:31Z",
                                                                                                                      "length": 20.2,
                                                                                                                      "width": 10.9,
                                                                                                                      "height": 5.0,
                                                                                                                      "predefined_package": null,
                                                                                                                      "weight": 65.9,
                                                                                                                      "mode": "test"
                                                                                                                    },
                                                                                                                    "postage_label": null,
                                                                                                                    "rates": [
                                                                                                                      {
                                                                                                                        "id": "rate_3a88998080864f5dafd05f0e39655253",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:31Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:31Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Express",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "49.60",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "57.40",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "49.60",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": null,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": null,
                                                                                                                        "shipment_id": "shp_594234d296794803bfd0a6814a29d976",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_54f2ef16614541fda0eb4cac44155954",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:31Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:31Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Priority",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "7.33",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "15.20",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "10.89",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 2,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 2,
                                                                                                                        "shipment_id": "shp_594234d296794803bfd0a6814a29d976",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_591fb9d8f10d456ea105ea2e700c00ad",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:31Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:31Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "GroundAdvantage",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_594234d296794803bfd0a6814a29d976",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_3bf9ed1c9fef437e957faeb8eb77d7f7",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:31Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:31Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "First",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_594234d296794803bfd0a6814a29d976",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_bf060d1d9e4a41c6bdbef4bee91643dd",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:31Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:31Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "ParcelSelect",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_594234d296794803bfd0a6814a29d976",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "refund_status": null,
                                                                                                                    "scan_form": null,
                                                                                                                    "selected_rate": null,
                                                                                                                    "tracker": null,
                                                                                                                    "to_address": {
                                                                                                                      "id": "adr_91305d88ba4c11eea7e63cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:31+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:31+00:00",
                                                                                                                      "name": "Dr. Steve Brule",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N Harbor Dr",
                                                                                                                      "street2": null,
                                                                                                                      "city": "Redondo Beach",
                                                                                                                      "state": "CA",
                                                                                                                      "zip": "90277",
                                                                                                                      "country": "US",
                                                                                                                      "phone": "8573875756",
                                                                                                                      "email": "dr_steve_brule@gmail.com",
                                                                                                                      "mode": "test",
                                                                                                                      "carrier_facility": null,
                                                                                                                      "residential": null,
                                                                                                                      "federal_tax_id": null,
                                                                                                                      "state_tax_id": null,
                                                                                                                      "verifications": {}
                                                                                                                    },
                                                                                                                    "usps_zone": 4,
                                                                                                                    "return_address": {
                                                                                                                      "id": "adr_913347feba4c11eeb701ac1f6bc539aa",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:31+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:31+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_91305d88ba4c11eea7e63cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:31+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:31+00:00",
                                                                                                                      "name": "Dr. Steve Brule",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N Harbor Dr",
                                                                                                                      "street2": null,
                                                                                                                      "city": "Redondo Beach",
                                                                                                                      "state": "CA",
                                                                                                                      "zip": "90277",
                                                                                                                      "country": "US",
                                                                                                                      "phone": "8573875756",
                                                                                                                      "email": "dr_steve_brule@gmail.com",
                                                                                                                      "mode": "test",
                                                                                                                      "carrier_facility": null,
                                                                                                                      "residential": null,
                                                                                                                      "federal_tax_id": null,
                                                                                                                      "state_tax_id": null,
                                                                                                                      "verifications": {}
                                                                                                                    },
                                                                                                                    "forms": [],
                                                                                                                    "fees": [],
                                                                                                                    "id": "shp_594234d296794803bfd0a6814a29d976",
                                                                                                                    "object": "Shipment"
                                                                                                                  }
                                                                                                                  POST/shipments/:id/buy

                                                                                                                  Buy a Shipment

                                                                                                                  To purchase a Shipment you only need to specify the Rate to purchase. This operation populates the tracking_code and postage_label attributes. The default image format of the associated PostageLabel is PNG. To change this default see the label_format option.

                                                                                                                  Additionally, insurance may be added during the purchase. To specify an amount to insure, pass the insurance attribute as a string. The currency of all insurance is USD.

                                                                                                                  Request Parameters
                                                                                                                  paramexample
                                                                                                                  rate<Rate>
                                                                                                                  insurance"100.00"
                                                                                                                  Example
                                                                                                                  package shipments;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Shipment;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  import java.util.HashMap;
                                                                                                                  
                                                                                                                  public class Buy {
                                                                                                                      public static void main(String[] args) throws EasyPostException {
                                                                                                                          EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                  
                                                                                                                          Shipment shipment = client.shipment.retrieve("shp_...");
                                                                                                                  
                                                                                                                          HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                          params.put("rate", shipment.lowestRate());
                                                                                                                          params.put("insurance", "249.99");
                                                                                                                  
                                                                                                                          Shipment boughtShipment = client.shipment.buy(shipment.getId(), params);
                                                                                                                  
                                                                                                                          System.out.println(boughtShipment);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "created_at": "2024-01-24T00:07:32Z",
                                                                                                                    "is_return": false,
                                                                                                                    "messages": [],
                                                                                                                    "mode": "test",
                                                                                                                    "options": {
                                                                                                                      "currency": "USD",
                                                                                                                      "payment": {
                                                                                                                        "type": "SENDER"
                                                                                                                      },
                                                                                                                      "date_advance": 0
                                                                                                                    },
                                                                                                                    "reference": null,
                                                                                                                    "status": "unknown",
                                                                                                                    "tracking_code": "9434600207552011812848",
                                                                                                                    "updated_at": "2024-01-24T00:07:33Z",
                                                                                                                    "batch_id": null,
                                                                                                                    "batch_status": null,
                                                                                                                    "batch_message": null,
                                                                                                                    "customs_info": {
                                                                                                                      "id": "cstinfo_fd42061296ef450285b451ef66f9b9d5",
                                                                                                                      "object": "CustomsInfo",
                                                                                                                      "created_at": "2024-01-24T00:07:32Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:32Z",
                                                                                                                      "contents_explanation": "",
                                                                                                                      "contents_type": "merchandise",
                                                                                                                      "customs_certify": true,
                                                                                                                      "customs_signer": "Steve Brule",
                                                                                                                      "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                      "non_delivery_option": "return",
                                                                                                                      "restriction_comments": null,
                                                                                                                      "restriction_type": "none",
                                                                                                                      "mode": "test",
                                                                                                                      "declaration": null,
                                                                                                                      "customs_items": [
                                                                                                                        {
                                                                                                                          "id": "cstitem_f7de527850e34f018ef41e9f69be6758",
                                                                                                                          "object": "CustomsItem",
                                                                                                                          "created_at": "2024-01-24T00:07:32Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:32Z",
                                                                                                                          "description": "T-shirt",
                                                                                                                          "hs_tariff_number": "123456",
                                                                                                                          "origin_country": "US",
                                                                                                                          "quantity": 1,
                                                                                                                          "value": "10.0",
                                                                                                                          "weight": 5.0,
                                                                                                                          "code": "123",
                                                                                                                          "mode": "test",
                                                                                                                          "manufacturer": null,
                                                                                                                          "currency": null,
                                                                                                                          "eccn": null,
                                                                                                                          "printed_commodity_identifier": null
                                                                                                                        }
                                                                                                                      ]
                                                                                                                    },
                                                                                                                    "from_address": {
                                                                                                                      "id": "adr_91fa95f1ba4c11ee8c59ac1f6bc53342",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:32+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:32+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": "249.99",
                                                                                                                    "order_id": null,
                                                                                                                    "parcel": {
                                                                                                                      "id": "prcl_a5e317e47ac9442988d338cb2a0fde17",
                                                                                                                      "object": "Parcel",
                                                                                                                      "created_at": "2024-01-24T00:07:32Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:32Z",
                                                                                                                      "length": 20.2,
                                                                                                                      "width": 10.9,
                                                                                                                      "height": 5.0,
                                                                                                                      "predefined_package": null,
                                                                                                                      "weight": 65.9,
                                                                                                                      "mode": "test"
                                                                                                                    },
                                                                                                                    "postage_label": {
                                                                                                                      "object": "PostageLabel",
                                                                                                                      "id": "pl_51b80cc8523d4fc28c4ab710594e0913",
                                                                                                                      "created_at": "2024-01-24T00:07:33Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:33Z",
                                                                                                                      "date_advance": 0,
                                                                                                                      "integrated_form": "none",
                                                                                                                      "label_date": "2024-01-24T00:07:33Z",
                                                                                                                      "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/20240124/e81cecd85b82d749a19cf38dae0e30fc53.png",
                                                                                                                      "label_pdf_url": null,
                                                                                                                      "label_zpl_url": null,
                                                                                                                      "label_epl2_url": null,
                                                                                                                      "label_file": null
                                                                                                                    },
                                                                                                                    "rates": [
                                                                                                                      {
                                                                                                                        "id": "rate_6366c70cbea94c60b8d282ccf0f60ce0",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:32Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:32Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "GroundAdvantage",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_7dd1fb53702d473bbb9eeaf53d7a72d7",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:32Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:32Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "First",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_263930dcc1ef4331b9a16313f55c47d6",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:32Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:32Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "ParcelSelect",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_bd7a2aa312224b43b15d56b2e818e946",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:32Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:32Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Express",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "49.60",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "57.40",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "49.60",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": null,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": null,
                                                                                                                        "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_6ec39e90cf6b4f2d97aab43d7c946559",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:32Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:32Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Priority",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "7.33",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "15.20",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "10.89",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 2,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 2,
                                                                                                                        "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "refund_status": null,
                                                                                                                    "scan_form": null,
                                                                                                                    "selected_rate": {
                                                                                                                      "id": "rate_6366c70cbea94c60b8d282ccf0f60ce0",
                                                                                                                      "object": "Rate",
                                                                                                                      "created_at": "2024-01-24T00:07:33Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:33Z",
                                                                                                                      "mode": "test",
                                                                                                                      "service": "GroundAdvantage",
                                                                                                                      "carrier": "USPS",
                                                                                                                      "rate": "6.79",
                                                                                                                      "currency": "USD",
                                                                                                                      "retail_rate": "13.15",
                                                                                                                      "retail_currency": "USD",
                                                                                                                      "list_rate": "9.41",
                                                                                                                      "list_currency": "USD",
                                                                                                                      "billing_type": "easypost",
                                                                                                                      "delivery_days": 3,
                                                                                                                      "delivery_date": null,
                                                                                                                      "delivery_date_guaranteed": false,
                                                                                                                      "est_delivery_days": 3,
                                                                                                                      "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
                                                                                                                      "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                    },
                                                                                                                    "tracker": {
                                                                                                                      "id": "trk_814a807c3fae4203a4d61293b2b0b3dc",
                                                                                                                      "object": "Tracker",
                                                                                                                      "mode": "test",
                                                                                                                      "tracking_code": "9434600207552011812848",
                                                                                                                      "status": "unknown",
                                                                                                                      "status_detail": "unknown",
                                                                                                                      "created_at": "2024-01-24T00:07:34Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:34Z",
                                                                                                                      "signed_by": null,
                                                                                                                      "weight": null,
                                                                                                                      "est_delivery_date": null,
                                                                                                                      "shipment_id": "shp_56b10c708daa4c25b5895c5354758aaf",
                                                                                                                      "carrier": "USPS",
                                                                                                                      "tracking_details": [],
                                                                                                                      "fees": [],
                                                                                                                      "carrier_detail": null,
                                                                                                                      "public_url": "https://track.easypost.com/djE6dHJrXzgxNGE4MDdjM2ZhZTQyMDNhNGQ2MTI5M2IyYjBiM2Rj"
                                                                                                                    },
                                                                                                                    "to_address": {
                                                                                                                      "id": "adr_91f7ca0fba4c11eeb731ac1f6bc539aa",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:32+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:33+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_91fa95f1ba4c11ee8c59ac1f6bc53342",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:32+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:32+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_91f7ca0fba4c11eeb731ac1f6bc539aa",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:32+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:33+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": "LabelFee",
                                                                                                                        "amount": "0.00000",
                                                                                                                        "charged": true,
                                                                                                                        "refunded": false
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "object": "Fee",
                                                                                                                        "type": "PostageFee",
                                                                                                                        "amount": "6.79000",
                                                                                                                        "charged": true,
                                                                                                                        "refunded": false
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "object": "Fee",
                                                                                                                        "type": "InsuranceFee",
                                                                                                                        "amount": "1.24995",
                                                                                                                        "charged": true,
                                                                                                                        "refunded": false
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "id": "shp_56b10c708daa4c25b5895c5354758aaf",
                                                                                                                    "object": "Shipment"
                                                                                                                  }
                                                                                                                  POST/shipments

                                                                                                                  Buy a Shipment without rating (One-Call Buy)

                                                                                                                  There is an alternative way to purchase shipments 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 shipment" then "buy shipment" workflow. In order to achieve this behavior all you have to do is add a single carrier account and service level name to your "Create Shipment" call.

                                                                                                                  Request Parameters
                                                                                                                  paramexampleinfo
                                                                                                                  reference"my-reference"An optional field that may be used in place of id in other API endpoints
                                                                                                                  to_address<Address>Can be specified by ID or attributes to create a new one, and be verified inline. See Create and Verify Address
                                                                                                                  from_address<Address>Can be specified by ID or attributes to create a new one, and be verified inline. See Create and Verify Address
                                                                                                                  parcel<Parcel>
                                                                                                                  carrier_accounts["ca_..."]List of carrier accounts
                                                                                                                  service"Priority"The service of carrier
                                                                                                                  Example
                                                                                                                  package shipments;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Shipment;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  import java.util.HashMap;
                                                                                                                  
                                                                                                                  public class OneCallBuy {
                                                                                                                      public static void main(String[] args) throws EasyPostException {
                                                                                                                          EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                  
                                                                                                                          HashMap<String, Object> toAddressMap = new HashMap<String, Object>();
                                                                                                                          toAddressMap.put("name", "Dr. Steve Brule");
                                                                                                                          toAddressMap.put("street1", "179 N Harbor Dr");
                                                                                                                          toAddressMap.put("city", "Redondo Beach");
                                                                                                                          toAddressMap.put("state", "CA");
                                                                                                                          toAddressMap.put("country", "US");
                                                                                                                          toAddressMap.put("phone", "8573875756");
                                                                                                                          toAddressMap.put("email", "dr_steve_brule@gmail.com");
                                                                                                                          toAddressMap.put("zip", "90277");
                                                                                                                  
                                                                                                                          HashMap<String, Object> fromAddressMap = new HashMap<String, Object>();
                                                                                                                          fromAddressMap.put("name", "EasyPost");
                                                                                                                          fromAddressMap.put("street1", "417 Montgomery Street");
                                                                                                                          fromAddressMap.put("street2", "5th Floor");
                                                                                                                          fromAddressMap.put("city", "San Francisco");
                                                                                                                          fromAddressMap.put("state", "CA");
                                                                                                                          fromAddressMap.put("zip", "94104");
                                                                                                                          fromAddressMap.put("country", "US");
                                                                                                                          fromAddressMap.put("phone", "4153334445");
                                                                                                                          fromAddressMap.put("email", "support@easypost.com");
                                                                                                                  
                                                                                                                          HashMap<String, Object> parcelMap = new HashMap<String, Object>();
                                                                                                                          parcelMap.put("length", 20.2);
                                                                                                                          parcelMap.put("width", 10.9);
                                                                                                                          parcelMap.put("height", 5);
                                                                                                                          parcelMap.put("weight", 65.9);
                                                                                                                  
                                                                                                                          HashMap<String, Object> customsInfoMap = new HashMap<String, Object>();
                                                                                                                          customsInfoMap.put("id", "cstinfo_...");
                                                                                                                  
                                                                                                                          HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                          params.put("to_address", toAddressMap);
                                                                                                                          params.put("from_address", fromAddressMap);
                                                                                                                          params.put("parcel", parcelMap);
                                                                                                                          params.put("customs_info", customsInfoMap);
                                                                                                                          params.put("carrier_accounts", "ca_...");
                                                                                                                          params.put("service", "NextDayAir");
                                                                                                                  
                                                                                                                          Shipment shipment = client.shipment.create(params);
                                                                                                                  
                                                                                                                          System.out.println(shipment);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "created_at": "2024-01-24T00:07:34Z",
                                                                                                                    "is_return": false,
                                                                                                                    "messages": [],
                                                                                                                    "mode": "test",
                                                                                                                    "options": {
                                                                                                                      "currency": "USD",
                                                                                                                      "payment": {
                                                                                                                        "type": "SENDER"
                                                                                                                      },
                                                                                                                      "date_advance": 0
                                                                                                                    },
                                                                                                                    "reference": null,
                                                                                                                    "status": "unknown",
                                                                                                                    "tracking_code": "9405500207552011812856",
                                                                                                                    "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                    "batch_id": null,
                                                                                                                    "batch_status": null,
                                                                                                                    "batch_message": null,
                                                                                                                    "customs_info": {
                                                                                                                      "id": "cstinfo_e6014c4dcdf5453791e90ce9a1e02415",
                                                                                                                      "object": "CustomsInfo",
                                                                                                                      "created_at": "2024-01-24T00:07:34Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:34Z",
                                                                                                                      "contents_explanation": "",
                                                                                                                      "contents_type": "merchandise",
                                                                                                                      "customs_certify": true,
                                                                                                                      "customs_signer": "Steve Brule",
                                                                                                                      "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                      "non_delivery_option": "return",
                                                                                                                      "restriction_comments": null,
                                                                                                                      "restriction_type": "none",
                                                                                                                      "mode": "test",
                                                                                                                      "declaration": null,
                                                                                                                      "customs_items": [
                                                                                                                        {
                                                                                                                          "id": "cstitem_a3eccb0d4eea40919cd8ce3fb946f294",
                                                                                                                          "object": "CustomsItem",
                                                                                                                          "created_at": "2024-01-24T00:07:34Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:34Z",
                                                                                                                          "description": "T-shirt",
                                                                                                                          "hs_tariff_number": "123456",
                                                                                                                          "origin_country": "US",
                                                                                                                          "quantity": 1,
                                                                                                                          "value": "10.0",
                                                                                                                          "weight": 5.0,
                                                                                                                          "code": "123",
                                                                                                                          "mode": "test",
                                                                                                                          "manufacturer": null,
                                                                                                                          "currency": null,
                                                                                                                          "eccn": null,
                                                                                                                          "printed_commodity_identifier": null
                                                                                                                        }
                                                                                                                      ]
                                                                                                                    },
                                                                                                                    "from_address": {
                                                                                                                      "id": "adr_931d01beba4c11eea85f3cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:34+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:34+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": null,
                                                                                                                    "parcel": {
                                                                                                                      "id": "prcl_e41371b468254344b140e685e879d69b",
                                                                                                                      "object": "Parcel",
                                                                                                                      "created_at": "2024-01-24T00:07:34Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:34Z",
                                                                                                                      "length": 20.2,
                                                                                                                      "width": 10.9,
                                                                                                                      "height": 5.0,
                                                                                                                      "predefined_package": null,
                                                                                                                      "weight": 65.9,
                                                                                                                      "mode": "test"
                                                                                                                    },
                                                                                                                    "postage_label": {
                                                                                                                      "object": "PostageLabel",
                                                                                                                      "id": "pl_737e9444077f4b00b11dd489f1ff1b24",
                                                                                                                      "created_at": "2024-01-24T00:07:34Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                      "date_advance": 0,
                                                                                                                      "integrated_form": "none",
                                                                                                                      "label_date": "2024-01-24T00:07:34Z",
                                                                                                                      "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/20240124/e855deb38cef7e400083067c600a9848f2.png",
                                                                                                                      "label_pdf_url": null,
                                                                                                                      "label_zpl_url": null,
                                                                                                                      "label_epl2_url": null,
                                                                                                                      "label_file": null
                                                                                                                    },
                                                                                                                    "rates": [
                                                                                                                      {
                                                                                                                        "id": "rate_2c2df636028f414a9334c086be6d8a78",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:34Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:34Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Express",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "49.60",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "57.40",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "49.60",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": null,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": null,
                                                                                                                        "shipment_id": "shp_032866f1a5174949bc938acc7f4a19fc",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_55157308ac5e46ef88c45f726bcbc786",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:34Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:34Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Priority",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "7.33",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "15.20",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "10.89",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 2,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 2,
                                                                                                                        "shipment_id": "shp_032866f1a5174949bc938acc7f4a19fc",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_9f6994d9e21940288ae27be89a958e92",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:34Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:34Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "GroundAdvantage",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_032866f1a5174949bc938acc7f4a19fc",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_75c2218b6bd149ec9b9145380024c633",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:34Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:34Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "First",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_032866f1a5174949bc938acc7f4a19fc",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_c8fd8ed2574c4c1aa5d751e344786157",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:34Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:34Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "ParcelSelect",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_032866f1a5174949bc938acc7f4a19fc",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "refund_status": null,
                                                                                                                    "scan_form": null,
                                                                                                                    "selected_rate": {
                                                                                                                      "id": "rate_55157308ac5e46ef88c45f726bcbc786",
                                                                                                                      "object": "Rate",
                                                                                                                      "created_at": "2024-01-24T00:07:34Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:34Z",
                                                                                                                      "mode": "test",
                                                                                                                      "service": "Priority",
                                                                                                                      "carrier": "USPS",
                                                                                                                      "rate": "7.33",
                                                                                                                      "currency": "USD",
                                                                                                                      "retail_rate": "15.20",
                                                                                                                      "retail_currency": "USD",
                                                                                                                      "list_rate": "10.89",
                                                                                                                      "list_currency": "USD",
                                                                                                                      "billing_type": "easypost",
                                                                                                                      "delivery_days": 2,
                                                                                                                      "delivery_date": null,
                                                                                                                      "delivery_date_guaranteed": false,
                                                                                                                      "est_delivery_days": 2,
                                                                                                                      "shipment_id": "shp_032866f1a5174949bc938acc7f4a19fc",
                                                                                                                      "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                    },
                                                                                                                    "tracker": {
                                                                                                                      "id": "trk_4f377a2463fe4af8a42f0bd2ea17d6d3",
                                                                                                                      "object": "Tracker",
                                                                                                                      "mode": "test",
                                                                                                                      "tracking_code": "9405500207552011812856",
                                                                                                                      "status": "unknown",
                                                                                                                      "status_detail": "unknown",
                                                                                                                      "created_at": "2024-01-24T00:07:35Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                      "signed_by": null,
                                                                                                                      "weight": null,
                                                                                                                      "est_delivery_date": null,
                                                                                                                      "shipment_id": "shp_032866f1a5174949bc938acc7f4a19fc",
                                                                                                                      "carrier": "USPS",
                                                                                                                      "tracking_details": [],
                                                                                                                      "fees": [],
                                                                                                                      "carrier_detail": null,
                                                                                                                      "public_url": "https://track.easypost.com/djE6dHJrXzRmMzc3YTI0NjNmZTRhZjhhNDJmMGJkMmVhMTdkNmQz"
                                                                                                                    },
                                                                                                                    "to_address": {
                                                                                                                      "id": "adr_9319ec85ba4c11ee8ca2ac1f6bc53342",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:34+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:34+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_931d01beba4c11eea85f3cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:34+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:34+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_9319ec85ba4c11ee8ca2ac1f6bc53342",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:34+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:34+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": "LabelFee",
                                                                                                                        "amount": "0.00000",
                                                                                                                        "charged": true,
                                                                                                                        "refunded": false
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "object": "Fee",
                                                                                                                        "type": "PostageFee",
                                                                                                                        "amount": "7.33000",
                                                                                                                        "charged": true,
                                                                                                                        "refunded": false
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "id": "shp_032866f1a5174949bc938acc7f4a19fc",
                                                                                                                    "object": "Shipment"
                                                                                                                  }
                                                                                                                  GET/shipments/:id/label

                                                                                                                  Convert the Label format of a Shipment

                                                                                                                  A Shipment's PostageLabel can be converted from PNG to other formats. To convert a PostageLabel, the original must be a PNG. Converting labels works best when they are 4x6 labels converted from PNG to ZPL.

                                                                                                                  Example
                                                                                                                  package shipments;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Shipment;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  import java.util.HashMap;
                                                                                                                  
                                                                                                                  public class Label {
                                                                                                                      public static void main(String[] args) throws EasyPostException {
                                                                                                                          EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                  
                                                                                                                          HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                          params.put("file_format", "ZPL");
                                                                                                                  
                                                                                                                          Shipment shipment = client.shipment.label("shp_...", params);
                                                                                                                  
                                                                                                                          System.out.println(shipment);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "created_at": "2024-01-24T00:07:35Z",
                                                                                                                    "is_return": false,
                                                                                                                    "messages": [],
                                                                                                                    "mode": "test",
                                                                                                                    "options": {
                                                                                                                      "currency": "USD",
                                                                                                                      "payment": {
                                                                                                                        "type": "SENDER"
                                                                                                                      },
                                                                                                                      "date_advance": 0
                                                                                                                    },
                                                                                                                    "reference": null,
                                                                                                                    "status": "unknown",
                                                                                                                    "tracking_code": "9434600207552011812862",
                                                                                                                    "updated_at": "2024-01-24T00:07:36Z",
                                                                                                                    "batch_id": null,
                                                                                                                    "batch_status": null,
                                                                                                                    "batch_message": null,
                                                                                                                    "customs_info": {
                                                                                                                      "id": "cstinfo_7020222e3699472186d9be5f7fe03965",
                                                                                                                      "object": "CustomsInfo",
                                                                                                                      "created_at": "2024-01-24T00:07:35Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                      "contents_explanation": "",
                                                                                                                      "contents_type": "merchandise",
                                                                                                                      "customs_certify": true,
                                                                                                                      "customs_signer": "Steve Brule",
                                                                                                                      "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                      "non_delivery_option": "return",
                                                                                                                      "restriction_comments": null,
                                                                                                                      "restriction_type": "none",
                                                                                                                      "mode": "test",
                                                                                                                      "declaration": null,
                                                                                                                      "customs_items": [
                                                                                                                        {
                                                                                                                          "id": "cstitem_b5d2e40ce0ce4a19aab950a848928989",
                                                                                                                          "object": "CustomsItem",
                                                                                                                          "created_at": "2024-01-24T00:07:35Z",
                                                                                                                          "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                          "description": "T-shirt",
                                                                                                                          "hs_tariff_number": "123456",
                                                                                                                          "origin_country": "US",
                                                                                                                          "quantity": 1,
                                                                                                                          "value": "10.0",
                                                                                                                          "weight": 5.0,
                                                                                                                          "code": "123",
                                                                                                                          "mode": "test",
                                                                                                                          "manufacturer": null,
                                                                                                                          "currency": null,
                                                                                                                          "eccn": null,
                                                                                                                          "printed_commodity_identifier": null
                                                                                                                        }
                                                                                                                      ]
                                                                                                                    },
                                                                                                                    "from_address": {
                                                                                                                      "id": "adr_93ec5efaba4c11eeb7baac1f6bc539aa",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:35+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:35+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": null,
                                                                                                                    "parcel": {
                                                                                                                      "id": "prcl_4aa6de11e4fa44739b7e4a2b3e28ad9a",
                                                                                                                      "object": "Parcel",
                                                                                                                      "created_at": "2024-01-24T00:07:35Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                      "length": 20.2,
                                                                                                                      "width": 10.9,
                                                                                                                      "height": 5.0,
                                                                                                                      "predefined_package": null,
                                                                                                                      "weight": 65.9,
                                                                                                                      "mode": "test"
                                                                                                                    },
                                                                                                                    "postage_label": {
                                                                                                                      "object": "PostageLabel",
                                                                                                                      "id": "pl_e5d4aec4ee23458ebcb4d29c41ee75f4",
                                                                                                                      "created_at": "2024-01-24T00:07:36Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:38Z",
                                                                                                                      "date_advance": 0,
                                                                                                                      "integrated_form": "none",
                                                                                                                      "label_date": "2024-01-24T00:07:36Z",
                                                                                                                      "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/20240124/e8118119c07a5e44a2aee0f6189f13f80a.png",
                                                                                                                      "label_pdf_url": null,
                                                                                                                      "label_zpl_url": "https://easypost-files.s3-us-west-2.amazonaws.com/files/postage_label/20240124/af790a0077514f32b1d035d8b2795bb0.zpl",
                                                                                                                      "label_epl2_url": null,
                                                                                                                      "label_file": null
                                                                                                                    },
                                                                                                                    "rates": [
                                                                                                                      {
                                                                                                                        "id": "rate_2068707826484b3cb89fac312a15525d",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:35Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "GroundAdvantage",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_1d00461199d74698b40c1c1cc55654a7",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_a1cd9d7eb69d43d084b58a01a3d433b1",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:35Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "First",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_1d00461199d74698b40c1c1cc55654a7",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_8276cb6c0c6e412a8dd4cf9b03de9eed",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:35Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "ParcelSelect",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_1d00461199d74698b40c1c1cc55654a7",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_0f20dca65d464d56b6d86ad06f27f408",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:35Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Express",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "49.60",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "57.40",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "49.60",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": null,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": null,
                                                                                                                        "shipment_id": "shp_1d00461199d74698b40c1c1cc55654a7",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_1cee068a0deb4f1283aeb9834c70bca1",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:07:35Z",
                                                                                                                        "updated_at": "2024-01-24T00:07:35Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Priority",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "7.33",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "15.20",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "10.89",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 2,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 2,
                                                                                                                        "shipment_id": "shp_1d00461199d74698b40c1c1cc55654a7",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "refund_status": null,
                                                                                                                    "scan_form": null,
                                                                                                                    "selected_rate": {
                                                                                                                      "id": "rate_2068707826484b3cb89fac312a15525d",
                                                                                                                      "object": "Rate",
                                                                                                                      "created_at": "2024-01-24T00:07:36Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:36Z",
                                                                                                                      "mode": "test",
                                                                                                                      "service": "GroundAdvantage",
                                                                                                                      "carrier": "USPS",
                                                                                                                      "rate": "6.79",
                                                                                                                      "currency": "USD",
                                                                                                                      "retail_rate": "13.15",
                                                                                                                      "retail_currency": "USD",
                                                                                                                      "list_rate": "9.41",
                                                                                                                      "list_currency": "USD",
                                                                                                                      "billing_type": "easypost",
                                                                                                                      "delivery_days": 3,
                                                                                                                      "delivery_date": null,
                                                                                                                      "delivery_date_guaranteed": false,
                                                                                                                      "est_delivery_days": 3,
                                                                                                                      "shipment_id": "shp_1d00461199d74698b40c1c1cc55654a7",
                                                                                                                      "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                    },
                                                                                                                    "tracker": {
                                                                                                                      "id": "trk_f82598977d4147b6829b688ff79a5f83",
                                                                                                                      "object": "Tracker",
                                                                                                                      "mode": "test",
                                                                                                                      "tracking_code": "9434600207552011812862",
                                                                                                                      "status": "pre_transit",
                                                                                                                      "status_detail": "status_update",
                                                                                                                      "created_at": "2024-01-24T00:07:37Z",
                                                                                                                      "updated_at": "2024-01-24T00:07:37Z",
                                                                                                                      "signed_by": null,
                                                                                                                      "weight": null,
                                                                                                                      "est_delivery_date": "2024-01-24T00:07:37Z",
                                                                                                                      "shipment_id": "shp_1d00461199d74698b40c1c1cc55654a7",
                                                                                                                      "carrier": "USPS",
                                                                                                                      "tracking_details": [
                                                                                                                        {
                                                                                                                          "object": "TrackingDetail",
                                                                                                                          "message": "Pre-Shipment Info Sent to USPS",
                                                                                                                          "description": "",
                                                                                                                          "status": "pre_transit",
                                                                                                                          "status_detail": "status_update",
                                                                                                                          "datetime": "2023-12-24T00:07:37Z",
                                                                                                                          "source": "USPS",
                                                                                                                          "carrier_code": "",
                                                                                                                          "tracking_location": {
                                                                                                                            "object": "TrackingLocation",
                                                                                                                            "city": null,
                                                                                                                            "state": null,
                                                                                                                            "country": null,
                                                                                                                            "zip": null
                                                                                                                          }
                                                                                                                        },
                                                                                                                        {
                                                                                                                          "object": "TrackingDetail",
                                                                                                                          "message": "Shipping Label Created",
                                                                                                                          "description": "",
                                                                                                                          "status": "pre_transit",
                                                                                                                          "status_detail": "status_update",
                                                                                                                          "datetime": "2023-12-24T12:44:37Z",
                                                                                                                          "source": "USPS",
                                                                                                                          "carrier_code": "",
                                                                                                                          "tracking_location": {
                                                                                                                            "object": "TrackingLocation",
                                                                                                                            "city": "HOUSTON",
                                                                                                                            "state": "TX",
                                                                                                                            "country": null,
                                                                                                                            "zip": "77063"
                                                                                                                          }
                                                                                                                        }
                                                                                                                      ],
                                                                                                                      "fees": [],
                                                                                                                      "carrier_detail": {
                                                                                                                        "object": "CarrierDetail",
                                                                                                                        "service": "First-Class Package Service",
                                                                                                                        "container_type": null,
                                                                                                                        "est_delivery_date_local": null,
                                                                                                                        "est_delivery_time_local": null,
                                                                                                                        "origin_location": "HOUSTON TX, 77001",
                                                                                                                        "origin_tracking_location": {
                                                                                                                          "object": "TrackingLocation",
                                                                                                                          "city": "HOUSTON",
                                                                                                                          "state": "TX",
                                                                                                                          "country": null,
                                                                                                                          "zip": "77063"
                                                                                                                        },
                                                                                                                        "destination_location": "CHARLESTON SC, 29401",
                                                                                                                        "destination_tracking_location": null,
                                                                                                                        "guaranteed_delivery_date": null,
                                                                                                                        "alternate_identifier": null,
                                                                                                                        "initial_delivery_attempt": null
                                                                                                                      },
                                                                                                                      "public_url": "https://track.easypost.com/djE6dHJrX2Y4MjU5ODk3N2Q0MTQ3YjY4MjliNjg4ZmY3OWE1Zjgz"
                                                                                                                    },
                                                                                                                    "to_address": {
                                                                                                                      "id": "adr_93e694b8ba4c11eea88d3cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:35+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:36+00:00",
                                                                                                                      "name": "DR. STEVE BRULE",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N HARBOR DR",
                                                                                                                      "street2": null,
                                                                                                                      "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_93ec5efaba4c11eeb7baac1f6bc539aa",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:35+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:35+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_93e694b8ba4c11eea88d3cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:07:35+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:07:36+00:00",
                                                                                                                      "name": "DR. STEVE BRULE",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N HARBOR DR",
                                                                                                                      "street2": null,
                                                                                                                      "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": "LabelFee",
                                                                                                                        "amount": "0.00000",
                                                                                                                        "charged": true,
                                                                                                                        "refunded": false
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "object": "Fee",
                                                                                                                        "type": "PostageFee",
                                                                                                                        "amount": "6.79000",
                                                                                                                        "charged": true,
                                                                                                                        "refunded": false
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "id": "shp_1d00461199d74698b40c1c1cc55654a7",
                                                                                                                    "object": "Shipment"
                                                                                                                  }

                                                                                                                  Forms

                                                                                                                  After a Shipment is created, you can create various associated Form objects for that Shipment such as a return packing slip, QR codes, and other international shipping forms. For more information about how to use Forms with your Shipments, please check our Forms guide.

                                                                                                                  Forms that may be returned with Shipment objects depending on the carrier and data passed:

                                                                                                                  • cn22
                                                                                                                  • cod_return_label
                                                                                                                  • commercial_invoice
                                                                                                                  • high_value_report
                                                                                                                  • nafta_certificate_of_origin
                                                                                                                  • order_summary

                                                                                                                  Forms that can be created after a Shipment has been bought:

                                                                                                                  • commercial_invoice
                                                                                                                  • label_qr_code
                                                                                                                  • return_packing_slip
                                                                                                                  • rma_qr_code

                                                                                                                  Form Object

                                                                                                                  attributetypespecification
                                                                                                                  idstringUnique, begins with "form_"
                                                                                                                  objectstring"Form"
                                                                                                                  modestring"test" or "production"
                                                                                                                  form_typestringThe type of form, can be one of "cn22", "cod_return_label", "commercial_invoice", "high_value_report", "label_qr_code", "nafta_certificate_of_origin", "order_summary", "return_packing_slip", "rma_qr_code"
                                                                                                                  form_urlstringThe URL that a form can be downloaded from
                                                                                                                  submitted_electronicallybooleanIf we have submitted the form to the carrier on behalf of the user
                                                                                                                  created_atdatetimeWhen the form was created
                                                                                                                  updated_atdatetimeWhen the form was updated
                                                                                                                  POST/shipments/:id/forms

                                                                                                                  Create Form

                                                                                                                  Please see Form guide for request parameter.
                                                                                                                  Example
                                                                                                                  package shipments;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Shipment;
                                                                                                                  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");
                                                                                                                  
                                                                                                                          Shipment shipment = client.shipment.retrieve("shp_...");
                                                                                                                          Shipment boughtShipment = client.shipment.buy(shipment.getId(), shipment.lowestRate());
                                                                                                                  
                                                                                                                          HashMap<String, Object> titleMap = new HashMap<String, Object>();
                                                                                                                          titleMap.put("title", "Square Reader");
                                                                                                                  
                                                                                                                          HashMap<String, Object> barcodeMap = new HashMap<String, Object>();
                                                                                                                          barcodeMap.put("barcode", "855658003251");
                                                                                                                  
                                                                                                                          ArrayList<HashMap<String, Object>> lineItemsMap = new ArrayList<HashMap<String, Object>>();
                                                                                                                          lineItemsMap.add(titleMap);
                                                                                                                          lineItemsMap.add(barcodeMap);
                                                                                                                  
                                                                                                                          HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                          params.put("barcode", "RMA12345678900");
                                                                                                                          params.put("units", 8);
                                                                                                                          params.put("line_items", lineItemsMap);
                                                                                                                  
                                                                                                                          Shipment shipmentWithForm = client.shipment.generateForm(boughtShipment.getId(), "return_packing_slip",
                                                                                                                                  params);
                                                                                                                  
                                                                                                                          System.out.println(shipment);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "created_at": "2024-01-24T00:05:50Z",
                                                                                                                    "is_return": false,
                                                                                                                    "messages": [],
                                                                                                                    "mode": "test",
                                                                                                                    "options": {
                                                                                                                      "currency": "USD",
                                                                                                                      "payment": {
                                                                                                                        "type": "SENDER"
                                                                                                                      },
                                                                                                                      "date_advance": 0
                                                                                                                    },
                                                                                                                    "reference": null,
                                                                                                                    "status": "unknown",
                                                                                                                    "tracking_code": "9405500207552011812542",
                                                                                                                    "updated_at": "2024-01-24T00:05:51Z",
                                                                                                                    "batch_id": null,
                                                                                                                    "batch_status": null,
                                                                                                                    "batch_message": null,
                                                                                                                    "customs_info": {
                                                                                                                      "id": "cstinfo_22c094c28a5849c2831e345cfa8a4809",
                                                                                                                      "object": "CustomsInfo",
                                                                                                                      "created_at": "2024-01-24T00:05:50Z",
                                                                                                                      "updated_at": "2024-01-24T00:05:50Z",
                                                                                                                      "contents_explanation": "",
                                                                                                                      "contents_type": "merchandise",
                                                                                                                      "customs_certify": true,
                                                                                                                      "customs_signer": "Steve Brule",
                                                                                                                      "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                      "non_delivery_option": "return",
                                                                                                                      "restriction_comments": null,
                                                                                                                      "restriction_type": "none",
                                                                                                                      "mode": "test",
                                                                                                                      "declaration": null,
                                                                                                                      "customs_items": [
                                                                                                                        {
                                                                                                                          "id": "cstitem_a1f6f1d173934f37a2ce669bb6657e3c",
                                                                                                                          "object": "CustomsItem",
                                                                                                                          "created_at": "2024-01-24T00:05:50Z",
                                                                                                                          "updated_at": "2024-01-24T00:05:50Z",
                                                                                                                          "description": "T-shirt",
                                                                                                                          "hs_tariff_number": "123456",
                                                                                                                          "origin_country": "US",
                                                                                                                          "quantity": 1,
                                                                                                                          "value": "10.0",
                                                                                                                          "weight": 5.0,
                                                                                                                          "code": "123",
                                                                                                                          "mode": "test",
                                                                                                                          "manufacturer": null,
                                                                                                                          "currency": null,
                                                                                                                          "eccn": null,
                                                                                                                          "printed_commodity_identifier": null
                                                                                                                        }
                                                                                                                      ]
                                                                                                                    },
                                                                                                                    "from_address": {
                                                                                                                      "id": "adr_550ea165ba4c11eeb9e7ac1f6bc53342",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:50+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:50+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": null,
                                                                                                                    "parcel": {
                                                                                                                      "id": "prcl_44286ed3097f46d1adbc382c934ce534",
                                                                                                                      "object": "Parcel",
                                                                                                                      "created_at": "2024-01-24T00:05:50Z",
                                                                                                                      "updated_at": "2024-01-24T00:05:50Z",
                                                                                                                      "length": 20.2,
                                                                                                                      "width": 10.9,
                                                                                                                      "height": 5.0,
                                                                                                                      "predefined_package": null,
                                                                                                                      "weight": 65.9,
                                                                                                                      "mode": "test"
                                                                                                                    },
                                                                                                                    "postage_label": {
                                                                                                                      "object": "PostageLabel",
                                                                                                                      "id": "pl_325a0a9ea29843a4918757c6bebb71b3",
                                                                                                                      "created_at": "2024-01-24T00:05:50Z",
                                                                                                                      "updated_at": "2024-01-24T00:05:51Z",
                                                                                                                      "date_advance": 0,
                                                                                                                      "integrated_form": "none",
                                                                                                                      "label_date": "2024-01-24T00:05:50Z",
                                                                                                                      "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/20240124/e82c64213af7be49b1b2aba1ea0c4dcd5f.png",
                                                                                                                      "label_pdf_url": null,
                                                                                                                      "label_zpl_url": null,
                                                                                                                      "label_epl2_url": null,
                                                                                                                      "label_file": null
                                                                                                                    },
                                                                                                                    "rates": [
                                                                                                                      {
                                                                                                                        "id": "rate_bdc3690cc6634a1fafde081f3b26c3d9",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:05:50Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:50Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Priority",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "7.33",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "15.20",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "10.89",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 2,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 2,
                                                                                                                        "shipment_id": "shp_5889c78f5e5547958e62f6993453f0d9",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_501c02949c3e44b0ab50eebde3068c8b",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:05:50Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:50Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "GroundAdvantage",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_5889c78f5e5547958e62f6993453f0d9",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_9649550ada4944a2b3439289a428761e",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:05:50Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:50Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "First",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_5889c78f5e5547958e62f6993453f0d9",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_4379eb9028654c9d93cf5905d8619163",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:05:50Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:50Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "ParcelSelect",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_5889c78f5e5547958e62f6993453f0d9",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_03369f5e3a844ec2b88588f2d566eef0",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:05:50Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:50Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Express",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "49.60",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "57.40",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "49.60",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": null,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": null,
                                                                                                                        "shipment_id": "shp_5889c78f5e5547958e62f6993453f0d9",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "refund_status": null,
                                                                                                                    "scan_form": null,
                                                                                                                    "selected_rate": {
                                                                                                                      "id": "rate_bdc3690cc6634a1fafde081f3b26c3d9",
                                                                                                                      "object": "Rate",
                                                                                                                      "created_at": "2024-01-24T00:05:50Z",
                                                                                                                      "updated_at": "2024-01-24T00:05:50Z",
                                                                                                                      "mode": "test",
                                                                                                                      "service": "Priority",
                                                                                                                      "carrier": "USPS",
                                                                                                                      "rate": "7.33",
                                                                                                                      "currency": "USD",
                                                                                                                      "retail_rate": "15.20",
                                                                                                                      "retail_currency": "USD",
                                                                                                                      "list_rate": "10.89",
                                                                                                                      "list_currency": "USD",
                                                                                                                      "billing_type": "easypost",
                                                                                                                      "delivery_days": 2,
                                                                                                                      "delivery_date": null,
                                                                                                                      "delivery_date_guaranteed": false,
                                                                                                                      "est_delivery_days": 2,
                                                                                                                      "shipment_id": "shp_5889c78f5e5547958e62f6993453f0d9",
                                                                                                                      "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                    },
                                                                                                                    "tracker": {
                                                                                                                      "id": "trk_a6ead3f2a19d4e1abfd3d1ce4db88ad5",
                                                                                                                      "object": "Tracker",
                                                                                                                      "mode": "test",
                                                                                                                      "tracking_code": "9405500207552011812542",
                                                                                                                      "status": "pre_transit",
                                                                                                                      "status_detail": "status_update",
                                                                                                                      "created_at": "2024-01-24T00:05:51Z",
                                                                                                                      "updated_at": "2024-01-24T00:05:51Z",
                                                                                                                      "signed_by": null,
                                                                                                                      "weight": null,
                                                                                                                      "est_delivery_date": "2024-01-24T00:05:51Z",
                                                                                                                      "shipment_id": "shp_5889c78f5e5547958e62f6993453f0d9",
                                                                                                                      "carrier": "USPS",
                                                                                                                      "tracking_details": [
                                                                                                                        {
                                                                                                                          "object": "TrackingDetail",
                                                                                                                          "message": "Pre-Shipment Info Sent to USPS",
                                                                                                                          "description": "",
                                                                                                                          "status": "pre_transit",
                                                                                                                          "status_detail": "status_update",
                                                                                                                          "datetime": "2023-12-24T00:05:51Z",
                                                                                                                          "source": "USPS",
                                                                                                                          "carrier_code": "",
                                                                                                                          "tracking_location": {
                                                                                                                            "object": "TrackingLocation",
                                                                                                                            "city": null,
                                                                                                                            "state": null,
                                                                                                                            "country": null,
                                                                                                                            "zip": null
                                                                                                                          }
                                                                                                                        },
                                                                                                                        {
                                                                                                                          "object": "TrackingDetail",
                                                                                                                          "message": "Shipping Label Created",
                                                                                                                          "description": "",
                                                                                                                          "status": "pre_transit",
                                                                                                                          "status_detail": "status_update",
                                                                                                                          "datetime": "2023-12-24T12:42:51Z",
                                                                                                                          "source": "USPS",
                                                                                                                          "carrier_code": "",
                                                                                                                          "tracking_location": {
                                                                                                                            "object": "TrackingLocation",
                                                                                                                            "city": "HOUSTON",
                                                                                                                            "state": "TX",
                                                                                                                            "country": null,
                                                                                                                            "zip": "77063"
                                                                                                                          }
                                                                                                                        }
                                                                                                                      ],
                                                                                                                      "fees": [],
                                                                                                                      "carrier_detail": {
                                                                                                                        "object": "CarrierDetail",
                                                                                                                        "service": "First-Class Package Service",
                                                                                                                        "container_type": null,
                                                                                                                        "est_delivery_date_local": null,
                                                                                                                        "est_delivery_time_local": null,
                                                                                                                        "origin_location": "HOUSTON TX, 77001",
                                                                                                                        "origin_tracking_location": {
                                                                                                                          "object": "TrackingLocation",
                                                                                                                          "city": "HOUSTON",
                                                                                                                          "state": "TX",
                                                                                                                          "country": null,
                                                                                                                          "zip": "77063"
                                                                                                                        },
                                                                                                                        "destination_location": "CHARLESTON SC, 29401",
                                                                                                                        "destination_tracking_location": null,
                                                                                                                        "guaranteed_delivery_date": null,
                                                                                                                        "alternate_identifier": null,
                                                                                                                        "initial_delivery_attempt": null
                                                                                                                      },
                                                                                                                      "public_url": "https://track.easypost.com/djE6dHJrX2E2ZWFkM2YyYTE5ZDRlMWFiZmQzZDFjZTRkYjg4YWQ1"
                                                                                                                    },
                                                                                                                    "to_address": {
                                                                                                                      "id": "adr_550c2974ba4c11ee96563cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:50+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:50+00:00",
                                                                                                                      "name": "DR. STEVE BRULE",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N HARBOR DR",
                                                                                                                      "street2": null,
                                                                                                                      "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_550ea165ba4c11eeb9e7ac1f6bc53342",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:50+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:50+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_550c2974ba4c11ee96563cecef1b359e",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:50+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:50+00:00",
                                                                                                                      "name": "DR. STEVE BRULE",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N HARBOR DR",
                                                                                                                      "street2": null,
                                                                                                                      "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": [
                                                                                                                      {
                                                                                                                        "object": "Form",
                                                                                                                        "id": "form_395cb033b8ed4be6bcacead7782cf0d9",
                                                                                                                        "created_at": "2024-01-24T00:05:52Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:52Z",
                                                                                                                        "mode": "test",
                                                                                                                        "form_type": "return_packing_slip",
                                                                                                                        "form_url": "https://easypost-files.s3-us-west-2.amazonaws.com/files/form/20240124/a4177d0bc14e456cb91e81f48f90fb83.pdf",
                                                                                                                        "submitted_electronically": null
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "fees": [
                                                                                                                      {
                                                                                                                        "object": "Fee",
                                                                                                                        "type": "LabelFee",
                                                                                                                        "amount": "0.00000",
                                                                                                                        "charged": true,
                                                                                                                        "refunded": false
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "object": "Fee",
                                                                                                                        "type": "PostageFee",
                                                                                                                        "amount": "7.33000",
                                                                                                                        "charged": true,
                                                                                                                        "refunded": false
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "id": "shp_5889c78f5e5547958e62f6993453f0d9",
                                                                                                                    "object": "Shipment"
                                                                                                                  }

                                                                                                                  Options

                                                                                                                  Shipments can have a variety of additional options which you can specify when creating a shipment. The Options object can be populated with the keys below.

                                                                                                                  Options Object

                                                                                                                  attributetypespecification
                                                                                                                  additional_handlingbooleanSetting this option to true, will add an additional handling charge. An Additional Handling charge may be applied to the following:
                                                                                                                  • Any article that is encased in an outside shipping container made of metal or wood.
                                                                                                                  • Any item, such as a barrel, drum, pail or tire, that is not fully encased in a corrugated cardboard shipping container.
                                                                                                                  • Any package with the longest side exceeding 60 inches or its second longest side exceeding 30 inches.
                                                                                                                  • Any package with an actual weight greater than 70 pounds.
                                                                                                                  address_validation_levelstringSetting this option to "0", will allow the minimum amount of address information to pass the validation check. Only for USPS postage.
                                                                                                                  alcoholbooleanSet this option to true if your shipment contains alcohol.
                                                                                                                  • UPS - only supported for US Domestic shipments
                                                                                                                  • FedEx - only supported for US Domestic shipments
                                                                                                                  • Canada Post - Requires adult signature 19 years or older. If you want adult signature 18 years or older, instead use delivery_confirmation: ADULT_SIGNATURE
                                                                                                                  bill_receiver_accountstring*This field is deprecated. Use the 'payment' option object instead.
                                                                                                                  bill_receiver_postal_codestring*This field is deprecated. Use the 'payment' option object instead.
                                                                                                                  bill_third_party_accountstring*This field is deprecated. Use the 'payment' option object instead.
                                                                                                                  bill_third_party_countrystring*This field is deprecated. Use the 'payment' option object instead.
                                                                                                                  bill_third_party_postal_codestring*This field is deprecated. Use the 'payment' option object instead.
                                                                                                                  by_dronebooleanSetting this option to true will indicate to the carrier to prefer delivery by drone, if the carrier supports drone delivery.
                                                                                                                  carbon_neutralbooleanSetting this to true will add a charge to reduce carbon emissions by Carriers who support this option. Alternatively, EasyPost provides carbon neutral shipping for all carriers, by default, for free.
                                                                                                                  carrier_notification_emailstringAssign an email address to receive carrier notifications.
                                                                                                                  carrier_notification_smsstringAssign a phone number to receive carrier notifications.
                                                                                                                  cod_amountstringAdding an amount will have the carrier collect the specified amount from the recipient.
                                                                                                                  cod_methodstringMethod for payment. "CASH", "CHECK", "MONEY_ORDER"
                                                                                                                  cod_address_idstringThe ID of the Address to which the COD payment should be returned. Defaults to the origin address. Only available on FedEx shipments.
                                                                                                                  content_descriptionstringA description of the content of the shipment.
                                                                                                                  currencystringWhich currency this shipment will show for rates if carrier allows.
                                                                                                                  delivery_confirmationstringIf you want to request a signature, you can pass "ADULT_SIGNATURE" or "SIGNATURE". You may also request "NO_SIGNATURE" to leave the package at the door. "NO_SIGNATURE" is equivalent to releasing liability. Some options may be limited for international shipments. Carrier specific delivery confirmation options are listed below:
                                                                                                                  • FedEx - additional options
                                                                                                                    • "DIRECT" - Requires the signature of someone at the delivery address.
                                                                                                                    • "INDIRECT_SIGNATURE" - Requires the signature of someone at the delivery address or from somebody nearby, such as a neighbor.
                                                                                                                    • "SERVICE_DEFAULT" - Attempts to set the signature requirements based on the shipment details and service level.
                                                                                                                  • USPS - additional options
                                                                                                                    • "ADULT_SIGNATURE_RESTRICTED" - Requires the signature of the specific addressee, or authorized agent, who is 21 years of age or older.
                                                                                                                    • "SIGNATURE_RESTRICTED" - Requires the signature of the specified addressee, or authorized agent.
                                                                                                                  • Canada Post - "DO_NOT_SAFE_DROP" - Tells the carrier to not hide the package ("safe drop").
                                                                                                                  • GSO - "STANDARD_SIGNATURE".
                                                                                                                  • DHL Express - option mapping
                                                                                                                    • SIGNATURE" - DHL Express Direct Signature
                                                                                                                    • NO_SIGNATURE" - DHL Express Signature Release
                                                                                                                  delivery_min_datetimestringThe earliest a package should be delivered. Supported carriers vary.
                                                                                                                  delivery_max_datetimestringThe latest a package should be delivered. Supported carriers vary.
                                                                                                                  dropoff_typestringMethod the customer will use to transfer the package to the carrier. Supported dropoff types and their corresponding carrier dropoff codes are below:
                                                                                                                  FedEx
                                                                                                                  • REGULAR_PICKUP" - Customer to transfer package during regular pickup (default)
                                                                                                                  • SCHEDULED_PICKUP" - Customer to transfer package during scheduled pickup
                                                                                                                  • RETAIL_LOCATION" - Customer to transfer package at FedEx retail location
                                                                                                                  • STATION" - "STATION
                                                                                                                  • DROP_BOX" - Customer to use carrier drop box for package transfer
                                                                                                                  dry_icebooleanPackage contents contain dry ice.
                                                                                                                  • UPS - Need dry_ice_weight to be set
                                                                                                                  • UPS MailInnovations - Need dry_ice_weight to be set
                                                                                                                  • FedEx - Need dry_ice_weight to be set
                                                                                                                  dry_ice_medicalbooleanIf the dry ice is for medical use, set this option to true.
                                                                                                                  • UPS - Need dry_ice_weight to be set
                                                                                                                  • UPS MailInnovations - Need dry_ice_weight to be set
                                                                                                                  dry_ice_weightstringWeight of the dry ice in ounces.
                                                                                                                  • UPS - Need dry_ice to be set
                                                                                                                  • UPS MailInnovations - Need dry_ice to be set
                                                                                                                  • FedEx - Need dry_ice to be set
                                                                                                                  duty_paymentobjectSetting duty_payment type to bill the correct account for purchasing postage. This option is only available with FedEx and UPS.
                                                                                                                  • type - (string) Supported values are "THIRD_PARTY", and "RECEIVER".
                                                                                                                  • account - (string) Setting account number.
                                                                                                                  • country - (string) Setting country code that the account is based in.
                                                                                                                  • postal_code - (string) Setting postal code that the account is based in.
                                                                                                                  endorsementstring
                                                                                                                  • Supported by USPS:
                                                                                                                    • ELECTRONIC_SERVICE_REQUESTED
                                                                                                                    • TEMP_RETURN_SERVICE_REQUESTED
                                                                                                                  • Supported by UPS, FedEx, and DHL:
                                                                                                                    • NO_RETURN_TO_SENDER
                                                                                                                  • Supported by: USPS, UPS, FedEx, and DHL:
                                                                                                                    • ADDRESS_SERVICE_REQUESTED
                                                                                                                    • CHANGE_SERVICE_REQUESTED
                                                                                                                    • FORWARDING_SERVICE_REQUESTED
                                                                                                                    • LEAVE_IF_NO_RESPONSE
                                                                                                                    • RETURN_SERVICE_REQUESTED
                                                                                                                  end_shipper_idstringSpecify the responsible EndShipper for the shipment by passing in an EndShipper ID.
                                                                                                                  freight_chargedoubleAdditional cost to be added to the invoice of this shipment. Only applies to UPS currently.
                                                                                                                  handling_instructionsstringThis is to designate special instructions for the carrier like "Do not drop!".
                                                                                                                  hazmatstring

                                                                                                                  Used to identify the type of hazardous materials (HazMat) or dangerous goods being shipped. Unidentified HazMat can introduce risk to human safety, property and expose the shipper to civil penalties, especially for packages that travel via air. Each carrier may have a different way of identifying HazMat and rates will only be retuned for carriers that support the type designated. Refer to carrier documentation to determine how to identify HazMat types and for complete rules and regulations.

                                                                                                                  FedEx and DHL eCommerce
                                                                                                                  • PRIMARY_CONTAINED: Primary Contained
                                                                                                                  • PRIMARY_PACKED: Primary Packed
                                                                                                                  • PRIMARY: Primary
                                                                                                                  • SECONDARY_CONTAINED: Secondary Contained
                                                                                                                  • SECONDARY_PACKED: Secondary Packed
                                                                                                                  • SECONDARY: Secondary
                                                                                                                  • ORMD: Other Regulated Materials—Domestic
                                                                                                                  • LITHIUM: Lithium
                                                                                                                  FedEx, DHL eCommerce, and USPS
                                                                                                                  • LIMITED_QUANTITY: Limited Quantity Ground Package
                                                                                                                  USPS: See EasyPost's USPS HazMat Guide and USPS Pub. 52 for complete regulations.
                                                                                                                  • AIR_ELIGIBLE_ETHANOL: Air Eligible Ethanol Package
                                                                                                                  • CLASS_1: Class 1 - Toy Propellant/Safety Fuse Package
                                                                                                                  • CLASS_3: Class 3 - Package
                                                                                                                  • CLASS_7: Class 7 - Radioactive Materials Package
                                                                                                                  • CLASS_8_CORROSIVE: Class 8 - Corrosive Materials Package
                                                                                                                  • CLASS_8_WET_BATTERY: Class 8 - Nonspillable Wet Battery Package
                                                                                                                  • CLASS_9_NEW_LITHIUM_INDIVIDUAL: Class 9 - Lithium Battery Marked - Ground Only Package
                                                                                                                  • CLASS_9_USED_LITHIUM: Class 9 - Lithium Battery - Returns Package
                                                                                                                  • CLASS_9_NEW_LITHIUM_DEVICE: Class 9 - Lithium batteries, marked package
                                                                                                                  • CLASS_9_DRY_ICE: Class 9 - Dry Ice Package
                                                                                                                  • CLASS_9_UNMARKED_LITHIUM: Class 9 - Lithium batteries, unmarked package
                                                                                                                  • CLASS_9_MAGNETIZED: Class 9 - Magnetized Materials Package
                                                                                                                  • DIVISION_4_1: Division 4.1 - Mailable flammable solids and Safety Matches Package
                                                                                                                  • DIVISION_5_1: Division 5.1 - Oxidizers Package
                                                                                                                  • DIVISION_5_2: Division 5.2 - Organic Peroxides Package
                                                                                                                  • DIVISION_6_1: Division 6.1 - Toxic Materials Package (with an LD50 of 50 mg/kg or less)
                                                                                                                  • DIVISION_6_2: Division 6.2
                                                                                                                  • EXCEPTED_QUANTITY_PROVISION: Excepted Quantity Provision Package
                                                                                                                  • GROUND_ONLY: Ground Only
                                                                                                                  • ID8000: ID8000 Consumer Commodity Package
                                                                                                                  • LIGHTERS: Lighters Package
                                                                                                                  • SMALL_QUANTITY_PROVISION: Small Quantity Provision Package
                                                                                                                  hold_for_pickupbooleanPackage will wait at carrier facility for pickup.
                                                                                                                  incotermstringIncoterm negotiated for shipment. Supported values are "EXW", "FCA", "CPT", "CIP", "DAT", "DAP", "DDP", "FAS", "FOB", "CFR", and "CIF". Setting this value to anything other than "DDP" will pass the cost and responsibility of duties on to the recipient of the package(s), as specified by Incoterms rules
                                                                                                                  invoice_numberstringThis will print an invoice number on the postage label.
                                                                                                                  label_datestringSet the date that will appear on the postage label. Accepts ISO 8601 formatted string including time zone offset. EasyPost stores all dates as UTC time.
                                                                                                                  label_formatstringSupported label formats include "PNG", "PDF", "ZPL", and "EPL2". "PNG" is the only format that allows for conversion.
                                                                                                                  machinablebooleanWhether or not the parcel can be processed by the carriers equipment.
                                                                                                                  paymentobjectSetting payment type to bill the correct account for purchasing postage. THIRD_PARTY is only supported on passthrough billed carriers.
                                                                                                                  • type - (string) Supported values are "SENDER", "THIRD_PARTY", "RECEIVER", "COLLECT". Defaults to SENDER.
                                                                                                                  • account - (string) Setting account number. Required for RECEIVER and THIRD_PARTY.
                                                                                                                  • country - (string) Setting country code that the account is based in. Required for THIRD_PARTY.
                                                                                                                  • postal_code - (string) Setting postal code that the account is based in. Required for RECEIVER and THIRD_PARTY.
                                                                                                                  pickup_min_datetimestringThe earliest a package should be picked up. Supported carriers vary.
                                                                                                                  pickup_max_datetimestringThe latest a package should be picked up. Supported carriers vary.
                                                                                                                  print_custom_1stringYou can optionally print custom messages on labels. The locations of these fields show up on different spots on the carrier's labels.
                                                                                                                  print_custom_2stringAn additional message on the label. Same restrictions as print_custom_1
                                                                                                                  print_custom_3stringAn additional message on the label. Same restrictions as print_custom_1
                                                                                                                  print_custom_1_barcodebooleanCreate a barcode for this custom reference if supported by carrier.
                                                                                                                  print_custom_2_barcodebooleanCreate a barcode for this custom reference if supported by carrier.
                                                                                                                  print_custom_3_barcodebooleanCreate a barcode for this custom reference if supported by carrier.
                                                                                                                  print_custom_1_codestringSpecify the type of print_custom_1.
                                                                                                                  FedEx
                                                                                                                  • (null) - If print_custom_1_code is not provided it defaults to Customer Reference
                                                                                                                  • PO - Purchase Order Number
                                                                                                                  • DP - Department Number
                                                                                                                  • RMA - Return Merchandise Authorization
                                                                                                                  UPS
                                                                                                                  • AJ - Accounts Receivable Customer Account
                                                                                                                  • AT - Appropriation Number
                                                                                                                  • BM - Bill of Lading Number
                                                                                                                  • 9V - Collect on Delivery (COD) Number
                                                                                                                  • ON - Dealer Order Number
                                                                                                                  • DP - Department Number
                                                                                                                  • 3Q - Food and Drug Administration (FDA) Product Code
                                                                                                                  • IK - Invoice Number
                                                                                                                  • MK - Manifest Key Number
                                                                                                                  • MJ - Model Number
                                                                                                                  • PM - Part Number
                                                                                                                  • PC - Production Code
                                                                                                                  • PO - Purchase Order Number
                                                                                                                  • RQ - Purchase Request Number
                                                                                                                  • RZ - Return Authorization Number
                                                                                                                  • SA - Salesperson Number
                                                                                                                  • SE - Serial Number
                                                                                                                  • ST - Store Number
                                                                                                                  • TN - Transaction Reference Number
                                                                                                                  • EI - Employer's ID Number
                                                                                                                  • TJ - Federal Taxpayer ID No.
                                                                                                                  print_custom_2_codestringSee print_custom_1_code.
                                                                                                                  print_custom_3_codestringSee print_custom_1_code.
                                                                                                                  saturday_deliverybooleanSet this value to true to make your shipment eligible for Saturday delivery.
                                                                                                                  special_rates_eligibilitystringThis option enables the selection of USPS Media Mail or Library Mail classes. Specify 'USPS.MEDIAMAIL' or 'USPS.LIBRARYMAIL' to return respective rates. To request rates for both classes simultaneously, input 'USPS.MEDIAMAIL,USPS.LIBRARYMAIL'. These mail classes are subject to restrictions and eligibility rules as outlined in the DMM .
                                                                                                                  smartpost_hubstringYou can use this to override the hub ID you have on your account.
                                                                                                                  smartpost_manifeststringThe manifest ID is used to group FedEx Ground Economy packages onto a manifest for each trailer.
                                                                                                                  billing_refstringA reference ID for aggregating DHL eCommerce billing data.
                                                                                                                  certified_mailbooleanCertified Mail provides the sender with a mailing receipt and, upon request, electronic verification that an article was delivered or that a delivery attempt was made.
                                                                                                                  registered_mailbooleanRegistered Mail is the most secure service that the USPS offers. It incorporates a system of receipts to monitor the movement of the mail from the point of acceptance to delivery
                                                                                                                  registered_mail_amountdoubleThe value of the package contents
                                                                                                                  return_receiptbooleanAn electronic return receipt may be purchased at the time of mailing and provides a shipper with evidence of delivery (to whom the mail was delivered and date of delivery), and information about the recipient's actual delivery address. Only applies to the USPS.
                                                                                                                  POST/shipments

                                                                                                                  Create a Shipment with Options

                                                                                                                  Any number of options can be specified during Shipment creation.

                                                                                                                  Example
                                                                                                                  package shipments;
                                                                                                                  
                                                                                                                  import com.easypost.exception.EasyPostException;
                                                                                                                  import com.easypost.model.Shipment;
                                                                                                                  import com.easypost.service.EasyPostClient;
                                                                                                                  
                                                                                                                  import java.util.HashMap;
                                                                                                                  
                                                                                                                  public class CreateWithOptions {
                                                                                                                      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> parcel = new HashMap<String, Object>();
                                                                                                                          parcel.put("id", "prcl_...");
                                                                                                                  
                                                                                                                          HashMap<String, Object> options = new HashMap<String, Object>();
                                                                                                                          parcel.put("print_custom_1", "Custom label message");
                                                                                                                  
                                                                                                                          HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                          params.put("to_address", toAddress);
                                                                                                                          params.put("from_address", fromAddress);
                                                                                                                          params.put("parcel", parcel);
                                                                                                                          params.put("options", options);
                                                                                                                  
                                                                                                                          Shipment shipment = client.shipment.create(params);
                                                                                                                  
                                                                                                                          System.out.println(shipment);
                                                                                                                      }
                                                                                                                  }
                                                                                                                  {
                                                                                                                    "created_at": "2024-01-24T00:05:54Z",
                                                                                                                    "is_return": false,
                                                                                                                    "messages": [],
                                                                                                                    "mode": "test",
                                                                                                                    "options": {
                                                                                                                      "print_custom_1": "Custom label message",
                                                                                                                      "currency": "USD",
                                                                                                                      "print_custom": [
                                                                                                                        {
                                                                                                                          "value": "Custom label message"
                                                                                                                        }
                                                                                                                      ],
                                                                                                                      "payment": {
                                                                                                                        "type": "SENDER"
                                                                                                                      },
                                                                                                                      "date_advance": 0
                                                                                                                    },
                                                                                                                    "reference": null,
                                                                                                                    "status": "unknown",
                                                                                                                    "tracking_code": null,
                                                                                                                    "updated_at": "2024-01-24T00:05:54Z",
                                                                                                                    "batch_id": null,
                                                                                                                    "batch_status": null,
                                                                                                                    "batch_message": null,
                                                                                                                    "customs_info": {
                                                                                                                      "id": "cstinfo_8a0e647447974eaf97d0d94fe660c888",
                                                                                                                      "object": "CustomsInfo",
                                                                                                                      "created_at": "2024-01-24T00:05:54Z",
                                                                                                                      "updated_at": "2024-01-24T00:05:54Z",
                                                                                                                      "contents_explanation": "",
                                                                                                                      "contents_type": "merchandise",
                                                                                                                      "customs_certify": true,
                                                                                                                      "customs_signer": "Steve Brule",
                                                                                                                      "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                      "non_delivery_option": "return",
                                                                                                                      "restriction_comments": null,
                                                                                                                      "restriction_type": "none",
                                                                                                                      "mode": "test",
                                                                                                                      "declaration": null,
                                                                                                                      "customs_items": [
                                                                                                                        {
                                                                                                                          "id": "cstitem_34121009b24446eca08712c10b95ffb7",
                                                                                                                          "object": "CustomsItem",
                                                                                                                          "created_at": "2024-01-24T00:05:54Z",
                                                                                                                          "updated_at": "2024-01-24T00:05:54Z",
                                                                                                                          "description": "T-shirt",
                                                                                                                          "hs_tariff_number": "123456",
                                                                                                                          "origin_country": "US",
                                                                                                                          "quantity": 1,
                                                                                                                          "value": "10.0",
                                                                                                                          "weight": 5.0,
                                                                                                                          "code": "123",
                                                                                                                          "mode": "test",
                                                                                                                          "manufacturer": null,
                                                                                                                          "currency": null,
                                                                                                                          "eccn": null,
                                                                                                                          "printed_commodity_identifier": null
                                                                                                                        }
                                                                                                                      ]
                                                                                                                    },
                                                                                                                    "from_address": {
                                                                                                                      "id": "adr_57988df8ba4c11ee8d3bac1f6bc539ae",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:54+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:54+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": null,
                                                                                                                    "parcel": {
                                                                                                                      "id": "prcl_5e953fb53a5f4207b7d6ee32267d25cb",
                                                                                                                      "object": "Parcel",
                                                                                                                      "created_at": "2024-01-24T00:05:54Z",
                                                                                                                      "updated_at": "2024-01-24T00:05:54Z",
                                                                                                                      "length": 20.2,
                                                                                                                      "width": 10.9,
                                                                                                                      "height": 5.0,
                                                                                                                      "predefined_package": null,
                                                                                                                      "weight": 65.9,
                                                                                                                      "mode": "test"
                                                                                                                    },
                                                                                                                    "postage_label": null,
                                                                                                                    "rates": [
                                                                                                                      {
                                                                                                                        "id": "rate_caa4e8d8f0ae4a06b7ea79451886c781",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:05:54Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:54Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Express",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "49.60",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "57.40",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "49.60",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": null,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": null,
                                                                                                                        "shipment_id": "shp_ca70827221b04ad589f0d170ec933f52",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_c5c1761ec40244e3bb06e16e4bf84e27",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:05:54Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:54Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "Priority",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "7.33",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "15.20",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "10.89",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 2,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 2,
                                                                                                                        "shipment_id": "shp_ca70827221b04ad589f0d170ec933f52",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_4f361f673c364f28bd4c8aa806c9a226",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:05:54Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:54Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "GroundAdvantage",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_ca70827221b04ad589f0d170ec933f52",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_c201b421c0304e73a4320c240d3c206b",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:05:54Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:54Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "First",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_ca70827221b04ad589f0d170ec933f52",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      },
                                                                                                                      {
                                                                                                                        "id": "rate_c1a6b070dd9d45acb3f3a3eaf3a439bd",
                                                                                                                        "object": "Rate",
                                                                                                                        "created_at": "2024-01-24T00:05:54Z",
                                                                                                                        "updated_at": "2024-01-24T00:05:54Z",
                                                                                                                        "mode": "test",
                                                                                                                        "service": "ParcelSelect",
                                                                                                                        "carrier": "USPS",
                                                                                                                        "rate": "6.79",
                                                                                                                        "currency": "USD",
                                                                                                                        "retail_rate": "13.15",
                                                                                                                        "retail_currency": "USD",
                                                                                                                        "list_rate": "9.41",
                                                                                                                        "list_currency": "USD",
                                                                                                                        "billing_type": "easypost",
                                                                                                                        "delivery_days": 3,
                                                                                                                        "delivery_date": null,
                                                                                                                        "delivery_date_guaranteed": false,
                                                                                                                        "est_delivery_days": 3,
                                                                                                                        "shipment_id": "shp_ca70827221b04ad589f0d170ec933f52",
                                                                                                                        "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                      }
                                                                                                                    ],
                                                                                                                    "refund_status": null,
                                                                                                                    "scan_form": null,
                                                                                                                    "selected_rate": null,
                                                                                                                    "tracker": null,
                                                                                                                    "to_address": {
                                                                                                                      "id": "adr_5795ce04ba4c11ee8d39ac1f6bc539ae",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:54+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:54+00:00",
                                                                                                                      "name": "Dr. Steve Brule",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N Harbor Dr",
                                                                                                                      "street2": null,
                                                                                                                      "city": "Redondo Beach",
                                                                                                                      "state": "CA",
                                                                                                                      "zip": "90277",
                                                                                                                      "country": "US",
                                                                                                                      "phone": "8573875756",
                                                                                                                      "email": "dr_steve_brule@gmail.com",
                                                                                                                      "mode": "test",
                                                                                                                      "carrier_facility": null,
                                                                                                                      "residential": null,
                                                                                                                      "federal_tax_id": null,
                                                                                                                      "state_tax_id": null,
                                                                                                                      "verifications": {}
                                                                                                                    },
                                                                                                                    "usps_zone": 4,
                                                                                                                    "return_address": {
                                                                                                                      "id": "adr_57988df8ba4c11ee8d3bac1f6bc539ae",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:54+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:54+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_5795ce04ba4c11ee8d39ac1f6bc539ae",
                                                                                                                      "object": "Address",
                                                                                                                      "created_at": "2024-01-24T00:05:54+00:00",
                                                                                                                      "updated_at": "2024-01-24T00:05:54+00:00",
                                                                                                                      "name": "Dr. Steve Brule",
                                                                                                                      "company": null,
                                                                                                                      "street1": "179 N Harbor Dr",
                                                                                                                      "street2": null,
                                                                                                                      "city": "Redondo Beach",
                                                                                                                      "state": "CA",
                                                                                                                      "zip": "90277",
                                                                                                                      "country": "US",
                                                                                                                      "phone": "8573875756",
                                                                                                                      "email": "dr_steve_brule@gmail.com",
                                                                                                                      "mode": "test",
                                                                                                                      "carrier_facility": null,
                                                                                                                      "residential": null,
                                                                                                                      "federal_tax_id": null,
                                                                                                                      "state_tax_id": null,
                                                                                                                      "verifications": {}
                                                                                                                    },
                                                                                                                    "forms": [],
                                                                                                                    "fees": [],
                                                                                                                    "id": "shp_ca70827221b04ad589f0d170ec933f52",
                                                                                                                    "object": "Shipment"
                                                                                                                  }

                                                                                                                  Rates

                                                                                                                  After a Shipment is successfully created, it will automatically fetch Rates. You can limit the CarrierAccounts to use for rating by passing the carrier_accounts parameter upon Shipment creation.

                                                                                                                  There are three rate types: the actual rate that will be purchased, rate and currency, the published non-discounted rate, list_rate and list_currency, and the rate if purchased from the post office, retail_rate and retail_currency.

                                                                                                                  Rates Object

                                                                                                                  attributetypespecification
                                                                                                                  idstringunique, begins with 'rate_'
                                                                                                                  objectstring"Rate"
                                                                                                                  modestring"test" or "production"
                                                                                                                  servicestringservice level/name
                                                                                                                  carrierstringname of carrier
                                                                                                                  carrier_account_idstringID of the CarrierAccount record used to generate this rate
                                                                                                                  shipment_idstringID of the Shipment this rate belongs to
                                                                                                                  ratestringthe actual rate quote for this service
                                                                                                                  currencystringcurrency for the rate
                                                                                                                  retail_ratestringthe retail rate is the in-store rate given with no account
                                                                                                                  retail_currencystringcurrency for the retail rate
                                                                                                                  list_ratestringthe list rate is the non-negotiated rate given for having an account with the carrier
                                                                                                                  list_currencystringcurrency for the list rate
                                                                                                                  delivery_daysintegerdelivery days for this service
                                                                                                                  delivery_datestringdate for delivery
                                                                                                                  delivery_date_guaranteedbooleanindicates if delivery window is guaranteed (true) or not (false)
                                                                                                                  est_delivery_days*integer*This field is deprecated and should be ignored.
                                                                                                                  billing_typestringBilling type of the rate
                                                                                                                  created_atdatetime
                                                                                                                  updated_atdatetime

                                                                                                                  Service Levels

                                                                                                                  Accurate
                                                                                                                  • Route
                                                                                                                  Amazon MWS
                                                                                                                  • UPS Rates
                                                                                                                  • USPS Rates
                                                                                                                  • FedEx Rates
                                                                                                                  • UPS Labels
                                                                                                                  • USPS Labels
                                                                                                                  • FedEx Labels
                                                                                                                  • UPS Tracking
                                                                                                                  • USPS Tracking
                                                                                                                  • FedEx Tracking
                                                                                                                  APC
                                                                                                                  • parcelConnectBookService
                                                                                                                  • parcelConnectExpeditedDDP
                                                                                                                  • parcelConnectExpeditedDDU
                                                                                                                  • parcelConnectPriorityDDP
                                                                                                                  • parcelConnectPriorityDDPDelcon
                                                                                                                  • parcelConnectPriorityDDU
                                                                                                                  • parcelConnectPriorityDDUDelcon
                                                                                                                  • parcelConnectPriorityDDUPQW
                                                                                                                  • parcelConnectStandardDDU
                                                                                                                  • parcelConnectStandardDDUPQW
                                                                                                                  • parcelConnectPacketDDU
                                                                                                                  Asendia USA
                                                                                                                  • ADS
                                                                                                                  • AirFreightInbound
                                                                                                                  • AirFreightOutbound
                                                                                                                  • AsendiaDomesticBoundPrinterMatterExpedited
                                                                                                                  • AsendiaDomesticBoundPrinterMatterGround
                                                                                                                  • AsendiaDomesticFlatsExpedited
                                                                                                                  • AsendiaDomesticFlatsGround
                                                                                                                  • AsendiaDomesticParcelGroundOver1lb
                                                                                                                  • AsendiaDomesticParcelGroundUnder1lb
                                                                                                                  • AsendiaDomesticParcelMAXOver1lb
                                                                                                                  • AsendiaDomesticParcelMAXUnder1lb
                                                                                                                  • AsendiaDomesticParcelOver1lbExpedited
                                                                                                                  • AsendiaDomesticParcelUnder1lbExpedited
                                                                                                                  • AsendiaDomesticPromoParcelExpedited
                                                                                                                  • AsendiaDomesticPromoParcelGround
                                                                                                                  • BulkFreight
                                                                                                                  • BusinessMailCanadaLettermail
                                                                                                                  • BusinessMailCanadaLettermailMachineable
                                                                                                                  • BusinessMailEconomy
                                                                                                                  • BusinessMailEconomyLPWholesale
                                                                                                                  • BusinessMailEconomySPWholesale
                                                                                                                  • BusinessMailIPA
                                                                                                                  • BusinessMailISAL
                                                                                                                  • BusinessMailPriority
                                                                                                                  • BusinessMailPriorityLPWholesale
                                                                                                                  • BusinessMailPrioritySPWholesale
                                                                                                                  • MarketingMailCanadaPersonalizedLCP
                                                                                                                  • MarketingMailCanadaPersonalizedMachineable
                                                                                                                  • MarketingMailCanadaPersonalizedNDG
                                                                                                                  • MarketingMailEconomy
                                                                                                                  • MarketingMailIPA
                                                                                                                  • MarketingMailISAL
                                                                                                                  • MarketingMailPriority
                                                                                                                  • PublicationsCanadaLCP
                                                                                                                  • PublicationsCanadaNDG
                                                                                                                  • PublicationsEconomy
                                                                                                                  • PublicationsIPA
                                                                                                                  • PublicationsISAL
                                                                                                                  • PublicationsPriority
                                                                                                                  • ePAQElite
                                                                                                                  • ePAQEliteCustom
                                                                                                                  • ePAQEliteDAP
                                                                                                                  • ePAQEliteDDP
                                                                                                                  • ePAQEliteDDPOversized
                                                                                                                  • ePAQEliteDPD
                                                                                                                  • ePAQEliteDirectAccessCanadaDDP
                                                                                                                  • ePAQEliteOversized
                                                                                                                  • ePAQPlus
                                                                                                                  • ePAQPlusCustom
                                                                                                                  • ePAQPlusCustomsPrepaid
                                                                                                                  • ePAQPlusDAP
                                                                                                                  • ePAQPlusDDP
                                                                                                                  • ePAQPlusEconomy
                                                                                                                  • ePAQPlusWholesale
                                                                                                                  • ePAQPlusePacket
                                                                                                                  • ePAQPlusePacketCanadaCustomsPrePaid
                                                                                                                  • ePAQPlusePacketCanadaDDP
                                                                                                                  • ePAQReturnsDomestic
                                                                                                                  • ePAQReturnsInternational
                                                                                                                  • ePAQSelect
                                                                                                                  • ePAQSelectCustom
                                                                                                                  • ePAQSelectCustomsPrepaidByShopper
                                                                                                                  • ePAQSelectDAP
                                                                                                                  • ePAQSelectDDP
                                                                                                                  • ePAQSelectDDPDirectAccess
                                                                                                                  • ePAQSelectDirectAccess
                                                                                                                  • ePAQSelectDirectAccessCanadaDDP
                                                                                                                  • ePAQSelectEconomy
                                                                                                                  • ePAQSelectOversized
                                                                                                                  • ePAQSelectOversizedDDP
                                                                                                                  • ePAQSelectPMEI
                                                                                                                  • ePAQSelectPMEICanadaCustomsPrePaid
                                                                                                                  • ePAQSelectPMEIPCPostage
                                                                                                                  • ePAQSelectPMI
                                                                                                                  • ePAQSelectPMICanadaCustomsPrepaid
                                                                                                                  • ePAQSelectPMICanadaDDP
                                                                                                                  • ePAQSelectPMINonPresort
                                                                                                                  • ePAQSelectPMIPCPostage
                                                                                                                  • ePAQStandard
                                                                                                                  • ePAQStandardCustom
                                                                                                                  • ePAQStandardEconomy
                                                                                                                  • ePAQStandardIPA
                                                                                                                  • ePAQStandardISAL
                                                                                                                  • ePaqSelectPMEINonPresort
                                                                                                                  Australia Post
                                                                                                                  • ParcelPost
                                                                                                                  • ExpressPost
                                                                                                                  • International
                                                                                                                  • Commercial
                                                                                                                  AxlehireV3
                                                                                                                  • AxleHireDelivery
                                                                                                                  Better Trucks
                                                                                                                  • NEXT_DAY
                                                                                                                  • EXPRESS
                                                                                                                  Canada Post
                                                                                                                  • RegularParcel
                                                                                                                  • ExpeditedParcel
                                                                                                                  • Xpresspost
                                                                                                                  • Priority
                                                                                                                  • ExpeditedParcelUSA
                                                                                                                  • SmallPacketUSAAir
                                                                                                                  • TrackedPacketUSA
                                                                                                                  • TrackedPacketUSALVM
                                                                                                                  • XpresspostUSA
                                                                                                                  • XpresspostInternational
                                                                                                                  • InternationalParcelAir
                                                                                                                  • InternationalParcelSurface
                                                                                                                  • SmallPacketInternationalAir
                                                                                                                  • SmallPacketInternationalSurface
                                                                                                                  • TrackedPacketInternational
                                                                                                                  • ExpeditedParcelPlus
                                                                                                                  Canpar
                                                                                                                  • Ground
                                                                                                                  • USA
                                                                                                                  • SelectLetter
                                                                                                                  • SelectPak
                                                                                                                  • Select
                                                                                                                  • OvernightLetter
                                                                                                                  • OvernightPak
                                                                                                                  • Overnight
                                                                                                                  • USALetter
                                                                                                                  • USAPak
                                                                                                                  • SelectUSA
                                                                                                                  • International
                                                                                                                  CDL Last Mile Solutions
                                                                                                                  • DISTRIBUTION
                                                                                                                  • Same Day
                                                                                                                  Chronopost

                                                                                                                  No service levels for Chronopost.

                                                                                                                    Cirro E-Commerce
                                                                                                                    • CAECOCE (US to CA Economy)
                                                                                                                    • CAECONE (US to CA Economy)
                                                                                                                    • CAECOWE (US to CA Economy)
                                                                                                                    • ECOCE (Economy Central)
                                                                                                                    • ECOEA (Economy East)
                                                                                                                    • ECONE (Economy Northeast)
                                                                                                                    • ECOSO (Economy South)
                                                                                                                    • ECOWE (Economy West)
                                                                                                                    • EUECOWE (US to Europe Economy)
                                                                                                                    • EXPBNE (Expedited Northeast)
                                                                                                                    • EXPWE (Expedited West)
                                                                                                                    • REGCE (Regional Central)
                                                                                                                    • REGEA (Regional East)
                                                                                                                    • REGNE (Regional Northeast)
                                                                                                                    • REGSO (Regional South)
                                                                                                                    • REGWE (Regional West)
                                                                                                                    CloudSort

                                                                                                                    No service levels for CloudSort.

                                                                                                                      Courier Express
                                                                                                                      • BASIC_PARCEL
                                                                                                                      Couriers Please
                                                                                                                      • RoadExpress
                                                                                                                      • AggExpAtlP10
                                                                                                                      • AggExpAtlP25
                                                                                                                      • AggExpAtlBaseandKilo
                                                                                                                      • AggExpAtlP0
                                                                                                                      • AggExpAtlP1
                                                                                                                      • AggExpAtlP3
                                                                                                                      • AggExpAtlP5
                                                                                                                      • AggDropOffHubbedBaseandKilo
                                                                                                                      • AggDropOffHubbedP0
                                                                                                                      • AggDropOffHubbedP1
                                                                                                                      • AggDropOffHubbedP3
                                                                                                                      • AggDropOffHubbedP5
                                                                                                                      • AggStdAtlP10
                                                                                                                      • AggStdAtlBaseandKilo
                                                                                                                      • AggStdAtlP0
                                                                                                                      • AggStdAtlP1
                                                                                                                      • AggStdAtlP3
                                                                                                                      • AggStdAtlP5
                                                                                                                      • AggEcomBaseandKilo
                                                                                                                      • AggEcomP0
                                                                                                                      • AggEcomP1
                                                                                                                      • AggEcomP3
                                                                                                                      • AggEcomP5
                                                                                                                      • AggDropOffHubbedP10
                                                                                                                      • AggDropOffHubbedP25
                                                                                                                      • AggStdAtlP25
                                                                                                                      • AggEcomP10
                                                                                                                      • AggEcomP25
                                                                                                                      • AustralianCityExpress
                                                                                                                      • DropShip500GramParcel
                                                                                                                      • DropShip1KgParcel
                                                                                                                      • DropShip3KgParcel
                                                                                                                      • DropShip5KgParcel
                                                                                                                      • DomesticPriority
                                                                                                                      • DropShip10KgParcel
                                                                                                                      • DropShip20KgParcel
                                                                                                                      • DomesticPrioritySignature
                                                                                                                      • GoldDomestic
                                                                                                                      • RoadExpressNoDelivery
                                                                                                                      • RoadExpressNoPickUp
                                                                                                                      • 500GramParcel
                                                                                                                      • 500GramParcelATL
                                                                                                                      • 10KgParcel
                                                                                                                      • 10KgParcelATL
                                                                                                                      • 15KgParcel
                                                                                                                      • 15KgParcelATL
                                                                                                                      • 1KgParcelATL
                                                                                                                      • 2KgParcel
                                                                                                                      • 25KgParcel
                                                                                                                      • 25KgParcelATL
                                                                                                                      • 2KgParcelATL
                                                                                                                      • 3KgParcelATL
                                                                                                                      • 5Kg Parcel ATL
                                                                                                                      • AustralianCityExpressSignature
                                                                                                                      • DomesticSaverSignature
                                                                                                                      • DomesticOffPeak
                                                                                                                      • DomesticSaver
                                                                                                                      • DomesticOffPeakSignature
                                                                                                                      • GoldDomesticSignature
                                                                                                                      • 1KgSatchelATL
                                                                                                                      • 1KgSatchel
                                                                                                                      • 3KgSatchel
                                                                                                                      • 5KgSatchel
                                                                                                                      • 3KgSatchelATL
                                                                                                                      • 5KgSatchelATL
                                                                                                                      • 500GramSatchelATL
                                                                                                                      • 500GramSatchel
                                                                                                                      • 5KSatchel
                                                                                                                      • ExpressInternationalPriority
                                                                                                                      • InternationalSaver
                                                                                                                      • InternationalExpressImport
                                                                                                                      • InternationalExpress
                                                                                                                      • 500gmParcel
                                                                                                                      • 1KgParcel
                                                                                                                      • 3KgParcel
                                                                                                                      • 5KgParcel
                                                                                                                      DAI Post
                                                                                                                      • ParcelMax
                                                                                                                      • InternationalEconomy
                                                                                                                      • InternationalStandard
                                                                                                                      • InternationalExpress
                                                                                                                      • DomesticTracked
                                                                                                                      Deliver-It
                                                                                                                      • Saturday
                                                                                                                      • Economy
                                                                                                                      • Noon-It
                                                                                                                      • Early-It
                                                                                                                      • Afternoon
                                                                                                                      Deutsche Post
                                                                                                                      • PacketPlus
                                                                                                                      Deutsche Post UK
                                                                                                                      • PriorityPacketPlus
                                                                                                                      • PriorityPacket
                                                                                                                      • PriorityPacketTracked
                                                                                                                      • BusinessMailRegistered
                                                                                                                      • StandardPacket
                                                                                                                      • BusinessMailStandard
                                                                                                                      DHL eCommerce Solutions
                                                                                                                      • DHLParcelExpedited
                                                                                                                      • DHLParcelExpeditedMax
                                                                                                                      • DHLParcelGround
                                                                                                                      • DHLBPMExpedited
                                                                                                                      • DHLBPMGround
                                                                                                                      • DHLParcelInternationalDirect
                                                                                                                      • DHLParcelInternationalStandard
                                                                                                                      • DHLPacketInternational
                                                                                                                      • DHLParcelInternationalDirectPriority
                                                                                                                      • DHLParcelInternationalDirectStandard
                                                                                                                      DHL Express
                                                                                                                      • BreakBulkEconomy
                                                                                                                      • BreakBulkExpress
                                                                                                                      • DomesticEconomySelect
                                                                                                                      • DomesticExpress
                                                                                                                      • DomesticExpress1030
                                                                                                                      • DomesticExpress1200
                                                                                                                      • EconomySelect
                                                                                                                      • EconomySelectNonDoc
                                                                                                                      • EuroPack
                                                                                                                      • EuropackNonDoc
                                                                                                                      • Express1030
                                                                                                                      • Express1030NonDoc
                                                                                                                      • Express1200NonDoc
                                                                                                                      • Express1200
                                                                                                                      • Express900
                                                                                                                      • Express900NonDoc
                                                                                                                      • ExpressEasy
                                                                                                                      • ExpressEasyNonDoc
                                                                                                                      • ExpressEnvelope
                                                                                                                      • ExpressWorldwide
                                                                                                                      • ExpressWorldwideB2C
                                                                                                                      • ExpressWorldwideB2CNonDoc
                                                                                                                      • ExpressWorldwideECX
                                                                                                                      • ExpressWorldwideNonDoc
                                                                                                                      • FreightWorldwide
                                                                                                                      • GlobalmailBusiness
                                                                                                                      • JetLine
                                                                                                                      • JumboBox
                                                                                                                      • LogisticsServices
                                                                                                                      • SameDay
                                                                                                                      • SecureLine
                                                                                                                      • SprintLine
                                                                                                                      DHL Paket
                                                                                                                      • EuroPaket
                                                                                                                      • Paket
                                                                                                                      • PaketConnect
                                                                                                                      • PaketInternational
                                                                                                                      • Retoure
                                                                                                                      DPD
                                                                                                                      • DPDCLASSIC
                                                                                                                      • DPD8:30
                                                                                                                      • DPD10:00
                                                                                                                      • DPD12:00
                                                                                                                      • DPD18:00
                                                                                                                      • DPDEXPRESS
                                                                                                                      • DPDPARCELLETTER
                                                                                                                      • DPDPARCELLETTERPLUS
                                                                                                                      • DPDINTERNATIONALMAIL
                                                                                                                      DPD NL
                                                                                                                      • DPDNL_CLASSIC
                                                                                                                      • EXPRESS_10
                                                                                                                      • EXPRESS_12
                                                                                                                      • EXPRESS_18
                                                                                                                      • INTERNATIONAL_EXPRESS
                                                                                                                      • DPDNL_HOME
                                                                                                                      • DPDNL_TO_SHOP
                                                                                                                      DPD UK
                                                                                                                      • AirClassicInternationalAir
                                                                                                                      • AirExpressInternationalAir
                                                                                                                      • ExpresspakDpd10:30
                                                                                                                      • ExpresspakDpd12:00
                                                                                                                      • ExpresspakDpdClassic
                                                                                                                      • ExpresspakDpdNextDay
                                                                                                                      • ExpresspakSaturday
                                                                                                                      • ExpresspakSaturday10:30
                                                                                                                      • ExpresspakSaturday12:00
                                                                                                                      • ExpresspakSunday
                                                                                                                      • ExpresspakSunday12:00
                                                                                                                      • FreightParcelDpd10:30
                                                                                                                      • FreightParcelDpd12:00
                                                                                                                      • FreightParcelDpdClassic
                                                                                                                      • FreightParcelDpdNextDay
                                                                                                                      • FreightParcelDpdTwoDay
                                                                                                                      • FreightParcelSaturday
                                                                                                                      • FreightParcelSaturday10:30
                                                                                                                      • FreightParcelSaturday12:00
                                                                                                                      • FreightParcelSunday
                                                                                                                      • FreightParcelSunday12:00
                                                                                                                      • PalletDpd10:30
                                                                                                                      • PalletDpd12:00
                                                                                                                      • PalletDpdClassic
                                                                                                                      • PalletDpdNextDay
                                                                                                                      • PalletDpdTwoDay
                                                                                                                      • PalletSaturday
                                                                                                                      • PalletSaturday10:30
                                                                                                                      • PalletSaturday12:00
                                                                                                                      • PalletSunday
                                                                                                                      • PalletSunday12:00
                                                                                                                      • ParcelDpd10:30
                                                                                                                      • ParcelDpd12:00
                                                                                                                      • ParcelDpdClassic
                                                                                                                      • ParcelDpdNextDay
                                                                                                                      • ParcelDpdTwoDay
                                                                                                                      • ParcelReturnToShop
                                                                                                                      • ParcelSaturday
                                                                                                                      • ParcelSaturday10:30
                                                                                                                      • ParcelSaturday12:00
                                                                                                                      • ParcelSunday
                                                                                                                      • ParcelSunday12:00
                                                                                                                      ePostGlobal
                                                                                                                      • CourierServiceDDP
                                                                                                                      • CourierServiceDDU
                                                                                                                      • DomesticEconomyParcel
                                                                                                                      • DomesticParcelBPM
                                                                                                                      • DomesticPriorityParcel
                                                                                                                      • DomesticPriorityParcelBPM
                                                                                                                      • EMIService
                                                                                                                      • EconomyParcelService
                                                                                                                      • IPAService
                                                                                                                      • ISALService
                                                                                                                      • PMIService
                                                                                                                      • PriorityParcelDDP
                                                                                                                      • PriorityParcelDDU
                                                                                                                      • PriorityParcelDeliveryConfirmationDDP
                                                                                                                      • PriorityParcelDeliveryConfirmationDDU
                                                                                                                      • ePacketService
                                                                                                                      Estafeta
                                                                                                                      • NextDayBy930
                                                                                                                      • NextDayBy1130
                                                                                                                      • NextDay
                                                                                                                      • Ground
                                                                                                                      • TwoDay
                                                                                                                      • LTL
                                                                                                                      Evri
                                                                                                                      • Courier2Home
                                                                                                                      • Courier2HomeNextDay
                                                                                                                      • Shop2Home
                                                                                                                      • Shop2HomeNextDay
                                                                                                                      • Shop2Shop
                                                                                                                      • Shop2ShopNextDay
                                                                                                                      • Courier2Shop
                                                                                                                      • Courier2ShopNextDay
                                                                                                                      • International Delivery
                                                                                                                      • Commercial
                                                                                                                      • DDP Courier
                                                                                                                      • DDU Courier
                                                                                                                      • DDU Shop
                                                                                                                      • Postal
                                                                                                                      Fastway
                                                                                                                      • Parcel
                                                                                                                      • Satchel
                                                                                                                      FedEx
                                                                                                                      • FEDEX_2_DAY
                                                                                                                      • FEDEX_2_DAY_AM
                                                                                                                      • FEDEX_EXPRESS_SAVER
                                                                                                                      • FEDEX_GROUND
                                                                                                                      • FEDEX_INTERNATIONAL_CONNECT_PLUS
                                                                                                                      • FIRST_OVERNIGHT
                                                                                                                      • GROUND_HOME_DELIVERY
                                                                                                                      • INTERNATIONAL_ECONOMY
                                                                                                                      • INTERNATIONAL_FIRST
                                                                                                                      • INTERNATIONAL_PRIORITY
                                                                                                                      • PRIORITY_OVERNIGHT
                                                                                                                      • SMART_POST
                                                                                                                      • STANDARD_OVERNIGHT
                                                                                                                      FedEx Ground Economy
                                                                                                                      • SMART_POST
                                                                                                                      First Choice
                                                                                                                      • ST
                                                                                                                      First Mile
                                                                                                                      • XParcelPriority
                                                                                                                      • XParcelExpedited
                                                                                                                      • XParcelReturns
                                                                                                                      • XParcelGround
                                                                                                                      • XParcelExpeditedPlus
                                                                                                                      Flexport
                                                                                                                      • Standard
                                                                                                                      • Expedited
                                                                                                                      GSO
                                                                                                                      • CaliforniaParcelService
                                                                                                                      • EarlyPriorityOvernight
                                                                                                                      • EarlySaturdayService
                                                                                                                      • Ground
                                                                                                                      • Overnight
                                                                                                                      • PriorityOvernight
                                                                                                                      • SaturdayDeliveryService
                                                                                                                      Hailify
                                                                                                                      • Xpress
                                                                                                                      Interlink Express
                                                                                                                      • InterlinkAirClassicInternationalAir
                                                                                                                      • InterlinkAirExpressInternationalAir
                                                                                                                      • InterlinkExpresspak1By10:30
                                                                                                                      • InterlinkExpresspak1By12
                                                                                                                      • InterlinkExpresspak1NextDay
                                                                                                                      • InterlinkExpresspak1Saturday
                                                                                                                      • InterlinkExpresspak1SaturdayBy10:30
                                                                                                                      • InterlinkExpresspak1SaturdayBy12
                                                                                                                      • InterlinkExpresspak1Sunday
                                                                                                                      • InterlinkExpresspak1SundayBy12
                                                                                                                      • InterlinkExpresspak5By10
                                                                                                                      • InterlinkExpresspak5By10:30
                                                                                                                      • InterlinkExpresspak5By12
                                                                                                                      • InterlinkExpresspak5NextDay
                                                                                                                      • InterlinkExpresspak5Saturday
                                                                                                                      • InterlinkExpresspak5SaturdayBy10
                                                                                                                      • InterlinkExpresspak5SaturdayBy10:30
                                                                                                                      • InterlinkExpresspak5SaturdayBy12
                                                                                                                      • InterlinkExpresspak5Sunday
                                                                                                                      • InterlinkExpresspak5SundayBy12
                                                                                                                      • InterlinkFreightBy10
                                                                                                                      • InterlinkFreightBy12
                                                                                                                      • InterlinkFreightNextDay
                                                                                                                      • InterlinkFreightSaturday
                                                                                                                      • InterlinkFreightSaturdayBy10
                                                                                                                      • InterlinkFreightSaturdayBy12
                                                                                                                      • InterlinkFreightSunday
                                                                                                                      • InterlinkFreightSundayBy12
                                                                                                                      • InterlinkParcelBy10
                                                                                                                      • InterlinkParcelBy10:30
                                                                                                                      • InterlinkParcelBy12
                                                                                                                      • InterlinkParcelDpdEuropeByRoad
                                                                                                                      • InterlinkParcelNextDay
                                                                                                                      • InterlinkParcelReturn
                                                                                                                      • InterlinkParcelReturnToShop
                                                                                                                      • InterlinkParcelSaturday
                                                                                                                      • InterlinkParcelSaturdayBy10
                                                                                                                      • InterlinkParcelSaturdayBy10:30
                                                                                                                      • InterlinkParcelSaturdayBy12
                                                                                                                      • InterlinkParcelShipToShop
                                                                                                                      • InterlinkParcelSunday
                                                                                                                      • InterlinkParcelSundayBy12
                                                                                                                      • InterlinkParcelTwoDay
                                                                                                                      • InterlinkPickupParcelDpdEuropeByRoad
                                                                                                                      Jet
                                                                                                                      • Distribution
                                                                                                                      JP Post

                                                                                                                      No service levels for JP Post.

                                                                                                                        Kuroneko Yamato

                                                                                                                        No service levels for Kuroneko Yamato.

                                                                                                                          La Poste

                                                                                                                          No service levels for La Poste.

                                                                                                                            LaserShip
                                                                                                                            • SameDay
                                                                                                                            • NextDay
                                                                                                                            • Weekend
                                                                                                                            Loomis Express
                                                                                                                            • LoomisGround
                                                                                                                            • LoomisExpress1800
                                                                                                                            • LoomisExpress1200
                                                                                                                            • LoomisExpress900
                                                                                                                            LSO

                                                                                                                            No service levels for LSO.

                                                                                                                              Maergo
                                                                                                                              • Standard
                                                                                                                              Newgistics
                                                                                                                              • ParcelSelect
                                                                                                                              • ParcelSelectLightweight
                                                                                                                              • Ground
                                                                                                                              • Express
                                                                                                                              • FirstClassMail
                                                                                                                              • PriorityMail
                                                                                                                              • BoundPrintedMatter
                                                                                                                              Ontrac
                                                                                                                              • Sunrise
                                                                                                                              • Gold
                                                                                                                              • OnTracGround
                                                                                                                              • SameDay
                                                                                                                              • PalletizedFreight
                                                                                                                              Optima
                                                                                                                              • NxtDay
                                                                                                                              OSM Worldwide
                                                                                                                              • Priority
                                                                                                                              • BPM
                                                                                                                              • ParcelSelect
                                                                                                                              • MediaMail
                                                                                                                              • MarketingParcel
                                                                                                                              • MarketingParcelTracked
                                                                                                                              • ParcelSelectHazardousMaterial
                                                                                                                              • USPSGroundAdvantage
                                                                                                                              • USPSGroundAdvantageLightweight
                                                                                                                              • USPSGroundAdvantageHazmat
                                                                                                                              • USPSGroundAdvantageHazmatSignature
                                                                                                                              • USPSGroundAdvantageLightweightHazmat
                                                                                                                              • USPSGroundAdvantageLightweightHazmatSignature
                                                                                                                              • ParcelSelectHazmatSignature
                                                                                                                              Pandion
                                                                                                                              • Pandion Express
                                                                                                                              Parcelforce
                                                                                                                              • europrioritybusiness
                                                                                                                              • europriorityhome
                                                                                                                              • express10
                                                                                                                              • express10CourierPack
                                                                                                                              • express10Exchange
                                                                                                                              • express10Secure
                                                                                                                              • express10SecureExchange
                                                                                                                              • express24
                                                                                                                              • express24CourierPack
                                                                                                                              • express24Exchange
                                                                                                                              • express24large
                                                                                                                              • express24Secure
                                                                                                                              • express24SecureExchange
                                                                                                                              • express48
                                                                                                                              • express48large
                                                                                                                              • express9
                                                                                                                              • express9CourierPack
                                                                                                                              • express9Secure
                                                                                                                              • expressAM
                                                                                                                              • expressAMCourierPack
                                                                                                                              • expressAMExchange
                                                                                                                              • expressAMSecure
                                                                                                                              • expressAMSecureExchange
                                                                                                                              • expressPM
                                                                                                                              • expressPMSecure
                                                                                                                              • globalBulkDirect
                                                                                                                              • globalexpress
                                                                                                                              • globalexpressEnvelopeDelivery
                                                                                                                              • globalexpressPackDelivery
                                                                                                                              • globalpriority
                                                                                                                              • globalpriorityReturns
                                                                                                                              • globalvalue
                                                                                                                              • irelandexpress
                                                                                                                              • ParcelRiderPlus
                                                                                                                              Passport

                                                                                                                              No service levels for Passport.

                                                                                                                                PostNL

                                                                                                                                No service levels for PostNL.

                                                                                                                                  Purolator
                                                                                                                                  • PurolatorExpress
                                                                                                                                  • PurolatorExpress12PM
                                                                                                                                  • PurolatorExpressPack12PM
                                                                                                                                  • PurolatorExpressBox12PM
                                                                                                                                  • PurolatorExpressEnvelope12PM
                                                                                                                                  • PurolatorExpress1030AM
                                                                                                                                  • PurolatorExpress9AM
                                                                                                                                  • PurolatorExpressBox
                                                                                                                                  • PurolatorExpressBox1030AM
                                                                                                                                  • PurolatorExpressBox9AM
                                                                                                                                  • PurolatorExpressBoxEvening
                                                                                                                                  • PurolatorExpressBoxInternational
                                                                                                                                  • PurolatorExpressBoxUS
                                                                                                                                  • PurolatorExpressEnvelope
                                                                                                                                  • PurolatorExpressEnvelope1030AM
                                                                                                                                  • PurolatorExpressEnvelope9AM
                                                                                                                                  • PurolatorExpressEnvelopeEvening
                                                                                                                                  • PurolatorExpressEnvelopeInternational
                                                                                                                                  • PurolatorExpressEnvelopeUS
                                                                                                                                  • PurolatorExpressEvening
                                                                                                                                  • PurolatorExpressInternational
                                                                                                                                  • PurolatorExpressInternational1030AM
                                                                                                                                  • PurolatorExpressInternational1200
                                                                                                                                  • PurolatorExpressInternational9AM
                                                                                                                                  • PurolatorExpressBoxInternational1030AM
                                                                                                                                  • PurolatorExpressBoxInternational1200
                                                                                                                                  • PurolatorExpressBoxInternational9AM
                                                                                                                                  • PurolatorExpressEnvelopeInternational1030AM
                                                                                                                                  • PurolatorExpressEnvelopeInternational1200
                                                                                                                                  • PurolatorExpressEnvelopeInternational9AM
                                                                                                                                  • PurolatorExpressPackInternational1030AM
                                                                                                                                  • PurolatorExpressPackInternational1200
                                                                                                                                  • PurolatorExpressPackInternational9AM
                                                                                                                                  • PurolatorExpressPack
                                                                                                                                  • PurolatorExpressPack1030AM
                                                                                                                                  • PurolatorExpressPack9AM
                                                                                                                                  • PurolatorExpressPackEvening
                                                                                                                                  • PurolatorExpressPackInternational
                                                                                                                                  • PurolatorExpressPackUS
                                                                                                                                  • PurolatorExpressUS
                                                                                                                                  • PurolatorExpressUS1030AM
                                                                                                                                  • PurolatorExpressUS1200
                                                                                                                                  • PurolatorExpressUS9AM
                                                                                                                                  • PurolatorExpressBoxUS1030AM
                                                                                                                                  • PurolatorExpressBoxUS1200
                                                                                                                                  • PurolatorExpressBoxUS9AM
                                                                                                                                  • PurolatorExpressEnvelopeUS1030AM
                                                                                                                                  • PurolatorExpressEnvelopeUS1200
                                                                                                                                  • PurolatorExpressEnvelopeUS9AM
                                                                                                                                  • PurolatorExpressPackUS1030AM
                                                                                                                                  • PurolatorExpressPackUS1200
                                                                                                                                  • PurolatorExpressPackUS9AM
                                                                                                                                  • PurolatorGround
                                                                                                                                  • PurolatorGround1030AM
                                                                                                                                  • PurolatorGround9AM
                                                                                                                                  • PurolatorGround12PM
                                                                                                                                  • PurolatorGroundDistribution
                                                                                                                                  • PurolatorGroundEvening
                                                                                                                                  • PurolatorGroundUS
                                                                                                                                  • PurolatorQuickShip
                                                                                                                                  • PurolatorQuickShipEnvelope
                                                                                                                                  • PurolatorQuickShipPack
                                                                                                                                  • PurolatorQuickShipBox
                                                                                                                                  Royal Mail
                                                                                                                                  • InternationalPriority
                                                                                                                                  • InternationalEconomy
                                                                                                                                  • InternationalStandard
                                                                                                                                  • InternationalTrackedAndSigned
                                                                                                                                  • InternationalTracked
                                                                                                                                  • InternationalSigned
                                                                                                                                  • AccountMail
                                                                                                                                  • RoyalMailUnsigned
                                                                                                                                  • RoyalMail
                                                                                                                                  • SpecialDeliveryGuaranteed
                                                                                                                                  • SpecialDeliveryGuaranteed1pm
                                                                                                                                  • SpecialDeliveryGuaranteed9am
                                                                                                                                  • StandardLetter
                                                                                                                                  • Tracked24
                                                                                                                                  • Tracked24HighVolume
                                                                                                                                  • Tracked24HighVolumeSignature
                                                                                                                                  • Tracked24LBT
                                                                                                                                  • Tracked24SignatureLBT
                                                                                                                                  • Tracked48LBT
                                                                                                                                  • Tracked48SignatureLBT
                                                                                                                                  • Tracked24Signature
                                                                                                                                  • Tracked48
                                                                                                                                  • Tracked48HighVolume
                                                                                                                                  • Tracked48HighVolumeSignature
                                                                                                                                  • Tracked48Signature
                                                                                                                                  • TrackedReturns24
                                                                                                                                  • TrackedReturns48
                                                                                                                                  • CrossBorderImportTracked48HighVolume
                                                                                                                                  SEKO OmniParcel
                                                                                                                                  • Ecommerce Standard Tracked
                                                                                                                                  • Ecommerce Express Tracked
                                                                                                                                  • Domestic Express
                                                                                                                                  • Domestic Standard
                                                                                                                                  Sendle
                                                                                                                                  • Standard
                                                                                                                                  • Express
                                                                                                                                  • Saver
                                                                                                                                  • Two-Day
                                                                                                                                  • Three-Day
                                                                                                                                  SF Express
                                                                                                                                  • InternationalStandardExpressDoc
                                                                                                                                  • InternationalStandardExpressParcel
                                                                                                                                  • InternationalEconomyExpressPilot
                                                                                                                                  • InternationalEconomyExpressDoc
                                                                                                                                  • InternationalEconomyExpressParcel
                                                                                                                                  • DomesticExpress
                                                                                                                                  • DomesticStandard
                                                                                                                                  • DomesticIntraCity
                                                                                                                                  • StandardExpress
                                                                                                                                  • EconomyExpress
                                                                                                                                  SmartKargo
                                                                                                                                  • EPR
                                                                                                                                  • EPS
                                                                                                                                  • EST
                                                                                                                                  • EXP
                                                                                                                                  Sonic
                                                                                                                                  • SAMEDAY
                                                                                                                                  Spee-Dee
                                                                                                                                  • SpeeDeeDelivery
                                                                                                                                  Swyft
                                                                                                                                  • NEXTDAY
                                                                                                                                  • SAMEDAY
                                                                                                                                  TForce Logistics
                                                                                                                                  • NextDay
                                                                                                                                  • Return
                                                                                                                                  Toll
                                                                                                                                  • IPEC Direct
                                                                                                                                  • IPEC Fashion
                                                                                                                                  • IPEC Local
                                                                                                                                  • IPEC Priority
                                                                                                                                  • IPEC Road Express
                                                                                                                                  • IPEC Sensitive
                                                                                                                                  • IPEC VicEXP
                                                                                                                                  UDS
                                                                                                                                  • DeliveryService
                                                                                                                                  UPS
                                                                                                                                  • Ground
                                                                                                                                  • UPSStandard
                                                                                                                                  • UPSSaver
                                                                                                                                  • Express
                                                                                                                                  • ExpressPlus
                                                                                                                                  • Expedited
                                                                                                                                  • NextDayAir
                                                                                                                                  • NextDayAirSaver
                                                                                                                                  • NextDayAirEarlyAM
                                                                                                                                  • 2ndDayAir
                                                                                                                                  • 2ndDayAirAM
                                                                                                                                  • 3DaySelect
                                                                                                                                  UPS iParcel

                                                                                                                                  No service levels for UPS iParcel.

                                                                                                                                    UPS Mail Innovations
                                                                                                                                    • BPMFlats
                                                                                                                                    • BPMParcels
                                                                                                                                    • EconomyMailInnovations
                                                                                                                                    • ExpeditedMailInnovations
                                                                                                                                    • First
                                                                                                                                    • MarketingParcels
                                                                                                                                    • MediaMail
                                                                                                                                    • ParcelSelect
                                                                                                                                    • ParcelSelectLightweight-Irreg
                                                                                                                                    • Priority
                                                                                                                                    • PriorityMailInnovations
                                                                                                                                    • SingleReturns
                                                                                                                                    • StandardFlats
                                                                                                                                    USPS
                                                                                                                                    • First
                                                                                                                                    • Priority
                                                                                                                                    • Express
                                                                                                                                    • GroundAdvantage
                                                                                                                                    • LibraryMail
                                                                                                                                    • MediaMail
                                                                                                                                    • FirstClassMailInternational
                                                                                                                                    • FirstClassPackageInternationalService
                                                                                                                                    • PriorityMailInternational
                                                                                                                                    • ExpressMailInternational
                                                                                                                                    Veho
                                                                                                                                    • nextDay
                                                                                                                                    • sameDay
                                                                                                                                    Yanwen

                                                                                                                                    No service levels for Yanwen.

                                                                                                                                      POST/shipments/:id/rerate

                                                                                                                                      Regenerate Rates for a Shipment

                                                                                                                                      You can regenerate the Rates of a Shipment at any time. This is ideal when shipments aren't bought the same day as they were created and you want the most up-to-date rates available. This operation respects the carrier_accounts attribute.

                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Shipment;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Regenerate {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Shipment shipment = client.shipment.newRates("shp_...");
                                                                                                                                      
                                                                                                                                              System.out.println(shipment);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "id": "rate_baa35256609648be87726a3e2dfebdac",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:18Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:18Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "7.33",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "15.20",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "10.89",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "shipment_id": "shp_ad0d9c3e424b498698df7258db0d677e",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_2bab14cc52364f2b9bc2ccf3ca7b3862",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:18Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:18Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_ad0d9c3e424b498698df7258db0d677e",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_e378828036014066810f573b11e3422c",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:18Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:18Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_ad0d9c3e424b498698df7258db0d677e",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_6989382e7baf477e90b024d4b2adb123",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:18Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:18Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_ad0d9c3e424b498698df7258db0d677e",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_d1795faa20de435089eac68b61ae37dc",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:18Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:18Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "49.60",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "57.40",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "49.60",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "shipment_id": "shp_ad0d9c3e424b498698df7258db0d677e",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      POST/beta/rates

                                                                                                                                      Retrieve Rates for a Shipment

                                                                                                                                      You can retrieve Rates without creating a Shipment object using this endpoint. This endpoint is ideal when wanting to display or compare rates without creating Shipment objects. The Rate objects returned by this endpoint do not include IDs.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      reference"my-reference"An optional field that may be used in place of id in other API endpoints
                                                                                                                                      to_address<Address>Can be specified by ID or attributes to create a new one, and be verified inline. See Create and Verify Address
                                                                                                                                      from_address<Address>Can be specified by ID or attributes to create a new one, and be verified inline. See Create and Verify Address
                                                                                                                                      parcel<Parcel>
                                                                                                                                      carrier_accounts["ca_..."]List of carrier accounts
                                                                                                                                      service"Priority"The service of carrier
                                                                                                                                      Example
                                                                                                                                      package rates;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.StatelessRate;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> toAddressMap = new HashMap<String, Object>();
                                                                                                                                              toAddressMap.put("name", "Dr. Steve Brule");
                                                                                                                                              toAddressMap.put("street1", "179 N Harbor Dr");
                                                                                                                                              toAddressMap.put("city", "Redondo Beach");
                                                                                                                                              toAddressMap.put("state", "CA");
                                                                                                                                              toAddressMap.put("country", "US");
                                                                                                                                              toAddressMap.put("phone", "8573875756");
                                                                                                                                              toAddressMap.put("email", "dr_steve_brule@gmail.com");
                                                                                                                                              toAddressMap.put("zip", "90277");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> fromAddressMap = new HashMap<String, Object>();
                                                                                                                                              fromAddressMap.put("name", "EasyPost");
                                                                                                                                              fromAddressMap.put("street1", "417 Montgomery Street");
                                                                                                                                              fromAddressMap.put("street2", "5th Floor");
                                                                                                                                              fromAddressMap.put("city", "San Francisco");
                                                                                                                                              fromAddressMap.put("state", "CA");
                                                                                                                                              fromAddressMap.put("zip", "94104");
                                                                                                                                              fromAddressMap.put("country", "US");
                                                                                                                                              fromAddressMap.put("phone", "4153334445");
                                                                                                                                              fromAddressMap.put("email", "support@easypost.com");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> parcelMap = new HashMap<String, Object>();
                                                                                                                                              parcelMap.put("length", 20.2);
                                                                                                                                              parcelMap.put("width", 10.9);
                                                                                                                                              parcelMap.put("height", 5);
                                                                                                                                              parcelMap.put("weight", 65.9);
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> shipmentDetails = new HashMap<String, Object>();
                                                                                                                                              shipmentDetails.put("to_address", toAddressMap);
                                                                                                                                              shipmentDetails.put("from_address", fromAddressMap);
                                                                                                                                              shipmentDetails.put("parcel", parcelMap);
                                                                                                                                      
                                                                                                                                              List<StatelessRate> rates = client.betaRate.retrieveStatelessRates(shipmentDetails);
                                                                                                                                      
                                                                                                                                              System.out.println(rates);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "from_address": {
                                                                                                                                          "object": "Address",
                                                                                                                                          "name": "EasyPost",
                                                                                                                                          "street1": "417 Montgomery Street",
                                                                                                                                          "street2": "5th Floor",
                                                                                                                                          "city": "San Francisco",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "94104",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "4153334445",
                                                                                                                                          "email": "support@easypost.com"
                                                                                                                                        },
                                                                                                                                        "to_address": {
                                                                                                                                          "object": "Address",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com"
                                                                                                                                        },
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "object": "Rate",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "7.33",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "15.20",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "10.89",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "Rate",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "Rate",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "Rate",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "Rate",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "49.60",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "57.40",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "49.60",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "options": {
                                                                                                                                          "currency": "USD",
                                                                                                                                          "payment": {
                                                                                                                                            "type": "SENDER"
                                                                                                                                          },
                                                                                                                                          "date_advance": 0
                                                                                                                                        },
                                                                                                                                        "parcel": {
                                                                                                                                          "object": "Parcel",
                                                                                                                                          "length": 20.2,
                                                                                                                                          "width": 10.9,
                                                                                                                                          "height": 5.0,
                                                                                                                                          "weight": 65.9
                                                                                                                                        },
                                                                                                                                        "messages": []
                                                                                                                                      }

                                                                                                                                      Messages

                                                                                                                                      When rating a Shipment or Pickup, some carriers may fail to generate rates. These failures are returned as part of the Shipment or Pickup as part of their messages attribute, and follow a common object structure.

                                                                                                                                      It is important to note that the message value for any member of this list comes directly from the carrier, not from EasyPost. This means that if you see an authentication or other non-shipping error here, it is not an issue between you and EasyPost, it is an issue between you and the carrier, or an issue with the given data.

                                                                                                                                      Message Object

                                                                                                                                      attributetypespecification
                                                                                                                                      carrierstringthe name of the carrier generating the error, e.g. "UPS"
                                                                                                                                      typestringthe category of error that occurred. Most frequently "rate_error"
                                                                                                                                      messagestringthe string from the carrier explaining the problem
                                                                                                                                      carrier_account_idstringthe account id of the carrier. Useful if you have multiple accounts with the same carrier

                                                                                                                                      SmartRate

                                                                                                                                      The SmartRate API provides shippers with highly accurate, Shipment-level transit time predictions which can be used to save money, improve on-time delivery, and provide end customers with reliable delivery estimates.

                                                                                                                                      The SmartRate API accepts a Shipment ID and returns predicted transit days across a variety of percentiles for each carrier service being evaluated for the Shipment. The transit time predictions in the response are based off of a sophisticated model using actual historical data for the shipping lane in question.

                                                                                                                                      To make a request to the SmartRate API, first create a Shipment, then make the SmartRate call. Using the response, you can now make better data-driven decisions about which Rate to select when purchasing a label.

                                                                                                                                      Time in Transit Object

                                                                                                                                      attributetypespecification
                                                                                                                                      percentile_50integerexpected transit days at the 50th percentile
                                                                                                                                      percentile_75integerexpected transit days at the 75th percentile
                                                                                                                                      percentile_85integerexpected transit days at the 85th percentile
                                                                                                                                      percentile_90integerexpected transit days at the 90th percentile
                                                                                                                                      percentile_95integerexpected transit days at the 95th percentile
                                                                                                                                      percentile_97integerexpected transit days at the 97th percentile
                                                                                                                                      percentile_99integerexpected transit days at the 99th percentile
                                                                                                                                      GET/shipments/:id/smartrate

                                                                                                                                      Retrieve Time in Transit statistics across all Rates for a Shipment

                                                                                                                                      The SmartRate API returns a Time in Transit object with transit days across a variety of percentiles for every Rate for a given Shipment. Transit days are calculated as the number of business days between the first time the carrier acknowledges possession of the Shipment and the first out-for-delivery attempt.

                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.SmartRate;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class RetrieveTimeInTransitStatistics {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              List<SmartRate> smartrates = client.shipment.smartrates("shp_...");
                                                                                                                                      
                                                                                                                                              System.out.println(smartrates);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "result": [
                                                                                                                                          {
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                            "created_at": "2024-01-24T00:07:44Z",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "id": "rate_29120e36c58a4232b14547e53b0131c6",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "list_rate": 49.6,
                                                                                                                                            "mode": "test",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "rate": 49.6,
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "retail_rate": 57.4,
                                                                                                                                            "service": "Express",
                                                                                                                                            "shipment_id": "shp_91721066728d473999b736a0d3f88ce8",
                                                                                                                                            "time_in_transit": {
                                                                                                                                              "percentile_50": 1,
                                                                                                                                              "percentile_75": 2,
                                                                                                                                              "percentile_85": 2,
                                                                                                                                              "percentile_90": 3,
                                                                                                                                              "percentile_95": 3,
                                                                                                                                              "percentile_97": 4,
                                                                                                                                              "percentile_99": 6
                                                                                                                                            },
                                                                                                                                            "updated_at": "2024-01-24T00:07:44Z"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                            "created_at": "2024-01-24T00:07:44Z",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "id": "rate_ea6e4920d07142f694e8d81a89fe3cd1",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "list_rate": 10.89,
                                                                                                                                            "mode": "test",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "rate": 7.33,
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "retail_rate": 15.2,
                                                                                                                                            "service": "Priority",
                                                                                                                                            "shipment_id": "shp_91721066728d473999b736a0d3f88ce8",
                                                                                                                                            "time_in_transit": {
                                                                                                                                              "percentile_50": 1,
                                                                                                                                              "percentile_75": 2,
                                                                                                                                              "percentile_85": 2,
                                                                                                                                              "percentile_90": 2,
                                                                                                                                              "percentile_95": 3,
                                                                                                                                              "percentile_97": 3,
                                                                                                                                              "percentile_99": 3
                                                                                                                                            },
                                                                                                                                            "updated_at": "2024-01-24T00:07:44Z"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                            "created_at": "2024-01-24T00:07:44Z",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "id": "rate_26cb7b0f451e407db3adddb432a38b19",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "list_rate": 9.41,
                                                                                                                                            "mode": "test",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "rate": 6.79,
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "retail_rate": 13.15,
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "shipment_id": "shp_91721066728d473999b736a0d3f88ce8",
                                                                                                                                            "time_in_transit": {
                                                                                                                                              "percentile_50": 1,
                                                                                                                                              "percentile_75": 2,
                                                                                                                                              "percentile_85": 2,
                                                                                                                                              "percentile_90": 2,
                                                                                                                                              "percentile_95": 3,
                                                                                                                                              "percentile_97": 3,
                                                                                                                                              "percentile_99": 4
                                                                                                                                            },
                                                                                                                                            "updated_at": "2024-01-24T00:07:44Z"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                            "created_at": "2024-01-24T00:07:44Z",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "id": "rate_3e9facc8738d41ecb3ff17b9c75d6669",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "list_rate": 9.41,
                                                                                                                                            "mode": "test",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "rate": 6.79,
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "retail_rate": 13.15,
                                                                                                                                            "service": "First",
                                                                                                                                            "shipment_id": "shp_91721066728d473999b736a0d3f88ce8",
                                                                                                                                            "time_in_transit": {
                                                                                                                                              "percentile_50": 1,
                                                                                                                                              "percentile_75": 2,
                                                                                                                                              "percentile_85": 2,
                                                                                                                                              "percentile_90": 2,
                                                                                                                                              "percentile_95": 3,
                                                                                                                                              "percentile_97": 3,
                                                                                                                                              "percentile_99": 4
                                                                                                                                            },
                                                                                                                                            "updated_at": "2024-01-24T00:07:44Z"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                            "created_at": "2024-01-24T00:07:44Z",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "id": "rate_c40cd28b908141649d8b66c4189266e0",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "list_rate": 9.41,
                                                                                                                                            "mode": "test",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "rate": 6.79,
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "retail_rate": 13.15,
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "shipment_id": "shp_91721066728d473999b736a0d3f88ce8",
                                                                                                                                            "time_in_transit": {
                                                                                                                                              "percentile_50": 1,
                                                                                                                                              "percentile_75": 2,
                                                                                                                                              "percentile_85": 2,
                                                                                                                                              "percentile_90": 2,
                                                                                                                                              "percentile_95": 3,
                                                                                                                                              "percentile_97": 3,
                                                                                                                                              "percentile_99": 4
                                                                                                                                            },
                                                                                                                                            "updated_at": "2024-01-24T00:07:44Z"
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      GET/shipments/:id/smartrate/delivery_date

                                                                                                                                      Retrieve Estimated Delivery Date and Total Transit Days across all Rates for a Shipment

                                                                                                                                      The Delivery Date endpoint of the SmartRate API will return an EasyPost Estimated Delivery Date as well as a Days in Transit object that contains the expected number of total days the shipment is to be in transit across a variety of percentiles for every Rate for a given Shipment. Transit days are calculated as the number of days (including weekends and holidays) between the first time the carrier acknowledges possession of the Shipment and the first out-for-delivery attempt.

                                                                                                                                      This endpoint requires the parameter planned_ship_date to be provided when called. Planned Ship Date is the date that the user would expect the carrier to take possession of the shipment. Knowing this makes the results of the API extremely accurate.

                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Shipment;
                                                                                                                                      import com.easypost.model.EstimatedDeliveryDate;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class RetrieveEstimatedDeliveryDate {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Shipment shipment = client.shipment.retrieve("shp_...");
                                                                                                                                              List<EstimatedDeliveryDate> estimatedDeliveryDates = client
                                                                                                                                                      .shipmentretrieveEstimatedDeliveryDate(shipment.getId(), "YYYY-MM-DD");
                                                                                                                                      
                                                                                                                                              System.out.println(estimatedDeliveryDates);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "easypost_time_in_transit_data": {
                                                                                                                                              "days_in_transit": {
                                                                                                                                                "percentile_50": 3,
                                                                                                                                                "percentile_75": 3,
                                                                                                                                                "percentile_85": 6,
                                                                                                                                                "percentile_90": 6,
                                                                                                                                                "percentile_95": 6,
                                                                                                                                                "percentile_97": 6,
                                                                                                                                                "percentile_99": 9
                                                                                                                                              },
                                                                                                                                              "easypost_estimated_delivery_date": "2024-01-26",
                                                                                                                                              "planned_ship_date": "2024-01-24"
                                                                                                                                            },
                                                                                                                                            "rate": {
                                                                                                                                              "carrier": "USPS",
                                                                                                                                              "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                              "created_at": "2024-01-24T00:07:45Z",
                                                                                                                                              "currency": "USD",
                                                                                                                                              "delivery_date": null,
                                                                                                                                              "delivery_date_guaranteed": false,
                                                                                                                                              "delivery_days": 3,
                                                                                                                                              "est_delivery_days": 3,
                                                                                                                                              "id": "rate_36a64db214ab4fafaeaaad6855ebf422",
                                                                                                                                              "list_currency": "USD",
                                                                                                                                              "list_rate": 9.41,
                                                                                                                                              "mode": "test",
                                                                                                                                              "object": "Rate",
                                                                                                                                              "rate": 6.79,
                                                                                                                                              "retail_currency": "USD",
                                                                                                                                              "retail_rate": 13.15,
                                                                                                                                              "service": "GroundAdvantage",
                                                                                                                                              "shipment_id": "shp_e3ce96ba8b6745608fe1c419d76b8fb5",
                                                                                                                                              "updated_at": "2024-01-24T00:07:45Z"
                                                                                                                                            }
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "easypost_time_in_transit_data": {
                                                                                                                                              "days_in_transit": {
                                                                                                                                                "percentile_50": 3,
                                                                                                                                                "percentile_75": 3,
                                                                                                                                                "percentile_85": 6,
                                                                                                                                                "percentile_90": 6,
                                                                                                                                                "percentile_95": 6,
                                                                                                                                                "percentile_97": 6,
                                                                                                                                                "percentile_99": 9
                                                                                                                                              },
                                                                                                                                              "easypost_estimated_delivery_date": "2024-01-26",
                                                                                                                                              "planned_ship_date": "2024-01-24"
                                                                                                                                            },
                                                                                                                                            "rate": {
                                                                                                                                              "carrier": "USPS",
                                                                                                                                              "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                              "created_at": "2024-01-24T00:07:45Z",
                                                                                                                                              "currency": "USD",
                                                                                                                                              "delivery_date": null,
                                                                                                                                              "delivery_date_guaranteed": false,
                                                                                                                                              "delivery_days": 3,
                                                                                                                                              "est_delivery_days": 3,
                                                                                                                                              "id": "rate_90170bc6328b46cda598d683828d6ac6",
                                                                                                                                              "list_currency": "USD",
                                                                                                                                              "list_rate": 9.41,
                                                                                                                                              "mode": "test",
                                                                                                                                              "object": "Rate",
                                                                                                                                              "rate": 6.79,
                                                                                                                                              "retail_currency": "USD",
                                                                                                                                              "retail_rate": 13.15,
                                                                                                                                              "service": "First",
                                                                                                                                              "shipment_id": "shp_e3ce96ba8b6745608fe1c419d76b8fb5",
                                                                                                                                              "updated_at": "2024-01-24T00:07:45Z"
                                                                                                                                            }
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "easypost_time_in_transit_data": {
                                                                                                                                              "days_in_transit": {
                                                                                                                                                "percentile_50": 3,
                                                                                                                                                "percentile_75": 3,
                                                                                                                                                "percentile_85": 6,
                                                                                                                                                "percentile_90": 6,
                                                                                                                                                "percentile_95": 6,
                                                                                                                                                "percentile_97": 6,
                                                                                                                                                "percentile_99": 9
                                                                                                                                              },
                                                                                                                                              "easypost_estimated_delivery_date": "2024-01-26",
                                                                                                                                              "planned_ship_date": "2024-01-24"
                                                                                                                                            },
                                                                                                                                            "rate": {
                                                                                                                                              "carrier": "USPS",
                                                                                                                                              "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                              "created_at": "2024-01-24T00:07:45Z",
                                                                                                                                              "currency": "USD",
                                                                                                                                              "delivery_date": null,
                                                                                                                                              "delivery_date_guaranteed": false,
                                                                                                                                              "delivery_days": 3,
                                                                                                                                              "est_delivery_days": 3,
                                                                                                                                              "id": "rate_ca519ed1f83d4a8ebc5c17a1dbe96553",
                                                                                                                                              "list_currency": "USD",
                                                                                                                                              "list_rate": 9.41,
                                                                                                                                              "mode": "test",
                                                                                                                                              "object": "Rate",
                                                                                                                                              "rate": 6.79,
                                                                                                                                              "retail_currency": "USD",
                                                                                                                                              "retail_rate": 13.15,
                                                                                                                                              "service": "ParcelSelect",
                                                                                                                                              "shipment_id": "shp_e3ce96ba8b6745608fe1c419d76b8fb5",
                                                                                                                                              "updated_at": "2024-01-24T00:07:45Z"
                                                                                                                                            }
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "easypost_time_in_transit_data": {
                                                                                                                                              "days_in_transit": {
                                                                                                                                                "percentile_50": 1,
                                                                                                                                                "percentile_75": 2,
                                                                                                                                                "percentile_85": 2,
                                                                                                                                                "percentile_90": 3,
                                                                                                                                                "percentile_95": 3,
                                                                                                                                                "percentile_97": 6,
                                                                                                                                                "percentile_99": 7
                                                                                                                                              },
                                                                                                                                              "easypost_estimated_delivery_date": "2024-01-25",
                                                                                                                                              "planned_ship_date": "2024-01-24"
                                                                                                                                            },
                                                                                                                                            "rate": {
                                                                                                                                              "carrier": "USPS",
                                                                                                                                              "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                              "created_at": "2024-01-24T00:07:45Z",
                                                                                                                                              "currency": "USD",
                                                                                                                                              "delivery_date": null,
                                                                                                                                              "delivery_date_guaranteed": false,
                                                                                                                                              "delivery_days": null,
                                                                                                                                              "est_delivery_days": null,
                                                                                                                                              "id": "rate_30c5c922506445a88b51212c52ac2db3",
                                                                                                                                              "list_currency": "USD",
                                                                                                                                              "list_rate": 49.6,
                                                                                                                                              "mode": "test",
                                                                                                                                              "object": "Rate",
                                                                                                                                              "rate": 49.6,
                                                                                                                                              "retail_currency": "USD",
                                                                                                                                              "retail_rate": 57.4,
                                                                                                                                              "service": "Express",
                                                                                                                                              "shipment_id": "shp_e3ce96ba8b6745608fe1c419d76b8fb5",
                                                                                                                                              "updated_at": "2024-01-24T00:07:45Z"
                                                                                                                                            }
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "easypost_time_in_transit_data": {
                                                                                                                                              "days_in_transit": {
                                                                                                                                                "percentile_50": 2,
                                                                                                                                                "percentile_75": 3,
                                                                                                                                                "percentile_85": 3,
                                                                                                                                                "percentile_90": 6,
                                                                                                                                                "percentile_95": 6,
                                                                                                                                                "percentile_97": 6,
                                                                                                                                                "percentile_99": 8
                                                                                                                                              },
                                                                                                                                              "easypost_estimated_delivery_date": "2024-01-26",
                                                                                                                                              "planned_ship_date": "2024-01-24"
                                                                                                                                            },
                                                                                                                                            "rate": {
                                                                                                                                              "carrier": "USPS",
                                                                                                                                              "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                              "created_at": "2024-01-24T00:07:45Z",
                                                                                                                                              "currency": "USD",
                                                                                                                                              "delivery_date": null,
                                                                                                                                              "delivery_date_guaranteed": false,
                                                                                                                                              "delivery_days": 2,
                                                                                                                                              "est_delivery_days": 2,
                                                                                                                                              "id": "rate_4d9a5348efb44acbb25d162e1a692cb0",
                                                                                                                                              "list_currency": "USD",
                                                                                                                                              "list_rate": 10.89,
                                                                                                                                              "mode": "test",
                                                                                                                                              "object": "Rate",
                                                                                                                                              "rate": 7.33,
                                                                                                                                              "retail_currency": "USD",
                                                                                                                                              "retail_rate": 15.2,
                                                                                                                                              "service": "Priority",
                                                                                                                                              "shipment_id": "shp_e3ce96ba8b6745608fe1c419d76b8fb5",
                                                                                                                                              "updated_at": "2024-01-24T00:07:45Z"
                                                                                                                                            }
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }

                                                                                                                                      Shipping Insurance

                                                                                                                                      Insuring your Shipment is as simple as sending us the value of the contents. We charge 0.5% of the value, with a 50 cent minimum, and handle all the claims. All our claims are paid out within 10 days.

                                                                                                                                      To buy insurance, first purchase the Shipment, then make the insurance call before the package begins being handled by the carrier.

                                                                                                                                      POST/shipments/:id/insure

                                                                                                                                      Insure a Shipment

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      amount200.00
                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Shipment;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class Insure {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("amount", 100);
                                                                                                                                      
                                                                                                                                              Shipment shipment = client.shipment.insure("shp_...", params);
                                                                                                                                      
                                                                                                                                              System.out.println(shipment);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                        "is_return": false,
                                                                                                                                        "messages": [],
                                                                                                                                        "mode": "test",
                                                                                                                                        "options": {
                                                                                                                                          "currency": "USD",
                                                                                                                                          "payment": {
                                                                                                                                            "type": "SENDER"
                                                                                                                                          },
                                                                                                                                          "date_advance": 0
                                                                                                                                        },
                                                                                                                                        "reference": null,
                                                                                                                                        "status": "unknown",
                                                                                                                                        "tracking_code": "9405500207552011812870",
                                                                                                                                        "updated_at": "2024-01-24T00:07:40Z",
                                                                                                                                        "batch_id": null,
                                                                                                                                        "batch_status": null,
                                                                                                                                        "batch_message": null,
                                                                                                                                        "customs_info": {
                                                                                                                                          "id": "cstinfo_894bee92fc8a4590b1bedd7c25d420aa",
                                                                                                                                          "object": "CustomsInfo",
                                                                                                                                          "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                          "updated_at": "2024-01-24T00:07:39Z",
                                                                                                                                          "contents_explanation": "",
                                                                                                                                          "contents_type": "merchandise",
                                                                                                                                          "customs_certify": true,
                                                                                                                                          "customs_signer": "Steve Brule",
                                                                                                                                          "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                                          "non_delivery_option": "return",
                                                                                                                                          "restriction_comments": null,
                                                                                                                                          "restriction_type": "none",
                                                                                                                                          "mode": "test",
                                                                                                                                          "declaration": null,
                                                                                                                                          "customs_items": [
                                                                                                                                            {
                                                                                                                                              "id": "cstitem_0e02f1ec747d40c390300494b5378f40",
                                                                                                                                              "object": "CustomsItem",
                                                                                                                                              "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                              "updated_at": "2024-01-24T00:07:39Z",
                                                                                                                                              "description": "T-shirt",
                                                                                                                                              "hs_tariff_number": "123456",
                                                                                                                                              "origin_country": "US",
                                                                                                                                              "quantity": 1,
                                                                                                                                              "value": "10.0",
                                                                                                                                              "weight": 5.0,
                                                                                                                                              "code": "123",
                                                                                                                                              "mode": "test",
                                                                                                                                              "manufacturer": null,
                                                                                                                                              "currency": null,
                                                                                                                                              "eccn": null,
                                                                                                                                              "printed_commodity_identifier": null
                                                                                                                                            }
                                                                                                                                          ]
                                                                                                                                        },
                                                                                                                                        "from_address": {
                                                                                                                                          "id": "adr_95ff946cba4c11eea9293cecef1b359e",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:39+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:39+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": "100.00",
                                                                                                                                        "order_id": null,
                                                                                                                                        "parcel": {
                                                                                                                                          "id": "prcl_2594ceec6c574946b89134e60fe4bc13",
                                                                                                                                          "object": "Parcel",
                                                                                                                                          "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                          "updated_at": "2024-01-24T00:07:39Z",
                                                                                                                                          "length": 20.2,
                                                                                                                                          "width": 10.9,
                                                                                                                                          "height": 5.0,
                                                                                                                                          "predefined_package": null,
                                                                                                                                          "weight": 65.9,
                                                                                                                                          "mode": "test"
                                                                                                                                        },
                                                                                                                                        "postage_label": {
                                                                                                                                          "object": "PostageLabel",
                                                                                                                                          "id": "pl_ae919bc0b3234b27a5c076d3975bba6d",
                                                                                                                                          "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                          "updated_at": "2024-01-24T00:07:40Z",
                                                                                                                                          "date_advance": 0,
                                                                                                                                          "integrated_form": "none",
                                                                                                                                          "label_date": "2024-01-24T00:07:39Z",
                                                                                                                                          "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/20240124/e81a3e19aeea384a65afa1f447056de071.png",
                                                                                                                                          "label_pdf_url": null,
                                                                                                                                          "label_zpl_url": null,
                                                                                                                                          "label_epl2_url": null,
                                                                                                                                          "label_file": null
                                                                                                                                        },
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "id": "rate_cfd85c8adde54ed8b8c6f579266254f7",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:39Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "49.60",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "57.40",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "49.60",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "shipment_id": "shp_3a557aeedf24430194ce622a7d2e84d0",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_00b65803675a45c490686889492ee95d",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:39Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "7.33",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "15.20",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "10.89",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "shipment_id": "shp_3a557aeedf24430194ce622a7d2e84d0",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_8d0a7124e1f243d98b487a2e0590cc5f",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:39Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_3a557aeedf24430194ce622a7d2e84d0",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_ca4b5b54136445578a7e68fee3bde594",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:39Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_3a557aeedf24430194ce622a7d2e84d0",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_7b08acaea4f94f4bacc1e53a9388a396",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:39Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_3a557aeedf24430194ce622a7d2e84d0",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "refund_status": null,
                                                                                                                                        "scan_form": null,
                                                                                                                                        "selected_rate": {
                                                                                                                                          "id": "rate_00b65803675a45c490686889492ee95d",
                                                                                                                                          "object": "Rate",
                                                                                                                                          "created_at": "2024-01-24T00:07:39Z",
                                                                                                                                          "updated_at": "2024-01-24T00:07:39Z",
                                                                                                                                          "mode": "test",
                                                                                                                                          "service": "Priority",
                                                                                                                                          "carrier": "USPS",
                                                                                                                                          "rate": "7.33",
                                                                                                                                          "currency": "USD",
                                                                                                                                          "retail_rate": "15.20",
                                                                                                                                          "retail_currency": "USD",
                                                                                                                                          "list_rate": "10.89",
                                                                                                                                          "list_currency": "USD",
                                                                                                                                          "billing_type": "easypost",
                                                                                                                                          "delivery_days": 2,
                                                                                                                                          "delivery_date": null,
                                                                                                                                          "delivery_date_guaranteed": false,
                                                                                                                                          "est_delivery_days": 2,
                                                                                                                                          "shipment_id": "shp_3a557aeedf24430194ce622a7d2e84d0",
                                                                                                                                          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                        },
                                                                                                                                        "tracker": {
                                                                                                                                          "id": "trk_0cc56e231b894ad3b639c168afff48a5",
                                                                                                                                          "object": "Tracker",
                                                                                                                                          "mode": "test",
                                                                                                                                          "tracking_code": "9405500207552011812870",
                                                                                                                                          "status": "pre_transit",
                                                                                                                                          "status_detail": "status_update",
                                                                                                                                          "created_at": "2024-01-24T00:07:40Z",
                                                                                                                                          "updated_at": "2024-01-24T00:07:40Z",
                                                                                                                                          "signed_by": null,
                                                                                                                                          "weight": null,
                                                                                                                                          "est_delivery_date": "2024-01-24T00:07:40Z",
                                                                                                                                          "shipment_id": "shp_3a557aeedf24430194ce622a7d2e84d0",
                                                                                                                                          "carrier": "USPS",
                                                                                                                                          "tracking_details": [
                                                                                                                                            {
                                                                                                                                              "object": "TrackingDetail",
                                                                                                                                              "message": "Pre-Shipment Info Sent to USPS",
                                                                                                                                              "description": "",
                                                                                                                                              "status": "pre_transit",
                                                                                                                                              "status_detail": "status_update",
                                                                                                                                              "datetime": "2023-12-24T00:07:40Z",
                                                                                                                                              "source": "USPS",
                                                                                                                                              "carrier_code": "",
                                                                                                                                              "tracking_location": {
                                                                                                                                                "object": "TrackingLocation",
                                                                                                                                                "city": null,
                                                                                                                                                "state": null,
                                                                                                                                                "country": null,
                                                                                                                                                "zip": null
                                                                                                                                              }
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                              "object": "TrackingDetail",
                                                                                                                                              "message": "Shipping Label Created",
                                                                                                                                              "description": "",
                                                                                                                                              "status": "pre_transit",
                                                                                                                                              "status_detail": "status_update",
                                                                                                                                              "datetime": "2023-12-24T12:44:40Z",
                                                                                                                                              "source": "USPS",
                                                                                                                                              "carrier_code": "",
                                                                                                                                              "tracking_location": {
                                                                                                                                                "object": "TrackingLocation",
                                                                                                                                                "city": "HOUSTON",
                                                                                                                                                "state": "TX",
                                                                                                                                                "country": null,
                                                                                                                                                "zip": "77063"
                                                                                                                                              }
                                                                                                                                            }
                                                                                                                                          ],
                                                                                                                                          "fees": [],
                                                                                                                                          "carrier_detail": {
                                                                                                                                            "object": "CarrierDetail",
                                                                                                                                            "service": "First-Class Package Service",
                                                                                                                                            "container_type": null,
                                                                                                                                            "est_delivery_date_local": null,
                                                                                                                                            "est_delivery_time_local": null,
                                                                                                                                            "origin_location": "HOUSTON TX, 77001",
                                                                                                                                            "origin_tracking_location": {
                                                                                                                                              "object": "TrackingLocation",
                                                                                                                                              "city": "HOUSTON",
                                                                                                                                              "state": "TX",
                                                                                                                                              "country": null,
                                                                                                                                              "zip": "77063"
                                                                                                                                            },
                                                                                                                                            "destination_location": "CHARLESTON SC, 29401",
                                                                                                                                            "destination_tracking_location": null,
                                                                                                                                            "guaranteed_delivery_date": null,
                                                                                                                                            "alternate_identifier": null,
                                                                                                                                            "initial_delivery_attempt": null
                                                                                                                                          },
                                                                                                                                          "public_url": "https://track.easypost.com/djE6dHJrXzBjYzU2ZTIzMWI4OTRhZDNiNjM5YzE2OGFmZmY0OGE1"
                                                                                                                                        },
                                                                                                                                        "to_address": {
                                                                                                                                          "id": "adr_95fd84d7ba4c11ee9fdbac1f6bc539ae",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:39+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:39+00:00",
                                                                                                                                          "name": "DR. STEVE BRULE",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N HARBOR DR",
                                                                                                                                          "street2": null,
                                                                                                                                          "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_95ff946cba4c11eea9293cecef1b359e",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:39+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:39+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_95fd84d7ba4c11ee9fdbac1f6bc539ae",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:39+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:39+00:00",
                                                                                                                                          "name": "DR. STEVE BRULE",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N HARBOR DR",
                                                                                                                                          "street2": null,
                                                                                                                                          "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": "LabelFee",
                                                                                                                                            "amount": "0.00000",
                                                                                                                                            "charged": true,
                                                                                                                                            "refunded": false
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "Fee",
                                                                                                                                            "type": "PostageFee",
                                                                                                                                            "amount": "7.33000",
                                                                                                                                            "charged": true,
                                                                                                                                            "refunded": false
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "Fee",
                                                                                                                                            "type": "InsuranceFee",
                                                                                                                                            "amount": "0.50000",
                                                                                                                                            "charged": true,
                                                                                                                                            "refunded": false
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "id": "shp_3a557aeedf24430194ce622a7d2e84d0",
                                                                                                                                        "object": "Shipment"
                                                                                                                                      }

                                                                                                                                      Refunds

                                                                                                                                      USPS shipping labels can be refunded if requested within 30 days of generation. The processing time is at least 15 days, after which the funds will return to your EasyPost balance. EasyPost fees will also be refunded. To qualify, a shipment must not have been scanned by the USPS.

                                                                                                                                      UPS and FedEx shipping labels may be refunded within 90 days of creation.

                                                                                                                                      POST/shipments/:id/refund

                                                                                                                                      Refund a Shipment

                                                                                                                                      Refunding a Shipment is available for many carriers supported by EasyPost. Once the refund has been submitted, refund_status attribute of the Shipment will be populated with one of the possible values: "submitted", "refunded", "rejected". The most common initial status is "submitted". Many carriers require that the refund be processed before the refund_status will move to "refunded". The length of this process depends on the carrier, but no greater than 30 days.

                                                                                                                                      Refunds created very shortly after a label is generated may be improperly flagged as invalid, but you may retry a refund with the "rejected" status by submitting the same request again. Carriers that are bill-on-scan tend to have refunds attempts return as "not_applicable", which will not change with multiple retries.

                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Shipment;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Create {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Shipment shipment = client.shipment.refund("shp_...");
                                                                                                                                      
                                                                                                                                              System.out.println(shipment);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                        "is_return": false,
                                                                                                                                        "messages": [],
                                                                                                                                        "mode": "test",
                                                                                                                                        "options": {
                                                                                                                                          "currency": "USD",
                                                                                                                                          "payment": {
                                                                                                                                            "type": "SENDER"
                                                                                                                                          },
                                                                                                                                          "date_advance": 0
                                                                                                                                        },
                                                                                                                                        "reference": null,
                                                                                                                                        "status": "unknown",
                                                                                                                                        "tracking_code": "9405500207552011818490",
                                                                                                                                        "updated_at": "2024-01-24T00:36:24Z",
                                                                                                                                        "batch_id": null,
                                                                                                                                        "batch_status": null,
                                                                                                                                        "batch_message": null,
                                                                                                                                        "customs_info": {
                                                                                                                                          "id": "cstinfo_eee83608742840b7aa1c20c38f069cb1",
                                                                                                                                          "object": "CustomsInfo",
                                                                                                                                          "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                          "updated_at": "2024-01-24T00:36:23Z",
                                                                                                                                          "contents_explanation": "",
                                                                                                                                          "contents_type": "merchandise",
                                                                                                                                          "customs_certify": true,
                                                                                                                                          "customs_signer": "Steve Brule",
                                                                                                                                          "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                                          "non_delivery_option": "return",
                                                                                                                                          "restriction_comments": null,
                                                                                                                                          "restriction_type": "none",
                                                                                                                                          "mode": "test",
                                                                                                                                          "declaration": null,
                                                                                                                                          "customs_items": [
                                                                                                                                            {
                                                                                                                                              "id": "cstitem_f8398fb53c8e4efe9df5968ce2d2d449",
                                                                                                                                              "object": "CustomsItem",
                                                                                                                                              "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                              "updated_at": "2024-01-24T00:36:23Z",
                                                                                                                                              "description": "T-shirt",
                                                                                                                                              "hs_tariff_number": "123456",
                                                                                                                                              "origin_country": "US",
                                                                                                                                              "quantity": 1,
                                                                                                                                              "value": "10.0",
                                                                                                                                              "weight": 5.0,
                                                                                                                                              "code": "123",
                                                                                                                                              "mode": "test",
                                                                                                                                              "manufacturer": null,
                                                                                                                                              "currency": null,
                                                                                                                                              "eccn": null,
                                                                                                                                              "printed_commodity_identifier": null
                                                                                                                                            }
                                                                                                                                          ]
                                                                                                                                        },
                                                                                                                                        "from_address": {
                                                                                                                                          "id": "adr_997cf4e0ba5011eeac3bac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:36:23+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:36:23+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": null,
                                                                                                                                        "parcel": {
                                                                                                                                          "id": "prcl_a019a6b39a544a8590527d22522e4685",
                                                                                                                                          "object": "Parcel",
                                                                                                                                          "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                          "updated_at": "2024-01-24T00:36:23Z",
                                                                                                                                          "length": 20.2,
                                                                                                                                          "width": 10.9,
                                                                                                                                          "height": 5.0,
                                                                                                                                          "predefined_package": null,
                                                                                                                                          "weight": 65.9,
                                                                                                                                          "mode": "test"
                                                                                                                                        },
                                                                                                                                        "postage_label": {
                                                                                                                                          "object": "PostageLabel",
                                                                                                                                          "id": "pl_da441fc128ec4987b792a759df9c2f48",
                                                                                                                                          "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                          "updated_at": "2024-01-24T00:36:24Z",
                                                                                                                                          "date_advance": 0,
                                                                                                                                          "integrated_form": "none",
                                                                                                                                          "label_date": "2024-01-24T00:36:23Z",
                                                                                                                                          "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/20240124/e822df92b132b44139ac11182aaa78181c.png",
                                                                                                                                          "label_pdf_url": null,
                                                                                                                                          "label_zpl_url": null,
                                                                                                                                          "label_epl2_url": null,
                                                                                                                                          "label_file": null
                                                                                                                                        },
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "id": "rate_70bf8e810a364331a5bf89b1fbee27dd",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                            "updated_at": "2024-01-24T00:36:23Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_3d349554446b4d85a59a367bda4e16f1",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_5bd8322e638f48f7a0a9546773e80ea1",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                            "updated_at": "2024-01-24T00:36:23Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_3d349554446b4d85a59a367bda4e16f1",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_ae9accce625e4dbea50caa5316a718f4",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                            "updated_at": "2024-01-24T00:36:23Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_3d349554446b4d85a59a367bda4e16f1",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_37f9982f38274b85a17ac4269eb40829",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                            "updated_at": "2024-01-24T00:36:23Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "49.60",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "57.40",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "49.60",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "shipment_id": "shp_3d349554446b4d85a59a367bda4e16f1",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_a8cc5650c3dd49328709c7b3ad010908",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                            "updated_at": "2024-01-24T00:36:23Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "7.33",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "15.20",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "10.89",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "shipment_id": "shp_3d349554446b4d85a59a367bda4e16f1",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "refund_status": "submitted",
                                                                                                                                        "scan_form": null,
                                                                                                                                        "selected_rate": {
                                                                                                                                          "id": "rate_a8cc5650c3dd49328709c7b3ad010908",
                                                                                                                                          "object": "Rate",
                                                                                                                                          "created_at": "2024-01-24T00:36:23Z",
                                                                                                                                          "updated_at": "2024-01-24T00:36:23Z",
                                                                                                                                          "mode": "test",
                                                                                                                                          "service": "Priority",
                                                                                                                                          "carrier": "USPS",
                                                                                                                                          "rate": "7.33",
                                                                                                                                          "currency": "USD",
                                                                                                                                          "retail_rate": "15.20",
                                                                                                                                          "retail_currency": "USD",
                                                                                                                                          "list_rate": "10.89",
                                                                                                                                          "list_currency": "USD",
                                                                                                                                          "billing_type": "easypost",
                                                                                                                                          "delivery_days": 2,
                                                                                                                                          "delivery_date": null,
                                                                                                                                          "delivery_date_guaranteed": false,
                                                                                                                                          "est_delivery_days": 2,
                                                                                                                                          "shipment_id": "shp_3d349554446b4d85a59a367bda4e16f1",
                                                                                                                                          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                        },
                                                                                                                                        "tracker": {
                                                                                                                                          "id": "trk_7adde026444941eb83df3c483eeaae24",
                                                                                                                                          "object": "Tracker",
                                                                                                                                          "mode": "test",
                                                                                                                                          "tracking_code": "9405500207552011818490",
                                                                                                                                          "status": "pre_transit",
                                                                                                                                          "status_detail": "status_update",
                                                                                                                                          "created_at": "2024-01-24T00:36:24Z",
                                                                                                                                          "updated_at": "2024-01-24T00:36:24Z",
                                                                                                                                          "signed_by": null,
                                                                                                                                          "weight": null,
                                                                                                                                          "est_delivery_date": "2024-01-24T00:36:24Z",
                                                                                                                                          "shipment_id": "shp_3d349554446b4d85a59a367bda4e16f1",
                                                                                                                                          "carrier": "USPS",
                                                                                                                                          "tracking_details": [
                                                                                                                                            {
                                                                                                                                              "object": "TrackingDetail",
                                                                                                                                              "message": "Pre-Shipment Info Sent to USPS",
                                                                                                                                              "description": "",
                                                                                                                                              "status": "pre_transit",
                                                                                                                                              "status_detail": "status_update",
                                                                                                                                              "datetime": "2023-12-24T00:36:24Z",
                                                                                                                                              "source": "USPS",
                                                                                                                                              "carrier_code": "",
                                                                                                                                              "tracking_location": {
                                                                                                                                                "object": "TrackingLocation",
                                                                                                                                                "city": null,
                                                                                                                                                "state": null,
                                                                                                                                                "country": null,
                                                                                                                                                "zip": null
                                                                                                                                              }
                                                                                                                                            },
                                                                                                                                            {
                                                                                                                                              "object": "TrackingDetail",
                                                                                                                                              "message": "Shipping Label Created",
                                                                                                                                              "description": "",
                                                                                                                                              "status": "pre_transit",
                                                                                                                                              "status_detail": "status_update",
                                                                                                                                              "datetime": "2023-12-24T13:13:24Z",
                                                                                                                                              "source": "USPS",
                                                                                                                                              "carrier_code": "",
                                                                                                                                              "tracking_location": {
                                                                                                                                                "object": "TrackingLocation",
                                                                                                                                                "city": "HOUSTON",
                                                                                                                                                "state": "TX",
                                                                                                                                                "country": null,
                                                                                                                                                "zip": "77063"
                                                                                                                                              }
                                                                                                                                            }
                                                                                                                                          ],
                                                                                                                                          "fees": [],
                                                                                                                                          "carrier_detail": {
                                                                                                                                            "object": "CarrierDetail",
                                                                                                                                            "service": "First-Class Package Service",
                                                                                                                                            "container_type": null,
                                                                                                                                            "est_delivery_date_local": null,
                                                                                                                                            "est_delivery_time_local": null,
                                                                                                                                            "origin_location": "HOUSTON TX, 77001",
                                                                                                                                            "origin_tracking_location": {
                                                                                                                                              "object": "TrackingLocation",
                                                                                                                                              "city": "HOUSTON",
                                                                                                                                              "state": "TX",
                                                                                                                                              "country": null,
                                                                                                                                              "zip": "77063"
                                                                                                                                            },
                                                                                                                                            "destination_location": "CHARLESTON SC, 29401",
                                                                                                                                            "destination_tracking_location": null,
                                                                                                                                            "guaranteed_delivery_date": null,
                                                                                                                                            "alternate_identifier": null,
                                                                                                                                            "initial_delivery_attempt": null
                                                                                                                                          },
                                                                                                                                          "public_url": "https://track.easypost.com/djE6dHJrXzdhZGRlMDI2NDQ0OTQxZWI4M2RmM2M0ODNlZWFhZTI0"
                                                                                                                                        },
                                                                                                                                        "to_address": {
                                                                                                                                          "id": "adr_997b2527ba5011eeac3aac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:36:23+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:36:23+00:00",
                                                                                                                                          "name": "DR. STEVE BRULE",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N HARBOR DR",
                                                                                                                                          "street2": null,
                                                                                                                                          "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_997cf4e0ba5011eeac3bac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:36:23+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:36:23+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_997b2527ba5011eeac3aac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:36:23+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:36:23+00:00",
                                                                                                                                          "name": "DR. STEVE BRULE",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N HARBOR DR",
                                                                                                                                          "street2": null,
                                                                                                                                          "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": "LabelFee",
                                                                                                                                            "amount": "0.00000",
                                                                                                                                            "charged": true,
                                                                                                                                            "refunded": false
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "Fee",
                                                                                                                                            "type": "PostageFee",
                                                                                                                                            "amount": "7.33000",
                                                                                                                                            "charged": true,
                                                                                                                                            "refunded": false
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "id": "shp_3d349554446b4d85a59a367bda4e16f1",
                                                                                                                                        "object": "Shipment"
                                                                                                                                      }

                                                                                                                                      Returns

                                                                                                                                      If you are shipping merchandise or other frequently-returned products, you may wish to generate return labels to include with your shipment, for you customer's convenience. EasyPost offers a simple way to submit the same parameters as your initial shipment, but with an additional flag set, that will generate you a return label to receive any return shipments at your original from address.

                                                                                                                                      It's important for some carriers, with different return billing, to specify a return label even if it's not a return label for an earlier Shipment.

                                                                                                                                      If doing more than 10,000 USPS Returns in a year, please contact EasyPost for the USPS scan-based return program, which we also offer.

                                                                                                                                      POST/shipments

                                                                                                                                      Create Return for a Shipment

                                                                                                                                      You can easily create return labels. All you need to do is set the is_return parameter to "true", leave the addresses the same as the initial Shipment's creation request and we switch the To and From Addresses for the return Shipment.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      is_returntrue
                                                                                                                                      to_addressthe original Shipment's to_address
                                                                                                                                      from_addressthe original Shipment's from_address
                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Shipment;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> toAddressMap = new HashMap<String, Object>();
                                                                                                                                              toAddressMap.put("name", "Dr. Steve Brule");
                                                                                                                                              toAddressMap.put("street1", "179 N Harbor Dr");
                                                                                                                                              toAddressMap.put("city", "Redondo Beach");
                                                                                                                                              toAddressMap.put("state", "CA");
                                                                                                                                              toAddressMap.put("country", "US");
                                                                                                                                              toAddressMap.put("phone", "8573875756");
                                                                                                                                              toAddressMap.put("email", "dr_steve_brule@gmail.com");
                                                                                                                                              toAddressMap.put("zip", "90277");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> fromAddressMap = new HashMap<String, Object>();
                                                                                                                                              fromAddressMap.put("name", "EasyPost");
                                                                                                                                              fromAddressMap.put("street1", "417 Montgomery Street");
                                                                                                                                              fromAddressMap.put("street2", "5th Floor");
                                                                                                                                              fromAddressMap.put("city", "San Francisco");
                                                                                                                                              fromAddressMap.put("state", "CA");
                                                                                                                                              fromAddressMap.put("zip", "94104");
                                                                                                                                              fromAddressMap.put("country", "US");
                                                                                                                                              fromAddressMap.put("phone", "4153334445");
                                                                                                                                              fromAddressMap.put("email", "support@easypost.com");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> parcelMap = new HashMap<String, Object>();
                                                                                                                                              parcelMap.put("length", 20.2);
                                                                                                                                              parcelMap.put("width", 10.9);
                                                                                                                                              parcelMap.put("height", 5);
                                                                                                                                              parcelMap.put("weight", 65.9);
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("to_address", toAddressMap);
                                                                                                                                              params.put("from_address", fromAddressMap);
                                                                                                                                              params.put("parcel", parcelMap);
                                                                                                                                              params.put("is_return", "true");
                                                                                                                                      
                                                                                                                                              Shipment shipment = client.shipment.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(shipment);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "created_at": "2024-01-24T00:07:25Z",
                                                                                                                                        "is_return": true,
                                                                                                                                        "messages": [],
                                                                                                                                        "mode": "test",
                                                                                                                                        "options": {
                                                                                                                                          "currency": "USD",
                                                                                                                                          "payment": {
                                                                                                                                            "type": "SENDER"
                                                                                                                                          },
                                                                                                                                          "date_advance": 0
                                                                                                                                        },
                                                                                                                                        "reference": null,
                                                                                                                                        "status": "unknown",
                                                                                                                                        "tracking_code": null,
                                                                                                                                        "updated_at": "2024-01-24T00:07:25Z",
                                                                                                                                        "batch_id": null,
                                                                                                                                        "batch_status": null,
                                                                                                                                        "batch_message": null,
                                                                                                                                        "customs_info": {
                                                                                                                                          "id": "cstinfo_75b9d86bcced4df4a90d971d79467395",
                                                                                                                                          "object": "CustomsInfo",
                                                                                                                                          "created_at": "2024-01-24T00:07:25Z",
                                                                                                                                          "updated_at": "2024-01-24T00:07:25Z",
                                                                                                                                          "contents_explanation": "",
                                                                                                                                          "contents_type": "merchandise",
                                                                                                                                          "customs_certify": true,
                                                                                                                                          "customs_signer": "Steve Brule",
                                                                                                                                          "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                                          "non_delivery_option": "return",
                                                                                                                                          "restriction_comments": null,
                                                                                                                                          "restriction_type": "none",
                                                                                                                                          "mode": "test",
                                                                                                                                          "declaration": null,
                                                                                                                                          "customs_items": [
                                                                                                                                            {
                                                                                                                                              "id": "cstitem_28713b4da6c442c59fc2643c27e68fbc",
                                                                                                                                              "object": "CustomsItem",
                                                                                                                                              "created_at": "2024-01-24T00:07:25Z",
                                                                                                                                              "updated_at": "2024-01-24T00:07:25Z",
                                                                                                                                              "description": "T-shirt",
                                                                                                                                              "hs_tariff_number": "123456",
                                                                                                                                              "origin_country": "US",
                                                                                                                                              "quantity": 1,
                                                                                                                                              "value": "10.0",
                                                                                                                                              "weight": 5.0,
                                                                                                                                              "code": "123",
                                                                                                                                              "mode": "test",
                                                                                                                                              "manufacturer": null,
                                                                                                                                              "currency": null,
                                                                                                                                              "eccn": null,
                                                                                                                                              "printed_commodity_identifier": null
                                                                                                                                            }
                                                                                                                                          ]
                                                                                                                                        },
                                                                                                                                        "from_address": {
                                                                                                                                          "id": "adr_8dcc8d20ba4c11eeb60eac1f6bc539aa",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:25+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:25+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": null,
                                                                                                                                        "parcel": {
                                                                                                                                          "id": "prcl_f5c724b686f5426e86572e0c6ae2eca3",
                                                                                                                                          "object": "Parcel",
                                                                                                                                          "created_at": "2024-01-24T00:07:25Z",
                                                                                                                                          "updated_at": "2024-01-24T00:07:25Z",
                                                                                                                                          "length": 20.2,
                                                                                                                                          "width": 10.9,
                                                                                                                                          "height": 5.0,
                                                                                                                                          "predefined_package": null,
                                                                                                                                          "weight": 65.9,
                                                                                                                                          "mode": "test"
                                                                                                                                        },
                                                                                                                                        "postage_label": null,
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "id": "rate_a5473958bf84407d98729d6a0ae57a50",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:25Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:25Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "49.60",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "57.40",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "49.60",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "shipment_id": "shp_d270335b7bf846b3b03b67df7c181d6f",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_cf8d03f7b5054a52a6f7e87a8f38bf86",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:25Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:25Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "7.33",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "15.20",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "10.89",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "shipment_id": "shp_d270335b7bf846b3b03b67df7c181d6f",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_51439cb11b9b4aa9b2de79bfc24fcae8",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:25Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:25Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_d270335b7bf846b3b03b67df7c181d6f",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_45e9d6f024724c47822543032841289f",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:25Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:25Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_d270335b7bf846b3b03b67df7c181d6f",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_45ac4cce2b18400ea50e0f330f74b430",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:25Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:25Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_d270335b7bf846b3b03b67df7c181d6f",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "refund_status": null,
                                                                                                                                        "scan_form": null,
                                                                                                                                        "selected_rate": null,
                                                                                                                                        "tracker": null,
                                                                                                                                        "to_address": {
                                                                                                                                          "id": "adr_8dc57048ba4c11eea6e33cecef1b359e",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:25+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:25+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "usps_zone": 4,
                                                                                                                                        "return_address": {
                                                                                                                                          "id": "adr_8dcc8d20ba4c11eeb60eac1f6bc539aa",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:25+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:25+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_8dc57048ba4c11eea6e33cecef1b359e",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:25+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:25+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "forms": [],
                                                                                                                                        "fees": [],
                                                                                                                                        "id": "shp_d270335b7bf846b3b03b67df7c181d6f",
                                                                                                                                        "object": "Shipment"
                                                                                                                                      }

                                                                                                                                      TaxIdentifiers

                                                                                                                                      TaxIdentifiers are identifying numbers or IDs that are used to charge a specific party when dealing with the importing or exporting of good across international borders.

                                                                                                                                      TaxIdentifiers is a list of TaxIdentifier objects, which allows you to supply up to 8 Tax Identification numbers. The fields for the TaxIdentifier object are outlined below.

                                                                                                                                      TaxIdentifier Object

                                                                                                                                      attributetypespecification
                                                                                                                                      entitystringWhich entity the tax id belongs to ("SENDER" or "RECEIVER")
                                                                                                                                      tax_idstringThe actual tax id number
                                                                                                                                      tax_id_typestringThe type of tax id that is being used with the shipment (see possible types by carrier here)
                                                                                                                                      issuing_countrystringThe issuing country of the tax id number
                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Shipment;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> toAddressMap = new HashMap<String, Object>();
                                                                                                                                              toAddressMap.put("name", "Dr. Steve Brule");
                                                                                                                                              toAddressMap.put("street1", "179 N Harbor Dr");
                                                                                                                                              toAddressMap.put("city", "Redondo Beach");
                                                                                                                                              toAddressMap.put("state", "CA");
                                                                                                                                              toAddressMap.put("country", "US");
                                                                                                                                              toAddressMap.put("phone", "8573875756");
                                                                                                                                              toAddressMap.put("email", "dr_steve_brule@gmail.com");
                                                                                                                                              toAddressMap.put("zip", "90277");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> fromAddressMap = new HashMap<String, Object>();
                                                                                                                                              fromAddressMap.put("name", "EasyPost");
                                                                                                                                              fromAddressMap.put("street1", "417 Montgomery Street");
                                                                                                                                              fromAddressMap.put("street2", "5th Floor");
                                                                                                                                              fromAddressMap.put("city", "San Francisco");
                                                                                                                                              fromAddressMap.put("state", "CA");
                                                                                                                                              fromAddressMap.put("zip", "94104");
                                                                                                                                              fromAddressMap.put("country", "US");
                                                                                                                                              fromAddressMap.put("phone", "4153334445");
                                                                                                                                              fromAddressMap.put("email", "support@easypost.com");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> parcelMap = new HashMap<String, Object>();
                                                                                                                                              parcelMap.put("length", 20.2);
                                                                                                                                              parcelMap.put("width", 10.9);
                                                                                                                                              parcelMap.put("height", 5);
                                                                                                                                              parcelMap.put("weight", 65.9);
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> customsInfoMap = new HashMap<String, Object>();
                                                                                                                                              customsInfoMap.put("id", "cstinfo_...");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> taxIdentifiersMap = new HashMap<String, Object>();
                                                                                                                                              taxIdentifiersMap.put("entity", "SENDER");
                                                                                                                                              taxIdentifiersMap.put("tax_id", "GB123456789");
                                                                                                                                              taxIdentifiersMap.put("tax_id_type", "EORI");
                                                                                                                                              taxIdentifiersMap.put("issuing_country", "GB");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("to_address", toAddressMap);
                                                                                                                                              params.put("from_address", fromAddressMap);
                                                                                                                                              params.put("parcel", parcelMap);
                                                                                                                                              params.put("customs_info", customsInfoMap);
                                                                                                                                              params.put("tax_identifiers", taxIdentifiersMap);
                                                                                                                                      
                                                                                                                                              Shipment shipment = client.shipment.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(shipment);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "created_at": "2024-01-24T00:07:46Z",
                                                                                                                                        "is_return": false,
                                                                                                                                        "messages": [],
                                                                                                                                        "mode": "test",
                                                                                                                                        "options": {
                                                                                                                                          "currency": "USD",
                                                                                                                                          "payment": {
                                                                                                                                            "type": "SENDER"
                                                                                                                                          },
                                                                                                                                          "date_advance": 0
                                                                                                                                        },
                                                                                                                                        "reference": null,
                                                                                                                                        "status": "unknown",
                                                                                                                                        "tracking_code": null,
                                                                                                                                        "updated_at": "2024-01-24T00:07:46Z",
                                                                                                                                        "batch_id": null,
                                                                                                                                        "batch_status": null,
                                                                                                                                        "batch_message": null,
                                                                                                                                        "customs_info": {
                                                                                                                                          "id": "cstinfo_cdfe0dff7d68443c8f7e0d1a9a6cfa00",
                                                                                                                                          "object": "CustomsInfo",
                                                                                                                                          "created_at": "2024-01-24T00:07:46Z",
                                                                                                                                          "updated_at": "2024-01-24T00:07:46Z",
                                                                                                                                          "contents_explanation": "",
                                                                                                                                          "contents_type": "merchandise",
                                                                                                                                          "customs_certify": true,
                                                                                                                                          "customs_signer": "Steve Brule",
                                                                                                                                          "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                                          "non_delivery_option": "return",
                                                                                                                                          "restriction_comments": null,
                                                                                                                                          "restriction_type": "none",
                                                                                                                                          "mode": "test",
                                                                                                                                          "declaration": null,
                                                                                                                                          "customs_items": [
                                                                                                                                            {
                                                                                                                                              "id": "cstitem_e887fa152fd249fabbac8ae2541f3892",
                                                                                                                                              "object": "CustomsItem",
                                                                                                                                              "created_at": "2024-01-24T00:07:46Z",
                                                                                                                                              "updated_at": "2024-01-24T00:07:46Z",
                                                                                                                                              "description": "T-shirt",
                                                                                                                                              "hs_tariff_number": "123456",
                                                                                                                                              "origin_country": "US",
                                                                                                                                              "quantity": 1,
                                                                                                                                              "value": "10.0",
                                                                                                                                              "weight": 5.0,
                                                                                                                                              "code": "123",
                                                                                                                                              "mode": "test",
                                                                                                                                              "manufacturer": null,
                                                                                                                                              "currency": null,
                                                                                                                                              "eccn": null,
                                                                                                                                              "printed_commodity_identifier": null
                                                                                                                                            }
                                                                                                                                          ]
                                                                                                                                        },
                                                                                                                                        "from_address": {
                                                                                                                                          "id": "adr_9a351a75ba4c11eeb96cac1f6bc539aa",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:46+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:46+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": null,
                                                                                                                                        "parcel": {
                                                                                                                                          "id": "prcl_e6f683f83bc84032b535e645639374a9",
                                                                                                                                          "object": "Parcel",
                                                                                                                                          "created_at": "2024-01-24T00:07:46Z",
                                                                                                                                          "updated_at": "2024-01-24T00:07:46Z",
                                                                                                                                          "length": 20.2,
                                                                                                                                          "width": 10.9,
                                                                                                                                          "height": 5.0,
                                                                                                                                          "predefined_package": null,
                                                                                                                                          "weight": 65.9,
                                                                                                                                          "mode": "test"
                                                                                                                                        },
                                                                                                                                        "postage_label": null,
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "id": "rate_4d0284c73a224c11b033185dd273b315",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:46Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:46Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "49.60",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "57.40",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "49.60",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "shipment_id": "shp_0ed780bf1e164297b60f240d96b278ac",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_23d42865d5474d649842391f6ae23ea9",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:46Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:46Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "7.33",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "15.20",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "10.89",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "shipment_id": "shp_0ed780bf1e164297b60f240d96b278ac",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_c7d8199fc61b46d59bdaf0efe4f783c8",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:46Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:46Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_0ed780bf1e164297b60f240d96b278ac",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_e2603204bd9548dea5320f9b11e5aa8d",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:46Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:46Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_0ed780bf1e164297b60f240d96b278ac",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_aa8e719214f446959c00492c1f996681",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:07:46Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:46Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_0ed780bf1e164297b60f240d96b278ac",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "refund_status": null,
                                                                                                                                        "scan_form": null,
                                                                                                                                        "selected_rate": null,
                                                                                                                                        "tracker": null,
                                                                                                                                        "to_address": {
                                                                                                                                          "id": "adr_9a32378eba4c11ee8e86ac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:46+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:46+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "usps_zone": 4,
                                                                                                                                        "return_address": {
                                                                                                                                          "id": "adr_9a351a75ba4c11eeb96cac1f6bc539aa",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:46+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:46+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_9a32378eba4c11ee8e86ac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:46+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:46+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "forms": [],
                                                                                                                                        "fees": [],
                                                                                                                                        "id": "shp_0ed780bf1e164297b60f240d96b278ac",
                                                                                                                                        "object": "Shipment",
                                                                                                                                        "tax_identifiers": [
                                                                                                                                          {
                                                                                                                                            "entity": "SENDER",
                                                                                                                                            "tax_id": "HIDDEN",
                                                                                                                                            "tax_id_type": "EORI",
                                                                                                                                            "issuing_country": "GB"
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }

                                                                                                                                      Trackers

                                                                                                                                      A Tracker object contains all of the tracking information for a package. A Tracker is created automatically whenever you buy a Shipment through EasyPost; if you don't use EasyPost to purchase your shipping labels, you can still track packages through our API by creating a Tracker object directly. Each Tracker is continually updated in the background as the package moves through its life cycle, regardless of whether or not the label was purchased through EasyPost.

                                                                                                                                      After creation, a Tracker object will be updated periodically based on when the carrier provides EasyPost with new tracking information. This information can be consumed by using our webhooks infrastructure. Every time a Tracker is updated a webhook Event will be sent.

                                                                                                                                      The Tracker object contains both the current information about the package as well as previous updates. All of the previous updates are stored in the tracking_details array. Each TrackingDetail object contains the status, the message from the carrier, and a TrackingLocation.

                                                                                                                                      The TrackingLocation contains city, state, country, and zip information about the location where the package was scanned. The information each carrier provides is different, so some carriers may not make use of all of these fields.

                                                                                                                                      Some Tracker objects may also contain a CarrierDetail, which stores some additional information about the Tracker that the carrier has made available to EasyPost. The CarrierDetail object contains the service and container_type of the package. Additionally, it also stores the est_delivery_date_local and est_delivery_time_local, which provide information about the local delivery time.

                                                                                                                                      It's worth noting that tracking_codes are not globally unique. Each carrier promises uniqueness for a given tracking_code for a certain period of time, but the length of time varies greatly based on the specific carrier and service level. The carriers do eventually recycle tracking_codes, and for this reason enforcing uniqueness on the tracking_code field is not recommended. EasyPost does, however, prevent the creation of duplicate Trackers based on tracking_code and carrier; duplicate requests by the same User will simply return the original Tracker.

                                                                                                                                      Tracker Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique identifier, begins with "trk_"
                                                                                                                                      objectstring"Tracker"
                                                                                                                                      modestring"test" or "production"
                                                                                                                                      tracking_codestringThe tracking code provided by the carrier
                                                                                                                                      statusstringThe current status of the package, possible values are "unknown", "pre_transit", "in_transit", "out_for_delivery", "delivered", "available_for_pickup", "return_to_sender", "failure", "cancelled" or "error"
                                                                                                                                      status_detailstringAdditional details about the current status, possible values are "address_correction", "arrived_at_destination", "arrived_at_facility", "arrived_at_pickup_location", "awaiting_information", "cancelled", "damaged", "delayed", "delivery_exception", "departed_facility", "departed_origin_facility", "expired", "failure", "held", "in_transit", "label_created", "lost", "missorted", "out_for_delivery", "received_at_destination_facility", "received_at_origin_facility", "refused", "return", "status_update", "transferred_to_destination_carrier", "transit_exception", "unknown", "weather_delay"
                                                                                                                                      signed_bystringThe name of the person who signed for the package (if available)
                                                                                                                                      weightfloatThe weight of the package as measured by the carrier in ounces (if available)
                                                                                                                                      est_delivery_datedatetimeThe estimated delivery date provided by the carrier (if available)
                                                                                                                                      shipment_idstringThe id of the EasyPost Shipment object associated with the Tracker (if any)
                                                                                                                                      carrierstringThe name of the carrier handling the shipment
                                                                                                                                      tracking_detailsTrackingDetail arrayArray of the associated TrackingDetail objects
                                                                                                                                      carrier_detailCarrierDetailThe associated CarrierDetail object (if available)
                                                                                                                                      public_urlstringURL to a publicly-accessible html page that shows tracking details for this tracker
                                                                                                                                      feesFee arrayArray of the associated Fee objects
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime

                                                                                                                                      TrackingDetail Object

                                                                                                                                      attributetypespecification
                                                                                                                                      objectstring"TrackingDetail"
                                                                                                                                      messagestringSummary of the scan event
                                                                                                                                      statusstringStatus of the package at the time of the scan event, possible values are "unknown", "pre_transit", "in_transit", "out_for_delivery", "delivered", "available_for_pickup", "return_to_sender", "failure", "cancelled" or "error"
                                                                                                                                      status_detailstringAdditional details about the current status, possible values are "address_correction", "arrived_at_destination", "arrived_at_facility", "arrived_at_pickup_location", "awaiting_information", "cancelled", "damaged", "delayed", "delivery_exception", "departed_facility", "departed_origin_facility", "expired", "failure", "held", "in_transit", "label_created", "lost", "missorted", "out_for_delivery", "received_at_destination_facility", "received_at_origin_facility", "refused", "return", "status_update", "transferred_to_destination_carrier", "transit_exception", "unknown", "weather_delay"
                                                                                                                                      datetimedatetimeThe timestamp when the tracking scan occurred
                                                                                                                                      sourcestringThe original source of the information for this scan event, usually the carrier
                                                                                                                                      tracking_locationTrackingLocationThe location associated with the scan event

                                                                                                                                      TrackingLocation Object

                                                                                                                                      attributetypespecification
                                                                                                                                      objectstring"TrackingLocation"
                                                                                                                                      citystringThe city where the scan event occurred (if available)
                                                                                                                                      statestringThe state where the scan event occurred (if available)
                                                                                                                                      countrystringThe country where the scan event occurred (if available)
                                                                                                                                      zipstringThe postal code where the scan event occurred (if available)

                                                                                                                                      CarrierDetail Object

                                                                                                                                      attributetypespecification
                                                                                                                                      objectstring"CarrierDetail"
                                                                                                                                      servicestringThe service level the associated shipment was shipped with (if available)
                                                                                                                                      container_typestringThe type of container the associated shipment was shipped in (if available)
                                                                                                                                      est_delivery_date_localdateThe estimated delivery date as provided by the carrier, in the local time zone (if available)
                                                                                                                                      est_delivery_time_localtimeThe estimated delivery time as provided by the carrier, in the local time zone (if available)
                                                                                                                                      origin_locationstringThe location from which the package originated, stringified for presentation (if available)
                                                                                                                                      origin_tracking_locationTrackingLocationThe location from which the package originated, broken down by city/state/country/zip (if available)
                                                                                                                                      destination_locationstringThe location to which the package is being sent, stringified for presentation (if available)
                                                                                                                                      destination_tracking_locationTrackingLocationThe location to which the package is being sent, broken down by city/state/country/zip (if available)
                                                                                                                                      guaranteed_delivery_datedatetimeThe date and time the carrier guarantees the package to be delivered by (if available)
                                                                                                                                      alternate_identifierstringThe alternate identifier for this package as provided by the carrier (if available)
                                                                                                                                      initial_delivery_attemptdatetimeThe date and time of the first attempt by the carrier to deliver the package (if available)

                                                                                                                                      Testing Specific Tracking States

                                                                                                                                      Sometimes you may want to simulate specific tracking statuses (e.g. "out_for_delivery") within your application to test how your application responds. EasyPost has a set of test tracking_codes that, when sent to the API, respond with specific tracking statuses and send a webhook Event to your test mode URL. The tracking updates that are sent by these tracking_codes will contain canned information, but it will be similar in form to the information normally provided by the carrier you selected.

                                                                                                                                      Test Tracking Codes

                                                                                                                                      tracking_codestatus
                                                                                                                                      EZ1000000001pre_transit
                                                                                                                                      EZ2000000002in_transit
                                                                                                                                      EZ3000000003out_for_delivery
                                                                                                                                      EZ4000000004delivered
                                                                                                                                      EZ5000000005return_to_sender
                                                                                                                                      EZ6000000006failure
                                                                                                                                      EZ7000000007unknown

                                                                                                                                      Carrier Tracking Strings

                                                                                                                                      CarrierString Representation
                                                                                                                                      Accurate
                                                                                                                                      AmazonMwsAmazonMws
                                                                                                                                      APCAPC
                                                                                                                                      Asendia USAAsendiaUsa
                                                                                                                                      Australia PostAustraliaPost
                                                                                                                                      AxlehireV3AxlehireV3
                                                                                                                                      Better TrucksBetterTrucks
                                                                                                                                      Canada PostCanadaPost
                                                                                                                                      CanparCanpar
                                                                                                                                      CDL Last Mile SolutionsColumbusLastMile
                                                                                                                                      ChronopostChronopost
                                                                                                                                      CIRRO E-CommerceCirro E-Commerce
                                                                                                                                      CloudSortCloudSort
                                                                                                                                      Courier ExpressCourierExpress
                                                                                                                                      CouriersPleaseCouriersPlease
                                                                                                                                      Dai PostDaiPost
                                                                                                                                      DeliverItDeliverIt
                                                                                                                                      Deutsche PostDeutschePost
                                                                                                                                      Deutsche Post UKDeutschePostUK
                                                                                                                                      DHL
                                                                                                                                      DHL eCommerce SolutionsDhlEcs
                                                                                                                                      DHL ExpressDHLExpress
                                                                                                                                      DHL PaketDHLPaket
                                                                                                                                      DouglasDouglas
                                                                                                                                      DPDDPD
                                                                                                                                      DPD NLDPDNL
                                                                                                                                      DPD UKDPDUK
                                                                                                                                      ePost GlobalePostGlobal
                                                                                                                                      EstafetaEstafeta
                                                                                                                                      EvriEvri
                                                                                                                                      FastwayFastway
                                                                                                                                      FedExFedEx
                                                                                                                                      FedEx Ground EconomyFedexSmartPost
                                                                                                                                      FedEx International ConnectFedExInternationalConnect
                                                                                                                                      FedEx MailviewFedExMailview
                                                                                                                                      FirstChoiceFirstChoice
                                                                                                                                      FirstMileFirstMile
                                                                                                                                      FlexportFlexport
                                                                                                                                      GSOGSO
                                                                                                                                      HailifyHailify
                                                                                                                                      Interlink ExpressInterlinkExpress
                                                                                                                                      Jet
                                                                                                                                      JP PostJPPost
                                                                                                                                      Kuroneko YamatoKuronekoYamato
                                                                                                                                      La PosteLaPoste
                                                                                                                                      LaserShipLaserShipV2
                                                                                                                                      Loomis ExpressLoomisExpress
                                                                                                                                      LSOLSO
                                                                                                                                      MaergoMaergo
                                                                                                                                      NewgisticsNewgistics
                                                                                                                                      OnTracOnTrac
                                                                                                                                      OptimaOptima
                                                                                                                                      Osm WorldwideOsmWorldwide
                                                                                                                                      PandionPandion
                                                                                                                                      ParcelParcel
                                                                                                                                      ParcelforceParcelforce
                                                                                                                                      PassportPassportGlobal
                                                                                                                                      PostNLPostNL
                                                                                                                                      PurolatorPurolator
                                                                                                                                      Royal MailRoyalMail
                                                                                                                                      SEKO OmniParcelOmniParcel
                                                                                                                                      SendleSendle
                                                                                                                                      SF ExpressSFExpress
                                                                                                                                      SmartKargoSmartKargo
                                                                                                                                      SonicSonic
                                                                                                                                      Spee-DeeSpeeDee
                                                                                                                                      SwyftSwyft
                                                                                                                                      TForce LogisticsTForce
                                                                                                                                      TollToll
                                                                                                                                      UDSUDS
                                                                                                                                      UPSUPS
                                                                                                                                      UPS i-parcelUPSIparcel
                                                                                                                                      UPS Mail InnovationsUPSMailInnovations
                                                                                                                                      USPSUSPS
                                                                                                                                      VehoVeho
                                                                                                                                      YanwenYanwen
                                                                                                                                      POST/trackers

                                                                                                                                      Create a Tracker

                                                                                                                                      A Tracker can be created with only a tracking_code. Optionally, you can provide the carrier parameter, which indicates the carrier the package was shipped with. If no carrier is provided, EasyPost will attempt to determine the carrier based on the tracking_code provided. Providing a carrier parameter is recommended, since some tracking_codes are ambiguous and may match with more than one carrier. In addition, not having to auto-match the carrier will significantly speed up the response time.

                                                                                                                                      In an effort to reduce wasted resources, EasyPost prevents the creation of duplicate Trackers. A Tracker is considered to be a duplicate if another Tracker with the same tracking_code and carrier was created by the same User in the last three months. In the case where a duplicate request is submitted, the original Tracker will be returned.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      tracking_code9400110898825022579493The tracking code associated with the package you'd like to track
                                                                                                                                      carrierUSPSThe carrier associated with the tracking_code you provided. The carrier will get auto-detected if none is provided
                                                                                                                                      Example
                                                                                                                                      package trackers;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Tracker;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> params = new HashMap<String, Object>();
                                                                                                                                              params.put("tracking_code", "EZ1000000001");
                                                                                                                                              params.put("carrier", "USPS");
                                                                                                                                      
                                                                                                                                              Tracker tracker = client.tracker.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(tracker);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "trk_a45db88bb5194557879246abd110606c",
                                                                                                                                        "object": "Tracker",
                                                                                                                                        "mode": "test",
                                                                                                                                        "tracking_code": "EZ1000000001",
                                                                                                                                        "status": "pre_transit",
                                                                                                                                        "status_detail": "status_update",
                                                                                                                                        "created_at": "2024-01-23T23:58:57Z",
                                                                                                                                        "updated_at": "2024-01-23T23:58:57Z",
                                                                                                                                        "signed_by": null,
                                                                                                                                        "weight": null,
                                                                                                                                        "est_delivery_date": "2024-01-23T23:58:57Z",
                                                                                                                                        "shipment_id": null,
                                                                                                                                        "carrier": "USPS",
                                                                                                                                        "tracking_details": [
                                                                                                                                          {
                                                                                                                                            "object": "TrackingDetail",
                                                                                                                                            "message": "Pre-Shipment Info Sent to USPS",
                                                                                                                                            "description": "",
                                                                                                                                            "status": "pre_transit",
                                                                                                                                            "status_detail": "status_update",
                                                                                                                                            "datetime": "2023-12-23T23:58:57Z",
                                                                                                                                            "source": "USPS",
                                                                                                                                            "carrier_code": "",
                                                                                                                                            "tracking_location": {
                                                                                                                                              "object": "TrackingLocation",
                                                                                                                                              "city": null,
                                                                                                                                              "state": null,
                                                                                                                                              "country": null,
                                                                                                                                              "zip": null
                                                                                                                                            }
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "TrackingDetail",
                                                                                                                                            "message": "Shipping Label Created",
                                                                                                                                            "description": "",
                                                                                                                                            "status": "pre_transit",
                                                                                                                                            "status_detail": "status_update",
                                                                                                                                            "datetime": "2023-12-24T12:35:57Z",
                                                                                                                                            "source": "USPS",
                                                                                                                                            "carrier_code": "",
                                                                                                                                            "tracking_location": {
                                                                                                                                              "object": "TrackingLocation",
                                                                                                                                              "city": "HOUSTON",
                                                                                                                                              "state": "TX",
                                                                                                                                              "country": null,
                                                                                                                                              "zip": "77063"
                                                                                                                                            }
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "carrier_detail": {
                                                                                                                                          "object": "CarrierDetail",
                                                                                                                                          "service": "First-Class Package Service",
                                                                                                                                          "container_type": null,
                                                                                                                                          "est_delivery_date_local": null,
                                                                                                                                          "est_delivery_time_local": null,
                                                                                                                                          "origin_location": "HOUSTON TX, 77001",
                                                                                                                                          "origin_tracking_location": {
                                                                                                                                            "object": "TrackingLocation",
                                                                                                                                            "city": "HOUSTON",
                                                                                                                                            "state": "TX",
                                                                                                                                            "country": null,
                                                                                                                                            "zip": "77063"
                                                                                                                                          },
                                                                                                                                          "destination_location": "CHARLESTON SC, 29401",
                                                                                                                                          "destination_tracking_location": null,
                                                                                                                                          "guaranteed_delivery_date": null,
                                                                                                                                          "alternate_identifier": null,
                                                                                                                                          "initial_delivery_attempt": null
                                                                                                                                        },
                                                                                                                                        "finalized": true,
                                                                                                                                        "is_return": false,
                                                                                                                                        "public_url": "https://track.easypost.com/djE6dHJrX2E0NWRiODhiYjUxOTQ1NTc4NzkyNDZhYmQxMTA2MDZj"
                                                                                                                                      }
                                                                                                                                      GET/trackers

                                                                                                                                      Retrieve a list of Trackers

                                                                                                                                      The Tracker List is a paginated list of all Tracker objects associated with the given API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                                      Using the Tracker List endpoint is the recommended way of retrieving a Tracker by tracking_code or carrier. Unlike the retrieving a Tracker using the Retrieve endpoint, which accepts an id, the List endpoint accepts the tracking_code as the search parameter. Normally, you'll only have one Tracker with a given tracking_code, but it is also possible to further filter those results by including the carrier parameter in your request.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      before_idtrk_...Optional pagination parameter. Only trackers created before the given ID will be included. May not be used with after_id
                                                                                                                                      after_idtrk_...Optional pagination parameter. Only trackers created after the given ID will be included. May not be used with before_id
                                                                                                                                      start_datetime2016-01-02T00:00:00ZOnly return Trackers created after this timestamp. Defaults to 1 month ago, or 1 month before a passed end_datetime
                                                                                                                                      end_datetime2016-01-02T00:00:00ZOnly return Trackers created before this timestamp. Defaults to end of the current day, or 1 month after a passed start_datetime
                                                                                                                                      page_size30The number of trackers to return on each page. The maximum value is 100
                                                                                                                                      tracking_code9400110898825022579493Only returns Trackers with the given tracking_code. Useful for retrieving an individual Tracker by tracking_code rather than by ID
                                                                                                                                      carrierUSPSOnly returns Trackers with the given carrier value
                                                                                                                                      Example
                                                                                                                                      package trackers;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.TrackerCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<>();
                                                                                                                                              params.put("page_size", 5);
                                                                                                                                      
                                                                                                                                              TrackerCollection trackers = client.tracker.all(params);
                                                                                                                                      
                                                                                                                                              System.out.println(trackers);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "trackers": [
                                                                                                                                          {
                                                                                                                                            "id": "trk_3898303eff624097a516ab324bb133f3",
                                                                                                                                            "object": "Tracker",
                                                                                                                                            "mode": "test",
                                                                                                                                            "tracking_code": "9405500207552011812894",
                                                                                                                                            "status": "pre_transit",
                                                                                                                                            "status_detail": "status_update",
                                                                                                                                            "created_at": "2024-01-24T00:07:43Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:43Z",
                                                                                                                                            "signed_by": null,
                                                                                                                                            "weight": null,
                                                                                                                                            "est_delivery_date": "2024-01-24T00:07:43Z",
                                                                                                                                            "shipment_id": "shp_82d5637d74404d1595eacdc7e5ca9273",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "tracking_details": [
                                                                                                                                              {
                                                                                                                                                "object": "TrackingDetail",
                                                                                                                                                "message": "Pre-Shipment Info Sent to USPS",
                                                                                                                                                "description": "",
                                                                                                                                                "status": "pre_transit",
                                                                                                                                                "status_detail": "status_update",
                                                                                                                                                "datetime": "2023-12-24T00:07:43Z",
                                                                                                                                                "source": "USPS",
                                                                                                                                                "carrier_code": "",
                                                                                                                                                "tracking_location": {
                                                                                                                                                  "object": "TrackingLocation",
                                                                                                                                                  "city": null,
                                                                                                                                                  "state": null,
                                                                                                                                                  "country": null,
                                                                                                                                                  "zip": null
                                                                                                                                                }
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "object": "TrackingDetail",
                                                                                                                                                "message": "Shipping Label Created",
                                                                                                                                                "description": "",
                                                                                                                                                "status": "pre_transit",
                                                                                                                                                "status_detail": "status_update",
                                                                                                                                                "datetime": "2023-12-24T12:44:43Z",
                                                                                                                                                "source": "USPS",
                                                                                                                                                "carrier_code": "",
                                                                                                                                                "tracking_location": {
                                                                                                                                                  "object": "TrackingLocation",
                                                                                                                                                  "city": "HOUSTON",
                                                                                                                                                  "state": "TX",
                                                                                                                                                  "country": null,
                                                                                                                                                  "zip": "77063"
                                                                                                                                                }
                                                                                                                                              }
                                                                                                                                            ],
                                                                                                                                            "fees": [],
                                                                                                                                            "carrier_detail": {
                                                                                                                                              "object": "CarrierDetail",
                                                                                                                                              "service": "First-Class Package Service",
                                                                                                                                              "container_type": null,
                                                                                                                                              "est_delivery_date_local": null,
                                                                                                                                              "est_delivery_time_local": null,
                                                                                                                                              "origin_location": "HOUSTON TX, 77001",
                                                                                                                                              "origin_tracking_location": {
                                                                                                                                                "object": "TrackingLocation",
                                                                                                                                                "city": "HOUSTON",
                                                                                                                                                "state": "TX",
                                                                                                                                                "country": null,
                                                                                                                                                "zip": "77063"
                                                                                                                                              },
                                                                                                                                              "destination_location": "CHARLESTON SC, 29401",
                                                                                                                                              "destination_tracking_location": null,
                                                                                                                                              "guaranteed_delivery_date": null,
                                                                                                                                              "alternate_identifier": null,
                                                                                                                                              "initial_delivery_attempt": null
                                                                                                                                            },
                                                                                                                                            "public_url": "https://track.easypost.com/djE6dHJrXzM4OTgzMDNlZmY2MjQwOTdhNTE2YWIzMjRiYjEzM2Yz"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "has_more": true
                                                                                                                                      }
                                                                                                                                      GET/trackers/:id

                                                                                                                                      Retrieve a Tracker

                                                                                                                                      Retrieve a Tracker by id.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      idtrk_...Unique, starts with "trk_"
                                                                                                                                      Example
                                                                                                                                      package trackers;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Tracker;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Tracker tracker = client.tracker.retrieve("trk_...");
                                                                                                                                      
                                                                                                                                              System.out.println(tracker);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "trk_3898303eff624097a516ab324bb133f3",
                                                                                                                                        "object": "Tracker",
                                                                                                                                        "mode": "test",
                                                                                                                                        "tracking_code": "9405500207552011812894",
                                                                                                                                        "status": "pre_transit",
                                                                                                                                        "status_detail": "status_update",
                                                                                                                                        "created_at": "2024-01-24T00:07:43Z",
                                                                                                                                        "updated_at": "2024-01-24T00:07:43Z",
                                                                                                                                        "signed_by": null,
                                                                                                                                        "weight": null,
                                                                                                                                        "est_delivery_date": "2024-01-24T00:07:43Z",
                                                                                                                                        "shipment_id": "shp_82d5637d74404d1595eacdc7e5ca9273",
                                                                                                                                        "carrier": "USPS",
                                                                                                                                        "tracking_details": [
                                                                                                                                          {
                                                                                                                                            "object": "TrackingDetail",
                                                                                                                                            "message": "Pre-Shipment Info Sent to USPS",
                                                                                                                                            "description": "",
                                                                                                                                            "status": "pre_transit",
                                                                                                                                            "status_detail": "status_update",
                                                                                                                                            "datetime": "2023-12-24T00:07:43Z",
                                                                                                                                            "source": "USPS",
                                                                                                                                            "carrier_code": "",
                                                                                                                                            "tracking_location": {
                                                                                                                                              "object": "TrackingLocation",
                                                                                                                                              "city": null,
                                                                                                                                              "state": null,
                                                                                                                                              "country": null,
                                                                                                                                              "zip": null
                                                                                                                                            }
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "TrackingDetail",
                                                                                                                                            "message": "Shipping Label Created",
                                                                                                                                            "description": "",
                                                                                                                                            "status": "pre_transit",
                                                                                                                                            "status_detail": "status_update",
                                                                                                                                            "datetime": "2023-12-24T12:44:43Z",
                                                                                                                                            "source": "USPS",
                                                                                                                                            "carrier_code": "",
                                                                                                                                            "tracking_location": {
                                                                                                                                              "object": "TrackingLocation",
                                                                                                                                              "city": "HOUSTON",
                                                                                                                                              "state": "TX",
                                                                                                                                              "country": null,
                                                                                                                                              "zip": "77063"
                                                                                                                                            }
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "fees": [],
                                                                                                                                        "carrier_detail": {
                                                                                                                                          "object": "CarrierDetail",
                                                                                                                                          "service": "First-Class Package Service",
                                                                                                                                          "container_type": null,
                                                                                                                                          "est_delivery_date_local": null,
                                                                                                                                          "est_delivery_time_local": null,
                                                                                                                                          "origin_location": "HOUSTON TX, 77001",
                                                                                                                                          "origin_tracking_location": {
                                                                                                                                            "object": "TrackingLocation",
                                                                                                                                            "city": "HOUSTON",
                                                                                                                                            "state": "TX",
                                                                                                                                            "country": null,
                                                                                                                                            "zip": "77063"
                                                                                                                                          },
                                                                                                                                          "destination_location": "CHARLESTON SC, 29401",
                                                                                                                                          "destination_tracking_location": null,
                                                                                                                                          "guaranteed_delivery_date": null,
                                                                                                                                          "alternate_identifier": null,
                                                                                                                                          "initial_delivery_attempt": null
                                                                                                                                        },
                                                                                                                                        "public_url": "https://track.easypost.com/djE6dHJrXzM4OTgzMDNlZmY2MjQwOTdhNTE2YWIzMjRiYjEzM2Yz"
                                                                                                                                      }

                                                                                                                                      Batches

                                                                                                                                      The Batch object allows you to perform operations on multiple Shipments at once. This includes scheduling a Pickup, creating a ScanForm and consolidating labels. Operations performed on Batches are asynchronous and take advantage of our webhook infrastructure.

                                                                                                                                      Batch Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with "batch_"
                                                                                                                                      referencestringAn optional field that may be used in place of ID in some API endpoints
                                                                                                                                      objectstring"Batch"
                                                                                                                                      modestring"test" or "production"
                                                                                                                                      statestringThe overall state. Possible values are "creating", "creation_failed", "created", "purchasing", "purchase_failed", "purchased", "label_generating", and "label_generated"
                                                                                                                                      num_shipmentsintegerThe number of shipments added
                                                                                                                                      shipmentsBatchShipment arrayAn array of batch shipments
                                                                                                                                      statusobjectA map of BatchShipment statuses to the count of BatchShipments with that status. Valid statuses are "postage_purchased", "postage_purchase_failed", "queued_for_purchase", and "creation_failed"
                                                                                                                                      label_urlstringThe label image url
                                                                                                                                      scan_formScanFormThe created ScanForm
                                                                                                                                      pickupPickupThe created Pickup
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime

                                                                                                                                      BatchShipment Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringThe id of the Shipment. Unique, begins with "shp_"
                                                                                                                                      referencestringAn optional field that may be used in place of ID in some API endpoints
                                                                                                                                      batch_statusstringThe current status. Possible values are "postage_purchased", "postage_purchase_failed", "queued_for_purchase", and "creation_failed"
                                                                                                                                      batch_messagestringA human readable message for any errors that occurred during the Batch's life cycle
                                                                                                                                      POST/batches

                                                                                                                                      Create a Batch

                                                                                                                                      A Batch can be created with or without Shipments. When created with Shipments the initial state will be creating. Once the state changes to created a webhook Event will be sent. When created with no Shipments the initial state will be created and webhook will be sent.

                                                                                                                                      Example
                                                                                                                                      package batches;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Batch;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.ArrayList;
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class Create {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              List<HashMap<String, Object>> shipmentsList = new ArrayList<HashMap<String, Object>>();
                                                                                                                                              HashMap<String, Object> shipmentMap = new HashMap<String, Object>();
                                                                                                                                      
                                                                                                                                              shipmentMap.put("id", "shp_...");
                                                                                                                                      
                                                                                                                                              shipmentsList.add(shipmentMap);
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                      
                                                                                                                                              params.put("shipment", shipmentsList);
                                                                                                                                      
                                                                                                                                              Batch batch = client.batch.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(batch);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "batch_94b0f73e5d3344158b588f1cac2d083c",
                                                                                                                                        "object": "Batch",
                                                                                                                                        "mode": "test",
                                                                                                                                        "state": "creating",
                                                                                                                                        "num_shipments": 1,
                                                                                                                                        "reference": null,
                                                                                                                                        "created_at": "2024-01-24T00:03:49Z",
                                                                                                                                        "updated_at": "2024-01-24T00:03:49Z",
                                                                                                                                        "scan_form": null,
                                                                                                                                        "shipments": [],
                                                                                                                                        "status": {
                                                                                                                                          "created": 0,
                                                                                                                                          "queued_for_purchase": 0,
                                                                                                                                          "creation_failed": 0,
                                                                                                                                          "postage_purchased": 0,
                                                                                                                                          "postage_purchase_failed": 0
                                                                                                                                        },
                                                                                                                                        "pickup": null,
                                                                                                                                        "label_url": null
                                                                                                                                      }
                                                                                                                                      GET/batches/:id

                                                                                                                                      Retrieve Batch

                                                                                                                                      A Batch 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.

                                                                                                                                      Example
                                                                                                                                      package batches;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Batch;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Batch batch = client.batch.retrieve("batch_...");
                                                                                                                                      
                                                                                                                                              System.out.println(batch);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "batch_05e9063986b94870818a3cc6d20df714",
                                                                                                                                        "object": "Batch",
                                                                                                                                        "mode": "test",
                                                                                                                                        "state": "created",
                                                                                                                                        "num_shipments": 1,
                                                                                                                                        "reference": null,
                                                                                                                                        "created_at": "2024-01-24T00:03:49Z",
                                                                                                                                        "updated_at": "2024-01-24T00:03:49Z",
                                                                                                                                        "scan_form": null,
                                                                                                                                        "shipments": [
                                                                                                                                          {
                                                                                                                                            "batch_status": "created",
                                                                                                                                            "batch_message": null,
                                                                                                                                            "reference": null,
                                                                                                                                            "tracking_code": null,
                                                                                                                                            "id": "shp_ce0a0cf1612b4e19b67bc27613ec7c8e"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "status": {
                                                                                                                                          "created": 1,
                                                                                                                                          "queued_for_purchase": 0,
                                                                                                                                          "creation_failed": 0,
                                                                                                                                          "postage_purchased": 0,
                                                                                                                                          "postage_purchase_failed": 0
                                                                                                                                        },
                                                                                                                                        "pickup": null,
                                                                                                                                        "label_url": null
                                                                                                                                      }
                                                                                                                                      GET/batches

                                                                                                                                      Retrieve a list of Batches

                                                                                                                                      The Batch List is a paginated list of all Batch objects associated with the given API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      before_idbatch_...Optional pagination parameter. Only batches created before the given ID will be included. May not be used with after_id
                                                                                                                                      after_idbatch_...Optional pagination parameter. Only batches created after the given ID will be included. May not be used with before_id
                                                                                                                                      start_datetime2016-01-02T00:00:00ZOnly return Batches created after this timestamp. Defaults to 1 month ago, or 1 month before a passed end_datetime
                                                                                                                                      end_datetime2016-01-02T00:00:00ZOnly return Batches created before this timestamp. Defaults to end of the current day, or 1 month after a passed start_datetime
                                                                                                                                      page_size5The number of records to return on each page. The maximum value is 100
                                                                                                                                      sortascThe order in which to return Batches. Must be either 'asc' or 'desc'. Defaults to 'desc' if not provided
                                                                                                                                      Example
                                                                                                                                      package batches;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.BatchCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<>();
                                                                                                                                              params.put("page_size", 5);
                                                                                                                                      
                                                                                                                                              BatchCollection batches = client.batch.all(params);
                                                                                                                                      
                                                                                                                                              System.out.println(batches);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "batches": [
                                                                                                                                          {
                                                                                                                                            "id": "batch_927adae9626b4c149d05e34a6d8261bd",
                                                                                                                                            "object": "Batch",
                                                                                                                                            "mode": "test",
                                                                                                                                            "state": "created",
                                                                                                                                            "num_shipments": 1,
                                                                                                                                            "reference": null,
                                                                                                                                            "created_at": "2024-01-23T23:54:59Z",
                                                                                                                                            "updated_at": "2024-01-23T23:55:00Z",
                                                                                                                                            "scan_form": null,
                                                                                                                                            "shipments": [
                                                                                                                                              {
                                                                                                                                                "batch_status": "created",
                                                                                                                                                "batch_message": null,
                                                                                                                                                "reference": null,
                                                                                                                                                "tracking_code": null,
                                                                                                                                                "id": "shp_8e2cb3a6881d43f39a0bd0eb9391ecbd"
                                                                                                                                              }
                                                                                                                                            ],
                                                                                                                                            "status": {
                                                                                                                                              "created": 1,
                                                                                                                                              "queued_for_purchase": 0,
                                                                                                                                              "creation_failed": 0,
                                                                                                                                              "postage_purchased": 0,
                                                                                                                                              "postage_purchase_failed": 0
                                                                                                                                            },
                                                                                                                                            "pickup": null,
                                                                                                                                            "label_url": null
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "has_more": true
                                                                                                                                      }
                                                                                                                                      POST/batches/:id/add_shipments

                                                                                                                                      Add Shipments to a Batch

                                                                                                                                      Shipments can be added to a Batch throughout its life cycle. Just remember that the state change of a Batch is asynchronous and will fire a webhook Event when the state change is completed.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      shipments[<Shipment>,<Shipment>,...]
                                                                                                                                      Example
                                                                                                                                      package batches;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Batch;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.ArrayList;
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class AddShipments {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> shipment1 = new HashMap<String, Object>();
                                                                                                                                              shipment1.put("id", "shp_...");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> shipment2 = new HashMap<String, Object>();
                                                                                                                                              shipment2.put("id", "shp_...");
                                                                                                                                      
                                                                                                                                              List<HashMap<String, Object>> shipments = new ArrayList<HashMap<String, Object>>();
                                                                                                                                              shipments.add(shipment1);
                                                                                                                                              shipments.add(shipment2);
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("shipments", shipments);
                                                                                                                                      
                                                                                                                                              Batch batch = client.batch.addShipments("batch_...", params);
                                                                                                                                      
                                                                                                                                              System.out.println(batch);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "batch_848345b6ef6c4297a489fd34af7e1514",
                                                                                                                                        "object": "Batch",
                                                                                                                                        "mode": "test",
                                                                                                                                        "state": "created",
                                                                                                                                        "num_shipments": 1,
                                                                                                                                        "reference": null,
                                                                                                                                        "created_at": "2024-01-24T00:04:53Z",
                                                                                                                                        "updated_at": "2024-01-24T00:04:53Z",
                                                                                                                                        "scan_form": null,
                                                                                                                                        "shipments": [
                                                                                                                                          {
                                                                                                                                            "batch_status": "postage_purchased",
                                                                                                                                            "batch_message": null,
                                                                                                                                            "reference": null,
                                                                                                                                            "tracking_code": "9405500207552011812467",
                                                                                                                                            "id": "shp_406a7ca4c34c47739093acf06ffbc4b6"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "status": {
                                                                                                                                          "created": 0,
                                                                                                                                          "queued_for_purchase": 0,
                                                                                                                                          "creation_failed": 0,
                                                                                                                                          "postage_purchased": 1,
                                                                                                                                          "postage_purchase_failed": 0
                                                                                                                                        },
                                                                                                                                        "pickup": null,
                                                                                                                                        "label_url": null
                                                                                                                                      }
                                                                                                                                      POST/batches/:id/remove_shipments

                                                                                                                                      Remove Shipments from a Batch

                                                                                                                                      There could be times when a Shipment needs to be removed from the Batch during its life cycle. Removing a Shipment does not remove it from the consolidated label or ScanForm.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      shipments[<Shipment>,<Shipment>,...]
                                                                                                                                      Example
                                                                                                                                      package batches;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Batch;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.ArrayList;
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class RemoveShipments {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> shipment1 = new HashMap<String, Object>();
                                                                                                                                              shipment1.put("id", "shp_...");
                                                                                                                                      
                                                                                                                                              List<HashMap<String, Object>> shipments = new ArrayList<HashMap<String, Object>>();
                                                                                                                                              shipments.add(shipment1);
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("shipments", shipments);
                                                                                                                                      
                                                                                                                                              Batch batch = client.batch.removeShipments("batch_...", params);
                                                                                                                                      
                                                                                                                                              System.out.println(batch);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "batch_f25fcb6de1254de1b3e0a3f770333292",
                                                                                                                                        "object": "Batch",
                                                                                                                                        "mode": "test",
                                                                                                                                        "state": "purchased",
                                                                                                                                        "num_shipments": 0,
                                                                                                                                        "reference": null,
                                                                                                                                        "created_at": "2024-01-24T00:04:55Z",
                                                                                                                                        "updated_at": "2024-01-24T00:04:55Z",
                                                                                                                                        "scan_form": null,
                                                                                                                                        "shipments": [],
                                                                                                                                        "status": {
                                                                                                                                          "created": 0,
                                                                                                                                          "queued_for_purchase": 0,
                                                                                                                                          "creation_failed": 0,
                                                                                                                                          "postage_purchased": 0,
                                                                                                                                          "postage_purchase_failed": 0
                                                                                                                                        },
                                                                                                                                        "pickup": null,
                                                                                                                                        "label_url": null
                                                                                                                                      }
                                                                                                                                      POST/batches/:id/buy

                                                                                                                                      Buy a Batch

                                                                                                                                      Once you have added all of your Shipments to a Batch, issue a buy request to enqueue a background job to purchase the shipments and generate all necessary labels.

                                                                                                                                      Purchasing may take anywhere from a few seconds to an hour, depending on the size of the batch, the carrier, and Internet weather.

                                                                                                                                      Buy Batch Request Parameters

                                                                                                                                      This endpoint takes no parameters.

                                                                                                                                      Example
                                                                                                                                      package batches;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Batch;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Buy {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Batch batch = client.batch.buy("batch_...");
                                                                                                                                      
                                                                                                                                              System.out.println(batch);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "batch_26bd321f6ba947be94a9928f7167a968",
                                                                                                                                        "object": "Batch",
                                                                                                                                        "mode": "test",
                                                                                                                                        "state": "created",
                                                                                                                                        "num_shipments": 1,
                                                                                                                                        "reference": null,
                                                                                                                                        "created_at": "2024-01-24T00:03:50Z",
                                                                                                                                        "updated_at": "2024-01-24T00:03:50Z",
                                                                                                                                        "scan_form": null,
                                                                                                                                        "shipments": [
                                                                                                                                          {
                                                                                                                                            "batch_status": "queued_for_purchase",
                                                                                                                                            "batch_message": null,
                                                                                                                                            "reference": null,
                                                                                                                                            "tracking_code": null,
                                                                                                                                            "id": "shp_52b29348cf76420c8b353ab3a022a4ba"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "status": {
                                                                                                                                          "created": 1,
                                                                                                                                          "queued_for_purchase": 0,
                                                                                                                                          "creation_failed": 0,
                                                                                                                                          "postage_purchased": 0,
                                                                                                                                          "postage_purchase_failed": 0
                                                                                                                                        },
                                                                                                                                        "pickup": null,
                                                                                                                                        "label_url": null
                                                                                                                                      }
                                                                                                                                      POST/batches/:id/label

                                                                                                                                      Batch Labels

                                                                                                                                      One of the advantages of processing Shipments in batches is the ability to consolidate the PostageLabel into one file. This can only be done once for each batch and all Shipments must have a status of postage_purchased.

                                                                                                                                      Available label formats are 'pdf', 'zpl' or 'epl2' format. Like converting a PostageLabel format, if this process will change the format of the labels, they must have been created as PNGs.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      file_format"PDF"
                                                                                                                                      Example
                                                                                                                                      package batches;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Batch;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class Label {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("file_format", "PDF");
                                                                                                                                      
                                                                                                                                              Batch batch = client.batch.label("batch_...", params);
                                                                                                                                      
                                                                                                                                              System.out.println(batch);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "batch_5e5323be0f8444e4b9e100a76afbc921",
                                                                                                                                        "object": "Batch",
                                                                                                                                        "mode": "test",
                                                                                                                                        "state": "label_generating",
                                                                                                                                        "num_shipments": 1,
                                                                                                                                        "reference": null,
                                                                                                                                        "created_at": "2024-01-24T00:04:56Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:36Z",
                                                                                                                                        "scan_form": null,
                                                                                                                                        "shipments": [
                                                                                                                                          {
                                                                                                                                            "batch_status": "postage_purchased",
                                                                                                                                            "batch_message": null,
                                                                                                                                            "reference": null,
                                                                                                                                            "tracking_code": "9405500207552011812511",
                                                                                                                                            "id": "shp_b9419ff95a034151826c7cad52556628"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "status": {
                                                                                                                                          "created": 0,
                                                                                                                                          "queued_for_purchase": 0,
                                                                                                                                          "creation_failed": 0,
                                                                                                                                          "postage_purchased": 1,
                                                                                                                                          "postage_purchase_failed": 0
                                                                                                                                        },
                                                                                                                                        "pickup": null,
                                                                                                                                        "label_url": null
                                                                                                                                      }
                                                                                                                                      POST/batches/:id/scan_form
                                                                                                                                      POST/scan_forms(see ScanForm)

                                                                                                                                      Manifesting (SCAN Form)

                                                                                                                                      See Scan Form rules and Object Definition.

                                                                                                                                      Example
                                                                                                                                      package batches;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Batch;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class ScanForms {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Batch batch = client.batch.createScanForm("batch_...");
                                                                                                                                      
                                                                                                                                              System.out.println(batch);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "batch_956120999a5d4ec6b3016476029b1ffa",
                                                                                                                                        "object": "Batch",
                                                                                                                                        "mode": "test",
                                                                                                                                        "state": "created",
                                                                                                                                        "num_shipments": 1,
                                                                                                                                        "reference": null,
                                                                                                                                        "created_at": "2024-01-24T00:04:10Z",
                                                                                                                                        "updated_at": "2024-01-24T00:04:11Z",
                                                                                                                                        "scan_form": null,
                                                                                                                                        "shipments": [
                                                                                                                                          {
                                                                                                                                            "batch_status": "queued_for_purchase",
                                                                                                                                            "batch_message": null,
                                                                                                                                            "reference": null,
                                                                                                                                            "tracking_code": null,
                                                                                                                                            "id": "shp_a8c6628dd39941a29093dabdea391766"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "status": {
                                                                                                                                          "created": 1,
                                                                                                                                          "queued_for_purchase": 0,
                                                                                                                                          "creation_failed": 0,
                                                                                                                                          "postage_purchased": 0,
                                                                                                                                          "postage_purchase_failed": 0
                                                                                                                                        },
                                                                                                                                        "pickup": null,
                                                                                                                                        "label_url": null
                                                                                                                                      }

                                                                                                                                      Carrier Metadata

                                                                                                                                      The Carrier Metadata endpoint returns information about all the carriers available on the EasyPost platform. This information may include service levels, predefined packages, shipment options, supported features, and more that are available per carrier. This metadata can be useful during onboarding and integration or when determining the ideal carrier mix for your setup.

                                                                                                                                      CarrierMetadata Object

                                                                                                                                      attributetypespecification
                                                                                                                                      carrierstringThe single-word name of a carrier such as "royalmail"
                                                                                                                                      human_readablestringThe human-readable name of the carrier
                                                                                                                                      service_levelsarrayA list of service level objects for this carrier
                                                                                                                                      predefined_packagesarrayA list of predefined package objects for this carrier
                                                                                                                                      supported_featuresarrayA list of supported feature objects for this carrier
                                                                                                                                      shipment_optionsarrayA list of shipment option objects for this carrier
                                                                                                                                      GET/metadata/carriers

                                                                                                                                      Retrieve Carrier Metadata

                                                                                                                                      Retrieve all Carrier Metadata for all carriers on the EasyPost platform. Optionally, filter the response by specifying a list of carriers or metadata types.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      carriersusps,fedex,upsA comma-delimited list of single-word carriers you'd like to filter the response by
                                                                                                                                      typesservice_levels,predefined_packagesA comma-delimited list of the metadata types you'd like to filter the response by
                                                                                                                                      Example
                                                                                                                                      package carrier_metadata;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.CarrierAccount;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.ArrayList;
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              // Request all metadata for all carriers
                                                                                                                                              CarrierAccount carrierMetadata = client.carrierMetadata.retrieve();
                                                                                                                                              System.out.println(carrierMetadata);
                                                                                                                                      
                                                                                                                                              // Request specific metadata for specific carriers
                                                                                                                                              List<String> carriers = new ArrayList<String>();
                                                                                                                                              carriers.add("usps");
                                                                                                                                      
                                                                                                                                              List<String> types = new ArrayList<String>();
                                                                                                                                              types.add("service_levels");
                                                                                                                                              types.add("predefined_packages");
                                                                                                                                      
                                                                                                                                              CarrierAccount carrierMetadata = client.carrierMetadata.retrieve(carriers, types);
                                                                                                                                              System.out.println(carrierMetadata);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "carriers": [
                                                                                                                                          {
                                                                                                                                            "human_readable": "USPS",
                                                                                                                                            "name": "usps",
                                                                                                                                            "predefined_packages": [
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["6in x 4.5in x 0.016in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "Card"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["11.5in x 6.125in x 0.25in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "Letter"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["11.5in x 6.125in x 0.75in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "Flat"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["12.5in x 9.5in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "FlatRateEnvelope"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["15in x 9.5in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "FlatRateLegalEnvelope"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["12.5in x 9.5in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "FlatRatePaddedEnvelope"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["10in x 5in", "12.5in x 9.5in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "FlatRateWindowEnvelope"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["12.5in x 9.5in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "FlatRateCardboardEnvelope"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["10in x 6in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "SmallFlatRateEnvelope"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["Varies based on service level"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "Parcel"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["Varies based on service level"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 320.0,
                                                                                                                                                "name": "SoftPack"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["8.6875in x 5.4375in x 1.75in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "SmallFlatRateBox"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["11.25in x 8.75in x 6in", "14.125in x 12in x 3.5in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "MediumFlatRateBox"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["12.25in x 12in x 6in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "LargeFlatRateBox"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["12.25in x 12.25in x 6in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "LargeFlatRateBoxAPOFPO"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": [],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "FlatTubTrayBox"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": [],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "EMMTrayBox"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": [],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "FullTrayBox"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": [],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "HalfTrayBox"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": [],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": null,
                                                                                                                                                "name": "PMODSack"
                                                                                                                                              }
                                                                                                                                            ],
                                                                                                                                            "service_levels": [
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": "1-5 business days",
                                                                                                                                                "dimensions": [
                                                                                                                                                  "Cards, Letters and Flats only (no Parcels)",
                                                                                                                                                  "See Predefined Packages (Card, Letter, Flat) for details"
                                                                                                                                                ],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 13.0,
                                                                                                                                                "name": "First"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": "1-3 business days",
                                                                                                                                                "dimensions": ["Combined Length and Girth < 108in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 1120.0,
                                                                                                                                                "name": "Priority"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": "1-2 days",
                                                                                                                                                "dimensions": ["Combined Length and Girth < 108in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 1120.0,
                                                                                                                                                "name": "Express"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": "2-5 days",
                                                                                                                                                "dimensions": ["Combined Length and Girth < 130in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 70.0,
                                                                                                                                                "name": "GroundAdvantage"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": "2-8 business days",
                                                                                                                                                "dimensions": ["Combined Length and Girth < 108in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 1120.0,
                                                                                                                                                "name": "LibraryMail"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": "2-8 business days",
                                                                                                                                                "dimensions": ["Combined Length and Girth < 108in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 1120.0,
                                                                                                                                                "name": "MediaMail"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": null,
                                                                                                                                                "dimensions": ["Must be rectangular, otherwise an additional charge may apply."],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 15.994,
                                                                                                                                                "name": "FirstClassMailInternational"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": "7-21 days",
                                                                                                                                                "dimensions": [
                                                                                                                                                  "Packages (Other Than Rolls): Combined Length and Girth < 108in",
                                                                                                                                                  "Rolls (Tubes): Length: min 4in; max 36 in. Length plus twice the diameter (combined): min 6.75 in; max 42in.",
                                                                                                                                                  "Some countries have specific prohibitions and restrictions"
                                                                                                                                                ],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 64.0,
                                                                                                                                                "name": "FirstClassPackageInternationalService"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": "6-10 business days",
                                                                                                                                                "dimensions": ["Combined Length and Girth < 108in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 1120.0,
                                                                                                                                                "name": "PriorityMailInternational"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "carrier": "usps",
                                                                                                                                                "description": "3-5 business days",
                                                                                                                                                "dimensions": ["Combined Length and Girth < 108in"],
                                                                                                                                                "human_readable": null,
                                                                                                                                                "max_weight": 1120.0,
                                                                                                                                                "name": "ExpressMailInternational"
                                                                                                                                              }
                                                                                                                                            ]
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }

                                                                                                                                      CustomsInfos

                                                                                                                                      CustomsInfo objects contain CustomsItem objects and all necessary information for the generation of customs forms required for international shipping.

                                                                                                                                      Please see the Shipments documentation for examples of including a CustomsInfo object in a shipment. Note: the maximum number of items that can be included in customs info with UPS is 100.

                                                                                                                                      CustomsInfo Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with 'cstinfo_'
                                                                                                                                      objectstring'CustomsInfo'
                                                                                                                                      eel_pfcstringEEL" or "PFC
                                                                                                                                      value less than $2500: "NOEEI 30.37(a)"; value greater than $2500: see Customs Guide
                                                                                                                                      contents_typestring"documents", "gift", "merchandise", "returned_goods", "sample", "dangerous_goods", "humanitarian_donation", or "other"
                                                                                                                                      contents_explanationstring(max 255 characters) Human readable description of content. Required for certain carriers and always required if contents_type is "other
                                                                                                                                      customs_certifybooleanElectronically certify the information provided
                                                                                                                                      customs_signerstringRequired if customs_certify is true
                                                                                                                                      non_delivery_optionstring"abandon" or "return", defaults to "return"
                                                                                                                                      restriction_typestring"none", "other", "quarantine", or "sanitary_phytosanitary_inspection"
                                                                                                                                      restriction_commentsstringRequired if restriction_type is not "none
                                                                                                                                      customs_itemsCustomItem arrayDescribes products being shipped
                                                                                                                                      declarationstringA customs declaration message, available for eligible carriers
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime
                                                                                                                                      POST/customs_infos

                                                                                                                                      Create a CustomsInfo

                                                                                                                                      A CustomsInfo object contains all administrative information for processing customs, as well as a list of CustomsItems. When creating a CustomsInfo, you may store the ID from the response for use later in shipment creation.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      customs_certifytrue
                                                                                                                                      customs_signer"Steve Brule"
                                                                                                                                      contents_type"merchandise"
                                                                                                                                      restriction_type"none"
                                                                                                                                      eel_pfc"NOEEI 30.37(a)"
                                                                                                                                      customs_items[<CustomsItem>,<CustomsItem>,...]
                                                                                                                                      Example
                                                                                                                                      package customs_info;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.CustomsInfo;
                                                                                                                                      import com.easypost.model.CustomsItem;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.ArrayList;
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class Create {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> customsItemMap = new HashMap<String, Object>();
                                                                                                                                              customsItemMap.put("description", "T-shirt");
                                                                                                                                              customsItemMap.put("quantity", 1);
                                                                                                                                              customsItemMap.put("value", 10);
                                                                                                                                              customsItemMap.put("weight", 5);
                                                                                                                                              customsItemMap.put("origin_country", "us");
                                                                                                                                              customsItemMap.put("hs_tariff_number", "123456");
                                                                                                                                      
                                                                                                                                              CustomsItem customsItem = client.customsItem.create(customsItemMap);
                                                                                                                                      
                                                                                                                                              List<CustomsItem> customsItemsList = new ArrayList<CustomsItem>();
                                                                                                                                              customsItemsList.add(customsItem);
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("customs_certify", true);
                                                                                                                                              params.put("customs_signer", "Steve Brule");
                                                                                                                                              params.put("contents_type", "merchandise");
                                                                                                                                              params.put("contents_explanation", "");
                                                                                                                                              params.put("eel_pfc", "NOEEI 30.37(a)");
                                                                                                                                              params.put("restriction_type", "none");
                                                                                                                                              params.put("customs_items", customsItemsList);
                                                                                                                                      
                                                                                                                                              CustomsInfo customsInfo = client.customsInfo.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(customsInfo);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "cstinfo_55c25c9757b6456c9f222b1e7d8dfe94",
                                                                                                                                        "object": "CustomsInfo",
                                                                                                                                        "created_at": "2024-01-24T00:05:42Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:42Z",
                                                                                                                                        "contents_explanation": "",
                                                                                                                                        "contents_type": "merchandise",
                                                                                                                                        "customs_certify": true,
                                                                                                                                        "customs_signer": "Steve Brule",
                                                                                                                                        "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                                        "non_delivery_option": "return",
                                                                                                                                        "restriction_comments": null,
                                                                                                                                        "restriction_type": "none",
                                                                                                                                        "mode": "test",
                                                                                                                                        "declaration": null,
                                                                                                                                        "customs_items": [
                                                                                                                                          {
                                                                                                                                            "id": "cstitem_ef7c227016ec4967833e8049cdc6d684",
                                                                                                                                            "object": "CustomsItem",
                                                                                                                                            "created_at": "2024-01-24T00:05:42Z",
                                                                                                                                            "updated_at": "2024-01-24T00:05:42Z",
                                                                                                                                            "description": "T-shirt",
                                                                                                                                            "hs_tariff_number": "123456",
                                                                                                                                            "origin_country": "US",
                                                                                                                                            "quantity": 1,
                                                                                                                                            "value": "10.0",
                                                                                                                                            "weight": 5.0,
                                                                                                                                            "code": "123",
                                                                                                                                            "mode": "test",
                                                                                                                                            "manufacturer": null,
                                                                                                                                            "currency": null,
                                                                                                                                            "eccn": null,
                                                                                                                                            "printed_commodity_identifier": null
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      GET/customs_infos/:id

                                                                                                                                      Retrieve a CustomsInfo

                                                                                                                                      A CustomsInfo can be retrieved by its id.

                                                                                                                                      Example
                                                                                                                                      package customs_info;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.CustomsInfo;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              CustomsInfo customsInfo = client.customsInfo.retrieve("cstinfo_...");
                                                                                                                                      
                                                                                                                                              System.out.println(customsInfo);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "cstinfo_8ebad928c87d40aea1d0695d835d93de",
                                                                                                                                        "object": "CustomsInfo",
                                                                                                                                        "created_at": "2024-01-24T00:05:43Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:43Z",
                                                                                                                                        "contents_explanation": "",
                                                                                                                                        "contents_type": "merchandise",
                                                                                                                                        "customs_certify": true,
                                                                                                                                        "customs_signer": "Steve Brule",
                                                                                                                                        "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                                        "non_delivery_option": "return",
                                                                                                                                        "restriction_comments": null,
                                                                                                                                        "restriction_type": "none",
                                                                                                                                        "mode": "test",
                                                                                                                                        "declaration": null,
                                                                                                                                        "customs_items": [
                                                                                                                                          {
                                                                                                                                            "id": "cstitem_ffde56d2590d498198fba5f223cd3ba5",
                                                                                                                                            "object": "CustomsItem",
                                                                                                                                            "created_at": "2024-01-24T00:05:43Z",
                                                                                                                                            "updated_at": "2024-01-24T00:05:43Z",
                                                                                                                                            "description": "T-shirt",
                                                                                                                                            "hs_tariff_number": "123456",
                                                                                                                                            "origin_country": "US",
                                                                                                                                            "quantity": 1,
                                                                                                                                            "value": "10.0",
                                                                                                                                            "weight": 5.0,
                                                                                                                                            "code": "123",
                                                                                                                                            "mode": "test",
                                                                                                                                            "manufacturer": null,
                                                                                                                                            "currency": null,
                                                                                                                                            "eccn": null,
                                                                                                                                            "printed_commodity_identifier": null
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }

                                                                                                                                      CustomsItems

                                                                                                                                      A CustomsItem object describes goods for international shipment and should be created then included in a CustomInfo object.

                                                                                                                                      CustomsItem Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with 'cstitem_'
                                                                                                                                      objectstring'CustomsItem'
                                                                                                                                      descriptionstringRequired, description of item being shipped
                                                                                                                                      quantityfloatRequired, greater than zero
                                                                                                                                      valuestringRequired, greater than zero, total value (unit value * quantity)
                                                                                                                                      weightfloat (oz)Required, greater than zero, total weight (unit weight * quantity)
                                                                                                                                      hs_tariff_numberstringHarmonized Tariff Schedule, e.g. "6109.10.0012" for Men's T-shirts
                                                                                                                                      codestringSKU/UPC or other product identifier
                                                                                                                                      origin_countrystringRequired, 2 char country code
                                                                                                                                      currencystring3 char currency code, default USD
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime
                                                                                                                                      POST/customs_items

                                                                                                                                      Create a CustomsItem

                                                                                                                                      A CustomsItem contains information relating to each product within the package. When creating a customs item, you may store the ID from the response for use later in CustomsInfo creation.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      description"T-Shirt"
                                                                                                                                      quantity1
                                                                                                                                      weight5
                                                                                                                                      value10
                                                                                                                                      hs_tariff_number"123456"
                                                                                                                                      origin_country"US"
                                                                                                                                      Example
                                                                                                                                      package customs_items;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.CustomsItem;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> params = new HashMap<String, Object>();
                                                                                                                                              params.put("description", "T-shirt");
                                                                                                                                              params.put("quantity", 1);
                                                                                                                                              params.put("value", 10);
                                                                                                                                              params.put("weight", 5);
                                                                                                                                              params.put("origin_country", "US");
                                                                                                                                              params.put("hs_tariff_number", "123456");
                                                                                                                                      
                                                                                                                                              CustomsItem customsItem = client.customsItem.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(customsItem);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "cstitem_71233110339145c8b1cd9107b9fff1af",
                                                                                                                                        "object": "CustomsItem",
                                                                                                                                        "created_at": "2024-01-24T00:05:43Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:43Z",
                                                                                                                                        "description": "T-shirt",
                                                                                                                                        "hs_tariff_number": "123456",
                                                                                                                                        "origin_country": "US",
                                                                                                                                        "quantity": 1,
                                                                                                                                        "value": "10.0",
                                                                                                                                        "weight": 5.0,
                                                                                                                                        "code": "123",
                                                                                                                                        "mode": "test",
                                                                                                                                        "manufacturer": null,
                                                                                                                                        "currency": null,
                                                                                                                                        "eccn": null,
                                                                                                                                        "printed_commodity_identifier": null
                                                                                                                                      }
                                                                                                                                      GET/customs_items/:id

                                                                                                                                      Retrieve a CustomsItem

                                                                                                                                      A CustomsItem can be retrieved by its id.

                                                                                                                                      Example
                                                                                                                                      package customs_items;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.CustomsItem;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              CustomsItem customsItem = client.customsItem.retrieve("cstitem_...");
                                                                                                                                      
                                                                                                                                              System.out.println(customsItem);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "cstitem_35d99d275eb346dcb77fbd42b90cb76c",
                                                                                                                                        "object": "CustomsItem",
                                                                                                                                        "created_at": "2024-01-24T00:05:44Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:44Z",
                                                                                                                                        "description": "T-shirt",
                                                                                                                                        "hs_tariff_number": "123456",
                                                                                                                                        "origin_country": "US",
                                                                                                                                        "quantity": 1,
                                                                                                                                        "value": "10.0",
                                                                                                                                        "weight": 5.0,
                                                                                                                                        "code": "123",
                                                                                                                                        "mode": "test",
                                                                                                                                        "manufacturer": null,
                                                                                                                                        "currency": null,
                                                                                                                                        "eccn": null,
                                                                                                                                        "printed_commodity_identifier": null
                                                                                                                                      }

                                                                                                                                      EndShippers

                                                                                                                                      The EndShipper API is for platforms purchasing postage on behalf of their users, the EndShipper. Platforms must assert the EndShipper details, as the EndShipper is ultimately responsible for what is in the box. Multiple labels purchased for the same EndShipper must use the same EndShipper identity (API object).

                                                                                                                                      EndShipper objects must be created prior to buying a Shipment. Once EndShipper objects have been created, you must keep track of their public id in order to use them during a label buy.

                                                                                                                                      EndShipper Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with 'es_'
                                                                                                                                      namestringName of responsible person (conditionally required)
                                                                                                                                      companystringName of responsible company (conditionally required)
                                                                                                                                      street1stringFirst line of the address
                                                                                                                                      street2stringSecond line of the address
                                                                                                                                      citystringCity the address is located in
                                                                                                                                      statestringState the address is located in
                                                                                                                                      zipstringZIP or postal code the address is located in
                                                                                                                                      countrystringCountry Code must be "US" for EndShippers.
                                                                                                                                      phonestringPhone number to reach the person or organization
                                                                                                                                      emailstringEmail to reach the person or organization
                                                                                                                                      POST/end_shippers

                                                                                                                                      Create an EndShipper

                                                                                                                                      The EndShipper object is meant to represent the person or business entity responsible for the shipment and not necessarily the shipping location.

                                                                                                                                      EndShipper objects are fully-qualified Address objects and require every field to be filled with two exceptions:

                                                                                                                                      1. name and company fields. At least one of these fields must be filled (when both are present, name will take precedence).
                                                                                                                                      2. street2 field. This fieldcan be empty if the address does not include multiple lines.
                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      nameHiro ProtagonistName of responsible person (conditionally required)
                                                                                                                                      companyEasyPostName of responsible company (conditionally required)
                                                                                                                                      street1417 Montgomery StFirst line of the address
                                                                                                                                      street2Floor 5Second line of the address (optional)
                                                                                                                                      citySan FranciscoCity the address is located in
                                                                                                                                      stateCAState the address is located in
                                                                                                                                      zip94104ZIP or postal code the address is located in
                                                                                                                                      countryUSCountry Code must be "US" for EndShippers.
                                                                                                                                      phone415-123-4567Phone number to reach the person or organization
                                                                                                                                      emailexample@example.comEmail to reach the person or organization
                                                                                                                                      Example
                                                                                                                                      package endshipper;
                                                                                                                                      
                                                                                                                                      import com.easypost.model.EndShipper;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class Create {
                                                                                                                                          public static void main(String[] args) {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                      
                                                                                                                                              params.put("name", "FOO BAR");
                                                                                                                                              params.put("company", "BAZ");
                                                                                                                                              params.put("street1", "164 TOWNSEND STREET UNIT 1");
                                                                                                                                              params.put("street2", "UNIT 1");
                                                                                                                                              params.put("city", "SAN FRANCISCO");
                                                                                                                                              params.put("state", "CA");
                                                                                                                                              params.put("zip", "94107");
                                                                                                                                              params.put("country", "US");
                                                                                                                                              params.put("phone", "555-555-5555");
                                                                                                                                              params.put("email", "FOO@EXAMPLE.COM");
                                                                                                                                      
                                                                                                                                              EndShipper endShipper = client.endShipper.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(endShipper);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "es_19a5071f0d224bd6a3eb372e408cdbee",
                                                                                                                                        "object": "EndShipper",
                                                                                                                                        "mode": "test",
                                                                                                                                        "created_at": "2024-01-24T00:05:44+00:00",
                                                                                                                                        "updated_at": "2024-01-24T00:05:44+00:00",
                                                                                                                                        "name": "FOO BAR",
                                                                                                                                        "company": "BAZ",
                                                                                                                                        "street1": "164 TOWNSEND ST UNIT 1",
                                                                                                                                        "street2": "",
                                                                                                                                        "city": "SAN FRANCISCO",
                                                                                                                                        "state": "CA",
                                                                                                                                        "zip": "94107-1990",
                                                                                                                                        "country": "US",
                                                                                                                                        "phone": "555 555-5555",
                                                                                                                                        "email": "FOO@EXAMPLE.COM"
                                                                                                                                      }
                                                                                                                                      PUT/end_shippers/:id

                                                                                                                                      Update an EndShipper

                                                                                                                                      An EndShipper object may be updated using the EndShipper API. All required fields for creating an EndShipper are required in an update request. Partial updates are not supported.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      ides_...Unique, starts with "es_"
                                                                                                                                      nameHiro ProtagonistName of responsible person (conditionally required)
                                                                                                                                      companyEasyPostName of responsible company (conditionally required)
                                                                                                                                      street1417 Montgomery StFirst line of the address
                                                                                                                                      street2Floor 5Second line of the address (optional)
                                                                                                                                      citySan FranciscoCity the address is located in
                                                                                                                                      stateCAState the address is located in
                                                                                                                                      zip94104ZIP or postal code the address is located in
                                                                                                                                      countryUSCountry Code must be "US" for EndShippers.
                                                                                                                                      phone415-123-4567Phone number to reach the person or organization
                                                                                                                                      emailexample@example.comEmail to reach the person or organization
                                                                                                                                      Example
                                                                                                                                      package endshipper;
                                                                                                                                      
                                                                                                                                      import com.easypost.model.EndShipper;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class Update {
                                                                                                                                          public static void main(String[] args) {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                      
                                                                                                                                              params.put("name", "NEW NAME");
                                                                                                                                              params.put("company", "BAZ");
                                                                                                                                              params.put("street1", "164 TOWNSEND STREET UNIT 1");
                                                                                                                                              params.put("street2", "UNIT 1");
                                                                                                                                              params.put("city", "SAN FRANCISCO");
                                                                                                                                              params.put("state", "CA");
                                                                                                                                              params.put("zip", "94107");
                                                                                                                                              params.put("country", "US");
                                                                                                                                              params.put("phone", "555-555-5555");
                                                                                                                                              params.put("email", "FOO@EXAMPLE.COM");
                                                                                                                                      
                                                                                                                                              EndShipper endShipper = client.endShipper.update("es_...", params);
                                                                                                                                      
                                                                                                                                              System.out.println(endShipper);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "es_f5ecda57a5aa4c4d9fe5e831366a3913",
                                                                                                                                        "object": "EndShipper",
                                                                                                                                        "mode": "test",
                                                                                                                                        "created_at": "2024-01-24T00:05:46+00:00",
                                                                                                                                        "updated_at": "2024-01-24T00:05:46+00:00",
                                                                                                                                        "name": "NEW NAME",
                                                                                                                                        "company": "BAZ",
                                                                                                                                        "street1": "164 TOWNSEND ST UNIT 1",
                                                                                                                                        "street2": "",
                                                                                                                                        "city": "SAN FRANCISCO",
                                                                                                                                        "state": "CA",
                                                                                                                                        "zip": "94107-1990",
                                                                                                                                        "country": "US",
                                                                                                                                        "phone": "555-555-5555",
                                                                                                                                        "email": "FOO@EXAMPLE.COM"
                                                                                                                                      }
                                                                                                                                      GET/end_shippers

                                                                                                                                      Retrieve a list of EndShippers

                                                                                                                                      List the EndShippers that have been created.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      after_ides_...Optional pagination parameter. Only records created after the given ID will be included. May not be used with before_id
                                                                                                                                      page_size20The number of records to return on each page. The maximum value is 100, and default is 20.
                                                                                                                                      Example
                                                                                                                                      package endshipper;
                                                                                                                                      
                                                                                                                                      import com.easypost.model.EndShipperCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<>();
                                                                                                                                              params.put("page_size", 5);
                                                                                                                                      
                                                                                                                                              EndShipperCollection endShippers = client.endShipper.all(params);
                                                                                                                                      
                                                                                                                                              System.out.println(endShippers);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "end_shippers": [
                                                                                                                                          {
                                                                                                                                            "id": "es_4e6fc3267bb14aab926fda9e5a764b4b",
                                                                                                                                            "object": "EndShipper",
                                                                                                                                            "mode": "test",
                                                                                                                                            "created_at": "2022-10-17T17:16:53+00:00",
                                                                                                                                            "updated_at": "2022-10-17T17:16:53+00:00",
                                                                                                                                            "name": "FOO BAR",
                                                                                                                                            "company": "BAZ",
                                                                                                                                            "street1": "164 TOWNSEND ST UNIT 1",
                                                                                                                                            "street2": null,
                                                                                                                                            "city": "SAN FRANCISCO",
                                                                                                                                            "state": "CA",
                                                                                                                                            "zip": "94107-1990",
                                                                                                                                            "country": "US",
                                                                                                                                            "phone": "555 555-5555",
                                                                                                                                            "email": "FOO@EXAMPLE.COM"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "has_more": true
                                                                                                                                      }
                                                                                                                                      GET/end_shippers/:id

                                                                                                                                      Retrieve an EndShipper

                                                                                                                                      Similar to retrieving a list of EndShippers, you can retrieve an individual EndShipper.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      ides_...Unique, starts with "es_"
                                                                                                                                      Example
                                                                                                                                      package endshipper;
                                                                                                                                      
                                                                                                                                      import com.easypost.model.EndShipper;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              EndShipper endShipper = client.endShipper.retrieve("es_...");
                                                                                                                                      
                                                                                                                                              System.out.println(endShipper);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "es_4377f46538594bf7a99ee851e3f6902d",
                                                                                                                                        "object": "EndShipper",
                                                                                                                                        "mode": "test",
                                                                                                                                        "created_at": "2024-01-24T00:05:45+00:00",
                                                                                                                                        "updated_at": "2024-01-24T00:05:45+00:00",
                                                                                                                                        "name": "FOO BAR",
                                                                                                                                        "company": "BAZ",
                                                                                                                                        "street1": "164 TOWNSEND ST UNIT 1",
                                                                                                                                        "street2": null,
                                                                                                                                        "city": "SAN FRANCISCO",
                                                                                                                                        "state": "CA",
                                                                                                                                        "zip": "94107-1990",
                                                                                                                                        "country": "US",
                                                                                                                                        "phone": "555 555-5555",
                                                                                                                                        "email": "FOO@EXAMPLE.COM"
                                                                                                                                      }
                                                                                                                                      POST/shipments/:id/buy

                                                                                                                                      Buy a Shipment with EndShipper

                                                                                                                                      Buy a Shipment and specify an EndShipper ID in the request.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      end_shipper_ides_...Unique, starts with "es_"
                                                                                                                                      raterate_...<Rate>
                                                                                                                                      Example
                                                                                                                                      package endshipper;
                                                                                                                                      
                                                                                                                                      import com.easypost.model.Shipment;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class Buy {
                                                                                                                                          public static void main(String[] args) {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Shipment shipment = client.shipment.retrieve("shp_...");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("rate", shipment.lowestRate());
                                                                                                                                              params.put("end_shipper_id", "es_...");
                                                                                                                                      
                                                                                                                                              Shipment endShipper = client.shipment.buy(shipment.getId(), params);
                                                                                                                                      
                                                                                                                                              System.out.println(endShipper);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "created_at": "2024-01-24T00:05:47Z",
                                                                                                                                        "is_return": false,
                                                                                                                                        "messages": [],
                                                                                                                                        "mode": "test",
                                                                                                                                        "options": {
                                                                                                                                          "currency": "USD",
                                                                                                                                          "payment": {
                                                                                                                                            "type": "SENDER"
                                                                                                                                          },
                                                                                                                                          "date_advance": 0
                                                                                                                                        },
                                                                                                                                        "reference": null,
                                                                                                                                        "status": "unknown",
                                                                                                                                        "tracking_code": "9434600207552011812534",
                                                                                                                                        "updated_at": "2024-01-24T00:05:48Z",
                                                                                                                                        "batch_id": null,
                                                                                                                                        "batch_status": null,
                                                                                                                                        "batch_message": null,
                                                                                                                                        "customs_info": {
                                                                                                                                          "id": "cstinfo_e46e1b49abf64d21af9701894ca1592e",
                                                                                                                                          "object": "CustomsInfo",
                                                                                                                                          "created_at": "2024-01-24T00:05:47Z",
                                                                                                                                          "updated_at": "2024-01-24T00:05:47Z",
                                                                                                                                          "contents_explanation": "",
                                                                                                                                          "contents_type": "merchandise",
                                                                                                                                          "customs_certify": true,
                                                                                                                                          "customs_signer": "Steve Brule",
                                                                                                                                          "eel_pfc": "NOEEI 30.37(a)",
                                                                                                                                          "non_delivery_option": "return",
                                                                                                                                          "restriction_comments": null,
                                                                                                                                          "restriction_type": "none",
                                                                                                                                          "mode": "test",
                                                                                                                                          "declaration": null,
                                                                                                                                          "customs_items": [
                                                                                                                                            {
                                                                                                                                              "id": "cstitem_4ade6839412c44e68d323ab9b6c29275",
                                                                                                                                              "object": "CustomsItem",
                                                                                                                                              "created_at": "2024-01-24T00:05:47Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:47Z",
                                                                                                                                              "description": "T-shirt",
                                                                                                                                              "hs_tariff_number": "123456",
                                                                                                                                              "origin_country": "US",
                                                                                                                                              "quantity": 1,
                                                                                                                                              "value": "10.0",
                                                                                                                                              "weight": 5.0,
                                                                                                                                              "code": "123",
                                                                                                                                              "mode": "test",
                                                                                                                                              "manufacturer": null,
                                                                                                                                              "currency": null,
                                                                                                                                              "eccn": null,
                                                                                                                                              "printed_commodity_identifier": null
                                                                                                                                            }
                                                                                                                                          ]
                                                                                                                                        },
                                                                                                                                        "from_address": {
                                                                                                                                          "id": "adr_5336fc74ba4c11ee8c01ac1f6bc539ae",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:47+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:47+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": null,
                                                                                                                                        "parcel": {
                                                                                                                                          "id": "prcl_b807202b272042a6bceadbac1653bf9c",
                                                                                                                                          "object": "Parcel",
                                                                                                                                          "created_at": "2024-01-24T00:05:47Z",
                                                                                                                                          "updated_at": "2024-01-24T00:05:47Z",
                                                                                                                                          "length": 20.2,
                                                                                                                                          "width": 10.9,
                                                                                                                                          "height": 5.0,
                                                                                                                                          "predefined_package": null,
                                                                                                                                          "weight": 65.9,
                                                                                                                                          "mode": "test"
                                                                                                                                        },
                                                                                                                                        "postage_label": {
                                                                                                                                          "object": "PostageLabel",
                                                                                                                                          "id": "pl_d33cf192bd1947cca390e3842621ea8f",
                                                                                                                                          "created_at": "2024-01-24T00:05:48Z",
                                                                                                                                          "updated_at": "2024-01-24T00:05:48Z",
                                                                                                                                          "date_advance": 0,
                                                                                                                                          "integrated_form": "none",
                                                                                                                                          "label_date": "2024-01-24T00:05:48Z",
                                                                                                                                          "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/20240124/e887f23d5484034c05a7634f4c1617945e.png",
                                                                                                                                          "label_pdf_url": null,
                                                                                                                                          "label_zpl_url": null,
                                                                                                                                          "label_epl2_url": null,
                                                                                                                                          "label_file": null
                                                                                                                                        },
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "id": "rate_eeb032afda0546898a29814903a3330f",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:05:47Z",
                                                                                                                                            "updated_at": "2024-01-24T00:05:47Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "49.60",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "57.40",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "49.60",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "shipment_id": "shp_a76316cb113f4779adddd86cae7c8008",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_4278234a11e4480daaf4f385ee56de74",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:05:47Z",
                                                                                                                                            "updated_at": "2024-01-24T00:05:47Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "7.33",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "15.20",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "10.89",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "shipment_id": "shp_a76316cb113f4779adddd86cae7c8008",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_3682234a6c724f38ac06919651071676",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:05:47Z",
                                                                                                                                            "updated_at": "2024-01-24T00:05:47Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_a76316cb113f4779adddd86cae7c8008",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_c35c6e7b71b745b0a4b4545a93d011b7",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:05:47Z",
                                                                                                                                            "updated_at": "2024-01-24T00:05:47Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_a76316cb113f4779adddd86cae7c8008",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_4c638f260a6c4747981a3960db495d82",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": "2024-01-24T00:05:47Z",
                                                                                                                                            "updated_at": "2024-01-24T00:05:47Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.79",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "13.15",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "9.41",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_a76316cb113f4779adddd86cae7c8008",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "refund_status": null,
                                                                                                                                        "scan_form": null,
                                                                                                                                        "selected_rate": {
                                                                                                                                          "id": "rate_3682234a6c724f38ac06919651071676",
                                                                                                                                          "object": "Rate",
                                                                                                                                          "created_at": "2024-01-24T00:05:48Z",
                                                                                                                                          "updated_at": "2024-01-24T00:05:48Z",
                                                                                                                                          "mode": "test",
                                                                                                                                          "service": "GroundAdvantage",
                                                                                                                                          "carrier": "USPS",
                                                                                                                                          "rate": "6.79",
                                                                                                                                          "currency": "USD",
                                                                                                                                          "retail_rate": "13.15",
                                                                                                                                          "retail_currency": "USD",
                                                                                                                                          "list_rate": "9.41",
                                                                                                                                          "list_currency": "USD",
                                                                                                                                          "billing_type": "easypost",
                                                                                                                                          "delivery_days": 3,
                                                                                                                                          "delivery_date": null,
                                                                                                                                          "delivery_date_guaranteed": false,
                                                                                                                                          "est_delivery_days": 3,
                                                                                                                                          "shipment_id": "shp_a76316cb113f4779adddd86cae7c8008",
                                                                                                                                          "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                        },
                                                                                                                                        "tracker": {
                                                                                                                                          "id": "trk_6a77d0aa61ca487c83a84b750a068a52",
                                                                                                                                          "object": "Tracker",
                                                                                                                                          "mode": "test",
                                                                                                                                          "tracking_code": "9434600207552011812534",
                                                                                                                                          "status": "unknown",
                                                                                                                                          "status_detail": "unknown",
                                                                                                                                          "created_at": "2024-01-24T00:05:48Z",
                                                                                                                                          "updated_at": "2024-01-24T00:05:48Z",
                                                                                                                                          "signed_by": null,
                                                                                                                                          "weight": null,
                                                                                                                                          "est_delivery_date": null,
                                                                                                                                          "shipment_id": "shp_a76316cb113f4779adddd86cae7c8008",
                                                                                                                                          "carrier": "USPS",
                                                                                                                                          "tracking_details": [],
                                                                                                                                          "fees": [],
                                                                                                                                          "carrier_detail": null,
                                                                                                                                          "public_url": "https://track.easypost.com/djE6dHJrXzZhNzdkMGFhNjFjYTQ4N2M4M2E4NGI3NTBhMDY4YTUy"
                                                                                                                                        },
                                                                                                                                        "to_address": {
                                                                                                                                          "id": "adr_5334b436ba4c11eeb963ac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:47+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:47+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_5336fc74ba4c11ee8c01ac1f6bc539ae",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:47+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:47+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_5334b436ba4c11eeb963ac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:47+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:47+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": "LabelFee",
                                                                                                                                            "amount": "0.00000",
                                                                                                                                            "charged": true,
                                                                                                                                            "refunded": false
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "Fee",
                                                                                                                                            "type": "PostageFee",
                                                                                                                                            "amount": "6.79000",
                                                                                                                                            "charged": true,
                                                                                                                                            "refunded": false
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "id": "shp_a76316cb113f4779adddd86cae7c8008",
                                                                                                                                        "object": "Shipment"
                                                                                                                                      }

                                                                                                                                      Events

                                                                                                                                      Webhook Events are triggered by changes in objects you've created via the API. Every time an Event related to one of your objects is created, EasyPost guarantees at least one POST request will be sent to each of the webhook URLs set up for your account. For this reason, we strongly encourage your webhook handler to be idempotent. See the webhooks guide for more information.

                                                                                                                                      Possible Event Types

                                                                                                                                      Batch
                                                                                                                                      • A "batch.created" Event is created when the initial creation of a Batch object is complete.
                                                                                                                                      • A "batch.updated" Event is created whenever the status of a Batch object changes.
                                                                                                                                      Insurance
                                                                                                                                      • An "insurance.purchased" Event is created whenever a standalone Insurance completes purchasing and reporting to the insurer.
                                                                                                                                      • An "insurance.cancelled" Event is created whenever a standalone Insurance fails purchasing, is refunded to your account balance, and is not reported to the insurer.
                                                                                                                                      Payment
                                                                                                                                      • A "payment.created" Event is created whenever a Bank Account or Credit Card is successfully charged. For credit card charges, this event indicates that the charge is complete and your account balance has already been updated. For bank account transfers (ACH) this indicates the beginning of the transfer process, which may still later fail.
                                                                                                                                      • A "payment.completed" Event is created when a Bank Account transfer is successfully completed and credited to your account balance. This event indicates that the accounting for that transfer is now complete.
                                                                                                                                      • A "payment.failed" Event is created when a Bank Account transfer or Credit Card charge has an issue and cannot be completed. For bank account transfers that fail your account balance may see a failure deduction and an EasyPost could possibly need to get in contact with you about your account status.
                                                                                                                                      Refund
                                                                                                                                      • A "refund.successful" Event is created whenever a non-instantaneous Refund request is completed. USPS is the best example of this, as USPS postage takes 15+ days to be refunded after the initial refund creation.
                                                                                                                                      Report
                                                                                                                                      • A "report.new" Event is created when a Report object is initially created. The report won't be immediately ready for download.
                                                                                                                                      • A "report.empty" Event is created when a Report did not generate because there was no data in the specified date range.
                                                                                                                                      • A "report.available" Event is created when a Report becomes available to download.
                                                                                                                                      • A "report.failed" Event is created when a Report fails to generate.
                                                                                                                                      Scan Form
                                                                                                                                      • A "scan_form.created" Event is created when the initial creation of a ScanForm object is complete.
                                                                                                                                      • A "scan_form.updated" Event is created whenever the status of a ScanForm object changes.
                                                                                                                                      Shipment Invoice
                                                                                                                                      • A "shipment.invoice.created" Event is created when a ShipmentInvoice object is initially created.
                                                                                                                                      • A "shipment.invoice.updated" Event is created if a ShipmentInvoice is adjusted and updated.
                                                                                                                                      Tracker
                                                                                                                                      • A "tracker.created" Event is created when the initial creation of a Tracker object is complete.
                                                                                                                                      • A "tracker.updated" Event is created whenever a Tracker object gets successfully updated.

                                                                                                                                      Event Object

                                                                                                                                      attributetypespecification
                                                                                                                                      objectstring"Event"
                                                                                                                                      idstringUnique identifier, begins with "evt_"
                                                                                                                                      modestring"test" or "production"
                                                                                                                                      descriptionstringResult type and event name, see the "Possible Event Types" section for more information
                                                                                                                                      previous_attributesobjectPrevious values of relevant result attributes
                                                                                                                                      resultobjectThe object associated with the Event. See the "object" attribute on the result to determine its specific type. This field will not be returned when retrieving events directly from the API
                                                                                                                                      statusstringThe current status of the event. Possible values are "completed", "failed", "in_queue", "retrying", or "pending" (deprecated)
                                                                                                                                      pending_urlsstring arrayWebhook URLs that have not yet been successfully notified as of the time this webhook event was sent. The URL receiving the Event will still be listed in pending_urls, as will any other URLs that receive the Event at the same time
                                                                                                                                      completed_urlsstring arrayWebhook URLs that have already been successfully notified as of the time this webhook was sent
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime
                                                                                                                                      GET/events

                                                                                                                                      Retrieve a list of Events

                                                                                                                                      The Events List is a paginated list of all Events objects associated with the given API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      before_idevt_...Optional pagination parameter. Only events created before the given ID will be included. May not be used with after_id
                                                                                                                                      after_idevt_...Optional pagination parameter. Only events created after the given ID will be included. May not be used with before_id
                                                                                                                                      start_datetime2016-01-02T00:00:00ZOnly return events created after this timestamp. Defaults to 1 month ago, or 1 month before a passed end_datetime
                                                                                                                                      end_datetime2016-01-02T00:00:00ZOnly return events created before this timestamp. Defaults to end of the current day, or 1 month after a passed start_datetime
                                                                                                                                      page_size5The number of events to return on each page. The maximum value is 100
                                                                                                                                      Example
                                                                                                                                      package events;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.EventCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<>();
                                                                                                                                      
                                                                                                                                              params.put("page_size", 5);
                                                                                                                                      
                                                                                                                                              EventCollection events = client.event.all(params);
                                                                                                                                      
                                                                                                                                              System.out.println(events);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "events": [
                                                                                                                                          {
                                                                                                                                            "description": "tracker.created",
                                                                                                                                            "id": "evt_5397c3dcba4c11ee99e74d3b807cff5b",
                                                                                                                                            "user_id": "user_060ab38db3c04ffaa60f262e5781a9be",
                                                                                                                                            "status": "pending",
                                                                                                                                            "created_at": "2024-01-24T00:05:47.779Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "object": "Event"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "has_more": true
                                                                                                                                      }
                                                                                                                                      GET/events/:id

                                                                                                                                      Retrieve an Event

                                                                                                                                      An Event can be retrieved by its id.

                                                                                                                                      Example
                                                                                                                                      package events;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Event;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Event event = client.event.retrieve("evt_...");
                                                                                                                                      
                                                                                                                                              System.out.println(event);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "description": "tracker.created",
                                                                                                                                        "mode": "test",
                                                                                                                                        "previous_attributes": {},
                                                                                                                                        "created_at": "2024-01-24T00:05:48.000Z",
                                                                                                                                        "pending_urls": [],
                                                                                                                                        "completed_urls": [],
                                                                                                                                        "updated_at": "2024-01-24T00:05:48.000Z",
                                                                                                                                        "id": "evt_5397c3dcba4c11ee99e74d3b807cff5b",
                                                                                                                                        "user_id": "user_060ab38db3c04ffaa60f262e5781a9be",
                                                                                                                                        "status": "pending",
                                                                                                                                        "object": "Event"
                                                                                                                                      }

                                                                                                                                      Payloads

                                                                                                                                      A Payload represents an attempt by EasyPost to send an Event to a Webhook. An Event can have multiple Payloads. For instance, if there is a failure to deliver a Webhook, an Event would have multiple payloads, one for each attempt to deliver the Event to the Webhook. Payload can be useful for debugging webhook delivery and when initially setting up EasyPost webhooks.

                                                                                                                                      Payload Object

                                                                                                                                      attributetypespecification
                                                                                                                                      objectstring"Payload"
                                                                                                                                      idstringUnique identifier, begins with "payload_"
                                                                                                                                      modestring"test" or "production"
                                                                                                                                      request_urlstringThe URL that the request was sent to (the webhook URL)
                                                                                                                                      request_bodystringThe body included in the request to the configured webhook
                                                                                                                                      request_headersobjectThe headers included in the request to the configured webhook
                                                                                                                                      response_codeintThe status code returned by the webhook server
                                                                                                                                      response_bodystringThe body returned by the webhook server
                                                                                                                                      response_headersobjectThe headers returned by the webhook server
                                                                                                                                      total_timeintHow long the request to the configured webhook took to complete
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime
                                                                                                                                      GET/events/:event_id/payloads

                                                                                                                                      Retrieve a list of Payloads

                                                                                                                                      Retrieve a list of Payloads by event id.

                                                                                                                                      Example
                                                                                                                                      package events;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Payload;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class RetrieveAllPayloads {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              List<Payload> payloads = client.event.retrieveAllPayloads("evt_...");
                                                                                                                                      
                                                                                                                                              System.out.println(payloads);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "payloads": [
                                                                                                                                          {
                                                                                                                                            "id": "payload_734d47163d0711ecb29421da38a2f124",
                                                                                                                                            "object": "Payload",
                                                                                                                                            "created_at": "2021-11-04T00:37:55Z",
                                                                                                                                            "updated_at": "2021-11-04T01:14:18Z",
                                                                                                                                            "request_url": "https://api.example.com/webhook",
                                                                                                                                            "request_headers": {
                                                                                                                                              "Accept": "application/json",
                                                                                                                                              "Content-Type": "application/json",
                                                                                                                                              "User-Agent": "Go-http-client/1.1"
                                                                                                                                            },
                                                                                                                                            "request_body": "{\"key\":\"value\"}",
                                                                                                                                            "response_code": 200,
                                                                                                                                            "response_headers": {
                                                                                                                                              "Content-Type": "application/json; charset=utf-8",
                                                                                                                                              "Date": "Tue, 02 Nov 2021 23:37:55 GMT",
                                                                                                                                              "Server": "nginx/1.19.6",
                                                                                                                                              "X-Content-Type-Options": "nosniff",
                                                                                                                                              "X-Frame-Options": "SAMEORIGIN",
                                                                                                                                              "X-Request-Id": "a1b2c3d4e5f6g7h8i9j0",
                                                                                                                                              "X-Runtime": "0.001000",
                                                                                                                                              "X-Xss-Protection": "1; mode=block"
                                                                                                                                            },
                                                                                                                                            "total_time": 34
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "payload_734d47163d0711ecb29421da38a2f414",
                                                                                                                                            "object": "Payload",
                                                                                                                                            "created_at": "2021-11-04T00:37:55Z",
                                                                                                                                            "updated_at": "2021-11-04T01:14:18Z",
                                                                                                                                            "request_url": "https://api.example.com/webhook",
                                                                                                                                            "request_headers": {
                                                                                                                                              "Accept": "application/json",
                                                                                                                                              "Content-Type": "application/json",
                                                                                                                                              "User-Agent": "Go-http-client/1.1"
                                                                                                                                            },
                                                                                                                                            "request_body": "{\"key\":\"value\"}",
                                                                                                                                            "response_code": 404,
                                                                                                                                            "response_headers": {
                                                                                                                                              "Content-Type": "application/json; charset=utf-8",
                                                                                                                                              "Date": "Tue, 02 Nov 2021 23:37:55 GMT",
                                                                                                                                              "Server": "nginx/1.19.6",
                                                                                                                                              "X-Content-Type-Options": "nosniff",
                                                                                                                                              "X-Frame-Options": "SAMEORIGIN",
                                                                                                                                              "X-Request-Id": "a1b2c3d4e5f6g7h8i9j0",
                                                                                                                                              "X-Runtime": "0.001000",
                                                                                                                                              "X-Xss-Protection": "1; mode=block"
                                                                                                                                            },
                                                                                                                                            "total_time": 122
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      GET/events/:event_id/payloads/:payload_id

                                                                                                                                      Retrieve a Payload

                                                                                                                                      A Payload can be retrieved by event id and payload id.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      id of Eventevt_...
                                                                                                                                      id of Payloadpayload_...
                                                                                                                                      Example
                                                                                                                                      package events;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Payload;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class RetrievePayload {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Payload payload = client.event.retrievePayload("evt_...", "payload_...");
                                                                                                                                      
                                                                                                                                              System.out.println(payload);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "payload_734d47163d0711ecb29421da38a2f124",
                                                                                                                                        "object": "Payload",
                                                                                                                                        "created_at": "2021-11-04T00:37:55Z",
                                                                                                                                        "updated_at": "2021-11-04T01:14:18Z",
                                                                                                                                        "request_url": "https://api.example.com/webhook",
                                                                                                                                        "request_headers": {
                                                                                                                                          "Accept": "application/json",
                                                                                                                                          "Content-Type": "application/json",
                                                                                                                                          "User-Agent": "Go-http-client/1.1"
                                                                                                                                        },
                                                                                                                                        "request_body": "{\"key\":\"value\"}",
                                                                                                                                        "response_code": 200,
                                                                                                                                        "response_headers": {
                                                                                                                                          "Content-Type": "application/json; charset=utf-8",
                                                                                                                                          "Date": "Tue, 02 Nov 2021 23:37:55 GMT",
                                                                                                                                          "Server": "nginx/1.19.6",
                                                                                                                                          "X-Content-Type-Options": "nosniff",
                                                                                                                                          "X-Frame-Options": "SAMEORIGIN",
                                                                                                                                          "X-Request-Id": "a1b2c3d4e5f6g7h8i9j0",
                                                                                                                                          "X-Runtime": "0.001000",
                                                                                                                                          "X-Xss-Protection": "1; mode=block"
                                                                                                                                        },
                                                                                                                                        "total_time": 34
                                                                                                                                      }

                                                                                                                                      Fees

                                                                                                                                      Fee objects are used to represent the breakdown of charges made when purchasing an item on EasyPost. Shipments and Tracker both have associations to Fee objects.

                                                                                                                                      Each Shipment object will have a Fee of type "LabelFee" to represent the label fee charged by EasyPost for the service. Shipments with postage collected by EasyPost (as opposed to shipments with postage collected directly by the carrier) will have a "PostageFee" according to the postage amount. Insurance on a Shipment will add an "InsuranceFee" with the insurance premium (not the covered value) for the amount. Tracker objects will have a "TrackerFee" with the price, even when a Tracker is free.

                                                                                                                                      Fee Object

                                                                                                                                      attributetypespecification
                                                                                                                                      objectstring"Fee"
                                                                                                                                      typestringThe name of the category of fee. Possible types are "LabelFee", "CarbonOffsetFee", "PostageFee", "InsuranceFee", and "TrackerFee"
                                                                                                                                      amountstringUSD value with sub-cent precision
                                                                                                                                      chargedbooleanWhether EasyPost has successfully charged your account for the fee
                                                                                                                                      refundedbooleanWhether the Fee has been refunded successfully

                                                                                                                                      Orders

                                                                                                                                      The Order object represents a collection of packages and is intended only for multi-parcel shipping; please use the Shipments endpoint for single parcel shipping. Like a single Shipment each Order consists of a "to" and "from" Address to be used for each Shipment within the Order. These Addresses 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 CustomInfo .

                                                                                                                                      An Order created with valid Addresses Objects and Parcel data nested within the Order's Shipment object will automatically retrieve available shipping Rate options.

                                                                                                                                      Order Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with "order_"
                                                                                                                                      objectstring"Order"
                                                                                                                                      referencestringAn optional field that may be used in place of id in other API endpoints
                                                                                                                                      modestring"test" or "production"
                                                                                                                                      to_addressAddressThe destination address
                                                                                                                                      from_addressAddressThe origin address
                                                                                                                                      return_addressAddressThe shipper's address, defaults to from_address
                                                                                                                                      buyer_addressAddressThe buyer's address, defaults to to_address
                                                                                                                                      shipmentsShipment arrayAll associated Shipment objects. Maximum of 100.
                                                                                                                                      ratesRate arrayAll associated Rate objects
                                                                                                                                      messagesMessage arrayAny carrier errors encountered during rating
                                                                                                                                      is_returnbooleanSet true to create as a return
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime
                                                                                                                                      POST/orders

                                                                                                                                      Create an Order

                                                                                                                                      Creating an Order is intended only for multi-parcel shipping; please use the Shipments endpoint 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.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      reference"my-reference"
                                                                                                                                      to_address<Address>Can be specified by ID or attributes to create a new one, and be verified inline. See Create and Verify Address
                                                                                                                                      from_address<Address>Can be specified by ID or attributes to create a new one, and be verified inline. See Create and Verify Address
                                                                                                                                      shipments[<Shipment>, <Shipment>, ...],List of shipments
                                                                                                                                      carrier_accounts[{"id": "ca_..."}, ...]List of carrier accounts
                                                                                                                                      Example
                                                                                                                                      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);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "mode": "test",
                                                                                                                                        "reference": "",
                                                                                                                                        "is_return": false,
                                                                                                                                        "options": {
                                                                                                                                          "currency": "USD",
                                                                                                                                          "payment": {
                                                                                                                                            "type": "SENDER"
                                                                                                                                          }
                                                                                                                                        },
                                                                                                                                        "messages": [],
                                                                                                                                        "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                        "customs_info": null,
                                                                                                                                        "from_address": {
                                                                                                                                          "id": "adr_57ea4540ba4c11ee8d58ac1f6bc539ae",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:55+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_57e87debba4c11eebad4ac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "buyer_address": {
                                                                                                                                          "id": "adr_57e87debba4c11eebad4ac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "return_address": {
                                                                                                                                          "id": "adr_57ea4540ba4c11ee8d58ac1f6bc539ae",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:55+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": [
                                                                                                                                          {
                                                                                                                                            "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                            "is_return": false,
                                                                                                                                            "messages": [],
                                                                                                                                            "mode": "test",
                                                                                                                                            "options": {
                                                                                                                                              "currency": "USD",
                                                                                                                                              "payment": {
                                                                                                                                                "type": "SENDER"
                                                                                                                                              },
                                                                                                                                              "date_advance": 0
                                                                                                                                            },
                                                                                                                                            "reference": null,
                                                                                                                                            "status": "unknown",
                                                                                                                                            "tracking_code": null,
                                                                                                                                            "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                            "batch_id": null,
                                                                                                                                            "batch_status": null,
                                                                                                                                            "batch_message": null,
                                                                                                                                            "customs_info": null,
                                                                                                                                            "from_address": {
                                                                                                                                              "id": "adr_57ea4540ba4c11ee8d58ac1f6bc539ae",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:55+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_825e4008bd1448c5acf82bb90dc461ca",
                                                                                                                                            "parcel": {
                                                                                                                                              "id": "prcl_ca08509bfc8347748c8acb479ec7c0dd",
                                                                                                                                              "object": "Parcel",
                                                                                                                                              "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                              "length": null,
                                                                                                                                              "width": null,
                                                                                                                                              "height": null,
                                                                                                                                              "predefined_package": null,
                                                                                                                                              "weight": 10.2,
                                                                                                                                              "mode": "test"
                                                                                                                                            },
                                                                                                                                            "postage_label": null,
                                                                                                                                            "rates": [
                                                                                                                                              {
                                                                                                                                                "id": "rate_ce70a3f843e74306a5271286a315c8d6",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "Express",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "33.10",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "37.90",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "33.10",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": null,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": null,
                                                                                                                                                "shipment_id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_bd2b1a604fdf497b950763818474b99c",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "Priority",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "6.88",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "9.80",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "8.25",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 2,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 2,
                                                                                                                                                "shipment_id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_cceeab9b94c74cd98b2bea0a53f092bb",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "GroundAdvantage",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_98a7f1f78555474f9d12fcc38fc4b640",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "First",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_674286cd966845ae8a830c4b554c00a0",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "ParcelSelect",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              }
                                                                                                                                            ],
                                                                                                                                            "refund_status": null,
                                                                                                                                            "scan_form": null,
                                                                                                                                            "selected_rate": null,
                                                                                                                                            "tracker": null,
                                                                                                                                            "to_address": {
                                                                                                                                              "id": "adr_57e87debba4c11eebad4ac1f6bc53342",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "name": "Dr. Steve Brule",
                                                                                                                                              "company": null,
                                                                                                                                              "street1": "179 N Harbor Dr",
                                                                                                                                              "street2": null,
                                                                                                                                              "city": "Redondo Beach",
                                                                                                                                              "state": "CA",
                                                                                                                                              "zip": "90277",
                                                                                                                                              "country": "US",
                                                                                                                                              "phone": "8573875756",
                                                                                                                                              "email": "dr_steve_brule@gmail.com",
                                                                                                                                              "mode": "test",
                                                                                                                                              "carrier_facility": null,
                                                                                                                                              "residential": null,
                                                                                                                                              "federal_tax_id": null,
                                                                                                                                              "state_tax_id": null,
                                                                                                                                              "verifications": {}
                                                                                                                                            },
                                                                                                                                            "usps_zone": 4,
                                                                                                                                            "return_address": {
                                                                                                                                              "id": "adr_57ea4540ba4c11ee8d58ac1f6bc539ae",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:55+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_57e87debba4c11eebad4ac1f6bc53342",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "name": "Dr. Steve Brule",
                                                                                                                                              "company": null,
                                                                                                                                              "street1": "179 N Harbor Dr",
                                                                                                                                              "street2": null,
                                                                                                                                              "city": "Redondo Beach",
                                                                                                                                              "state": "CA",
                                                                                                                                              "zip": "90277",
                                                                                                                                              "country": "US",
                                                                                                                                              "phone": "8573875756",
                                                                                                                                              "email": "dr_steve_brule@gmail.com",
                                                                                                                                              "mode": "test",
                                                                                                                                              "carrier_facility": null,
                                                                                                                                              "residential": null,
                                                                                                                                              "federal_tax_id": null,
                                                                                                                                              "state_tax_id": null,
                                                                                                                                              "verifications": {}
                                                                                                                                            },
                                                                                                                                            "forms": [],
                                                                                                                                            "fees": [],
                                                                                                                                            "id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                            "object": "Shipment"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "id": "rate_ce70a3f843e74306a5271286a315c8d6",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "33.10",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "37.90",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "33.10",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "shipment_id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_bd2b1a604fdf497b950763818474b99c",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.88",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "9.80",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "8.25",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "shipment_id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_cceeab9b94c74cd98b2bea0a53f092bb",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_98a7f1f78555474f9d12fcc38fc4b640",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_674286cd966845ae8a830c4b554c00a0",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_f4ca387fab464f7dac233a355801b61c",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "id": "order_825e4008bd1448c5acf82bb90dc461ca",
                                                                                                                                        "object": "Order"
                                                                                                                                      }
                                                                                                                                      GET/orders/:id

                                                                                                                                      Retrieve an 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.

                                                                                                                                      Example
                                                                                                                                      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);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "mode": "test",
                                                                                                                                        "reference": "",
                                                                                                                                        "is_return": false,
                                                                                                                                        "options": {
                                                                                                                                          "currency": "USD",
                                                                                                                                          "payment": {
                                                                                                                                            "type": "SENDER"
                                                                                                                                          }
                                                                                                                                        },
                                                                                                                                        "messages": [],
                                                                                                                                        "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                        "customs_info": null,
                                                                                                                                        "from_address": {
                                                                                                                                          "id": "adr_5836298bba4c11eebaecac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:55+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_583448c1ba4c11eebaebac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "buyer_address": {
                                                                                                                                          "id": "adr_583448c1ba4c11eebaebac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "return_address": {
                                                                                                                                          "id": "adr_5836298bba4c11eebaecac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:55+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": [
                                                                                                                                          {
                                                                                                                                            "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                            "is_return": false,
                                                                                                                                            "messages": [],
                                                                                                                                            "mode": "test",
                                                                                                                                            "options": {
                                                                                                                                              "currency": "USD",
                                                                                                                                              "payment": {
                                                                                                                                                "type": "SENDER"
                                                                                                                                              },
                                                                                                                                              "date_advance": 0
                                                                                                                                            },
                                                                                                                                            "reference": null,
                                                                                                                                            "status": "unknown",
                                                                                                                                            "tracking_code": null,
                                                                                                                                            "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                            "batch_id": null,
                                                                                                                                            "batch_status": null,
                                                                                                                                            "batch_message": null,
                                                                                                                                            "customs_info": null,
                                                                                                                                            "from_address": {
                                                                                                                                              "id": "adr_5836298bba4c11eebaecac1f6bc53342",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:55+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_b567c8fffd5641608bda48f0bc58e1d6",
                                                                                                                                            "parcel": {
                                                                                                                                              "id": "prcl_eb7de3870d864d408017e4e5a8633b1a",
                                                                                                                                              "object": "Parcel",
                                                                                                                                              "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                              "length": null,
                                                                                                                                              "width": null,
                                                                                                                                              "height": null,
                                                                                                                                              "predefined_package": null,
                                                                                                                                              "weight": 10.2,
                                                                                                                                              "mode": "test"
                                                                                                                                            },
                                                                                                                                            "postage_label": null,
                                                                                                                                            "rates": [
                                                                                                                                              {
                                                                                                                                                "id": "rate_46c2da4561664d5fbc7ebfca38e472d6",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "Express",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "33.10",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "37.90",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "33.10",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": null,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": null,
                                                                                                                                                "shipment_id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_5f8a285fa1094e129d121e4dfe59c314",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "Priority",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "6.88",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "9.80",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "8.25",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 2,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 2,
                                                                                                                                                "shipment_id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_836fd4e6359e4e40bc27bc39eff5b432",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "GroundAdvantage",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_d1fe066dc3c844c2984ac13308bf7b3e",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "First",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_3b915871b5ff4cccaec973eedde9e4bb",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:55Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "ParcelSelect",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              }
                                                                                                                                            ],
                                                                                                                                            "refund_status": null,
                                                                                                                                            "scan_form": null,
                                                                                                                                            "selected_rate": null,
                                                                                                                                            "tracker": null,
                                                                                                                                            "to_address": {
                                                                                                                                              "id": "adr_583448c1ba4c11eebaebac1f6bc53342",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "name": "Dr. Steve Brule",
                                                                                                                                              "company": null,
                                                                                                                                              "street1": "179 N Harbor Dr",
                                                                                                                                              "street2": null,
                                                                                                                                              "city": "Redondo Beach",
                                                                                                                                              "state": "CA",
                                                                                                                                              "zip": "90277",
                                                                                                                                              "country": "US",
                                                                                                                                              "phone": "8573875756",
                                                                                                                                              "email": "dr_steve_brule@gmail.com",
                                                                                                                                              "mode": "test",
                                                                                                                                              "carrier_facility": null,
                                                                                                                                              "residential": null,
                                                                                                                                              "federal_tax_id": null,
                                                                                                                                              "state_tax_id": null,
                                                                                                                                              "verifications": {}
                                                                                                                                            },
                                                                                                                                            "usps_zone": 4,
                                                                                                                                            "return_address": {
                                                                                                                                              "id": "adr_5836298bba4c11eebaecac1f6bc53342",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:55+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_583448c1ba4c11eebaebac1f6bc53342",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:55+00:00",
                                                                                                                                              "name": "Dr. Steve Brule",
                                                                                                                                              "company": null,
                                                                                                                                              "street1": "179 N Harbor Dr",
                                                                                                                                              "street2": null,
                                                                                                                                              "city": "Redondo Beach",
                                                                                                                                              "state": "CA",
                                                                                                                                              "zip": "90277",
                                                                                                                                              "country": "US",
                                                                                                                                              "phone": "8573875756",
                                                                                                                                              "email": "dr_steve_brule@gmail.com",
                                                                                                                                              "mode": "test",
                                                                                                                                              "carrier_facility": null,
                                                                                                                                              "residential": null,
                                                                                                                                              "federal_tax_id": null,
                                                                                                                                              "state_tax_id": null,
                                                                                                                                              "verifications": {}
                                                                                                                                            },
                                                                                                                                            "forms": [],
                                                                                                                                            "fees": [],
                                                                                                                                            "id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                            "object": "Shipment"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "id": "rate_46c2da4561664d5fbc7ebfca38e472d6",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "33.10",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "37.90",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "33.10",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "shipment_id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_5f8a285fa1094e129d121e4dfe59c314",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.88",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "9.80",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "8.25",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "shipment_id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_836fd4e6359e4e40bc27bc39eff5b432",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_d1fe066dc3c844c2984ac13308bf7b3e",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_3b915871b5ff4cccaec973eedde9e4bb",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_1df4e5ffe3ed4909b17b23d56f532c69",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "id": "order_b567c8fffd5641608bda48f0bc58e1d6",
                                                                                                                                        "object": "Order"
                                                                                                                                      }
                                                                                                                                      POST/orders/:id/buy

                                                                                                                                      Buy an Order

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

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      carrier"FedEx"
                                                                                                                                      service"FEDEX_GROUND"
                                                                                                                                      Example
                                                                                                                                      package order;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Order;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class Buy {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("carrier", "FedEx");
                                                                                                                                              params.put("service", "FEDEX_GROUND");
                                                                                                                                      
                                                                                                                                              Order order = client.order.buy("order_...", params);
                                                                                                                                      
                                                                                                                                              System.out.println(order);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "mode": "test",
                                                                                                                                        "reference": "",
                                                                                                                                        "is_return": false,
                                                                                                                                        "options": {
                                                                                                                                          "currency": "USD",
                                                                                                                                          "payment": {
                                                                                                                                            "type": "SENDER"
                                                                                                                                          }
                                                                                                                                        },
                                                                                                                                        "messages": [],
                                                                                                                                        "created_at": "2024-01-24T00:05:56Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:56Z",
                                                                                                                                        "customs_info": null,
                                                                                                                                        "from_address": {
                                                                                                                                          "id": "adr_58ec479fba4c11ee975e3cecef1b359e",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:56+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:56+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_58ea8f17ba4c11eea6f0ac1f6bc539aa",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:56+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:57+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_58ea8f17ba4c11eea6f0ac1f6bc539aa",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:56+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:57+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_58ec479fba4c11ee975e3cecef1b359e",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:56+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:56+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": [
                                                                                                                                          {
                                                                                                                                            "created_at": "2024-01-24T00:05:56Z",
                                                                                                                                            "is_return": false,
                                                                                                                                            "messages": [],
                                                                                                                                            "mode": "test",
                                                                                                                                            "options": {
                                                                                                                                              "currency": "USD",
                                                                                                                                              "payment": {
                                                                                                                                                "type": "SENDER"
                                                                                                                                              },
                                                                                                                                              "date_advance": 0
                                                                                                                                            },
                                                                                                                                            "reference": null,
                                                                                                                                            "status": "unknown",
                                                                                                                                            "tracking_code": "9400100207552011812556",
                                                                                                                                            "updated_at": "2024-01-24T00:05:58Z",
                                                                                                                                            "batch_id": null,
                                                                                                                                            "batch_status": null,
                                                                                                                                            "batch_message": null,
                                                                                                                                            "customs_info": null,
                                                                                                                                            "from_address": {
                                                                                                                                              "id": "adr_58ec479fba4c11ee975e3cecef1b359e",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:56+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:56+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_12032df7a2c440c08adcf90653c22b9b",
                                                                                                                                            "parcel": {
                                                                                                                                              "id": "prcl_2e3d35cf1f4645a8bb23095b8cd4382e",
                                                                                                                                              "object": "Parcel",
                                                                                                                                              "created_at": "2024-01-24T00:05:56Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:56Z",
                                                                                                                                              "length": null,
                                                                                                                                              "width": null,
                                                                                                                                              "height": null,
                                                                                                                                              "predefined_package": null,
                                                                                                                                              "weight": 10.2,
                                                                                                                                              "mode": "test"
                                                                                                                                            },
                                                                                                                                            "postage_label": {
                                                                                                                                              "object": "PostageLabel",
                                                                                                                                              "id": "pl_717a685a1bb7490f908559900668f9d7",
                                                                                                                                              "created_at": "2024-01-24T00:05:57Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:57Z",
                                                                                                                                              "date_advance": 0,
                                                                                                                                              "integrated_form": "none",
                                                                                                                                              "label_date": "2024-01-24T00:05:57Z",
                                                                                                                                              "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/20240124/e82f4c1546988644378a9a63fb5bb1507e.png",
                                                                                                                                              "label_pdf_url": null,
                                                                                                                                              "label_zpl_url": null,
                                                                                                                                              "label_epl2_url": null,
                                                                                                                                              "label_file": null
                                                                                                                                            },
                                                                                                                                            "rates": [
                                                                                                                                              {
                                                                                                                                                "id": "rate_a15180650fa747c9b39df69fed0837cc",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:56Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:56Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "Express",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "33.10",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "37.90",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "33.10",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": null,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": null,
                                                                                                                                                "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_f80af12685ed43dd8449574aaa79d320",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:56Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:56Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "Priority",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "6.88",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "9.80",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "8.25",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 2,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 2,
                                                                                                                                                "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_1a9a747ade654bae93f2b81003af08dc",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:56Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:56Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "GroundAdvantage",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_e5a4f53119594475935dc6c89990e9f9",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:56Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:56Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "First",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_0a08acd20fe5497191b4346db709464b",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:56Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:56Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "ParcelSelect",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              }
                                                                                                                                            ],
                                                                                                                                            "refund_status": null,
                                                                                                                                            "scan_form": null,
                                                                                                                                            "selected_rate": {
                                                                                                                                              "id": "rate_e5a4f53119594475935dc6c89990e9f9",
                                                                                                                                              "object": "Rate",
                                                                                                                                              "created_at": "2024-01-24T00:05:57Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:57Z",
                                                                                                                                              "mode": "test",
                                                                                                                                              "service": "First",
                                                                                                                                              "carrier": "USPS",
                                                                                                                                              "rate": "5.07",
                                                                                                                                              "currency": "USD",
                                                                                                                                              "retail_rate": "6.70",
                                                                                                                                              "retail_currency": "USD",
                                                                                                                                              "list_rate": "5.07",
                                                                                                                                              "list_currency": "USD",
                                                                                                                                              "billing_type": "easypost",
                                                                                                                                              "delivery_days": 3,
                                                                                                                                              "delivery_date": null,
                                                                                                                                              "delivery_date_guaranteed": false,
                                                                                                                                              "est_delivery_days": 3,
                                                                                                                                              "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                              "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                            },
                                                                                                                                            "tracker": {
                                                                                                                                              "id": "trk_2165a610b2ca4c0da08583c70a0efa27",
                                                                                                                                              "object": "Tracker",
                                                                                                                                              "mode": "test",
                                                                                                                                              "tracking_code": "9400100207552011812556",
                                                                                                                                              "status": "unknown",
                                                                                                                                              "status_detail": "unknown",
                                                                                                                                              "created_at": "2024-01-24T00:05:58Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:58Z",
                                                                                                                                              "signed_by": null,
                                                                                                                                              "weight": null,
                                                                                                                                              "est_delivery_date": null,
                                                                                                                                              "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                              "carrier": "USPS",
                                                                                                                                              "tracking_details": [],
                                                                                                                                              "fees": [],
                                                                                                                                              "carrier_detail": null,
                                                                                                                                              "public_url": "https://track.easypost.com/djE6dHJrXzIxNjVhNjEwYjJjYTRjMGRhMDg1ODNjNzBhMGVmYTI3"
                                                                                                                                            },
                                                                                                                                            "to_address": {
                                                                                                                                              "id": "adr_58ea8f17ba4c11eea6f0ac1f6bc539aa",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:56+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:57+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_58ec479fba4c11ee975e3cecef1b359e",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:56+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:56+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_58ea8f17ba4c11eea6f0ac1f6bc539aa",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:56+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:57+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": "LabelFee",
                                                                                                                                                "amount": "0.00000",
                                                                                                                                                "charged": true,
                                                                                                                                                "refunded": false
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "object": "Fee",
                                                                                                                                                "type": "PostageFee",
                                                                                                                                                "amount": "5.07000",
                                                                                                                                                "charged": true,
                                                                                                                                                "refunded": false
                                                                                                                                              }
                                                                                                                                            ],
                                                                                                                                            "id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                            "object": "Shipment"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "id": "rate_a15180650fa747c9b39df69fed0837cc",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "33.10",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "37.90",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "33.10",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_f80af12685ed43dd8449574aaa79d320",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.88",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "9.80",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "8.25",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_1a9a747ade654bae93f2b81003af08dc",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_e5a4f53119594475935dc6c89990e9f9",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_0a08acd20fe5497191b4346db709464b",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_3767a779a1b442d9bbf80a81c58499d8",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "id": "order_12032df7a2c440c08adcf90653c22b9b",
                                                                                                                                        "object": "Order"
                                                                                                                                      }
                                                                                                                                      POST/orders

                                                                                                                                      Buy an Order without rating (One-Call Buy)

                                                                                                                                      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 single carrier account and service level name to your "Create Order" call.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      reference"my-reference"
                                                                                                                                      to_address<Address>Can be specified by ID or attributes to create a new one, and be verified inline. See Create and Verify Address
                                                                                                                                      from_address<Address>Can be specified by ID or attributes to create a new one, and be verified inline. See Create and Verify Address
                                                                                                                                      shipments[Shipment]A list of shipments
                                                                                                                                      carrier_accounts["ca_..."]List of carrier accounts
                                                                                                                                      service"Priority"Service of carrier
                                                                                                                                      Example
                                                                                                                                      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 OneCallBuy {
                                                                                                                                          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> firstParcel = new HashMap<String, Object>();
                                                                                                                                              firstParcel.put("weight", 10.2);
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> secondParcel = new HashMap<String, Object>();
                                                                                                                                              secondParcel.put("weight", 17.5);
                                                                                                                                              secondParcel.put("predefined_package", "FedExBox");
                                                                                                                                      
                                                                                                                                              ArrayList<HashMap<String, Object>> shipments = new ArrayList<HashMap<String, Object>>();
                                                                                                                                              shipments.add(firstParcel);
                                                                                                                                              shipments.add(secondParcel);
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("carrier_accounts", "ca_...");
                                                                                                                                              params.put("service", "NextDayAir");
                                                                                                                                              params.put("to_address", toAddress);
                                                                                                                                              params.put("from_address", fromAddress);
                                                                                                                                              params.put("shipments", shipments);
                                                                                                                                      
                                                                                                                                              Order order = client.order.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(order);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "messages": [],
                                                                                                                                        "mode": "test",
                                                                                                                                        "reference": "",
                                                                                                                                        "is_return": false,
                                                                                                                                        "options": {
                                                                                                                                          "currency": "USD",
                                                                                                                                          "payment": {
                                                                                                                                            "type": "SENDER"
                                                                                                                                          }
                                                                                                                                        },
                                                                                                                                        "created_at": "2024-01-24T00:05:58Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:58Z",
                                                                                                                                        "customs_info": null,
                                                                                                                                        "from_address": {
                                                                                                                                          "id": "adr_5a0f5af8ba4c11eebb69ac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:58+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:58+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_5a0dc9a4ba4c11ee8df2ac1f6bc539ae",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:58+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:58+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_5a0dc9a4ba4c11ee8df2ac1f6bc539ae",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:58+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:58+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_5a0f5af8ba4c11eebb69ac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:05:58+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:05:58+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": [
                                                                                                                                          {
                                                                                                                                            "created_at": "2024-01-24T00:05:58Z",
                                                                                                                                            "is_return": false,
                                                                                                                                            "messages": [],
                                                                                                                                            "mode": "test",
                                                                                                                                            "options": {
                                                                                                                                              "currency": "USD",
                                                                                                                                              "payment": {
                                                                                                                                                "type": "SENDER"
                                                                                                                                              },
                                                                                                                                              "date_advance": 0
                                                                                                                                            },
                                                                                                                                            "reference": null,
                                                                                                                                            "status": "unknown",
                                                                                                                                            "tracking_code": "9400100207552011812563",
                                                                                                                                            "updated_at": "2024-01-24T00:05:59Z",
                                                                                                                                            "batch_id": null,
                                                                                                                                            "batch_status": null,
                                                                                                                                            "batch_message": null,
                                                                                                                                            "customs_info": null,
                                                                                                                                            "from_address": {
                                                                                                                                              "id": "adr_5a0f5af8ba4c11eebb69ac1f6bc53342",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:58+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:58+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_700c1e0203b24cf192d38ba62aacdb86",
                                                                                                                                            "parcel": {
                                                                                                                                              "id": "prcl_d12175ef61644588b383d5debb91bf96",
                                                                                                                                              "object": "Parcel",
                                                                                                                                              "created_at": "2024-01-24T00:05:58Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:58Z",
                                                                                                                                              "length": null,
                                                                                                                                              "width": null,
                                                                                                                                              "height": null,
                                                                                                                                              "predefined_package": null,
                                                                                                                                              "weight": 10.2,
                                                                                                                                              "mode": "test"
                                                                                                                                            },
                                                                                                                                            "postage_label": {
                                                                                                                                              "object": "PostageLabel",
                                                                                                                                              "id": "pl_a9d0d35f3cc24095a458b14fef6cbd96",
                                                                                                                                              "created_at": "2024-01-24T00:05:59Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:59Z",
                                                                                                                                              "date_advance": 0,
                                                                                                                                              "integrated_form": "none",
                                                                                                                                              "label_date": "2024-01-24T00:05:59Z",
                                                                                                                                              "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/20240124/e8050a603da7fe4bc5bc98247ca27a2dde.png",
                                                                                                                                              "label_pdf_url": null,
                                                                                                                                              "label_zpl_url": null,
                                                                                                                                              "label_epl2_url": null,
                                                                                                                                              "label_file": null
                                                                                                                                            },
                                                                                                                                            "rates": [
                                                                                                                                              {
                                                                                                                                                "id": "rate_985c0d7c85f545ecb6367f377df13453",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:58Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:58Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "Priority",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "6.88",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "9.80",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "8.25",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 2,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 2,
                                                                                                                                                "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_01c4b156f83247d9a8087b60ba19a4e0",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:58Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:58Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "GroundAdvantage",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_b499467fd724497caf04475555082734",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:58Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:58Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "First",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_b35f9780e45d463a9cf672f04fafa3c3",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:58Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:58Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "ParcelSelect",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "5.07",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "6.70",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "5.07",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": 3,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": 3,
                                                                                                                                                "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "id": "rate_b1bac17f8cc6444f8d192ed09965f667",
                                                                                                                                                "object": "Rate",
                                                                                                                                                "created_at": "2024-01-24T00:05:58Z",
                                                                                                                                                "updated_at": "2024-01-24T00:05:58Z",
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "Express",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "rate": "33.10",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "retail_rate": "37.90",
                                                                                                                                                "retail_currency": "USD",
                                                                                                                                                "list_rate": "33.10",
                                                                                                                                                "list_currency": "USD",
                                                                                                                                                "billing_type": "easypost",
                                                                                                                                                "delivery_days": null,
                                                                                                                                                "delivery_date": null,
                                                                                                                                                "delivery_date_guaranteed": false,
                                                                                                                                                "est_delivery_days": null,
                                                                                                                                                "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                                "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                              }
                                                                                                                                            ],
                                                                                                                                            "refund_status": null,
                                                                                                                                            "scan_form": null,
                                                                                                                                            "selected_rate": {
                                                                                                                                              "id": "rate_b499467fd724497caf04475555082734",
                                                                                                                                              "object": "Rate",
                                                                                                                                              "created_at": "2024-01-24T00:05:59Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:59Z",
                                                                                                                                              "mode": "test",
                                                                                                                                              "service": "First",
                                                                                                                                              "carrier": "USPS",
                                                                                                                                              "rate": "5.07",
                                                                                                                                              "currency": "USD",
                                                                                                                                              "retail_rate": "6.70",
                                                                                                                                              "retail_currency": "USD",
                                                                                                                                              "list_rate": "5.07",
                                                                                                                                              "list_currency": "USD",
                                                                                                                                              "billing_type": "easypost",
                                                                                                                                              "delivery_days": 3,
                                                                                                                                              "delivery_date": null,
                                                                                                                                              "delivery_date_guaranteed": false,
                                                                                                                                              "est_delivery_days": 3,
                                                                                                                                              "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                              "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                            },
                                                                                                                                            "tracker": {
                                                                                                                                              "id": "trk_02a7da80556f4742b9d39a854f135661",
                                                                                                                                              "object": "Tracker",
                                                                                                                                              "mode": "test",
                                                                                                                                              "tracking_code": "9400100207552011812563",
                                                                                                                                              "status": "unknown",
                                                                                                                                              "status_detail": "unknown",
                                                                                                                                              "created_at": "2024-01-24T00:05:59Z",
                                                                                                                                              "updated_at": "2024-01-24T00:05:59Z",
                                                                                                                                              "signed_by": null,
                                                                                                                                              "weight": null,
                                                                                                                                              "est_delivery_date": null,
                                                                                                                                              "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                              "carrier": "USPS",
                                                                                                                                              "tracking_details": [],
                                                                                                                                              "fees": [],
                                                                                                                                              "carrier_detail": null,
                                                                                                                                              "public_url": "https://track.easypost.com/djE6dHJrXzAyYTdkYTgwNTU2ZjQ3NDJiOWQzOWE4NTRmMTM1NjYx"
                                                                                                                                            },
                                                                                                                                            "to_address": {
                                                                                                                                              "id": "adr_5a0dc9a4ba4c11ee8df2ac1f6bc539ae",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:58+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:58+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_5a0f5af8ba4c11eebb69ac1f6bc53342",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:58+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:58+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_5a0dc9a4ba4c11ee8df2ac1f6bc539ae",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:05:58+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:05:58+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": "LabelFee",
                                                                                                                                                "amount": "0.00000",
                                                                                                                                                "charged": true,
                                                                                                                                                "refunded": false
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "object": "Fee",
                                                                                                                                                "type": "PostageFee",
                                                                                                                                                "amount": "5.07000",
                                                                                                                                                "charged": true,
                                                                                                                                                "refunded": false
                                                                                                                                              }
                                                                                                                                            ],
                                                                                                                                            "id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                            "object": "Shipment"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "rates": [
                                                                                                                                          {
                                                                                                                                            "id": "rate_985c0d7c85f545ecb6367f377df13453",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Priority",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "6.88",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "9.80",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "8.25",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 2,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 2,
                                                                                                                                            "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_01c4b156f83247d9a8087b60ba19a4e0",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "GroundAdvantage",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_b499467fd724497caf04475555082734",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "First",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_b35f9780e45d463a9cf672f04fafa3c3",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "ParcelSelect",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "5.07",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "6.70",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "5.07",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": 3,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": 3,
                                                                                                                                            "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "id": "rate_b1bac17f8cc6444f8d192ed09965f667",
                                                                                                                                            "object": "Rate",
                                                                                                                                            "created_at": null,
                                                                                                                                            "updated_at": null,
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "Express",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "rate": "33.10",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "retail_rate": "37.90",
                                                                                                                                            "retail_currency": "USD",
                                                                                                                                            "list_rate": "33.10",
                                                                                                                                            "list_currency": "USD",
                                                                                                                                            "billing_type": "easypost",
                                                                                                                                            "delivery_days": null,
                                                                                                                                            "delivery_date": null,
                                                                                                                                            "delivery_date_guaranteed": false,
                                                                                                                                            "est_delivery_days": null,
                                                                                                                                            "shipment_id": "shp_ca14f75e17154537a4cd8b80d31e0825",
                                                                                                                                            "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "id": "order_700c1e0203b24cf192d38ba62aacdb86",
                                                                                                                                        "object": "Order"
                                                                                                                                      }

                                                                                                                                      Pickups

                                                                                                                                      The Pickup object allows you to schedule a pickup from your carrier from your customer's residence or place of business. Supported carriers include:

                                                                                                                                      • Canada Post
                                                                                                                                      • Canpar
                                                                                                                                      • DHL Express
                                                                                                                                      • FedEx
                                                                                                                                      • Lasership
                                                                                                                                      • Loomis Express
                                                                                                                                      • LSO
                                                                                                                                      • Ontrac
                                                                                                                                      • UPS
                                                                                                                                      • USPS
                                                                                                                                      • Veho

                                                                                                                                      After a Pickup is successfully created, it will automatically fetch PickupRates for each CarrierAccounts specified that supports scheduled pickups. Then a PickupRate must be selected and purchased before the pickup can be successfully scheduled.

                                                                                                                                      Pickup Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringunique, begins with "pickup_"
                                                                                                                                      objectstring"Pickup"
                                                                                                                                      referencestringAn optional field that may be used in place of ID in some API endpoints
                                                                                                                                      modestring"test" or "production"
                                                                                                                                      statusstringOne of: "unknown", "scheduled", or "canceled"
                                                                                                                                      min_datetimedatetimeThe earliest time at which the package is available to pick up
                                                                                                                                      max_datetimedatetimeThe latest time at which the package is available to pick up. Must be later than the min_datetime
                                                                                                                                      is_account_addressbooleanIs the pickup address the account's address?
                                                                                                                                      instructionsstringAdditional text to help the driver successfully obtain the package
                                                                                                                                      messagesMessage arrayA list of messages containing carrier errors encountered during pickup rate generation
                                                                                                                                      confirmationstringThe confirmation number for a booked pickup from the carrier
                                                                                                                                      addressAddressThe associated Address
                                                                                                                                      carrier_accountsCarrierAccount arrayThe list of carriers (if empty, all carriers were used) used to generate pickup rates
                                                                                                                                      pickup_ratesPickupRate arrayThe list of different pickup rates across valid carrier accounts for the shipment
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime

                                                                                                                                      PickupRate Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringunique, begins with 'pickuprate_'
                                                                                                                                      objectstring"PickupRate"
                                                                                                                                      modestring"test" or "production"
                                                                                                                                      servicestringservice name
                                                                                                                                      carrierstringname of carrier
                                                                                                                                      ratestringthe actual rate quote for this service
                                                                                                                                      currencystringcurrency for the rate
                                                                                                                                      pickup_idstringthe ID of the pickup this is a quote for
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime
                                                                                                                                      POST/pickups

                                                                                                                                      Create a Pickup

                                                                                                                                      Creating a Pickup will automatically fetch rates for the given time frame and location.

                                                                                                                                      Pickups work with existing purchased shipments or a fully–purchased batch and either a fully-specified Address object or id. The examples below assume that a shipment and address have both already been created.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      address<Address>
                                                                                                                                      shipment<Shipment> (if no batch)
                                                                                                                                      batch<Batch> (if no shipment)
                                                                                                                                      carrier_accounts[<CarrierAccount>,<CarrierAccount>,...]
                                                                                                                                      instructions"Knock loudly"
                                                                                                                                      reference"my-custom-pickup"
                                                                                                                                      is_account_addresstrue
                                                                                                                                      min_datetime2014-10-21 10:30:00
                                                                                                                                      max_datetime2014-10-22 10:30:00
                                                                                                                                      Example
                                                                                                                                      package pickups;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Pickup;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> address = new HashMap<String, Object>();
                                                                                                                                              address.put("id", "adr_...");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> shipment = new HashMap<String, Object>();
                                                                                                                                              shipment.put("id", "shp_...");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("address", address);
                                                                                                                                              params.put("shipment", shipment);
                                                                                                                                              params.put("reference", "my-first-pickup");
                                                                                                                                              params.put("min_datetime", "2022-10-01 10:30:00");
                                                                                                                                              params.put("max_datetime", "2022-10-02 10:30:00");
                                                                                                                                              params.put("is_account_address", false);
                                                                                                                                              params.put("instructions", "Special pickup instructions");
                                                                                                                                      
                                                                                                                                              Pickup pickup = client.pickup.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(pickup);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "pickup_13e5d7e2a7824432a07975bc553944bc",
                                                                                                                                        "object": "Pickup",
                                                                                                                                        "created_at": "2024-01-24T00:06:03Z",
                                                                                                                                        "updated_at": "2024-01-24T00:06:03Z",
                                                                                                                                        "mode": "test",
                                                                                                                                        "status": "unknown",
                                                                                                                                        "reference": "my-first-pickup",
                                                                                                                                        "min_datetime": "2024-01-24T00:00:00Z",
                                                                                                                                        "max_datetime": "2024-01-24T00:00:00Z",
                                                                                                                                        "is_account_address": false,
                                                                                                                                        "instructions": "Special pickup instructions",
                                                                                                                                        "messages": [],
                                                                                                                                        "confirmation": null,
                                                                                                                                        "address": {
                                                                                                                                          "id": "adr_5d1b8e3aba4c11ee98803cecef1b359e",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:06:03+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:06:03+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "carrier_accounts": [],
                                                                                                                                        "pickup_rates": [
                                                                                                                                          {
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "NextDay",
                                                                                                                                            "rate": "0.00",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "created_at": "2024-01-24T00:06:04Z",
                                                                                                                                            "updated_at": "2024-01-24T00:06:04Z",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "pickup_id": "pickup_13e5d7e2a7824432a07975bc553944bc",
                                                                                                                                            "id": "pickuprate_a6cd2647a898410aa5d33febde44e1b2",
                                                                                                                                            "object": "PickupRate"
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      GET/pickups

                                                                                                                                      Retrieve a list of Pickups

                                                                                                                                      The Pickup List is a paginated list of all Pickup objects associated with the given API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      before_idpickup_...Optional pagination parameter. Only pickups created before the given ID will be included. May not be used with after_id
                                                                                                                                      after_idpickup_...Optional pagination parameter. Only pickups created after the given ID will be included. May not be used with before_id
                                                                                                                                      start_datetime2016-01-02T00:00:00ZOnly return pickups created after this timestamp. Defaults to 1 month ago, or 1 month before a passed end_datetime
                                                                                                                                      end_datetime2016-01-02T00:00:00ZOnly return pickups created before this timestamp. Defaults to end of the current day, or 1 month after a passed start_datetime
                                                                                                                                      page_size20The number of pickups to return on each page. The maximum value is 100
                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.PickupCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<>();
                                                                                                                                              params.put("page_size", 5);
                                                                                                                                      
                                                                                                                                              PickupCollection pickupCollection = client.pickup.all(params);
                                                                                                                                      
                                                                                                                                              System.out.println(pickupCollection);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "pickups": [
                                                                                                                                          {
                                                                                                                                            "id": "pickup_de371d00d7c1446e9c73ae1f7742c708",
                                                                                                                                            "object": "Pickup",
                                                                                                                                            "created_at": "2024-01-24T00:06:32Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:15Z",
                                                                                                                                            "mode": "test",
                                                                                                                                            "status": "canceled",
                                                                                                                                            "reference": "my-first-pickup",
                                                                                                                                            "min_datetime": "2024-01-24T00:00:00Z",
                                                                                                                                            "max_datetime": "2024-01-24T00:00:00Z",
                                                                                                                                            "is_account_address": false,
                                                                                                                                            "instructions": "Special pickup instructions",
                                                                                                                                            "messages": [],
                                                                                                                                            "confirmation": "WTC64065024",
                                                                                                                                            "address": {
                                                                                                                                              "id": "adr_6e5b0cd4ba4c11ee81dcac1f6bc53342",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:06:32+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:06:32+00:00",
                                                                                                                                              "name": "Dr. Steve Brule",
                                                                                                                                              "company": null,
                                                                                                                                              "street1": "179 N Harbor Dr",
                                                                                                                                              "street2": null,
                                                                                                                                              "city": "Redondo Beach",
                                                                                                                                              "state": "CA",
                                                                                                                                              "zip": "90277",
                                                                                                                                              "country": "US",
                                                                                                                                              "phone": "8573875756",
                                                                                                                                              "email": "dr_steve_brule@gmail.com",
                                                                                                                                              "mode": "test",
                                                                                                                                              "carrier_facility": null,
                                                                                                                                              "residential": null,
                                                                                                                                              "federal_tax_id": null,
                                                                                                                                              "state_tax_id": null,
                                                                                                                                              "verifications": {}
                                                                                                                                            },
                                                                                                                                            "carrier_accounts": [],
                                                                                                                                            "pickup_rates": [
                                                                                                                                              {
                                                                                                                                                "mode": "test",
                                                                                                                                                "service": "NextDay",
                                                                                                                                                "rate": "0.00",
                                                                                                                                                "currency": "USD",
                                                                                                                                                "created_at": "2024-01-24T00:06:33Z",
                                                                                                                                                "updated_at": "2024-01-24T00:06:33Z",
                                                                                                                                                "carrier": "USPS",
                                                                                                                                                "pickup_id": "pickup_de371d00d7c1446e9c73ae1f7742c708",
                                                                                                                                                "id": "pickuprate_4c260c126e114a09a4522c7d18b71636",
                                                                                                                                                "object": "PickupRate"
                                                                                                                                              }
                                                                                                                                            ]
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "has_more": true
                                                                                                                                      }
                                                                                                                                      GET/pickups/:id

                                                                                                                                      Retrieve a Pickup

                                                                                                                                      A Pickup object can be retrieved by either an id or reference. However it is recommended to use EasyPost's provided identifiers because uniqueness on reference is not enforced.

                                                                                                                                      Example
                                                                                                                                      package pickups;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Pickup;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Pickup pickup = client.pickup.retrieve("pickup_...");
                                                                                                                                      
                                                                                                                                              System.out.println(pickup);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "pickup_0ccd407d45a24451a8599824d1961989",
                                                                                                                                        "object": "Pickup",
                                                                                                                                        "created_at": "2024-01-24T00:06:06Z",
                                                                                                                                        "updated_at": "2024-01-24T00:06:06Z",
                                                                                                                                        "mode": "test",
                                                                                                                                        "status": "unknown",
                                                                                                                                        "reference": "my-first-pickup",
                                                                                                                                        "min_datetime": "2024-01-24T00:00:00Z",
                                                                                                                                        "max_datetime": "2024-01-24T00:00:00Z",
                                                                                                                                        "is_account_address": false,
                                                                                                                                        "instructions": "Special pickup instructions",
                                                                                                                                        "messages": [],
                                                                                                                                        "confirmation": null,
                                                                                                                                        "address": {
                                                                                                                                          "id": "adr_5e864f12ba4c11ee8f38ac1f6bc539ae",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:06:06+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:06:06+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "carrier_accounts": [],
                                                                                                                                        "pickup_rates": [
                                                                                                                                          {
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "NextDay",
                                                                                                                                            "rate": "0.00",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "created_at": "2024-01-24T00:06:06Z",
                                                                                                                                            "updated_at": "2024-01-24T00:06:06Z",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "pickup_id": "pickup_0ccd407d45a24451a8599824d1961989",
                                                                                                                                            "id": "pickuprate_c8c474e62dd94c34b2fd8770b848c96e",
                                                                                                                                            "object": "PickupRate"
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      POST/pickups/:id/buy

                                                                                                                                      Buy a Pickup

                                                                                                                                      To purchase a Pickup a PickupRate must be specified by its carrier and service name, instead of its id. The client libraries will handle this automatically if a PickupRate is provided.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      carrier"UPS"
                                                                                                                                      service"Same-day Pickup"
                                                                                                                                      Example
                                                                                                                                      package pickups;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Pickup;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class Buy {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("carrier", "UPS");
                                                                                                                                              params.put("service", "Same-day Pickup");
                                                                                                                                      
                                                                                                                                              Pickup pickup = client.pickup.buy("pickup_...", params);
                                                                                                                                      
                                                                                                                                              System.out.println(pickup);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "pickup_9eaa3a663af34ffba5ed9a6849edc7fe",
                                                                                                                                        "object": "Pickup",
                                                                                                                                        "created_at": "2024-01-24T00:06:09Z",
                                                                                                                                        "updated_at": "2024-01-24T00:06:31Z",
                                                                                                                                        "mode": "test",
                                                                                                                                        "status": "scheduled",
                                                                                                                                        "reference": "my-first-pickup",
                                                                                                                                        "min_datetime": "2024-01-24T00:00:00Z",
                                                                                                                                        "max_datetime": "2024-01-24T00:00:00Z",
                                                                                                                                        "is_account_address": false,
                                                                                                                                        "instructions": "Special pickup instructions",
                                                                                                                                        "messages": [],
                                                                                                                                        "confirmation": "WTC64065022",
                                                                                                                                        "address": {
                                                                                                                                          "id": "adr_60557ddaba4c11eea8e7ac1f6bc539aa",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:06:09+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:06:09+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "carrier_accounts": [],
                                                                                                                                        "pickup_rates": [
                                                                                                                                          {
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "NextDay",
                                                                                                                                            "rate": "0.00",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "created_at": "2024-01-24T00:06:09Z",
                                                                                                                                            "updated_at": "2024-01-24T00:06:09Z",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "pickup_id": "pickup_9eaa3a663af34ffba5ed9a6849edc7fe",
                                                                                                                                            "id": "pickuprate_4c3092b06e9342fc848b7ecd28a24f22",
                                                                                                                                            "object": "PickupRate"
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      POST/pickups/:id/cancel

                                                                                                                                      Cancel a Pickup

                                                                                                                                      You may cancel a Pickup anytime before it has been completed. It requires no additional parameters other than the id or reference. The status will change to "canceled" on success.

                                                                                                                                      Example
                                                                                                                                      package pickups;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Pickup;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Cancel {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Pickup pickup = client.pickup.cancel("pickup_...");
                                                                                                                                      
                                                                                                                                              System.out.println(pickup);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "pickup_de371d00d7c1446e9c73ae1f7742c708",
                                                                                                                                        "object": "Pickup",
                                                                                                                                        "created_at": "2024-01-24T00:06:32Z",
                                                                                                                                        "updated_at": "2024-01-24T00:07:15Z",
                                                                                                                                        "mode": "test",
                                                                                                                                        "status": "canceled",
                                                                                                                                        "reference": "my-first-pickup",
                                                                                                                                        "min_datetime": "2024-01-24T00:00:00Z",
                                                                                                                                        "max_datetime": "2024-01-24T00:00:00Z",
                                                                                                                                        "is_account_address": false,
                                                                                                                                        "instructions": "Special pickup instructions",
                                                                                                                                        "messages": [],
                                                                                                                                        "confirmation": "WTC64065024",
                                                                                                                                        "address": {
                                                                                                                                          "id": "adr_6e5b0cd4ba4c11ee81dcac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:06:32+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:06:32+00:00",
                                                                                                                                          "name": "Dr. Steve Brule",
                                                                                                                                          "company": null,
                                                                                                                                          "street1": "179 N Harbor Dr",
                                                                                                                                          "street2": null,
                                                                                                                                          "city": "Redondo Beach",
                                                                                                                                          "state": "CA",
                                                                                                                                          "zip": "90277",
                                                                                                                                          "country": "US",
                                                                                                                                          "phone": "8573875756",
                                                                                                                                          "email": "dr_steve_brule@gmail.com",
                                                                                                                                          "mode": "test",
                                                                                                                                          "carrier_facility": null,
                                                                                                                                          "residential": null,
                                                                                                                                          "federal_tax_id": null,
                                                                                                                                          "state_tax_id": null,
                                                                                                                                          "verifications": {}
                                                                                                                                        },
                                                                                                                                        "carrier_accounts": [],
                                                                                                                                        "pickup_rates": [
                                                                                                                                          {
                                                                                                                                            "mode": "test",
                                                                                                                                            "service": "NextDay",
                                                                                                                                            "rate": "0.00",
                                                                                                                                            "currency": "USD",
                                                                                                                                            "created_at": "2024-01-24T00:06:33Z",
                                                                                                                                            "updated_at": "2024-01-24T00:06:33Z",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "pickup_id": "pickup_de371d00d7c1446e9c73ae1f7742c708",
                                                                                                                                            "id": "pickuprate_4c260c126e114a09a4522c7d18b71636",
                                                                                                                                            "object": "PickupRate"
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }

                                                                                                                                      Refunds

                                                                                                                                      The Refund object represents a refunded shipment, and includes details about the related Shipment and tracking code.

                                                                                                                                      USPS shipping labels can be refunded if requested within 30 days of generation. The processing time is at least 15 days, after which the funds will return to your EasyPost balance. EasyPost fees will also be refunded. To qualify, a shipment must not have been scanned by the USPS.

                                                                                                                                      UPS and FedEx shipping labels may be refunded within 90 days of creation.

                                                                                                                                      Refund Object

                                                                                                                                      Request Parameters
                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with "rfnd_"
                                                                                                                                      objectstring"Refund"
                                                                                                                                      tracking_codestringThe tracking code of the related Shipment
                                                                                                                                      confirmation_numberstringThe confirmation number for the refund request to the carrier
                                                                                                                                      statusstringThe status of the refund request, reported by the carrier. Possible values are "submitted", "refunded", or "rejected"
                                                                                                                                      carrierstringThe carrier the refund request was submitted to
                                                                                                                                      shipment_idstringThe ID of the related Shipment being refunded
                                                                                                                                      created_atdatetimeWhen the refund was created
                                                                                                                                      updated_atdatetimeWhen the refund was last updated
                                                                                                                                      POST/refunds

                                                                                                                                      Create a Refund

                                                                                                                                      This endpoint is intended to be used to bulk-process multiple refunds; as a result, this endpoint will return a list of Refund objects.

                                                                                                                                      To refund a single shipment, use the Refund a Shipment endpoint instead.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      carrierUSPSThe carrier to request a refund from
                                                                                                                                      tracking_codes["EZ10000001"]A list of tracking codes to request refunds for. Even for a single tracking code, it needs to be submitted as a list.
                                                                                                                                      Example
                                                                                                                                      package refunds;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Refund;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> params = new HashMap<String, Object>();
                                                                                                                                              params.put("carrier", toAddressMap);
                                                                                                                                              params.put("tracking_codes", Arrays.asList(new String[] { "EZ1000000001" }));
                                                                                                                                      
                                                                                                                                              List<Refund> refunds = client.refund.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(refunds);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      [
                                                                                                                                        {
                                                                                                                                          "id": "rfnd_f85f150c71c748649ec06d319a26e54c",
                                                                                                                                          "object": "Refund",
                                                                                                                                          "created_at": "2024-01-24T00:07:22Z",
                                                                                                                                          "updated_at": "2024-01-24T00:07:22Z",
                                                                                                                                          "tracking_code": "9405500207552011812764",
                                                                                                                                          "confirmation_number": null,
                                                                                                                                          "status": "submitted",
                                                                                                                                          "carrier": "USPS",
                                                                                                                                          "shipment_id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc"
                                                                                                                                        }
                                                                                                                                      ]
                                                                                                                                      GET/refunds

                                                                                                                                      Retrieve a list of Refunds

                                                                                                                                      Retrieve a paginated list of all Refunds associated with the given API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      before_idrfnd_...Optional pagination parameter. Only refunds created before the given ID will be included. May not be used with after_id
                                                                                                                                      after_idrfnd_...Optional pagination parameter. Only refunds created after the given ID will be included. May not be used with before_id
                                                                                                                                      start_datetime2016-01-02T00:00:00ZOnly return refunds created after this timestamp. Defaults to 1 month ago, or 1 month before a passed end_datetime
                                                                                                                                      end_datetime2016-01-02T00:00:00ZOnly return refunds created before this timestamp. Defaults to end of the current day, or 1 month after a passed start_datetime
                                                                                                                                      page_size20The number of refunds to return on each page. The maximum value is 100
                                                                                                                                      Example
                                                                                                                                      package refunds;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.RefundCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<>();
                                                                                                                                              params.put("page_size", 5);
                                                                                                                                      
                                                                                                                                              RefundCollection refunds = client.refund.all(params);
                                                                                                                                      
                                                                                                                                              System.out.println(refunds);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "refunds": [
                                                                                                                                          {
                                                                                                                                            "id": "rfnd_f85f150c71c748649ec06d319a26e54c",
                                                                                                                                            "object": "Refund",
                                                                                                                                            "created_at": "2024-01-24T00:07:22Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:22Z",
                                                                                                                                            "tracking_code": "9405500207552011812764",
                                                                                                                                            "confirmation_number": null,
                                                                                                                                            "status": "submitted",
                                                                                                                                            "carrier": "USPS",
                                                                                                                                            "shipment_id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "has_more": true
                                                                                                                                      }
                                                                                                                                      GET/refunds/:id

                                                                                                                                      Retrieve a Refund

                                                                                                                                      Retrieve a Refund by id.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      idrfnd_abc1234The ID of the refund to retrieve
                                                                                                                                      Example
                                                                                                                                      package refunds;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Refund;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Refund refund = client.refund.retrieve("rfnd_...");
                                                                                                                                      
                                                                                                                                              System.out.println(refund);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "rfnd_f85f150c71c748649ec06d319a26e54c",
                                                                                                                                        "object": "Refund",
                                                                                                                                        "created_at": "2024-01-24T00:07:22Z",
                                                                                                                                        "updated_at": "2024-01-24T00:07:22Z",
                                                                                                                                        "tracking_code": "9405500207552011812764",
                                                                                                                                        "confirmation_number": null,
                                                                                                                                        "status": "submitted",
                                                                                                                                        "carrier": "USPS",
                                                                                                                                        "shipment_id": "shp_c3b0a61f204b4593a1ed98a3026dc4dc"
                                                                                                                                      }

                                                                                                                                      Reports

                                                                                                                                      A Report contains a csv that is a log of all the objects created within a certain time frame.

                                                                                                                                      Reports can be generated using the Reports Endpoint. You can create and view Reports created between any time frame defined between the start_date and end_date.

                                                                                                                                      The Report api can be categorized into several types. These types determine which EasyPost Object to produce a Report for, and should be passed as either the type in our libraries or at the end of the URL.

                                                                                                                                      Report Types

                                                                                                                                      • cash_flow
                                                                                                                                      • insurance
                                                                                                                                      • payment_log
                                                                                                                                      • refund
                                                                                                                                      • shipment
                                                                                                                                      • shipment_invoice
                                                                                                                                      • tracker

                                                                                                                                      Report Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with "cfrep_" (Cash Flow Report), "insrep_" (Insurance Report), "plrep_" (Payment Log Report), "refrep_" (Refund Report), "shprep_" (Shipment Report), "shpinvrep_" (Shipment Invoice Report), or "trkrep_" (Tracker Report)
                                                                                                                                      objectstring"CashFlowReport", "InsuranceReport", "PaymentLogReport", "RefundReport", "ShipmentReport", "ShipmentInvoiceReport", or "TrackerReport"
                                                                                                                                      modestring"test" or "production"
                                                                                                                                      statusstring"new", "available", "failed", "empty" or null
                                                                                                                                      start_datestringA date string in YYYY-MM-DD form eg: "2016-02-02"
                                                                                                                                      end_datestringA date string in YYYY-MM-DD form eg: "2016-02-03"
                                                                                                                                      include_childrenbooleanSet true if you would like to include Insurances, Refunds, Shipments, ShipmentInvoices, or Trackers created by child users
                                                                                                                                      urlstringA url that contains a link to the Report. Expires 30 seconds after retrieving this object
                                                                                                                                      url_expires_atdatetimeUrl expiring time
                                                                                                                                      send_emailbooleanSet true if you would like to send an email containing the Report
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime
                                                                                                                                      POST/reports/:type

                                                                                                                                      Create a Report

                                                                                                                                      To create a Report, provide a start_date and end_date that are less than 31 days apart along with any other optional parameter that you would like to specify. A detailed list of Report Object attributes are provided below.

                                                                                                                                      The expiry on url is 30 seconds. The default status on each new Report is "new". It changes to "available" if the csv file is created successfully or to "failed" when csv creation is unsuccessful, or to "empty" if the report does not include any data for the specified date range. Additionally, null could also be a status.

                                                                                                                                      When a Report's status changes, a webhook will be created. See our Webhooks Guide for help on Event handling.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      start_date2016-11-02Required
                                                                                                                                      end_date2016-12-02Required
                                                                                                                                      include_childrenfalseOptional, defaults to false
                                                                                                                                      send_emailtrueOptional, defaults to false
                                                                                                                                      columns["shipment_id", "usps_zone"]Optional, can use to specify the exact columns you want in your report
                                                                                                                                      additional_columns["usps_zone"]Optional, can use to request additional columns (if any) outside of the defaults
                                                                                                                                      Example
                                                                                                                                      package reports;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Report;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> params = new HashMap<String, Object>();
                                                                                                                                              params.put("type", "payment_log");
                                                                                                                                              params.put("start_date", "2022-10-01");
                                                                                                                                              params.put("end_date", "2022-10-31");
                                                                                                                                      
                                                                                                                                              Report report = client.report.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(report);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "shprep_4a6f6e7e1b8a4794b5395008c89625be",
                                                                                                                                        "object": "ShipmentReport",
                                                                                                                                        "created_at": "2024-01-24T00:07:24Z",
                                                                                                                                        "updated_at": "2024-01-24T00:07:24Z",
                                                                                                                                        "start_date": "2022-10-01",
                                                                                                                                        "end_date": "2022-10-01",
                                                                                                                                        "mode": "test",
                                                                                                                                        "status": "new",
                                                                                                                                        "url": null,
                                                                                                                                        "url_expires_at": null,
                                                                                                                                        "include_children": false
                                                                                                                                      }
                                                                                                                                      GET/reports/:type

                                                                                                                                      Retrieve a list of Reports

                                                                                                                                      The Report List is a paginated list of all Report objects associated with the given API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      before_idshprep_c8e0edb5efebb28Optional pagination parameter. Only Reports created before the given ID will be included. May not be used with after_id
                                                                                                                                      after_idshprep_c8e0edbz5zebb4cOptional pagination parameter. Only Reports created before the given ID will be included. May not be used with before_id
                                                                                                                                      page_size30The number of Reports to return on each page. The maximum value is 100
                                                                                                                                      Example
                                                                                                                                      package reports;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.ReportCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("type", "payment_log");
                                                                                                                                              params.put("page_size", "5");
                                                                                                                                      
                                                                                                                                              ReportCollection reports = client.report.all(params);
                                                                                                                                      
                                                                                                                                              System.out.println(reports);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "reports": [
                                                                                                                                          {
                                                                                                                                            "id": "shprep_82ee56b0b96247528187f3f9b4fa1360",
                                                                                                                                            "object": "ShipmentReport",
                                                                                                                                            "created_at": "2024-01-24T00:07:24Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:24Z",
                                                                                                                                            "start_date": "2022-10-01",
                                                                                                                                            "end_date": "2022-10-01",
                                                                                                                                            "mode": "test",
                                                                                                                                            "status": "empty",
                                                                                                                                            "url": null,
                                                                                                                                            "url_expires_at": null,
                                                                                                                                            "include_children": false
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "has_more": true
                                                                                                                                      }
                                                                                                                                      GET/reports/:id

                                                                                                                                      Retrieve a Report

                                                                                                                                      Retrieve a Report by id.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      idshprep_c8e0ecb4bb284caa9Unique. See object definition for possible id prefixes
                                                                                                                                      Example
                                                                                                                                      package reports;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Report;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Report report = client.report.retrieve("<REPORT_ID>");
                                                                                                                                      
                                                                                                                                              System.out.println(report);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "shprep_82ee56b0b96247528187f3f9b4fa1360",
                                                                                                                                        "object": "ShipmentReport",
                                                                                                                                        "created_at": "2024-01-24T00:07:24Z",
                                                                                                                                        "updated_at": "2024-01-24T00:07:24Z",
                                                                                                                                        "start_date": "2022-10-01",
                                                                                                                                        "end_date": "2022-10-01",
                                                                                                                                        "mode": "test",
                                                                                                                                        "status": "new",
                                                                                                                                        "url": null,
                                                                                                                                        "url_expires_at": null,
                                                                                                                                        "include_children": false
                                                                                                                                      }

                                                                                                                                      ScanForms

                                                                                                                                      A ScanForm can be created to speed up and simplify the carrier pickup process. The ScanForm is one document that can be scanned to mark all included tracking codes as "Accepted for Shipment" by the carrier. The following criteria must met before creation:

                                                                                                                                      • Refunded Shipments cannot be added
                                                                                                                                      • Each Shipment must have the same origin address
                                                                                                                                      • Shipments must all be dated (using the label_date option) on or after the date the form is generated
                                                                                                                                      • Shipments cannot be added to more than one ScanForm
                                                                                                                                      • Existing ScanForms may not be updated with additional Shipments. If a ScanForm already exists, and new Shipments need to be added, a new ScanForm must be created.
                                                                                                                                      • Shipments should be provided in the form of an array

                                                                                                                                      ScanForm Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with "sf_"
                                                                                                                                      objectstring"ScanForm"
                                                                                                                                      statusstringCurrent status. Possible values are "creating", "created" and "failed"
                                                                                                                                      messagestringHuman readable message explaining any failures
                                                                                                                                      addressAddressAddress that the Shipments will be shipped from
                                                                                                                                      tracking_codesstring arrayTracking codes included on the ScanForm
                                                                                                                                      form_urlstringUrl of the document
                                                                                                                                      form_file_typestringFile format of the document
                                                                                                                                      batch_idstringThe id of the associated Batch. Unique, starts with "batch_"
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime
                                                                                                                                      POST/scan_forms
                                                                                                                                      POST/batches/:id/scan_form(see Batches Manifesting)

                                                                                                                                      Create a ScanForm

                                                                                                                                      A ScanForm can be created in two ways:

                                                                                                                                      • Add Shipments to a Batch and create a ScanForm for a Batch of Shipments
                                                                                                                                      • Create a scan-form for shipments directly without adding shipments to a batch

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      shipments[<Shipment>,<Shipment>,...]
                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.ScanForm;
                                                                                                                                      import com.easypost.model.Shipment;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.ArrayList;
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class Create {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Shipment shipment = client.shipment.retrieve("shp_...");
                                                                                                                                      
                                                                                                                                              List<Shipment> shipments = new ArrayList<Shipment>();
                                                                                                                                              shipments.add(shipment);
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("shipments", shipments);
                                                                                                                                      
                                                                                                                                              ScanForm scanForm = client.scanform.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(scanForm);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "sf_e79db685aecd4c7286471ff06a27a121",
                                                                                                                                        "object": "ScanForm",
                                                                                                                                        "created_at": "2024-01-24T00:07:27Z",
                                                                                                                                        "updated_at": "2024-01-24T00:07:27Z",
                                                                                                                                        "tracking_codes": ["9405500207552011812801"],
                                                                                                                                        "address": {
                                                                                                                                          "id": "adr_8e182c46ba4c11ee8b51ac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:25+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:25+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": {}
                                                                                                                                        },
                                                                                                                                        "status": "created",
                                                                                                                                        "message": null,
                                                                                                                                        "form_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240124/e872ec72373078434880f49a17e5788dcc.pdf",
                                                                                                                                        "form_file_type": null,
                                                                                                                                        "batch_id": "batch_78507c9db0574b02813cf08bd52357b5",
                                                                                                                                        "confirmation": null
                                                                                                                                      }
                                                                                                                                      GET/scan_forms

                                                                                                                                      Retrieve a list of ScanForms

                                                                                                                                      The ScanForm List is a paginated list of all ScanForm objects associated with the given API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      before_idsf_...Optional pagination parameter. Only ScanForms created before the given ID will be included. May not be used with after_id
                                                                                                                                      after_idsf_...Optional pagination parameter. Only ScanForms created after the given ID will be included. May not be used with before_id
                                                                                                                                      start_datetime2016-01-02T00:00:00ZOnly return ScanForms created after this timestamp. Defaults to 1 month ago, or 1 month before a passed end_datetime
                                                                                                                                      end_datetime2016-01-02T00:00:00ZOnly return ScanForms created before this timestamp. Defaults to end of the current day, or 1 month after a passed start_datetime
                                                                                                                                      page_size20The number of ScanForms to return on each page. The maximum value is 100
                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.ScanFormCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("page_size", 5);
                                                                                                                                      
                                                                                                                                              ScanFormCollection scanForms = client.scanform.all(params);
                                                                                                                                      
                                                                                                                                              System.out.println(scanForms);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "scan_forms": [
                                                                                                                                          {
                                                                                                                                            "id": "sf_589e52186e9249669c7806912a6ab766",
                                                                                                                                            "object": "ScanForm",
                                                                                                                                            "created_at": "2024-01-24T00:07:29Z",
                                                                                                                                            "updated_at": "2024-01-24T00:07:29Z",
                                                                                                                                            "tracking_codes": ["9405500207552011812825"],
                                                                                                                                            "address": {
                                                                                                                                              "id": "adr_8f5e7e74ba4c11ee8bd0ac1f6bc53342",
                                                                                                                                              "object": "Address",
                                                                                                                                              "created_at": "2024-01-24T00:07:28+00:00",
                                                                                                                                              "updated_at": "2024-01-24T00:07:28+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": {}
                                                                                                                                            },
                                                                                                                                            "status": "created",
                                                                                                                                            "message": null,
                                                                                                                                            "form_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240124/e82a4cb71096604dc7bd773b1285d7e9db.pdf",
                                                                                                                                            "form_file_type": null,
                                                                                                                                            "batch_id": "batch_83009a1272fa48ffb1a3d29074a16960",
                                                                                                                                            "confirmation": null
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "has_more": true
                                                                                                                                      }
                                                                                                                                      GET/scan_forms/:id

                                                                                                                                      Retrieve a ScanForm

                                                                                                                                      Retrieve a ScanForm by id.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      idsf_...Unique, starts with "sf"
                                                                                                                                      Example
                                                                                                                                      package shipments;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.ScanForm;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              ScanForm scanForm = client.scanform.retrieve("sf_...");
                                                                                                                                      
                                                                                                                                              System.out.println(scanForm);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "sf_589e52186e9249669c7806912a6ab766",
                                                                                                                                        "object": "ScanForm",
                                                                                                                                        "created_at": "2024-01-24T00:07:29Z",
                                                                                                                                        "updated_at": "2024-01-24T00:07:29Z",
                                                                                                                                        "tracking_codes": ["9405500207552011812825"],
                                                                                                                                        "address": {
                                                                                                                                          "id": "adr_8f5e7e74ba4c11ee8bd0ac1f6bc53342",
                                                                                                                                          "object": "Address",
                                                                                                                                          "created_at": "2024-01-24T00:07:28+00:00",
                                                                                                                                          "updated_at": "2024-01-24T00:07:28+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": {}
                                                                                                                                        },
                                                                                                                                        "status": "created",
                                                                                                                                        "message": null,
                                                                                                                                        "form_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240124/e82a4cb71096604dc7bd773b1285d7e9db.pdf",
                                                                                                                                        "form_file_type": null,
                                                                                                                                        "batch_id": "batch_83009a1272fa48ffb1a3d29074a16960",
                                                                                                                                        "confirmation": null
                                                                                                                                      }

                                                                                                                                      Webhooks

                                                                                                                                      Each Webhook contains the url which EasyPost will notify whenever an object in our system updates. Several types of objects are processed asynchronously in the EasyPost system, so whenever an object updates, an Event is sent via HTTP POST to each configured webhook URL. The Webhook object provides CRUD operations for all Webhooks.

                                                                                                                                      In general, a Webhook's endpoint should return a status code of 2XX. A 200 is preferred, but any 2XX status will indicate to our system that the Webhook request was successful. Endpoints that return a large volume and rate of failures over a period of time will get automatically disabled by the system; a disabled Webhook can be re-enabled using the Webhook update endpoint.

                                                                                                                                      Webhook Authentication

                                                                                                                                      Our recommended best practice for securing Webhooks involves either HMAC validation which has first-class support in each of our client libraries or using basic authentication and HTTPS on your endpoint. This will help prevent any altering of any information communicated to you by EasyPost, prevent any third parties from seeing your webhooks in transit, and will prevent any third parties from masquerading as EasyPost and sending fraudulent data. EasyPost performs certificate validation and requires any TLS-enabled (HTTPS) webhook recipients to have a certificate signed by a public trusted certification authority. We do not support sending webhooks over SSLv2, SSLv3, or any connection using so-called export-grade ciphers. For documentation on how to set up your server with TLS, we recommend Mozilla's guide to Server-Side TLS and Qualys's SSL/TLS deployment best practices guide.

                                                                                                                                      HMAC Validation

                                                                                                                                      Securing a webhook via HMAC validation is simple. Pass a webhook_secret with your request to create or update a webhook as shown example below. Once a webhook secret is setup, we will return its signature via the X-Hmac-Signature header on every event sent to your webhook URL. All that's left is to validate that the signature we sent you matches the webhook secret you initially sent us. You can accomplish this by calling the validate_webhook() function if using one of our client libraries (the naming convention of this function may differ per language), and passing in your webhook secret, headers, and the event body. If the signatures match, the function will return the webhook data, otherwise it will throw an error to protect your system from the incoming webhook.

                                                                                                                                      Basic Authentication

                                                                                                                                      Basic authorization requires that a username and password combination along with the webhook URL be passed during webhook creation. An example may look like this:https://username:secret@www.example.com/easypost-webhook. When an event triggers in our system, we'll deliver a webhook to this endpoint along with an Authorization header that you will need to validate the credentials for. If the credentials do not match what we have stored in our system for this webhook (the basic auth header sent to this endpoint), the webhook should be rejected.

                                                                                                                                      Webhook Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with "hook_"
                                                                                                                                      objectstring"Webhook"
                                                                                                                                      modestring"test" or "production"
                                                                                                                                      urlstringhttps://example.com
                                                                                                                                      disabled_atdatetimethe timestamp at which the webhook was most recently disabled (if any)
                                                                                                                                      POST/webhooks

                                                                                                                                      Create a Webhook

                                                                                                                                      To create a Webhook, you simply need to provide a url parameter that you wish to receive notifications to. You can also secure your webhook via a webhook_secret or basic auth.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      url"https://example.com"This is the URL that your webhook will receive data at
                                                                                                                                      webhook_secret"A1B2C3"The webhook secret to perform HMAC validation with used to secure a webhook
                                                                                                                                      Example
                                                                                                                                      package webhooks;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Webhook;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> params = new HashMap<String, Object>();
                                                                                                                                              params.put("url", "example.com");
                                                                                                                                      
                                                                                                                                              Webhook webhook = client.webhook.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(webhook);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "hook_9dd6e2fcba4c11ee92767be0e8b3db48",
                                                                                                                                        "object": "Webhook",
                                                                                                                                        "mode": "test",
                                                                                                                                        "url": "http://example.com",
                                                                                                                                        "created_at": "2024-01-24T00:07:52Z",
                                                                                                                                        "disabled_at": null
                                                                                                                                      }
                                                                                                                                      GET/webhooks

                                                                                                                                      List a Webhooks

                                                                                                                                      Retrieve an unpaginated list of all Webhooks available to the authenticated account.

                                                                                                                                      Example
                                                                                                                                      package webhooks;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.WebhookCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              WebhookCollection webhooks = client.webhook.all();
                                                                                                                                      
                                                                                                                                              System.out.println(webhooks);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "webhooks": [
                                                                                                                                          {
                                                                                                                                            "id": "hook_9f1fa072ba4c11ee9b29733b326f964d",
                                                                                                                                            "object": "Webhook",
                                                                                                                                            "mode": "test",
                                                                                                                                            "url": "http://example.com",
                                                                                                                                            "created_at": "2024-01-24T00:07:54Z",
                                                                                                                                            "disabled_at": null
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      GET/webhooks/:id

                                                                                                                                      Retrieve a Webhook

                                                                                                                                      Retrieve a Webhook by id.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      idhook_abc1234
                                                                                                                                      Example
                                                                                                                                      package webhooks;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Webhook;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Webhook webhook = client.webhook.retrieve("hook_...");
                                                                                                                                      
                                                                                                                                              System.out.println(webhook);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "hook_9e64905cba4c11eeaac53dd08b571ecc",
                                                                                                                                        "object": "Webhook",
                                                                                                                                        "mode": "test",
                                                                                                                                        "url": "http://example.com",
                                                                                                                                        "created_at": "2024-01-24T00:07:53Z",
                                                                                                                                        "disabled_at": null
                                                                                                                                      }
                                                                                                                                      PATCH/webhooks/:id

                                                                                                                                      Update a Webhook

                                                                                                                                      Enables a Webhook that has been disabled. You can also secure your webhook by adding a webhook_secret.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      webhook_secret"A1B2C3"The webhook secret to perform HMAC validation with used to secure a webhook
                                                                                                                                      Example
                                                                                                                                      package webhooks;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Webhook;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Update {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              Webhook webhook = client.webhook.update("hook_...");
                                                                                                                                      
                                                                                                                                              System.out.println(webhook);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "hook_9ff05f5aba4c11ee882b0fe795304884",
                                                                                                                                        "object": "Webhook",
                                                                                                                                        "mode": "test",
                                                                                                                                        "url": "http://example.com",
                                                                                                                                        "created_at": "2024-01-24T00:07:56Z",
                                                                                                                                        "disabled_at": null
                                                                                                                                      }
                                                                                                                                      DELETE/webhooks/:id

                                                                                                                                      Delete a Webhook

                                                                                                                                      Delete a Webhook by id.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      idhook_abc1234
                                                                                                                                      Example
                                                                                                                                      package webhooks;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Delete {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              client.webhook.delete("hook_...");
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {}

                                                                                                                                      API Keys

                                                                                                                                      When performing operations on API Keys for a specific user, you must be authenticated using a production key.

                                                                                                                                      API Keys full response structure

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringThe User id of the authenticated User making the API Key request
                                                                                                                                      childrenarray of API Key response structuresA list of all Child Users presented with ONLY id, children, and key array structures.
                                                                                                                                      keysAPI Key arrayThe list of all API keys active for an account, both for "test" and "production" modes.

                                                                                                                                      API Key Object

                                                                                                                                      attributetypespecification
                                                                                                                                      objectstring"ApiKey"
                                                                                                                                      modestring"test" or "production"
                                                                                                                                      keystringThe actual key value to use for authentication
                                                                                                                                      created_atdatetimeWhen the API key was created
                                                                                                                                      activebooleanWhether the API key is active or not
                                                                                                                                      idstringThe ID of the API key
                                                                                                                                      GET/api_keys
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Retrieve an Api Key

                                                                                                                                      Both production and test keys will be returned for a User and all of its children. If the request is authenticated as a Child, only the API Keys for that Child will be returned.

                                                                                                                                      Example
                                                                                                                                      package api_keys;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.ApiKeys;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              // Retrieve all API keys including children
                                                                                                                                              ApiKeys parentKeys = client.apiKey.all();
                                                                                                                                      
                                                                                                                                              System.out.println(parentKeys);
                                                                                                                                      
                                                                                                                                              // Retrieve API keys for a specific child user
                                                                                                                                              ApiKeys childKeys = client.apiKey.retrieveApiKeysForUser("user_...");
                                                                                                                                      
                                                                                                                                              System.out.println(childKeys);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "user_060ab38db3c04ffaa60f262e5781a9be",
                                                                                                                                        "keys": [
                                                                                                                                          {
                                                                                                                                            "object": "ApiKey",
                                                                                                                                            "active": true,
                                                                                                                                            "key": "<REDACTED>",
                                                                                                                                            "mode": "test",
                                                                                                                                            "created_at": "2022-10-14T17:23:58Z",
                                                                                                                                            "id": "ak_eb495dfd453647749dc6471290b33685"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "ApiKey",
                                                                                                                                            "active": true,
                                                                                                                                            "key": "<REDACTED>",
                                                                                                                                            "mode": "production",
                                                                                                                                            "created_at": "2022-10-14T17:23:58Z",
                                                                                                                                            "id": "ak_6f4eae3909464f3f807b3af2a687c85b"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "children": [
                                                                                                                                          {
                                                                                                                                            "id": "user_0ae8cb7000a1438c8598fa5786fdae84",
                                                                                                                                            "keys": [
                                                                                                                                              {
                                                                                                                                                "object": "ApiKey",
                                                                                                                                                "active": true,
                                                                                                                                                "key": "<REDACTED>",
                                                                                                                                                "mode": "test",
                                                                                                                                                "created_at": "2022-10-17T17:28:30Z",
                                                                                                                                                "id": "ak_3b56830ab851496f946c368cb001c3f4"
                                                                                                                                              },
                                                                                                                                              {
                                                                                                                                                "object": "ApiKey",
                                                                                                                                                "active": true,
                                                                                                                                                "key": "<REDACTED>",
                                                                                                                                                "mode": "production",
                                                                                                                                                "created_at": "2022-10-17T17:28:30Z",
                                                                                                                                                "id": "ak_e5020ebb06b84733891c0e0e5ce25b27"
                                                                                                                                              }
                                                                                                                                            ],
                                                                                                                                            "children": []
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      POST/api_keys
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Create an Api Key

                                                                                                                                      Both production and test keys can be created for a User and all of its children. If the request is authenticated as a Child then API Keys for that Child will be created.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      mode"test", "production"
                                                                                                                                      Example
                                                                                                                                      This method is not yet supported in the java client library. Please select cURL to view an example.
                                                                                                                                      
                                                                                                                                      If you would like to see this functionality added, feel free to submit a pull request at https://github.com/EasyPost/easypost-java.
                                                                                                                                      {
                                                                                                                                        "object": "ApiKey",
                                                                                                                                        "key": "<REDACTED>",
                                                                                                                                        "mode": "test",
                                                                                                                                        "created_at": "2022-01-29T00:02:36Z",
                                                                                                                                        "active": true,
                                                                                                                                        "id": "ak_..."
                                                                                                                                      }
                                                                                                                                      POST/api_keys/:id/disable
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Disable an Api Key

                                                                                                                                      Disabling an API key immediately renders it unusable. You can disable production or test API keys, but you must use your production API key to authenticate. Please exercise caution when disabling API keys.

                                                                                                                                      Example
                                                                                                                                      This method is not yet supported in the java client library. Please select cURL to view an example.
                                                                                                                                      
                                                                                                                                      If you would like to see this functionality added, feel free to submit a pull request at https://github.com/EasyPost/easypost-java.
                                                                                                                                      {
                                                                                                                                        "object": "ApiKey",
                                                                                                                                        "key": "<REDACTED>",
                                                                                                                                        "mode": "test",
                                                                                                                                        "created_at": "2022-01-29T00:02:36Z",
                                                                                                                                        "active": false,
                                                                                                                                        "id": "ak_..."
                                                                                                                                      }
                                                                                                                                      POST/api_keys/:id/enable
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Enable an Api Key

                                                                                                                                      You can enable an API key if it is disabled.

                                                                                                                                      Example
                                                                                                                                      This method is not yet supported in the java client library. Please select cURL to view an example.
                                                                                                                                      
                                                                                                                                      If you would like to see this functionality added, feel free to submit a pull request at https://github.com/EasyPost/easypost-java.
                                                                                                                                      {
                                                                                                                                        "object": "ApiKey",
                                                                                                                                        "key": "<REDACTED>",
                                                                                                                                        "mode": "test",
                                                                                                                                        "created_at": "2022-01-29T00:02:36Z",
                                                                                                                                        "active": true,
                                                                                                                                        "id": "ak_..."
                                                                                                                                      }
                                                                                                                                      DELETE/api_keys/:id
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Delete an Api Key

                                                                                                                                      Once an API key is deleted, it cannot be re-enabled, and will no longer be shown in your list of keys. Please exercise caution when deleting API keys.

                                                                                                                                      Example
                                                                                                                                      This method is not yet supported in the java client library. Please select cURL to view an example.
                                                                                                                                      
                                                                                                                                      If you would like to see this functionality added, feel free to submit a pull request at https://github.com/EasyPost/easypost-java.
                                                                                                                                      {}

                                                                                                                                      Users

                                                                                                                                      The User object can be used to manage your own account and to create child accounts. Only a Production mode API key can be used to make requests against the Users API.

                                                                                                                                      There are two kinds of accounts. The first is the standard (parent) User object. It represents your account state, settings, and credentials to log in via the website. The second is the child User, which is a User that belongs to a parent.

                                                                                                                                      Balance and recharge values on User objects are expressed in higher precision USD.

                                                                                                                                      User Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with "user_"
                                                                                                                                      objectstring"User"
                                                                                                                                      parent_idstringThe ID of the parent user object. Top-level users are defined as users with no parent
                                                                                                                                      namestringFirst and last name required
                                                                                                                                      emailstringRequired
                                                                                                                                      phone_numberstringRequired
                                                                                                                                      balancestringFormatted as string "XX.XXXXX"
                                                                                                                                      price_per_shipmentstringCost per shipment purchase, formatted as string "XX.XXXXX"
                                                                                                                                      recharge_amountstringUSD formatted dollars and cents, delimited by a decimal point
                                                                                                                                      secondary_recharge_amountstringUSD formatted dollars and cents, delimited by a decimal point
                                                                                                                                      recharge_thresholdstringNumber of cents USD that when your balance drops below, we automatically recharge your account with your primary payment method.
                                                                                                                                      cc_fee_ratestringThe fee rate for convenience fees
                                                                                                                                      insurance_fee_ratestringThe fee rate for insurance purchases
                                                                                                                                      insurance_fee_minimumstringThe minimum cost for insurance purchases
                                                                                                                                      childrenarrayAll associated children
                                                                                                                                      GET/users/:id
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Retrieve a User

                                                                                                                                      Each User can be retrieved individually by id. Any id provided must be either the id of the authenticated User or the id of one of its children. Additionally, to retrieve the authenticated User directly no id is required.

                                                                                                                                      Example
                                                                                                                                      package users;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.User;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              // Retrieve the authenticated user
                                                                                                                                              User parentUser = client.user.retrieveMe();
                                                                                                                                      
                                                                                                                                              System.out.println(parentUser);
                                                                                                                                      
                                                                                                                                              // Retrieve a child user
                                                                                                                                              User childUser = client.user.retrieve("user_...");
                                                                                                                                      
                                                                                                                                              System.out.println(childUser);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "user_060ab38db3c04ffaa60f262e5781a9be",
                                                                                                                                        "object": "User",
                                                                                                                                        "parent_id": null,
                                                                                                                                        "name": "EasyPost Docs",
                                                                                                                                        "phone_number": "5555555555",
                                                                                                                                        "verified": true,
                                                                                                                                        "created_at": "2022-10-14T17:23:58Z",
                                                                                                                                        "default_carbon_offset": false,
                                                                                                                                        "has_elevate_access": false,
                                                                                                                                        "balance": "0.00000",
                                                                                                                                        "price_per_shipment": "0.00000",
                                                                                                                                        "recharge_amount": null,
                                                                                                                                        "secondary_recharge_amount": null,
                                                                                                                                        "recharge_threshold": null,
                                                                                                                                        "has_billing_method": null,
                                                                                                                                        "cc_fee_rate": "0.0375",
                                                                                                                                        "default_insurance_amount": null,
                                                                                                                                        "insurance_fee_rate": "0.005",
                                                                                                                                        "insurance_fee_minimum": "0.50",
                                                                                                                                        "email": "dev+easypost-docs@easypost.com",
                                                                                                                                        "children": [
                                                                                                                                          {
                                                                                                                                            "id": "user_0ae8cb7000a1438c8598fa5786fdae84",
                                                                                                                                            "object": "User",
                                                                                                                                            "parent_id": "user_060ab38db3c04ffaa60f262e5781a9be",
                                                                                                                                            "name": "Test User",
                                                                                                                                            "phone_number": "8005550100",
                                                                                                                                            "verified": true,
                                                                                                                                            "created_at": "2022-10-17T17:28:30Z",
                                                                                                                                            "default_carbon_offset": false,
                                                                                                                                            "has_elevate_access": false,
                                                                                                                                            "children": []
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      PATCH/users/:id
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Update a User

                                                                                                                                      Just like retrieving a User they can be updated using the same patterns. Passing an id will allow the update of a child or the authenticated User. Passing no id will update the authenticated User.

                                                                                                                                      Since children also have the ability to authenticate themselves they can be updated without passing an id. Children may only have their "name" field updated, all other fields are ignored.

                                                                                                                                      Update requests for Users are partial updates. Only attributes specifically passed in will be updated. The current_password attribute is required when updating email or password.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      "password""hunter2"
                                                                                                                                      "password_confirmation""hunter2"
                                                                                                                                      "current_password""Cthon98"
                                                                                                                                      "name""Azure Diamond"
                                                                                                                                      "phone_number""555-867-5309"
                                                                                                                                      "recharge_amount""100.00"
                                                                                                                                      "secondary_recharge_amount""50.00"
                                                                                                                                      "recharge_threshold""20.00"
                                                                                                                                      Example
                                                                                                                                      package users;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.User;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class Update {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("recharge_threshold", "50.00");
                                                                                                                                      
                                                                                                                                              User user = client.user.update("user_...", params);
                                                                                                                                      
                                                                                                                                              System.out.println(user);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "user_060ab38db3c04ffaa60f262e5781a9be",
                                                                                                                                        "object": "User",
                                                                                                                                        "parent_id": null,
                                                                                                                                        "name": "EasyPost Docs",
                                                                                                                                        "phone_number": "5555555555",
                                                                                                                                        "verified": true,
                                                                                                                                        "created_at": "2022-10-14T17:23:58Z",
                                                                                                                                        "default_carbon_offset": false,
                                                                                                                                        "has_elevate_access": false,
                                                                                                                                        "balance": "0.00000",
                                                                                                                                        "price_per_shipment": "0.00000",
                                                                                                                                        "recharge_amount": null,
                                                                                                                                        "secondary_recharge_amount": null,
                                                                                                                                        "recharge_threshold": null,
                                                                                                                                        "has_billing_method": null,
                                                                                                                                        "cc_fee_rate": "0.0375",
                                                                                                                                        "default_insurance_amount": null,
                                                                                                                                        "insurance_fee_rate": "0.005",
                                                                                                                                        "insurance_fee_minimum": "0.50",
                                                                                                                                        "email": "dev+easypost-docs@easypost.com",
                                                                                                                                        "children": [
                                                                                                                                          {
                                                                                                                                            "id": "user_0ae8cb7000a1438c8598fa5786fdae84",
                                                                                                                                            "object": "User",
                                                                                                                                            "parent_id": "user_060ab38db3c04ffaa60f262e5781a9be",
                                                                                                                                            "name": "Test User",
                                                                                                                                            "phone_number": "8005550100",
                                                                                                                                            "verified": true,
                                                                                                                                            "created_at": "2022-10-17T17:28:30Z",
                                                                                                                                            "default_carbon_offset": false,
                                                                                                                                            "has_elevate_access": false,
                                                                                                                                            "children": []
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }

                                                                                                                                      Billing

                                                                                                                                      The Billing functions allow you to manage an account's billing. You can use these functions to add or delete credit cards or bank accounts, list the available payment methods, and fund a wallet.

                                                                                                                                      POST/credit_cards/:id/charges
                                                                                                                                      POST/bank_accounts/:id/charges
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Add Funds to your wallet (One-Time Charge)

                                                                                                                                      Fund your EasyPost wallet by charging your primary or secondary payment method on file. The amount added must be greater than or equal to your current balance.

                                                                                                                                      Adding funds with one-time charges is optional, as EasyPost uses an automatic recharge system to maintain a wallet balance.

                                                                                                                                      The API response for this endpoint is empty, the functions in our client libraries will return true if the API call succeed, or else an error will be thrown.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      amount2000Amount in cents to be deposited into the user's wallet. Amount must be greater than or equal to the user's current balance.
                                                                                                                                      priority"primary"The payment method from your account, either primary or secondary.
                                                                                                                                      Example
                                                                                                                                      package billing;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.PaymentMethod;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Fund {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              client.billing.fundWallet("2000", PaymentMethod.Priority.PRIMARY);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {}
                                                                                                                                      GET/payment_methods
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Retrieve Payment Methods

                                                                                                                                      List payment methods associated with an account.

                                                                                                                                      Example
                                                                                                                                      package billing;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.PaymentMethod;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              PaymentMethod paymentMethods = client.billing.retrievePaymentMethods();
                                                                                                                                      
                                                                                                                                              System.out.println(paymentMethods);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "cust_...",
                                                                                                                                        "object": "PaymentMethods",
                                                                                                                                        "primary_payment_method": {
                                                                                                                                          "id": "card_...",
                                                                                                                                          "disabled_at": null,
                                                                                                                                          "object": "CreditCard",
                                                                                                                                          "name": null,
                                                                                                                                          "last4": "4242",
                                                                                                                                          "exp_month": 1,
                                                                                                                                          "exp_year": 2025,
                                                                                                                                          "brand": "Visa"
                                                                                                                                        },
                                                                                                                                        "secondary_payment_method": {
                                                                                                                                          "id": "card_...",
                                                                                                                                          "disabled_at": null,
                                                                                                                                          "object": "CreditCard",
                                                                                                                                          "name": null,
                                                                                                                                          "last4": "4444",
                                                                                                                                          "exp_month": 1,
                                                                                                                                          "exp_year": 2025,
                                                                                                                                          "brand": "Mastercard"
                                                                                                                                        }
                                                                                                                                      }
                                                                                                                                      DELETE/credit_cards/:id
                                                                                                                                      DELETE/bank_accounts/:id
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Delete a Payment Method

                                                                                                                                      Delete the primary or secondary payment method. The API response for this endpoint is empty, the functions in our client libraries will return true if the API call succeed, or else an error will be thrown.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      priority"primary"The payment method from your account, either primary or secondary.
                                                                                                                                      Example
                                                                                                                                      package billing;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.PaymentMethod;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Delete {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              client.billing.deletePaymentMethod(PaymentMethod.Priority.PRIMARY);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {}
                                                                                                                                      GET/partners/stripe_public_key
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Use EasyPost's Stripe Public API key to create tokens for your Referral Customers on Stripe. Please retrieve EasyPost's Stripe Public API key every time you need to create a new payment method, as we may rotate the key for security at any time. If using one of our client libraries, this will be handled on your behalf when adding a credit card.

                                                                                                                                      Retrieve EasyPost's Public Stripe Key

                                                                                                                                      Example
                                                                                                                                      This method is not yet supported in the java client library. Please select cURL to view an example.
                                                                                                                                      
                                                                                                                                      If you would like to see this functionality added, feel free to submit a pull request at https://github.com/EasyPost/easypost-java.
                                                                                                                                      {
                                                                                                                                        "public_key": "pk_..."
                                                                                                                                      }
                                                                                                                                      POST/credit_cards
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      This endpoint will create a Stripe credit card object on your behalf using EasyPost's Stripe public key, and does not require you to have a Stripe account.

                                                                                                                                      Create Credit Card

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      stripe_object_idtok_...Token from Stripe
                                                                                                                                      priorityprimary"primary" or "secondary"
                                                                                                                                      Example
                                                                                                                                      package referral;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Create {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              PaymentMethodObject creditCard = client.referralCustomer.addCreditCardToUser("REFERRAL_USER_API_KEY",
                                                                                                                                                      "0123456789101234", 01, 2025, "111", PaymentMethod.Priority.PRIMARY);
                                                                                                                                      
                                                                                                                                              System.out.println(referralUser);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "card_...",
                                                                                                                                        "object": "CreditCard",
                                                                                                                                        "name": null,
                                                                                                                                        "last4": "1234",
                                                                                                                                        "exp_month": 1,
                                                                                                                                        "exp_year": 2025,
                                                                                                                                        "brand": "Visa"
                                                                                                                                      }

                                                                                                                                      Brand

                                                                                                                                      The Brand object allows you to customize the publicly-accessible html page that shows tracking details for every EasyPost tracker. You can change your Logo, Brand Color, include an Ad to keep your customers engaged, as well as some other theme-specific details to customize the way your tracking pages will look. Your Brand can be set from the EasyPost dashboard or via API.

                                                                                                                                      Brand Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with 'brd_'
                                                                                                                                      background_colorstringHex code for background color
                                                                                                                                      colorstringHex code for primary color
                                                                                                                                      logostringURL of uploaded logo image (PNG, GIF, JPEG, or SVG)
                                                                                                                                      logo_hrefstringHyperlink when logo is clicked
                                                                                                                                      adstringURL of uploaded ad image (PNG, GIF, JPEG, or SVG)
                                                                                                                                      ad_hrefstringHyperlink when ad is clicked
                                                                                                                                      namestringThe name associated with the User object
                                                                                                                                      user_idstringThe ID of the User object
                                                                                                                                      themestring"theme1" or "theme2"
                                                                                                                                      PATCH/users/:id/brand

                                                                                                                                      Update a Brand

                                                                                                                                      To update a Brand you need to specify the User.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      background_color"#FFFFFF"
                                                                                                                                      color"#303F9F"
                                                                                                                                      logo"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
                                                                                                                                      logo_href"https://www.easypost.com"
                                                                                                                                      ad"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
                                                                                                                                      ad_href"https://www.easypost.com"
                                                                                                                                      theme"theme2"
                                                                                                                                      Example
                                                                                                                                      package brand;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.Brand;
                                                                                                                                      import com.easypost.model.User;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class Update {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              User user = User.retrieveMe();
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<>();
                                                                                                                                              params.put("color", "303F9F");
                                                                                                                                      
                                                                                                                                              Brand brand = client.user.updateBrand(user.getId(), params);
                                                                                                                                      
                                                                                                                                              System.out.println(brand);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "brd_aa3f5a1043ca46cf8e2e9b879c9a5895",
                                                                                                                                        "color": "#123456",
                                                                                                                                        "logo": "https://assets.easypost.com/assets/images/branding/easypost-primary-logo.7324aa54b64b34d6cd70ca5ba4d1842d.svg",
                                                                                                                                        "logo_href": "https://www.easypost.com",
                                                                                                                                        "name": "EasyPost",
                                                                                                                                        "ad": null,
                                                                                                                                        "ad_href": null,
                                                                                                                                        "object": "Brand",
                                                                                                                                        "user_id": "user_060ab38db3c04ffaa60f262e5781a9be",
                                                                                                                                        "background_color": "#123456",
                                                                                                                                        "theme": "theme1"
                                                                                                                                      }

                                                                                                                                      Child Users

                                                                                                                                      A child User can be created for the purpose of organizing larger integrations with EasyPost. If you are representing multiple end users, each with their own set of carrier credentials it can make sense to organize them under a child User.

                                                                                                                                      Other than organizing activity and CarrierAccounts, the central advantage of a child account is that billing flows through the parent's payment information. This allows the child to not have to duplicate payment information.

                                                                                                                                      The structure of a child User is identical to its parent, which means that their representations contain many more properties than are actually used. As well, creating a child User requires almost none of the properties necessary for creating a top-level User.

                                                                                                                                      POST/users
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Create a Child User

                                                                                                                                      Children use the billing information of the parent, and are not able to log in to the website. Any User creation attempt made with an authenticated request (via API key or cookie) is assumed to be the creation of a child of that User.

                                                                                                                                      The name attribute is the only user-settable value on child accounts. It is also optional, as one will be automatically generated if it is not supplied.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      nameChild Account Name
                                                                                                                                      Example
                                                                                                                                      package users;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.User;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> params = new HashMap<String, Object>();
                                                                                                                                              params.put("name", "Child Account Name");
                                                                                                                                      
                                                                                                                                              User user = client.user.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(user);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "user_d2539e6862fe4f389f735c7c00aaa37a",
                                                                                                                                        "object": "User",
                                                                                                                                        "parent_id": "user_060ab38db3c04ffaa60f262e5781a9be",
                                                                                                                                        "name": "Test User",
                                                                                                                                        "phone_number": "8005550100",
                                                                                                                                        "verified": true,
                                                                                                                                        "created_at": "2024-01-24T00:07:48Z",
                                                                                                                                        "default_carbon_offset": false,
                                                                                                                                        "has_elevate_access": false,
                                                                                                                                        "children": [],
                                                                                                                                        "api_keys": [
                                                                                                                                          {
                                                                                                                                            "object": "ApiKey",
                                                                                                                                            "key": "<REDACTED>",
                                                                                                                                            "mode": "test",
                                                                                                                                            "created_at": "2024-01-24T00:07:48Z",
                                                                                                                                            "active": true,
                                                                                                                                            "id": "ak_afdf54db97e24e4aa7354527c8aa3be0"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "ApiKey",
                                                                                                                                            "key": "<REDACTED>",
                                                                                                                                            "mode": "production",
                                                                                                                                            "created_at": "2024-01-24T00:07:48Z",
                                                                                                                                            "active": true,
                                                                                                                                            "id": "ak_da39a3c4afd946e1b77a578ec211e816"
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      GET/users/children
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Retrieve a list of Child Users

                                                                                                                                      The Child User List is a paginated list of all Child User objects associated with the given User API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      after_iduser_...Optional pagination parameter. Only records created after the given ID will be included.
                                                                                                                                      page_size30The number of records to return on each page. The maximum value is 100, and default is 10.
                                                                                                                                      Example
                                                                                                                                      package users;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.ChildUserCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class AllChildren {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<>();
                                                                                                                                      
                                                                                                                                              params.put("page_size", 5);
                                                                                                                                      
                                                                                                                                              ChildUserCollection childUsers = client.users.allChildren(params);
                                                                                                                                      
                                                                                                                                              System.out.println(childUsers);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "children": [
                                                                                                                                          {
                                                                                                                                            "id": "user_0ae8cb7000a1438c8598fa5786fdae84",
                                                                                                                                            "object": "User",
                                                                                                                                            "parent_id": "user_060ab38db3c04ffaa60f262e5781a9be",
                                                                                                                                            "name": "Test User",
                                                                                                                                            "phone_number": "8005550100",
                                                                                                                                            "verified": true,
                                                                                                                                            "created_at": "2022-10-17T17:28:30Z"
                                                                                                                                          }
                                                                                                                                        ],
                                                                                                                                        "has_more": false
                                                                                                                                      }
                                                                                                                                      DELETE/users/:child_id
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Delete a Child User

                                                                                                                                      Childen may be removed from its parent. The parent account's Production API key must be used for the request, a child may not remove itself from its parent.

                                                                                                                                      A successful delete will return HTTP status 204 and an empty object for JSON content.

                                                                                                                                      Example
                                                                                                                                      package users;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Delete {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              client.user.delete("user_...");
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {}

                                                                                                                                      Referral Customers

                                                                                                                                      A Referral Customer is a white label User that can have its own billing methods.

                                                                                                                                      POST/referral_customers
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Create a Referral Customer

                                                                                                                                      Use the Referral Customers endpoint to create a white label User.

                                                                                                                                      To create a Referral User, you must provide a name, email, and phone number. The API keys of the Referral User will be returned to you. Save these API keys securely as they will not be able to be retrieved again later. NOTE: When a Referral Customer is created with your API key, you are certifying that the Referral Customer agrees to EasyPost Terms of Service.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexample
                                                                                                                                      nameFirstname Lastname
                                                                                                                                      emailsupport@easypost.com
                                                                                                                                      phone415-123-4567
                                                                                                                                      Example
                                                                                                                                      package referral;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.ReferralCustomer;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> params = new HashMap<>();
                                                                                                                                      
                                                                                                                                              params.put("name", "test test");
                                                                                                                                              params.put("email", "test@test.com");
                                                                                                                                              params.put("phone", "8888888888");
                                                                                                                                      
                                                                                                                                              ReferralCustomer referralUser = client.referralCustomer.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(referralUser);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "user_50d792728c504bd4a34642ecdfd915b2",
                                                                                                                                        "object": "User",
                                                                                                                                        "parent_id": null,
                                                                                                                                        "name": "test test",
                                                                                                                                        "phone_number": "8888888888",
                                                                                                                                        "verified": true,
                                                                                                                                        "created_at": "2024-01-24T00:07:18Z",
                                                                                                                                        "default_carbon_offset": false,
                                                                                                                                        "has_elevate_access": false,
                                                                                                                                        "balance": "0.00000",
                                                                                                                                        "price_per_shipment": "0.00000",
                                                                                                                                        "recharge_amount": null,
                                                                                                                                        "secondary_recharge_amount": null,
                                                                                                                                        "recharge_threshold": null,
                                                                                                                                        "has_billing_method": null,
                                                                                                                                        "cc_fee_rate": "0.0375",
                                                                                                                                        "default_insurance_amount": "50.00",
                                                                                                                                        "insurance_fee_rate": "0.005",
                                                                                                                                        "insurance_fee_minimum": "0.25",
                                                                                                                                        "email": "referral_customer_50f0324e81a94c4baa5bcc8644624e34@donotemail.easypost.com",
                                                                                                                                        "children": [],
                                                                                                                                        "api_keys": [
                                                                                                                                          {
                                                                                                                                            "object": "ApiKey",
                                                                                                                                            "key": "<REDACTED>",
                                                                                                                                            "mode": "test",
                                                                                                                                            "created_at": "2024-01-24T00:07:19Z",
                                                                                                                                            "active": true,
                                                                                                                                            "id": "ak_b5aad6a37ee9493fb3af53e2e7dbbbd8"
                                                                                                                                          },
                                                                                                                                          {
                                                                                                                                            "object": "ApiKey",
                                                                                                                                            "key": "<REDACTED>",
                                                                                                                                            "mode": "production",
                                                                                                                                            "created_at": "2024-01-24T00:07:19Z",
                                                                                                                                            "active": true,
                                                                                                                                            "id": "ak_af20f85584744cf79933aae294ba59ba"
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      GET/referral_customers
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Retrieve a list of Referral Customers

                                                                                                                                      The Referral Customer List is a paginated list of all Referral Customer User objects associated with the given User API Key. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      before_iduser_...Optional pagination parameter. Only records created before the given ID will be included. May not be used with after_id
                                                                                                                                      after_iduser_...Optional pagination parameter. Only records created after the given ID will be included. May not be used with before_id
                                                                                                                                      page_size30The number of records to return on each page. The maximum value is 100, and default is 10.
                                                                                                                                      Example
                                                                                                                                      package referral;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.ReferralCustomer;
                                                                                                                                      import com.easypost.model.ReferralCustomerCollection;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                      
                                                                                                                                              params.put("page_size", 5);
                                                                                                                                      
                                                                                                                                              ReferralCustomerCollection referallCustomorCollection = client.referralCustomer.all(params);
                                                                                                                                      
                                                                                                                                              List<ReferralCustomer> referallUsers = referallCustomorCollection.getReferralCustomers();
                                                                                                                                      
                                                                                                                                              System.out.println(referallUsers);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "has_more": true,
                                                                                                                                        "referral_customers": [
                                                                                                                                          {
                                                                                                                                            "id": "user_634b6daa05744bfaa205058f06864363",
                                                                                                                                            "object": "User",
                                                                                                                                            "parent_id": null,
                                                                                                                                            "name": "Firstname Lastname",
                                                                                                                                            "phone_number": "8888888888",
                                                                                                                                            "verified": true,
                                                                                                                                            "created_at": "2022-04-26T15:50:28Z",
                                                                                                                                            "default_carbon_offset": false,
                                                                                                                                            "has_elevate_access": false,
                                                                                                                                            "balance": "0.00000",
                                                                                                                                            "price_per_shipment": "0.00000",
                                                                                                                                            "recharge_amount": null,
                                                                                                                                            "secondary_recharge_amount": null,
                                                                                                                                            "recharge_threshold": null,
                                                                                                                                            "has_billing_method": null,
                                                                                                                                            "cc_fee_rate": "0.0325",
                                                                                                                                            "default_insurance_amount": "50.00",
                                                                                                                                            "insurance_fee_rate": "0.005",
                                                                                                                                            "insurance_fee_minimum": "0.25",
                                                                                                                                            "email": "email@example.com",
                                                                                                                                            "children": []
                                                                                                                                          }
                                                                                                                                        ]
                                                                                                                                      }
                                                                                                                                      PUT/referral_customers/:id
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Update a Referral Customer

                                                                                                                                      Partners have the ability to update email addresses of Referral Customers. Partners are obligated to provide us with up-to-date emails for Referral Customers. EasyPost will not contact your customers; this information is used for security purposes only.

                                                                                                                                      Example
                                                                                                                                      package referral;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Update {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              client.referralCustomer.updateEmail("new_email@example.com", "user_...");
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "message": "Referral Customer email updated successfully"
                                                                                                                                      }
                                                                                                                                      POST/beta/referral_customers/payment_method
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Add Payment Method to Referral User

                                                                                                                                      Add a payment method for a referral User. This endpoint is only used if you are using the Stripe Connect integration for the Partner White Label API. Both a "primary" payment method and a "secondary" payment method can be set.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      stripe_customer_idcus_...Unique customer id provided by Stripe
                                                                                                                                      payment_method_referencecard_...Id of the 'card...' or 'ba...' provided by Stripe
                                                                                                                                      priorityprimary'primary' or 'secondary' to set the priority of the payment method in EasyPost
                                                                                                                                      Example
                                                                                                                                      package referral;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.PaymentMethodObject;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Create {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              PaymentMethodObject paymentMethod = client.betaReferralCustomer.addPaymentMethod("cus_...", "card_...");
                                                                                                                                      
                                                                                                                                              System.out.println(paymentMethod);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "card_...",
                                                                                                                                        "disabled_at": null,
                                                                                                                                        "object": "CreditCard",
                                                                                                                                        "name": null,
                                                                                                                                        "last4": "1234",
                                                                                                                                        "exp_month": 7,
                                                                                                                                        "exp_year": 2024,
                                                                                                                                        "brand": "MasterCard"
                                                                                                                                      }
                                                                                                                                      Example
                                                                                                                                      package referral;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.PaymentMethodObject;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Create {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              PaymentMethodObject paymentMethod = client.betaReferralCustomer.addPaymentMethod("cus_...", "ba_...");
                                                                                                                                      
                                                                                                                                              System.out.println(paymentMethod);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "ba_...",
                                                                                                                                        "disabled_at": null,
                                                                                                                                        "object": "BankAccount",
                                                                                                                                        "bank_name": "WELLS FARGO",
                                                                                                                                        "last4": "1234",
                                                                                                                                        "country": "US"
                                                                                                                                      }
                                                                                                                                      POST/beta/referral_customers/refunds
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Refund a Referral User

                                                                                                                                      For partners integrated with Stripe Connect, a referral User's EasyPost wallet balance can be refunded back to a referral User payment method when necessary. An example use case is if a referral User accidentally added too much funds in their wallet.

                                                                                                                                      There are two ways to specify a refund. A refund can be specified by payment_log, which will refund the amount to the original payment method of that payment_log. A refund can also be specified for a specific amount, which will refund a referral User using the most recent payment logs back to their original payment method. For both options, refunds are limited to charges within the last 90 days. Please contact support for additional assistance.

                                                                                                                                      Request Parameters
                                                                                                                                      paramexampleinfo
                                                                                                                                      payment_log_idpaylog_...A previously created EasyPost charge payment_log_id to refund back to the referral User's original payment method
                                                                                                                                      refund_amount2000Amount in cents to be refunded from the referral user's wallet. Amount must be less than or equal to the referral user's current balance.
                                                                                                                                      Example
                                                                                                                                      package referral;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.BetaPaymentRefund;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Create {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              BetaPaymentRefund refund = client.betaReferralCustomer.refundByAmount(2000);
                                                                                                                                      
                                                                                                                                              System.out.println(refund);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "refunded_amount": 2000,
                                                                                                                                        "payment_log_id": "paylog_...",
                                                                                                                                        "refunded_payment_logs": ["paylog...", "paylog..."],
                                                                                                                                        "errors": []
                                                                                                                                      }
                                                                                                                                      Example
                                                                                                                                      package referral;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.BetaPaymentRefund;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Create {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              BetaPaymentRefund refund = client.betaReferralCustomer.refundByAmount(2000);
                                                                                                                                      
                                                                                                                                              System.out.println(refund);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "refunded_amount": 2000,
                                                                                                                                        "payment_log_id": "paylog_...",
                                                                                                                                        "refunded_payment_logs": ["paylog...", "paylog..."],
                                                                                                                                        "errors": []
                                                                                                                                      }

                                                                                                                                      CarrierTypes

                                                                                                                                      The CarrierType object provides an interface for determining the valid fields of a CarrierAccount. The list of CarrierType objects only changes when a new carrier is added to EasyPost.

                                                                                                                                      The CarrierType objects consist of their top level attributes as well as a fields object that contains credentials and sometimes test_credentials sub-objects, which themselves are collections of attributes for CarrierAccounts creation as well as metadata about presentation and the naming of said attributes.

                                                                                                                                      There are a couple special case CarrierAccounts, with structures differing somewhat from the norm. For instance, instead of credentials for UspsAccount, it has only auto_link: true, which indicates that it is an account that can be added or removed without any carrier-specific fields.

                                                                                                                                      The other custom option in the fields list is custom_workflow: true, which indicates that the EasyPost website interface includes special processing for signups for the associated CarrierType. Carriers with a custom workflow will also present their normal credential rules, but it is considered unsafe to directly add a CarrierAccount of this type with these attributes filled out via another source than the EasyPost custom workflow.

                                                                                                                                      CarrierType Object

                                                                                                                                      attributetypespecification
                                                                                                                                      objectstring"CarrierType"
                                                                                                                                      typestringSpecifies the CarrierAccount type.
                                                                                                                                      fieldsfields objectContains at least one of the following keys: "auto_link", "credentials", "test_credentials", and "custom_workflow"

                                                                                                                                      fields Object

                                                                                                                                      attributetypespecification
                                                                                                                                      auto_linkbooleanIf this key is present with the value of true, no other attributes are needed for CarrierAccount creation
                                                                                                                                      custom_workflowbooleanIf this key is present with the value of true, CarrierAccount creation of this type requires extra work not handled by the CarrierAccount standard API
                                                                                                                                      credentialscredentials objectIf this object is present, required attribute names and their metadata are presented inside
                                                                                                                                      test_credentialscredentials objectIf this object is present, it contains attribute names and metadata just as the credentials object. It is not required for CarrierAccount creation if you do not plan on using the carrier account for test mode

                                                                                                                                      attribute objects from credentials/test_credentials

                                                                                                                                      attributetypespecification
                                                                                                                                      namestringThe key for each attribute sub-object within credentials is the name of the attribute for submission on CarrierAccounts
                                                                                                                                      visibilitystringThere are five possible values, which encode the security need and storage type for each attribute: "visible", "checkbox", "fake", "password", and "masked"
                                                                                                                                      labelstringMost attributes have generic names, so for clarity a "label" value is provided for clearer representation when rendering forms
                                                                                                                                      GET/carrier_types
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Retrieve available Carrier Types

                                                                                                                                      The CarrierType list is an unpaginated list of all carrier types available to the account of the given API key.

                                                                                                                                      Example
                                                                                                                                      package carrier_types;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.CarrierType;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class All {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              List<CarrierType> carrierTypes = client.carrierType.all();
                                                                                                                                      
                                                                                                                                              System.out.println(carrierTypes);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      [
                                                                                                                                        {
                                                                                                                                          "object": "CarrierType",
                                                                                                                                          "type": "AmazonMwsAccount",
                                                                                                                                          "readable": "Amazon MWS",
                                                                                                                                          "logo": null,
                                                                                                                                          "fields": {
                                                                                                                                            "credentials": {
                                                                                                                                              "access_key_id": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "AWS Access Key ID"
                                                                                                                                              },
                                                                                                                                              "secret_key": {
                                                                                                                                                "visibility": "password",
                                                                                                                                                "label": "Secret Key"
                                                                                                                                              },
                                                                                                                                              "merchant_id": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "Seller ID"
                                                                                                                                              }
                                                                                                                                            }
                                                                                                                                          }
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                          "object": "CarrierType",
                                                                                                                                          "type": "ApcAccount",
                                                                                                                                          "readable": "APC",
                                                                                                                                          "logo": null,
                                                                                                                                          "fields": {
                                                                                                                                            "credentials": {
                                                                                                                                              "shipper_id": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "APC Shipper ID"
                                                                                                                                              },
                                                                                                                                              "password": {
                                                                                                                                                "visibility": "password",
                                                                                                                                                "label": "APC Password"
                                                                                                                                              },
                                                                                                                                              "facility": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "APC Facility (e.g., NJ, LA)"
                                                                                                                                              }
                                                                                                                                            }
                                                                                                                                          }
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                          "object": "CarrierType",
                                                                                                                                          "type": "AsendiaUsaAccount",
                                                                                                                                          "readable": "Asendia USA",
                                                                                                                                          "logo": null,
                                                                                                                                          "fields": {
                                                                                                                                            "credentials": {
                                                                                                                                              "account_number": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "AsendiaUsa Account Number"
                                                                                                                                              },
                                                                                                                                              "sub_account_number": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "AsendiaUsa Sub Account Number"
                                                                                                                                              },
                                                                                                                                              "username": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "AsendiaUsa Username"
                                                                                                                                              },
                                                                                                                                              "password": {
                                                                                                                                                "visibility": "password",
                                                                                                                                                "label": "AsendiaUsa Password"
                                                                                                                                              },
                                                                                                                                              "api_key": {
                                                                                                                                                "visibility": "masked",
                                                                                                                                                "label": "AsendiaUsa API key"
                                                                                                                                              },
                                                                                                                                              "carrier_facility": {
                                                                                                                                                "visibility": "select",
                                                                                                                                                "label": "AsendiaUsa Carrier Facility / Processing Location (Optional)"
                                                                                                                                              }
                                                                                                                                            },
                                                                                                                                            "test_credentials": {
                                                                                                                                              "account_number": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "Test AsendiaUsa Account Number"
                                                                                                                                              },
                                                                                                                                              "sub_account_number": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "Test AsendiaUsa Sub Account Number"
                                                                                                                                              },
                                                                                                                                              "username": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "Test AsendiaUsa Username"
                                                                                                                                              },
                                                                                                                                              "password": {
                                                                                                                                                "visibility": "password",
                                                                                                                                                "label": "Test AsendiaUsa Password"
                                                                                                                                              },
                                                                                                                                              "api_key": {
                                                                                                                                                "visibility": "masked",
                                                                                                                                                "label": "Test AsendiaUsa API key"
                                                                                                                                              },
                                                                                                                                              "carrier_facility": {
                                                                                                                                                "visibility": "select",
                                                                                                                                                "label": "Test AsendiaUsa Carrier Facility / Processing Location (Optional)"
                                                                                                                                              }
                                                                                                                                            }
                                                                                                                                          }
                                                                                                                                        }
                                                                                                                                      ]

                                                                                                                                      CarrierAccounts

                                                                                                                                      A CarrierAccount encapsulates your credentials with the carrier. The CarrierAccount object provides CRUD operations for all CarrierAccounts.

                                                                                                                                      Each EasyPost account is automatically provided a USPS account managed by EasyPost.

                                                                                                                                      Other operations, such as Shipment creation, can reference CarrierAccounts to reduce the scope of data returned. For instance, you may have multiple warehouses that need to use distinct FedEx Ground Economy credentials to request the correct rates. Rate objects will include a carrier_account_id field which can be used to determine the account used for rating.

                                                                                                                                      CarrierAccount Object

                                                                                                                                      attributetypespecification
                                                                                                                                      idstringUnique, begins with "ca_"
                                                                                                                                      objectstring"CarrierAccount"
                                                                                                                                      typestringThe name of the carrier type.
                                                                                                                                      fieldsFields objectContains "credentials" and/or "test_credentials", or may be empty
                                                                                                                                      clonebooleanIf clone is true, only the reference and description are possible to update
                                                                                                                                      descriptionstringAn optional, user-readable field to help distinguish accounts
                                                                                                                                      referencestringAn optional field that may be used in place of carrier_account_id in other API endpoints
                                                                                                                                      readablestringThe name used when displaying a readable value for the type of the account
                                                                                                                                      credentialsobjectUnlike the "credentials" object contained in "fields", this nullable object contains just raw credential pairs for client library consumption
                                                                                                                                      test_credentialsobjectUnlike the "test_credentials" object contained in "fields", this nullable object contains just raw test_credential pairs for client library consumption
                                                                                                                                      billing_typestringBilling type of the carrier account
                                                                                                                                      created_atdatetime
                                                                                                                                      updated_atdatetime

                                                                                                                                      Fields Object

                                                                                                                                      attributetypespecification
                                                                                                                                      credentialsField objectCredentials used in the production environment.
                                                                                                                                      test_credentialsField objectCredentials used in the test environment.
                                                                                                                                      auto_linkbooleanFor USPS this designates that no credentials are required.
                                                                                                                                      custom_workflowbooleanWhen present, a separate authentication process will be required through the UI to link this account type.

                                                                                                                                      Field Object

                                                                                                                                      attributetypespecification
                                                                                                                                      keystringEach key in the sub-objects of a CarrierAccount's fields is the name of a settable field
                                                                                                                                      visibilitystringThe visibility value is used to control form field types, and is discussed in the CarrierType section
                                                                                                                                      labelstringThe label value is used in form rendering to display a more precise field name
                                                                                                                                      valuestringCheckbox fields use "0" and "1" as False and True, all other field types present plaintext, partly-masked, or masked credential data for reference
                                                                                                                                      POST/carrier_accounts
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Create a Carrier Account

                                                                                                                                      CarrierAccount objects may be managed through the EasyPost API using the Production mode API key only. Multiple accounts can be added for a single carrier.

                                                                                                                                      The CarrierType of the preferred CarrierAccount should be consulted before attempting to create a new CarrierAccount, as it will inform you of the field names expected by a certain carrier. Some carriers may have a custom_workflow field set to true. These carriers cannot be created with the traditional flow listed below and instead have a special steps that must be followed. Please see our Adding Carriers With Custom Workflows help center article for more details on these carriers.

                                                                                                                                      Example
                                                                                                                                      package carrier_accounts;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.CarrierAccount;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      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> credentials = new HashMap<String, Object>();
                                                                                                                                              credentials.put("client_id", "123456");
                                                                                                                                              credentials.put("client_secret", "123abc");
                                                                                                                                              credentials.put("distribution_center", "USLAX1");
                                                                                                                                              credentials.put("pickup_id", "123456");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> testCredentials = new HashMap<String, Object>();
                                                                                                                                              testCredentials.put("client_id", "123456");
                                                                                                                                              testCredentials.put("client_secret", "123abc");
                                                                                                                                              testCredentials.put("distribution_center", "USLAX1");
                                                                                                                                              testCredentials.put("pickup_id", "123456");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("type", "DhlEcsAccount");
                                                                                                                                              params.put("description", "CA Location DHL eCommerce Solutions Account");
                                                                                                                                              params.put("credentials", credentials);
                                                                                                                                              params.put("test_credentials", testCredentials);
                                                                                                                                      
                                                                                                                                              CarrierAccount carrierAccount = client.carrierAccount.create(params);
                                                                                                                                      
                                                                                                                                              System.out.println(carrierAccount);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "ca_f64a75cee8ed4c83a7625c1d00cf8f0b",
                                                                                                                                        "object": "CarrierAccount",
                                                                                                                                        "type": "DhlEcsAccount",
                                                                                                                                        "clone": false,
                                                                                                                                        "created_at": "2024-01-24T00:05:37Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:37Z",
                                                                                                                                        "description": "CA Location DHL eCommerce Solutions Account",
                                                                                                                                        "reference": null,
                                                                                                                                        "billing_type": "carrier",
                                                                                                                                        "readable": "DHL eCommerce Solutions",
                                                                                                                                        "logo": null,
                                                                                                                                        "fields": {
                                                                                                                                          "credentials": {
                                                                                                                                            "client_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "DHL eCommerce Solutions client ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "client_secret": {
                                                                                                                                              "visibility": "password",
                                                                                                                                              "label": "DHL eCommerce Solutions client secret",
                                                                                                                                              "value": "********"
                                                                                                                                            },
                                                                                                                                            "pickup_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "DHL eCommerce Solutions pickup ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "distribution_center": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "DHL eCommerce Solutions distribution center",
                                                                                                                                              "value": "USLAX1"
                                                                                                                                            }
                                                                                                                                          },
                                                                                                                                          "test_credentials": {
                                                                                                                                            "client_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "Test DHL eCommerce Solutions client ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "client_secret": {
                                                                                                                                              "visibility": "password",
                                                                                                                                              "label": "Test DHL eCommerce Solutions client secret",
                                                                                                                                              "value": "********"
                                                                                                                                            },
                                                                                                                                            "pickup_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "Test DHL eCommerce Solutions pickup ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "distribution_center": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "Test DHL eCommerce Solutions distribution center",
                                                                                                                                              "value": "USLAX1"
                                                                                                                                            }
                                                                                                                                          }
                                                                                                                                        },
                                                                                                                                        "credentials": {
                                                                                                                                          "client_id": "123456",
                                                                                                                                          "client_secret": "********",
                                                                                                                                          "pickup_id": "123456",
                                                                                                                                          "distribution_center": "USLAX1"
                                                                                                                                        },
                                                                                                                                        "test_credentials": {
                                                                                                                                          "client_id": "123456",
                                                                                                                                          "client_secret": "********",
                                                                                                                                          "pickup_id": "123456",
                                                                                                                                          "distribution_center": "USLAX1"
                                                                                                                                        }
                                                                                                                                      }
                                                                                                                                      GET/carrier_accounts
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      List all Carrier Accounts

                                                                                                                                      Retrieve an unpaginated list of all CarrierAccounts available to the authenticated account. Only Production API keys may be used to retrieve this list, as there is no test mode equivalent.

                                                                                                                                      Example
                                                                                                                                      package carrier_accounts;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.CarrierAccount;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.List;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              List<CarrierAccount> carrierAccounts = client.carrierAccount.all();
                                                                                                                                      
                                                                                                                                              System.out.println(carrierAccounts);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      [
                                                                                                                                        {
                                                                                                                                          "id": "ca_9685a1198a75477885a3cdca37559bac",
                                                                                                                                          "object": "CarrierAccount",
                                                                                                                                          "type": "UspsAccount",
                                                                                                                                          "clone": false,
                                                                                                                                          "created_at": "2022-10-14T17:23:58Z",
                                                                                                                                          "updated_at": "2022-10-14T17:34:05Z",
                                                                                                                                          "description": "USPS Account",
                                                                                                                                          "reference": null,
                                                                                                                                          "billing_type": "easypost",
                                                                                                                                          "readable": "USPS",
                                                                                                                                          "logo": null,
                                                                                                                                          "fields": {
                                                                                                                                            "credentials": {
                                                                                                                                              "company_name": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "Account Holder Name",
                                                                                                                                                "value": ""
                                                                                                                                              },
                                                                                                                                              "address_street": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "Street Address",
                                                                                                                                                "value": ""
                                                                                                                                              },
                                                                                                                                              "address_city": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "City",
                                                                                                                                                "value": ""
                                                                                                                                              },
                                                                                                                                              "address_state": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "State",
                                                                                                                                                "value": ""
                                                                                                                                              },
                                                                                                                                              "address_zip": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "ZIP Code",
                                                                                                                                                "value": ""
                                                                                                                                              },
                                                                                                                                              "phone": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "Phone Number",
                                                                                                                                                "value": ""
                                                                                                                                              },
                                                                                                                                              "email": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "Email Address",
                                                                                                                                                "value": null
                                                                                                                                              },
                                                                                                                                              "shipper_id": {
                                                                                                                                                "visibility": "visible",
                                                                                                                                                "label": "Shipper Identifier (Optional)",
                                                                                                                                                "value": ""
                                                                                                                                              }
                                                                                                                                            }
                                                                                                                                          },
                                                                                                                                          "credentials": {
                                                                                                                                            "company_name": "",
                                                                                                                                            "address_street": "",
                                                                                                                                            "address_city": "",
                                                                                                                                            "address_state": "",
                                                                                                                                            "address_zip": "",
                                                                                                                                            "phone": "",
                                                                                                                                            "email": null,
                                                                                                                                            "shipper_id": ""
                                                                                                                                          },
                                                                                                                                          "test_credentials": null
                                                                                                                                        }
                                                                                                                                      ]
                                                                                                                                      GET/carrier_accounts/:id
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Retrieve a CarrierAccount

                                                                                                                                      Retrieve a CarrierAccount by either its id or reference. However it is recommended to use EasyPost's provided identifiers because we do not enforce a unique reference.

                                                                                                                                      Example
                                                                                                                                      package carrier_accounts;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.CarrierAccount;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Retrieve {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              CarrierAccount carrierAccount = client.carrierAccount.retrieve("ca_...");
                                                                                                                                      
                                                                                                                                              System.out.println(carrierAccount);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "ca_13e1617aec534a8bb7b5daee3d0e471c",
                                                                                                                                        "object": "CarrierAccount",
                                                                                                                                        "type": "DhlEcsAccount",
                                                                                                                                        "clone": false,
                                                                                                                                        "created_at": "2024-01-24T00:05:38Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:38Z",
                                                                                                                                        "description": "CA Location DHL eCommerce Solutions Account",
                                                                                                                                        "reference": null,
                                                                                                                                        "billing_type": "carrier",
                                                                                                                                        "readable": "DHL eCommerce Solutions",
                                                                                                                                        "logo": null,
                                                                                                                                        "fields": {
                                                                                                                                          "credentials": {
                                                                                                                                            "client_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "DHL eCommerce Solutions client ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "client_secret": {
                                                                                                                                              "visibility": "password",
                                                                                                                                              "label": "DHL eCommerce Solutions client secret",
                                                                                                                                              "value": "********"
                                                                                                                                            },
                                                                                                                                            "pickup_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "DHL eCommerce Solutions pickup ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "distribution_center": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "DHL eCommerce Solutions distribution center",
                                                                                                                                              "value": "USLAX1"
                                                                                                                                            }
                                                                                                                                          },
                                                                                                                                          "test_credentials": {
                                                                                                                                            "client_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "Test DHL eCommerce Solutions client ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "client_secret": {
                                                                                                                                              "visibility": "password",
                                                                                                                                              "label": "Test DHL eCommerce Solutions client secret",
                                                                                                                                              "value": "********"
                                                                                                                                            },
                                                                                                                                            "pickup_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "Test DHL eCommerce Solutions pickup ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "distribution_center": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "Test DHL eCommerce Solutions distribution center",
                                                                                                                                              "value": "USLAX1"
                                                                                                                                            }
                                                                                                                                          }
                                                                                                                                        },
                                                                                                                                        "credentials": {
                                                                                                                                          "client_id": "123456",
                                                                                                                                          "client_secret": "********",
                                                                                                                                          "pickup_id": "123456",
                                                                                                                                          "distribution_center": "USLAX1"
                                                                                                                                        },
                                                                                                                                        "test_credentials": {
                                                                                                                                          "client_id": "123456",
                                                                                                                                          "client_secret": "********",
                                                                                                                                          "pickup_id": "123456",
                                                                                                                                          "distribution_center": "USLAX1"
                                                                                                                                        }
                                                                                                                                      }
                                                                                                                                      PATCH/carrier_accounts/:id
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Update a CarrierAccount

                                                                                                                                      Updates can be made to description, reference, and any fields in credentials or test_credentials.

                                                                                                                                      The CarrierType of the CarrierAccount should be consulted before attempting to updating an existing CarrierAccount, as it will inform you of the field names expected by a certain carrier. Update requests for Carrier Accounts are partial updates. Only attributes specifically passed in will be updated.

                                                                                                                                      Example
                                                                                                                                      package carrier_accounts;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.model.CarrierAccount;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      import java.util.HashMap;
                                                                                                                                      
                                                                                                                                      public class Update {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> credentials = new HashMap<String, Object>();
                                                                                                                                              credentials.put("pickup_id", "abc123");
                                                                                                                                      
                                                                                                                                              HashMap<String, Object> params = new HashMap<String, Object>();
                                                                                                                                              params.put("description", "FL Location DHL eCommerce Solutions Account");
                                                                                                                                              params.put("credentials", credentials);
                                                                                                                                      
                                                                                                                                              CarrierAccount carrierAccount = client.carrierAccount.update("ca_...", params);
                                                                                                                                      
                                                                                                                                              System.out.println(carrierAccount);
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {
                                                                                                                                        "id": "ca_1f69b4afc44a480a8728e19381cb9b0f",
                                                                                                                                        "object": "CarrierAccount",
                                                                                                                                        "type": "DhlEcsAccount",
                                                                                                                                        "clone": false,
                                                                                                                                        "created_at": "2024-01-24T00:05:40Z",
                                                                                                                                        "updated_at": "2024-01-24T00:05:40Z",
                                                                                                                                        "description": "My custom description",
                                                                                                                                        "reference": null,
                                                                                                                                        "billing_type": "carrier",
                                                                                                                                        "readable": "DHL eCommerce Solutions",
                                                                                                                                        "logo": null,
                                                                                                                                        "fields": {
                                                                                                                                          "credentials": {
                                                                                                                                            "client_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "DHL eCommerce Solutions client ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "client_secret": {
                                                                                                                                              "visibility": "password",
                                                                                                                                              "label": "DHL eCommerce Solutions client secret",
                                                                                                                                              "value": "********"
                                                                                                                                            },
                                                                                                                                            "pickup_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "DHL eCommerce Solutions pickup ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "distribution_center": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "DHL eCommerce Solutions distribution center",
                                                                                                                                              "value": "USLAX1"
                                                                                                                                            }
                                                                                                                                          },
                                                                                                                                          "test_credentials": {
                                                                                                                                            "client_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "Test DHL eCommerce Solutions client ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "client_secret": {
                                                                                                                                              "visibility": "password",
                                                                                                                                              "label": "Test DHL eCommerce Solutions client secret",
                                                                                                                                              "value": "********"
                                                                                                                                            },
                                                                                                                                            "pickup_id": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "Test DHL eCommerce Solutions pickup ID",
                                                                                                                                              "value": "123456"
                                                                                                                                            },
                                                                                                                                            "distribution_center": {
                                                                                                                                              "visibility": "visible",
                                                                                                                                              "label": "Test DHL eCommerce Solutions distribution center",
                                                                                                                                              "value": "USLAX1"
                                                                                                                                            }
                                                                                                                                          }
                                                                                                                                        },
                                                                                                                                        "credentials": {
                                                                                                                                          "client_id": "123456",
                                                                                                                                          "client_secret": "********",
                                                                                                                                          "pickup_id": "123456",
                                                                                                                                          "distribution_center": "USLAX1"
                                                                                                                                        },
                                                                                                                                        "test_credentials": {
                                                                                                                                          "client_id": "123456",
                                                                                                                                          "client_secret": "********",
                                                                                                                                          "pickup_id": "123456",
                                                                                                                                          "distribution_center": "USLAX1"
                                                                                                                                        }
                                                                                                                                      }
                                                                                                                                      DELETE/carrier_accounts/:id
                                                                                                                                      Production OnlyThis call will only work with your production API Key.

                                                                                                                                      Delete a Carrier Account

                                                                                                                                      CarrierAccount objects may be removed from your account when they become out of date or no longer useful.

                                                                                                                                      Example
                                                                                                                                      package carrier_accounts;
                                                                                                                                      
                                                                                                                                      import com.easypost.exception.EasyPostException;
                                                                                                                                      import com.easypost.service.EasyPostClient;
                                                                                                                                      
                                                                                                                                      public class Delete {
                                                                                                                                          public static void main(String[] args) throws EasyPostException {
                                                                                                                                              EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");
                                                                                                                                      
                                                                                                                                              client.carrierAccount.delete("ca_...");
                                                                                                                                          }
                                                                                                                                      }
                                                                                                                                      {}