Saltar al contenido

Compra directa de etiqueta

Solicitud

Compra una etiqueta de envío directamente, sin comparar varias opciones de transportistas. Este endpoint solo es aplicable cuando hay un único transportista configurado para cada tipo de transportista en la cuenta del usuario. Si existen varios transportistas del mismo tipo, utiliza la API de Obtener tarifa para recuperar las opciones y, a continuación, llama a la API de Comprar etiqueta para completar la compra.
Límite de tasa: 600 solicitudes por minuto.

Seguridad
ApiTokenAuth
Cuerpoapplication/jsonrequerido
request_idstring

Identificador único de esta solicitud de API. Se utiliza para el rastreo, la depuración y la resolución de problemas. Debe ser una cadena de hasta 64 caracteres.

Ejemplo:"req_20251024_abcd1234ef567890"
carrierobject

Información del transportista

fromobjectrequerido

Dirección del remitente

toobjectrequerido

Dirección del destinatario

shipmentsArray of objectsrequerido

Lista de envíos

orderobject

Información del pedido

optionsobject

Opciones de envío adicionales

recipient_tax_idsArray of objects

Información fiscal del destinatario

POST
/api/rates/buy-label
curl -i -X POST \
  'https://api.shipsaving.com/api/rates/buy-label?api_token=YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "request_id": "req_20251024_abcd1234ef567890",
    "carrier": {
      "carrier_token": "ca_36f49ebbe91d4006a6583e17ceeec500"
    },
    "from": {
      "name": "full name",
      "company": "company name",
      "email": "xxx@gmail.com",
      "phone": 1237771234,
      "street": "xxx Grand Ave",
      "street2": "Apt 5B",
      "city": "Los Angeles",
      "state": "CA",
      "zip": 90018,
      "country": "US"
    },
    "to": {
      "name": "full name",
      "company": "company name",
      "email": "xxx@gmail.com",
      "phone": 1237771234,
      "street": "xxx Grand Ave",
      "street2": "Apt 5B",
      "city": "Los Angeles",
      "state": "CA",
      "zip": 90018,
      "country": "US",
      "residential": true
    },
    "shipments": [
      {
        "length": 6,
        "width": 6,
        "height": 6,
        "weight": 1,
        "packages": [
          "usps_small_flat_rate_box"
        ],
        "insurance_amount": 120,
        "custom_print1": "custom print1",
        "custom_print2": "custom print2",
        "contents": [
          {
            "weight": 1,
            "description": "T-shirt",
            "quantity": 2,
            "value": 29.99,
            "hs_tariff_number": "610910",
            "origin_country": "US"
          }
        ]
      }
    ],
    "order": {
      "warehouse_name": "WH",
      "store_name": "string",
      "order_number": "string",
      "status": "awaiting",
      "service_type": "usps_ground_advantage",
      "signature": "NO_SIGNATURE",
      "insurance_provider": "SHIPSURANCE",
      "contents_type": "GIFT",
      "non_delivery_option": "RETURN",
      "eel_pfc_type": "ITN",
      "eel_pfc_code": "X20250627012345",
      "tax_ids": [
        {
          "tax_id_type": "TIN",
          "tax_id_number": "string",
          "tax_id_country": "US"
        }
      ]
    },
    "options": {
      "ship_date": "2024-02-07T10:55:56-08:00",
      "require_saturday_delivery": false,
      "require_hazmat": false,
      "hazmat_code": "usps_hazmat_820",
      "label_type": "png",
      "require_qr_code": false
    },
    "recipient_tax_ids": [
      {
        "tax_id_type": "TIN",
        "tax_id_number": "string"
      }
    ]
  }'

Respuestas

Etiqueta comprada correctamente

