Skip to content

Purchase a Label

Overview

This guide will step you through the process of purchasing a label with the Veeqo API.

Prerequisites

To purchase a label you must have the following set up on your Veeqo account:

  • A valid order that is ready to ship. You can create/retrieve these on the /orders endpoint.
  • A payment method linked to your account. You must set this up in your Veeqo account settings.

Walk-through

We need to gather some required parameters before we can make our POST request to the /shipping/shipments endpoint. The table below shows you all the required parameters to purchase a label that need to be retrieved, and where they can be obtained from through the API. The other optional parameters that can be included are defined within the Rate Shopping API reference.

Parameter Endpoint
allocation_id /orders/(order_id)
remote_shipment_id /shipping/quotes/amazon_shipping_v2
service_type /shipping/quotes/amazon_shipping_v2
sub_carrier_id /shipping/quotes/amazon_shipping_v2
service_carrier /shipping/quotes/amazon_shipping_v2
total_net_charge /shipping/quotes/amazon_shipping_v2
base_rate /shipping/quotes/amazon_shipping_v2

Order Details

In order to find the allocation_id for the order we wish to buy a label for, we made the following request:

GET https://api.veeqo.com/orders/22334455

Response:

{
    "id": 22334455,
    "cancel_reason": null,
    "send_refund_email": null,
    "cancelled_at": null,
    "created_at": "2025-08-05T09:16:35.594Z",
    ...
    "allocations": [
        {
            "id": 55443322,
            "updated_at": "2025-08-05T09:16:36.802Z",
            "created_at": "2025-08-05T09:16:35.721Z",
            "total_weight": 0,
            "weight_unit": "oz",
            "allocated_by_id": 4444,
            "order_id": 22334455,
            ...
        }
    ],
    ...
}

From this response, we will save:

  • "id": 55443322, which will be used as allocation_id later.

Shipping Rates

After we have an allocation, we can get all the shipping rates for the allocation and choose which one we want to use. Rates that are available for use will be objects in the "available" parameter in the response.

We made the following request:

GET https://api.veeqo.com/shipping/quotes/amazon_shipping_v2?allocation_id=55443322&from_allocation_package=true

Response:

{
  "available": [
    {
      "carrier": "amazon_shipping_v2",
      "name": "amazon_shipping_v2-2295c3aa-af8c-48a0-9f19-cd84d53cbd36",
      "title": "UPS 3 Day Select®",
      "short_title": "UPS 3 Day Select®",
      "title_with_price": "UPS 3 Day Select® - $11.80",
      "total_net_charge": "11.80",
      "total_gross_charge": "11.80",
      "base_rate": "11.80",
      "charges": [
        {
          "price": "$11.80",
          "charge_id": "BASE_RATE",
          "charge_title": "Base Rate",
          "charge_type": "MANDATORY"
        },
        {
          "price": "$5.90",
          "charge_id": "SIGNATURE_CONFIRMATION",
          "charge_title": "Signature confirmation",
          "charge_type": "OPTIONAL"
        },
        {
          "price": "$7.10",
          "charge_id": "ADULT_SIGNATURE_CONFIRMATION",
          "charge_title": "Adult signature confirmation",
          "charge_type": "OPTIONAL"
        }
      ],
      "currency": "$",
      "weight": "1550.9999986993",
      "remote_shipment_id": "prb123abcde",
      "cutoff": "2025-06-10T22:00:00+01:00",
      "mailpiece_shapes": null,
      "liability_amount": null,
      "expected_delivery_days": 4,
      "sub_carrier_id": "UPS",
      "service_carrier": "ups",
      "shipping_service_options": [
        {
          "key": "value_added_service__VAS_GROUP_ID_CONFIRMATION",
          "label": "Confirmation",
          "type": "select"
        }
      ]
    }
  ]
}

From this response, we will save:

  • "remote_shipment_id": "prb123abcde", which will be used as remote_shipment_id later.
  • "name": "amazon_shipping_v2-2295c3aa-af8c-48a0-9f19-cd84d53cbd36", which will be used as service_type later.
  • "sub_carrier_id": "UPS", which will be used as sub_carrier_id later.
  • "service_carrier": "ups", which will be used as service_carrier later.
  • "total_net_charge": "11.80", which will be used as total_net_charge later.
  • "base_rate": "11.80", which will be used as base_rate later.

Since we are shipping with UPS, we will use the information from the shipments overview and use "5" as our "carrier_id".

Purchase Label

Finally, we can make our POST request in shipments to purchase the label on Veeqo:

POST https://api.veeqo.com/shipping/shipments

Payload:

{
  "carrier": "amazon_shipping_v2",
  "shipment": {
    "allocation_id": "55443322",
    "carrier_id": "5",
    "remote_shipment_id": "prb123abcde",
    "service_type": "amazon_shipping_v2-2295c3aa-af8c-48a0-9f19-cd84d53cbd36",
    "notify_customer": true,
    "creation_method": "single_ship_from_orders_list",
    "sub_carrier_id": "UPS",
    "service_carrier": "ups",
    "payment_method_id": null,
    "value_added_service__VAS_GROUP_ID_CONFIRMATION\"": "DELIVERY_CONFIRMATION",
    "liability_amount\"": "0.0",
    "try_inbound_label\"": false,
    "total_net_charge\"": "11.80",
    "base_rate\"": "11.80"
  }
}