quote_rates
Compare live shipping rates across the carriers bound to a merchant AfterShip shipper account (UPS / USPS / FedEx / DHL / Ninja Van / J&T and more). IMPORTANT: shipper_account_id is the MERCHANT'S OWN carrier account (their own contract/rates), which they bound inside AfterShip / admin.postmen.com — this server never owns carrier accounts. Pass a to/from address and a parcel (weight + optional dimensions); returns a list of available service_type values with each total_charge (amount + currency), delivery_date and transit_time. Feed the service_type you want into create_label. Bring-your-own key via header x-aftership-key; x-aftership-env sandbox (default, free) or production. This call never buys anything.
Parameters33
| shipper_account_id | string | required | The MERCHANT'S AfterShip shipper-account id — the carrier account (UPS/FedEx/DHL/Ninja Van...) THEY bound in AfterShip, with their own contract & rates. Not owned by this server. List them via AfterShip / admin.postmen.com shipper accounts. |
| to_name | string | required | Recipient contact full name. |
| to_company | string | optional | Optional Recipient company name. |
| to_street1 | string | required | Recipient street address line 1. |
| to_street2 | string | optional | Optional Recipient street address line 2. |
| to_city | string | required | Recipient city. |
| to_state | string | optional | Optional Recipient state / province / region. |
| to_postal_code | string | optional | Recipient postal / ZIP code (required by most carriers). |
| to_country | string | required | Recipient country as an ISO 3166-1 ALPHA-3 code (3 letters, e.g. USA, GBR, JPN, SGP, HKG). Required. |
| to_phone | string | optional | Optional Recipient phone (some carriers/services require it). |
| to_email | string | optional | Optional Recipient email. |
| to_type | string | optional | Optional address type: "residential" or "business" (default residential). |
| from_name | string | required | Sender contact full name. |
| from_company | string | optional | Optional Sender company name. |
| from_street1 | string | required | Sender street address line 1. |
| from_street2 | string | optional | Optional Sender street address line 2. |
| from_city | string | required | Sender city. |
| from_state | string | optional | Optional Sender state / province / region. |
| from_postal_code | string | optional | Sender postal / ZIP code (required by most carriers). |
| from_country | string | required | Sender country as an ISO 3166-1 ALPHA-3 code (3 letters, e.g. USA, GBR, JPN, SGP, HKG). Required. |
| from_phone | string | optional | Optional Sender phone (some carriers/services require it). |
| from_email | string | optional | Optional Sender email. |
| from_type | string | optional | Optional address type: "residential" or "business" (default residential). |
| weight_value | number | required | Parcel weight value. Required. Pair with weight_unit. |
| weight_unit | string | optional | Weight unit: kg | lb | oz | g. Default kg. |
| width | number | optional | Parcel width. Provide width+height+depth together (with dimension_unit), or omit all three. |
| height | number | optional | Parcel height. |
| depth | number | optional | Parcel depth / length. |
| dimension_unit | string | optional | Dimension unit: cm | in | m. Default cm. |
| box_type | string | optional | Parcel box type. Default "custom" (uses your dimensions). Some carriers accept named flat-rate boxes. |
| parcel_description | string | optional | Optional human description of the parcel contents. |
| items | array | optional | Optional line items for customs (required for most INTERNATIONAL shipments). Each: {description, quantity, price_amount, price_currency, origin_country (alpha-3), weight_value, weight_unit, sku, hs_code}. |
| is_document | boolean | optional | Optional: true if the shipment is documents only (no customs value). Default false. |
Raw schema
{
"type": "object",
"properties": {
"shipper_account_id": {
"type": "string",
"description": "The MERCHANT'S AfterShip shipper-account id — the carrier account (UPS/FedEx/DHL/Ninja Van...) THEY bound in AfterShip, with their own contract & rates. Not owned by this server. List them via AfterShip / admin.postmen.com shipper accounts."
},
"to_name": {
"type": "string",
"description": "Recipient contact full name."
},
"to_company": {
"type": "string",
"description": "Optional Recipient company name."
},
"to_street1": {
"type": "string",
"description": "Recipient street address line 1."
},
"to_street2": {
"type": "string",
"description": "Optional Recipient street address line 2."
},
"to_city": {
"type": "string",
"description": "Recipient city."
},
"to_state": {
"type": "string",
"description": "Optional Recipient state / province / region."
},
"to_postal_code": {
"type": "string",
"description": "Recipient postal / ZIP code (required by most carriers)."
},
"to_country": {
"type": "string",
"description": "Recipient country as an ISO 3166-1 ALPHA-3 code (3 letters, e.g. USA, GBR, JPN, SGP, HKG). Required."
},
"to_phone": {
"type": "string",
"description": "Optional Recipient phone (some carriers/services require it)."
},
"to_email": {
"type": "string",
"description": "Optional Recipient email."
},
"to_type": {
"type": "string",
"description": "Optional address type: \"residential\" or \"business\" (default residential)."
},
"from_name": {
"type": "string",
"description": "Sender contact full name."
},
"from_company": {
"type": "string",
"description": "Optional Sender company name."
},
"from_street1": {
"type": "string",
"description": "Sender street address line 1."
},
"from_street2": {
"type": "string",
"description": "Optional Sender street address line 2."
},
"from_city": {
"type": "string",
"description": "Sender city."
},
"from_state": {
"type": "string",
"description": "Optional Sender state / province / region."
},
"from_postal_code": {
"type": "string",
"description": "Sender postal / ZIP code (required by most carriers)."
},
"from_country": {
"type": "string",
"description": "Sender country as an ISO 3166-1 ALPHA-3 code (3 letters, e.g. USA, GBR, JPN, SGP, HKG). Required."
},
"from_phone": {
"type": "string",
"description": "Optional Sender phone (some carriers/services require it)."
},
"from_email": {
"type": "string",
"description": "Optional Sender email."
},
"from_type": {
"type": "string",
"description": "Optional address type: \"residential\" or \"business\" (default residential)."
},
"weight_value": {
"type": "number",
"description": "Parcel weight value. Required. Pair with weight_unit."
},
"weight_unit": {
"type": "string",
"description": "Weight unit: kg | lb | oz | g. Default kg."
},
"width": {
"type": "number",
"description": "Parcel width. Provide width+height+depth together (with dimension_unit), or omit all three."
},
"height": {
"type": "number",
"description": "Parcel height."
},
"depth": {
"type": "number",
"description": "Parcel depth / length."
},
"dimension_unit": {
"type": "string",
"description": "Dimension unit: cm | in | m. Default cm."
},
"box_type": {
"type": "string",
"description": "Parcel box type. Default \"custom\" (uses your dimensions). Some carriers accept named flat-rate boxes."
},
"parcel_description": {
"type": "string",
"description": "Optional human description of the parcel contents."
},
"items": {
"type": "array",
"description": "Optional line items for customs (required for most INTERNATIONAL shipments). Each: {description, quantity, price_amount, price_currency, origin_country (alpha-3), weight_value, weight_unit, sku, hs_code}.",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"quantity": {
"type": "number"
},
"price_amount": {
"type": "number"
},
"price_currency": {
"type": "string"
},
"origin_country": {
"type": "string",
"description": "ISO 3166-1 alpha-3."
},
"weight_value": {
"type": "number"
},
"weight_unit": {
"type": "string"
},
"sku": {
"type": "string"
},
"hs_code": {
"type": "string"
}
}
}
},
"is_document": {
"type": "boolean",
"description": "Optional: true if the shipment is documents only (no customs value). Default false."
}
},
"required": [
"shipper_account_id",
"to_name",
"to_street1",
"to_city",
"to_country",
"from_name",
"from_street1",
"from_city",
"from_country",
"weight_value"
]
}