Cuerpoapplication/json
packing_slip_numberinteger
Ejemplo:109169
master_tracking_codestring
Ejemplo:""
prefix_tracking_codestring
Ejemplo:""
tracking_codestring
Ejemplo:"1ZY50G652000880500"
label_sizestring
Ejemplo:"4x6"
label_typestring
Ejemplo:"label"
lengthnumber
Ejemplo:12
widthnumber
Ejemplo:12
heightnumber
Ejemplo:7
weightnumber
Ejemplo:14.99
insurancenumber
Ejemplo:0
insurance_feenumber
Ejemplo:0
signaturestring
Ejemplo:"NO_SIGNATURE"
custom_print1string
Ejemplo:""
custom_print2string
Ejemplo:""
delivery_daysstring
Ejemplo:"1"
service_feenumber
Ejemplo:0.05
ratenumber
Ejemplo:10.87
rebatenumber
Ejemplo:0
from_namestring

Nombre del remitente

Ejemplo:"sender name"
from_companystring

Empresa del remitente

Ejemplo:"ShipSaving, LLC"
from_phonestring

Teléfono del remitente

Ejemplo:""
from_streetstring

Línea 1 de la dirección del remitente

Ejemplo:"769 Broadview Avenue"
from_street2string

Línea 2 de la dirección del remitente

Ejemplo:""
from_citystring

Ciudad del remitente

Ejemplo:"Toronto"
from_statestring

Estado o provincia del remitente

Ejemplo:"ON"
from_zipstring

Código postal del remitente

Ejemplo:"M4K 2P7"
from_countrystring

Código de país del remitente

Ejemplo:"CA"
to_namestring

Nombre del destinatario

Ejemplo:"ShipSaving"
to_companystring

Empresa del destinatario

Ejemplo:"UPS Plus"
to_phonestring

Teléfono del destinatario

Ejemplo:""
to_streetstring

Línea 1 de la dirección del destinatario

Ejemplo:"961 Broadview Avenue"
to_street2string

Línea 2 de la dirección del destinatario

Ejemplo:""
to_citystring

Ciudad del destinatario

Ejemplo:"Toronto"
to_statestring

Estado o provincia del destinatario

Ejemplo:"ON"
to_zipstring

Código postal del destinatario

Ejemplo:"M4K 2P7"
to_countrystring

Código de país del destinatario

Ejemplo:"CA"
label_statusstring
Ejemplo:"completed"
shipment_idinteger
Ejemplo:1245627
warehouse_namestring
Ejemplo:"WH"
store_namestring
Ejemplo:""
order_numberstring
Ejemplo:""
providerstring
Ejemplo:"shipsaving"
carrierstring
Ejemplo:"UPS"
servicestring
Ejemplo:"UPS_GROUND"
packagestring
Ejemplo:"PACKAGE"
published_ratenumber
Ejemplo:34.53
label_urlArray of strings
Ejemplo:
[ "https://...../labels/2025-06-30/0231b055b64044e6b7e027874e915361_0.pdf" ]
commercial_invoice_urlstring or null
Ejemplo:null
Response
{ "packing_slip_number": 109169, "master_tracking_code": "", "prefix_tracking_code": "", "tracking_code": "1ZY50G652000880500", "label_size": "4x6", "label_type": "label", "length": 12, "width": 12, "height": 7, "weight": 14.99, "insurance": 0, "insurance_fee": 0, "signature": "NO_SIGNATURE", "custom_print1": "", "custom_print2": "", "delivery_days": "1", "service_fee": 0.05, "rate": 10.87, "rebate": 0, "from_name": "sender name", "from_company": "ShipSaving, LLC", "from_phone": "", "from_street": "769 Broadview Avenue", "from_street2": "", "from_city": "Toronto", "from_state": "ON", "from_zip": "M4K 2P7", "from_country": "CA", "to_name": "ShipSaving", "to_company": "UPS Plus", "to_phone": "", "to_street": "961 Broadview Avenue", "to_street2": "", "to_city": "Toronto", "to_state": "ON", "to_zip": "M4K 2P7", "to_country": "CA", "label_status": "completed", "shipment_id": 1245627, "warehouse_name": "WH", "store_name": "", "order_number": "", "provider": "shipsaving", "carrier": "UPS", "service": "UPS_GROUND", "package": "PACKAGE", "published_rate": 34.53, "label_url": [ "https://...../labels/2025-06-30/0231b055b64044e6b7e027874e915361_0.pdf" ], "commercial_invoice_url": null }