# Buy Label

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

Endpoint: GET /api/rates/buy
Version: v1
Security: BearerAuth, ApiTokenAuth

## Query parameters:

  - `rate_id` (string, required)
    Rate identifier returned by the Get Rates endpoint.

## Response 200 fields (application/json):

  - `shipment_id` (integer)
    Internal shipment record ID.
    Example: 1245627

  - `packing_slip_number` (integer)
    Packing slip number for the shipment.
    Example: 109169

  - `master_tracking_code` (string)
    Master tracking number for multi-piece shipments.

  - `prefix_tracking_code` (string)
    Tracking number prefix (carrier-specific).

  - `tracking_code` (string)
    Primary tracking number.
    Example: 1ZY50G652000880500

  - `label_size` (string)
    Label dimensions.
    Example: 4x6

  - `label_type` (string)
    Label output format used.
    Example: png

  - `length` (number)
    Package length in inches.
    Example: 12

  - `width` (number)
    Package width in inches.
    Example: 12

  - `height` (number)
    Package height in inches.
    Example: 7

  - `weight` (number)
    Package weight in pounds.
    Example: 14.99

  - `insurance` (number)
    Declared insurance value.
    Example: 0

  - `insurance_fee` (object)
    Insurance fee with currency.

  - `insurance_fee.currency` (string)
    Example: USD

  - `insurance_fee.amount` (number)
    Example: 0

  - `signature` (string)
    Signature confirmation level applied.
    Example: NO_SIGNATURE

  - `custom_print1` (string)
    First line of custom label text.

  - `custom_print2` (string)
    Second line of custom label text.

  - `delivery_days` (integer)
    Estimated transit time in business days.
    Example: 1

  - `service_fee` (number)
    ShipSaving service fee.
    Example: 0.05

  - `rate` (number)
    Your discounted shipping rate.
    Example: 10.87

  - `rebate` (number)
    Rebate amount credited back.
    Example: 0

  - `from_name` (string)
    Sender's name.
    Example: John Doe

  - `from_company` (string)
    Sender's company.
    Example: ShipSaving, LLC

  - `from_phone` (string)
    Sender's phone number.

  - `from_street` (string)
    Sender's street address.
    Example: 1600 Amphitheatre Parkway

  - `from_street2` (string)
    Sender's secondary address line.

  - `from_city` (string)
    Sender's city.
    Example: Mountain View

  - `from_state` (string)
    Sender's state.
    Example: CA

  - `from_zip` (string)
    Sender's ZIP code.
    Example: 94043

  - `from_country` (string)
    Sender's country code.
    Example: US

  - `to_name` (string)
    Recipient's name.
    Example: Jane Smith

  - `to_company` (string)
    Recipient's company.

  - `to_phone` (string)
    Recipient's phone number.

  - `to_street` (string)
    Recipient's street address.
    Example: 350 Fifth Avenue

  - `to_street2` (string)
    Recipient's secondary address line.

  - `to_city` (string)
    Recipient's city.
    Example: New York

  - `to_state` (string)
    Recipient's state.
    Example: NY

  - `to_zip` (string)
    Recipient's ZIP code.
    Example: 10118

  - `to_country` (string)
    Recipient's country code.
    Example: US

  - `label_status` (string)
    Current label status.
    Example: completed

  - `warehouse_name` (string)
    Warehouse name associated with the shipment.
    Example: WH

  - `store_name` (string)
    Store name associated with the shipment.

  - `order_number` (string)
    Linked order number.

  - `provider` (string)
    Account provider — `shipsaving` or `user`.
    Example: shipsaving

  - `carrier` (string)
    Carrier name.
    Example: UPS

  - `service` (string)
    Service level used.
    Example: UPS_GROUND

  - `package` (string)
    Package type used.
    Example: PACKAGE

  - `published_rate` (number)
    Carrier's retail rate.
    Example: 34.53

  - `label_url` (array)
    Label image URLs.
    Example: ["https://example.com/labels/2025-06-30/label_0.png"]

  - `commercial_invoice_url` (array)
    Commercial invoice URLs for international shipments.
    Example: null

## Response 400 fields (application/json):

  - `message` (string)
    Human-readable error message.
    Example: Invalid request parameters.

## Response 403 fields (application/json):

  - `message` (string)
    Human-readable error message.
    Example: Invalid request parameters.

