Authenticated — all requests require Authorization: Bearer mk_test_…Learn more
API ReferenceRatesGet rate quotes
Get rate quotes
POST/api/v1/rates
Quotes are entitlement-scoped: options come from the Service Codes your account can book — resolved from BOTH entitlement tracks (Product Code entitlements and assigned rate cards) — and each option carries the pricing-model v2 metadata (product_code, service_options, is_standard_service). Zoned destinations (currently AU) price by postal-code zone: supply destination_postal_code, or zoned options come back available=false with unavailable_reason. Opt-in surcharges (e.g. SIGNATURE, INSURANCE) can be passed in selected_surcharges; per-option eligibility is returned in opt_in_availability and surcharges that could not be applied are listed in surcharge_conflicts. EU destinations include an ioss_notice block showing the VAT-prepay picture; using_ioss is true when an IOSS number (the request's ioss_number or your account default) was applied to the quote. Engine rejections return 400 INVALID_FIELD whose message is an English description of the reason (message_zh has the Chinese version); data.field classifies it — rate_card (entitlement / pricing setup; also the fallback), declared_value_hkd (destination declared-value cap), parcels (size over carrier limit) — and data.errors lists every reason in English, with data.errors_zh listing the same reasons in Chinese (one entry per entry of data.errors). Send the same ioss_number and items you will send to POST /v1/shipments (and weight_kg equal to the sum of the parcel weights) and total_hkd matches the order-time price; without ioss_number your account's default IOSS number applies, as at create. An administrator can restrict, per account and per Product Code, which destination countries may be booked. A restricted option is still returned with its prices unchanged, but available=false, unavailable_reason set and unavailable_code CLIENT_PRODUCT_COUNTRY_DISABLED, and it cannot be booked. unavailable_code may also be one of SERVICE_DESTINATION_UNSUPPORTED, SERVICE_EU_TAX_MODE_REQUIRED, SERVICE_OWN_VOEC_UNSUPPORTED, SERVICE_UK_VAT_UNSUPPORTED, SERVICE_SIGNATURE_UNSUPPORTED, SERVICE_INSURANCE_UNSUPPORTED, SERVICE_BATTERY_UNSUPPORTED, SERVICE_DISPATCH_MODE_UNSUPPORTED or SERVICE_BOOKING_PAUSED when the service cannot be booked for the shipment as submitted (choose another service or change the shipment details); other unavailable options carry unavailable_reason alone. Contact customer support to have the destination enabled; retrying or switching to another service you are not entitled to will not help.
Sandbox IOSS: with a mk_test_* key, first register the number through POST /v1/ioss for the same account, then send that same ioss_number to POST /v1/rates and POST /v1/shipments. The sandbox registry is separate from live: a live registration or live account default alone does not authorize an explicit sandbox override; it returns 400 IOSS_NOT_OWNED until registered in sandbox. Sandbox registration never files with the carrier or changes the live account default. Omitting ioss_number keeps the existing account-default fallback behavior.
Parameters
cod
booleanbody
declared_currency
enum (HKD | USD)body
Currency of the items' unit prices — same meaning as declared_currency on POST /v1/shipments (omitted: decided by the price field the items use). Requires items; sending it without items returns 400 INVALID_FIELD. A USD quote needs the day's USD/HKD rate and returns 503 FX_RATE_UNAVAILABLE when none can be resolved.
declared_value_hkd
numberbody
declared_value_usd
numberbody
Total declared value of the parcel in USD (sum of unit price x quantity of all items), optional. China-origin services whose destination caps declared value in USD (for example US: USD 60, refused at or above the cap) compare this figure directly, with no HKD conversion; an option at or above its cap is returned unavailable, and when every option is refused the request fails with 400 INVALID_FIELD (field declared_value_usd). Omitted → the USD cap is not evaluated (declared_value_hkd rules are unchanged).
destination_country*
stringbody
destination_postal_code
stringbody
Destination postal code. Required for accurate zoned pricing (AU Z1/Z2/Z3) — without it, zoned options return available=false with a reason.
goods_category*
stringbody
insured_amount_hkd
numberbody
Custom insured amount for a quote preview, in HKD — the same currency as declared_value_hkd on this endpoint (POST /v1/shipments takes insured_amount in the shipment's declared_currency instead). Available only to accounts enrolled for custom insured amount; when supported for an option, its opt_in_availability INSURANCE entry carries custom_insured_amount. Must be > 0 with at most 2 decimal places, and at most USD 2500 once converted at the day's USD/HKD rate — any other value returns 400 INVALID_FIELD. The INSURANCE fee is 0.7% × this amount, min HKD 9.
ioss_number
stringbody
EU IOSS number (IM + 10 digits) to quote with — the same value and rules as ioss_number on POST /v1/shipments. With an IOSS number the EU VAT prepay surcharge (VAT_HANDLING) is not quoted and ioss_notice.using_ioss is true. Omitted → your account's default IOSS number applies, exactly as at shipment create; accounts without one are quoted with VAT_HANDLING as before. The number must belong to your account — your own saved IOSS or a marketplace platform IOSS registered to you — anything else returns 400 IOSS_NOT_OWNED. Sending it together with NO_VOEC_PREPAY in selected_surcharges returns 400 VOEC_PREPAY_CONFLICT.
items
array<object>body
Declared items, in the same shape as items on POST /v1/shipments — send the same array you will send at create. When present: (1) the per-item temporary levy (TEMP_LEVY, e.g. EUR 3 per distinct item for the EU — distinct by first 6 digits of hs_code + description + country_of_manufacture) is quoted, as at create; (2) the declared value is computed from the items' unit prices exactly as at create (see declared_currency), so do not also send declared_value_hkd or declared_value_usd (400 INVALID_FIELD). For order_type domestic_delivery, items that carry only a description and quantity (no unit price on any item) are accepted and quoted as at create: no exchange rate is needed, no zero-value declaration is made, value-based surcharges are not calculated, and a service that requires unit prices is returned unavailable (unavailable_code DECLARED_VALUE_REQUIRED). Declaration-completeness rules that create enforces (EU product identifiers, Brazil 8-digit HS code, and similar) are not checked here. Omitted → behaviour unchanged: the levy is shown only as a notice and declared_value_hkd / declared_value_usd are used.
order_type
stringbody
Order type to quote for: "full_service" (default when omitted) or "domestic_delivery" (destination local delivery). Only services of that type are returned. Unknown values (including empty string and null) return 400 ORDER_TYPE_INVALID. domestic_delivery returns 400 ORDER_TYPE_DISABLED while the feature is off. For domestic_delivery origin_country is ignored.
origin_country
stringbody
Sender/pickup origin country (ISO-2), e.g. "HK" or "CN". When present, only service options published for this origin are returned (e.g. CN → the China-origin CNBIML products). Omitted → no origin filtering (all products your account is entitled to). Ignored for order_type domestic_delivery: it starts in the destination country, so the sender country never filters its options. Matches the create-shipment sender.country_code semantics.
parcels
array<object>body
Package dimensions (cm). Enables volumetric chargeable weight (per-destination divisor) and the oversize gate. Omitted → quote uses actual weight only; the carrier's measured charge weight still applies at settlement.
selected_surcharges
array<string>body
tax_number
stringbody
Norway VOEC number you will send as tax_number on POST /v1/shipments — used only to decide the quote, never validated here. Omitted or blank for a Norway destination on the China-origin lanes (CNASTDGGSTCM, CNASTDBTSTCM, CNCSTDGGSTCM, CNCSTDBTSTCM) quotes carrier VOEC prepayment by default (declared value × 27% plus a weight-stepped handling fee, product TDPHR / TDZXR; option voec_prepay is true), exactly as POST /v1/shipments will charge when you send neither tax_number nor voec_prepay. With a VOEC number the lane is quoted without prepayment. If you also send ioss_number or vat_prepay without a VOEC number, the default prepayment cannot be combined with them: those China-origin options are returned unavailable (see unavailable_reason) while options on other lanes are quoted as usual, and POST /v1/shipments refuses the same combination with 400 VOEC_PREPAY_CONFLICT. A China-origin option whose prepayment cannot be applied is likewise returned unavailable rather than priced without it. No effect for other destinations or lanes.
vat_prepay
booleanbody
Quote for carrier VAT prepay instead of an IOSS number — same field as on POST /v1/shipments (EU only; mutually exclusive with ioss_number, 400 IOSS_AND_PREPAY_CONFLICT; 400 VAT_PREPAY_DISABLED while the feature is off). Your account's default IOSS number is then not applied. Whether the carrier of the option you later select supports VAT prepay is not checked here: POST /v1/shipments returns 400 VAT_PREPAY_UNSUPPORTED if it does not.
weight_kg*
numberbody
Total weight in kg. To match the order-time price, use the sum of parcels[].weight_kg you will send to POST /v1/shipments.
Responses
Success body
{"status":200,"message":"OK","data":{"data":[{"service_tier_id":"HKASTDGGSTCM","name":{"en":"香港發貨公開價標準服務","zh":"香港發貨公開價標準服務"},"eta_days_min":8,"eta_days_max":12,"free_pickup":true,"supports_cod":false,"freight_hkd":58.5,"reg_fee_hkd":36,"surcharges":[{"code":"FUEL","name_zh":"燃油附加費","amount_hkd":4.7,"is_estimate":false,"basis":"8% × 運費"}],"total_hkd":99.2,"rate_table_code":"RT-HKASTDGGSTCM-US-v1","rate_table_version":1,"zone":null,"product_code":"HKASTD","is_standard_service":true,"service_options":[{"layer_key":"cargo_type","option_code":"GG","label_zh":"普貨(帶電)","is_vas":false},{"layer_key":"air_service","option_code":"ST","label_zh":"標準","is_vas":false},{"layer_key":"tail_service","option_code":"CM","label_zh":"綜合","is_vas":false}],"available":true,"unavailable_reason":null,"opt_in_availability":[{"code":"SIGNATURE","selectable":false,"reason":"此路線承運商不支援簽名簽收"},{"code":"INSURANCE","selectable":true,"reason":null}],"surcharge_conflicts":[],"carrier":{"code":"yunexpress","product_code":"HKTHZXR","dispatch_mode":"B2C"}}],"available_opt_in_surcharges":[{"code":"SIGNATURE","name_zh":"簽名簽收","description":"Signature on delivery"},{"code":"INSURANCE","name_zh":"保價","description":"0.7% × (申報 + 運費), min HKD 9"}],"ioss_notice":null}}