GetRates

This method calculates the shipping costs for a shipment, or multiple permutations of a shipment, to allow your customers to select the best rate.

Most carrier apps should implement this method, unless you don't support rating shipments.

Request
Request Body schema: application/json
service_code
string or null

If present, a specific service is being requested, and that is the only rate required to fulfill the request. The service code uniquely identifies a shipping service that you offer. Which service codes can be passed to you will be configured in ShipEngine.

ship_datetime
required
string <date-time>

When the package is expected to ship. Not guaranteed to be in the future. Formatted per the https://tools.ietf.org/html/rfc3339 spec. Will always be in UTC.

confirmation
string (ConfirmationTypes)
Enum: "None" "Delivery" "Signature" "AdultSignature" "DirectSignature"
object (AdvancedOptions)

This is a schemaless object. It is for open ended customizations unique to particular carriers. The documented keys are some common options shared by many carriers, but are not definitive. Advanced options you support will be defined in ShipEngine. If the field is absent it should be interpreted as the default value for any applicable options, e.g. false for booleans.

insurance_provider
string (InsuranceProviders)
Enum: "None" "ShipStation" "Carrier" "External"
is_return_label
required
boolean

Whether this label is to return a previously shipped package. If the field is absent it should be interpreted as false.

required
Array of objects or null (Package)

All the packages that make up this shipment. There will always be at least one package defined.

object (Customs)
required
object (ShipTo)
required
object (ShipFrom)

The shipment sender's address. It may or may not have been validated.

object (PudoLocation)

Pickup/Dropoff Location used by carriers that offer this service.

international
boolean or null

Whether this shipment is deemed international.

next_day
boolean or null

Whether this shipment is expected to use a next day service class. If the field is absent it should be interpreted as false

object (FulfillmentPlanDetails)

This model contains information about the fulfillment plan.

object (BillTo)

Bill to is a generic object used for billing a part of the shipment, duties, taxes, or otherwise to a party other than the shipper (the shipper is considered the default party responsible). CarrierApi.Common.Request.CarrierApi.Common.Models.BillTo extends CarrierApi.Common.Models.Addresses.AddressWithContact since address fields are often required when associating billing to another account. Additionally, this allows for a contact to be specified, if necessary.

object (TimeWindow)
transaction_id
required
string <uuid>

The transaction ID uniquely represents this request. If the request is retried then this transaction ID will be the same. You should only perform the requested action once per given transaction ID.

object (Authorization)
object or null
Responses
200

This object model represents the response from a successful get rates request.

post/GetRates
Request samples
application/json
{
  • "service_code": "string",
  • "ship_datetime": "2019-08-24T14:15:22Z",
  • "confirmation": "None",
  • "advanced_options": {
    },
  • "insurance_provider": "None",
  • "is_return_label": true,
  • "packages": [
    ],
  • "customs": {
    },
  • "ship_to": {
    },
  • "ship_from": {
    },
  • "pickup_location": {
    },
  • "international": true,
  • "next_day": true,
  • "fulfillment_plan_details": {
    },
  • "bill_shipping_to": {
    },
  • "carrier_pickup_window": {
    },
  • "transaction_id": "0fec1e58-b197-4052-99cf-2218496c5482",
  • "authorization": {
    },
  • "metadata": {
    }
}
Response samples
application/json
{
  • "rates": [
    ],
  • "metadata": {
    }
}