跳转到内容

Buy Label

请求

Purchase a shipping label using the rate_id returned by Get Rates.

安全
BearerAuth or ApiTokenAuth
查询
rate_idstring必需

Rate identifier returned by the Get Rates endpoint.

示例:rate_id=rate_e50d02e2-047a-402c-aa32-22ad0926db00
curl -i -X GET \
  'https://ps-api.shipsaving.com/api/rates/buy?rate_id=rate_e50d02e2-047a-402c-aa32-22ad0926db00' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

响应

Label purchased successfully

正文application/json
Array [
shipment_idinteger

Internal shipment record ID.

示例:1245627
packing_slip_numberinteger

Packing slip number for the shipment.

示例:109169
master_tracking_codestring

Master tracking number for multi-piece shipments.

示例:""
prefix_tracking_codestring

Tracking number prefix (carrier-specific).

示例:""
tracking_codestring

Primary tracking number.

示例:"1ZY50G652000880500"
label_sizestring

Label dimensions.

示例:"4x6"
label_typestring

Label output format used.

示例:"png"
lengthnumber, (double)

Package length in inches.

示例:12
widthnumber, (double)

Package width in inches.

示例:12
heightnumber, (double)

Package height in inches.

示例:7
weightnumber, (double)

Package weight in pounds.

示例:14.99
insurancenumber, (double)

Declared insurance value.

示例:0
insurance_feeobject

Insurance fee with currency.

signaturestring

Signature confirmation level applied.

示例:"NO_SIGNATURE"
custom_print1string

First line of custom label text.

示例:""
custom_print2string

Second line of custom label text.

示例:""
delivery_daysinteger

Estimated transit time in business days.

示例:1
service_feenumber, (double)

ShipSaving service fee.

示例:0.05
ratenumber, (double)

Your discounted shipping rate.

示例:10.87
rebatenumber, (double)

Rebate amount credited back.

示例:0
from_namestring

Sender's name.

示例:"John Doe"
from_companystring

Sender's company.

示例:"ShipSaving, LLC"
from_phonestring

Sender's phone number.

示例:""
from_streetstring

Sender's street address.

示例:"1600 Amphitheatre Parkway"
from_street2string

Sender's secondary address line.

示例:""
from_citystring

Sender's city.

示例:"Mountain View"
from_statestring

Sender's state.

示例:"CA"
from_zipstring

Sender's ZIP code.

示例:"94043"
from_countrystring

Sender's country code.

示例:"US"
to_namestring

Recipient's name.

示例:"Jane Smith"
to_companystring

Recipient's company.

示例:""
to_phonestring

Recipient's phone number.

示例:""
to_streetstring

Recipient's street address.

示例:"350 Fifth Avenue"
to_street2string

Recipient's secondary address line.

示例:""
to_citystring

Recipient's city.

示例:"New York"
to_statestring

Recipient's state.

示例:"NY"
to_zipstring

Recipient's ZIP code.

示例:"10118"
to_countrystring

Recipient's country code.

示例:"US"
label_statusstring

Current label status.

示例:"completed"
warehouse_namestring

Warehouse name associated with the shipment.

示例:"WH"
store_namestring

Store name associated with the shipment.

示例:""
order_numberstring

Linked order number.

示例:""
providerstring

Account provider — shipsaving or user.

示例:"shipsaving"
carrierstring

Carrier name.

示例:"UPS"
servicestring

Service level used.

示例:"UPS_GROUND"
packagestring

Package type used.

示例:"PACKAGE"
published_ratenumber, (double)

Carrier's retail rate.

示例:34.53
label_urlArray of strings or null, (uri)

Label image URLs.

示例:
[ "https://example.com/labels/2025-06-30/label_0.png" ]
commercial_invoice_urlArray of strings or null, (uri)

Commercial invoice URLs for international shipments.

示例:null
]
Response
[ { "shipment_id": 1245627, "packing_slip_number": 109169, "master_tracking_code": "", "prefix_tracking_code": "", "tracking_code": "1ZY50G652000880500", "label_size": "4x6", "label_type": "png", "length": 12, "width": 12, "height": 7, "weight": 14.99, "insurance": 0, "insurance_fee": { … }, "signature": "NO_SIGNATURE", "custom_print1": "", "custom_print2": "", "delivery_days": 1, "service_fee": 0.05, "rate": 10.87, "rebate": 0, "from_name": "John Doe", "from_company": "ShipSaving, LLC", "from_phone": "", "from_street": "1600 Amphitheatre Parkway", "from_street2": "", "from_city": "Mountain View", "from_state": "CA", "from_zip": "94043", "from_country": "US", "to_name": "Jane Smith", "to_company": "", "to_phone": "", "to_street": "350 Fifth Avenue", "to_street2": "", "to_city": "New York", "to_state": "NY", "to_zip": "10118", "to_country": "US", "label_status": "completed", "warehouse_name": "WH", "store_name": "", "order_number": "", "provider": "shipsaving", "carrier": "UPS", "service": "UPS_GROUND", "package": "PACKAGE", "published_rate": 34.53, "label_url": [ … ], "commercial_invoice_url": null } ]