Saltar al contenido

Obtener tarifas

Solicitud

Recupera las tarifas de envío de todos los transportistas y niveles de servicio activos en tu cuenta, opcionalmente filtradas por transportistas y niveles de servicio específicos, y devuelve los resultados ordenados por el más rápido, el más económico y otros criterios, junto con la información de errores aplicable.

Seguridad
BearerAuth
Cuerpoapplication/jsonrequerido
return_address_dataobject(AddressReturn)

Dirección a la que se debe devolver el paquete si no se puede entregar o si se devuelve al remitente. Nota: Solo USPS admite la impresión de una dirección de devolución específica en la etiqueta.

from_address_dataobject(AddressFrom)requerido
to_address_dataobject(AddressTo)requerido
package_dataobject(ShipmentPackageData)requerido
option_dataobject(ShipmentOptionData)

Opciones de envío adicionales

ship_datestring(ShipDate)requerido

Marca de tiempo en formato ISO 8601, incluyendo la hora local y el desplazamiento de zona horaria.

Ejemplo:"2025-07-31T00:00:00+08:00"
shipment_rate_carrier_dataArray of objects(ShipmentRateCarrierData)

Al especificar este parámetro, puedes filtrar las tarifas por transportista y nivel de servicio, lo que permite consultas más rápidas.

custom_dataobject(ShipmentCustomData)

Datos aduaneros

POST
/api/shipment/get_rates
curl -i -X POST \
  https://x-api.shipsaving.com/api/shipment/get_rates \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "return_address_data": {
      "first_name": "Alice",
      "last_name": "Green",
      "company_name": "ShipSaving",
      "phone": "1234567890",
      "email": "it@shipsaving.com",
      "street": "xxxx Olive Street",
      "street2": "STE XXX",
      "city": "Los Angeles",
      "state": "CA",
      "zip_code": "021XX",
      "country": "US"
    },
    "from_address_data": {
      "first_name": "Alice",
      "last_name": "Green",
      "company_name": "ShipSaving",
      "phone": "1234567890",
      "email": "it@shipsaving.com",
      "street": "xxxx Olive Street",
      "street2": "STE XXX",
      "city": "Los Angeles",
      "state": "CA",
      "zip_code": "021XX",
      "country": "US"
    },
    "to_address_data": {
      "first_name": "Alice",
      "last_name": "Green",
      "company_name": "ShipSaving",
      "phone": "1234567890",
      "email": "it@shipsaving.com",
      "street": "xxxx Olive Street",
      "street2": "STE XXX",
      "city": "Los Angeles",
      "state": "CA",
      "zip_code": "021XX",
      "country": "US",
      "address_type": "residential"
    },
    "package_data": {
      "type": "my_package",
      "length": 10,
      "width": 10,
      "height": 10,
      "weight": 10,
      "carrier_package_code": "USPS_SMALL_FLAT_RATE_BOX",
      "dimension_unit": "in",
      "weight_unit": "lb"
    },
    "option_data": {
      "signature": "signature",
      "custom_text_on_label_1": "Por favor, deja el paquete en el casillero.",
      "custom_text_on_label_2": "Por favor, deja el paquete en el casillero.",
      "hazardous_materials": true,
      "is_lithium_battery": false,
      "additional_handling": false,
      "require_saturday_delivery": false
    },
    "ship_date": "2025-07-31T00:00:00+08:00",
    "shipment_rate_carrier_data": [
      {
        "provider_id": "USPS_X",
        "service_levels": [
          "USPS_GROUND_ADVANTAGE"
        ]
      }
    ],
    "custom_data": {
      "signing_person": "Ray",
      "content_type": "merchandise",
      "tax_ids": [
        {
          "tax_id_type": "TIN",
          "tax_id_number": "tin2888",
          "country_code": "US"
        }
      ],
      "eel_pfc_type": "ITN",
      "eel_pfc_code": "X20250719123456",
      "undeliverable_option": "return_to_sender",
      "item_data_list": [
        {
          "description": "ropa",
          "quantity": 10,
          "origin": "US",
          "weight": 10,
          "unit_cost": 19.99,
          "weight_unit": "lb",
          "hs_tariff_number": "xx"
        }
      ]
    }
  }'

Respuestas

OK

Cuerpoapplication/json
codestring
Ejemplo:"ok"
msgstring
Ejemplo:"ok"
dataobject
Response
{ "code": "ok", "msg": "ok", "data": { "fastest": { … }, "cheapest": { … }, "shipment_rate_data": [ … ], "fastest_and_cheapest": { … }, "error_info": {} } }