Bulk labels

What is bulk label purchasing?

In Shippo, bulk label purchasing is a tool for creating labels for multiple orders in a single batch. Purchasing labels in a batch helps your merchants save time and effort. Merchants can create up to 50 labels at a time.

The bulk flow enables the following.

  • Merchants see a list of their orders.
  • The UI prompts your merchant to complete required details that are missing.
  • Merchants can edit their shipment details in the UI for each order.
  • Merchants can print labels and packing slips with a single click.

The following shows an example of bulk label purchase flow in Elements.

Enable bulk in Elements

Bulk is available to all Elements users. To start a bulk label purchase flow, call labelPurchase and pass orderDetails as an array. Each element of the array contains the details for an individual order.

This example shows two orders added to Elements that starts the bulk label purchase flow.

Copy
Copied
<!doctype html>
<html class="no-js" lang="">
<head>
        <meta charset="utf-8">
        <title>Web Application</title>
</head>
<body>
    <button id="purchaseLabelButton">Purchase Label</button>
    <div id="shippoWidget"></div>
    <script src="https://js.goshippo.com/embeddable-client.js"></script>
    <script type="application/javascript">
      if (shippo) {
        shippo.init({
          token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
          org: 'john-doe-industries',
          locale: 'fr-CA',
          theme: {
            width: '100%',
          },
        });
      }
      document.getElementById('purchaseLabelButton').addEventListener('click', (event) => {
      	event.preventDefault();
        shippo.labelPurchase('#shippoWidget', {
          address_to: {
            name: 'William Faulkner',
            company: '',
            street1: '916 Old Taylor Rd',
            city: 'Oxford',
            state: 'MS',
            zip: '38655',
            country: 'US',
            phone: '662-234-3284',
            email: 'william@rowanoak.com',
          },
          line_items: [
            {
              title: 'hitchhikers guide to the galaxy',
              sku: 'TS-42',
              quantity: 1,
              currency: 'USD',
              unit_amount: '12',
              unit_weight: '0.40',
              weight_unit: 'lb',
              country_of_origin: 'US',
            }
          ],
          order_number: '12345'
        },
        {
          address_to: {
            name: 'John Daley',
            company: '',
            street1: '107 Wolf Pen Road',
            city: 'San Francisco',
            state: 'CA',
            zip: '394107',
            country: 'US',
            phone: '882-985-5421',
            email: 'john@ymail.com',
          },
          line_items: [
            {
              title: 'A brief history of time',
              sku: 'TS-662',
              quantity: 1,
              currency: 'USD',
              unit_amount: '12',
              unit_weight: '0.40',
              weight_unit: 'lb',
              country_of_origin: 'US',
            }
          ],
          order_number: '87667'
        }
        
        );
      }, false);
    </script>
</body>
</html>