Label Proxy

Generate shipping labels without exposing customer addresses to your WMS

Label Proxy

The Label Proxy is Data Border's most powerful feature. It lets your WMS generate shipping labels from any supported carrier without ever seeing customer PII.

How It Works

Instead of fetching customer addresses and building carrier requests yourself, you send requests with placeholders. Data Border handles the rest:

sequenceDiagram
    participant WMS
    participant ADB
    participant Amazon as Amazon SP-API
    participant Carrier as Carrier API
    participant Scrubber as Scrubber Service
    participant S3 as S3 Storage

    WMS->>ADB: POST /api/label-proxy/forward<br/>with {{placeholders}}
    ADB->>ADB: Validate carrier whitelist
    ADB->>Amazon: Fetch customer PII
    Amazon->>ADB: Return address data
    ADB->>ADB: Replace placeholders with PII
    ADB->>Carrier: POST request with real addresses
    Carrier->>ADB: Return label + tracking
    ADB->>Scrubber: Scrub PII from response
    Scrubber->>S3: Store original label
    Scrubber->>ADB: Return scrubbed response
    ADB->>WMS: Scrubbed response + document UUIDs

Your WMS receives:

  • Tracking numbers and carrier references
  • Shipment IDs for printing later
  • Document UUIDs for each label
  • Scrubbed response with no customer PII

Available Placeholders

Use these placeholders in your carrier request body:

PlaceholderDescriptionExample Value
{{ship_to_name}}Recipient full nameJohn Doe
{{ship_to_address1}}Address line 1123 Main Street
{{ship_to_address2}}Address line 2Apt 4B
{{ship_to_address3}}Address line 3Building C
{{ship_to_city}}CitySan Francisco
{{ship_to_state}}State or regionCA
{{ship_to_zip}}Postal code94102
{{ship_to_country}}Country codeUS
{{ship_to_phone}}Phone number+1-555-123-4567
{{buyer_name}}Buyer name (may differ from ship-to)Jane Smith
{{buyer_email}}Buyer emailjane@example.com

Supported Carriers

Data Border validates that requests only go to whitelisted carrier origins:

CarrierAllowed Origins
EasyPosthttps://api.easypost.com
ShipStationhttps://ssapi.shipstation.com
Shippohttps://api.goshippo.com
UPShttps://onlinetools.ups.com, https://wwwcie.ups.com
FedExhttps://apis.fedex.com, https://apis-sandbox.fedex.com
USPShttps://secure.shippingapis.com
DHLhttps://express.api.dhl.com, https://api-sandbox.dhl.com

Making a Request

Required Headers

HeaderDescription
x-seller-access-tokenYour seller access token
x-amazon-token-secretSecret for decrypting Amazon tokens
x-original-urlFull URL of the carrier endpoint
x-amazon-order-idAmazon order ID to fetch PII from
x-unique-shipment-idYour unique identifier for this shipment

Optional Headers

HeaderDescription
authorizationForwarded to carrier for authentication
x-api-keyForwarded to carrier for authentication

Example: EasyPost Shipment

curl -X POST https://adb.example.com/api/label-proxy/forward \
  -H "Content-Type: application/json" \
  -H "x-seller-access-token: YOUR_SELLER_TOKEN" \
  -H "x-amazon-token-secret: YOUR_TOKEN_SECRET" \
  -H "x-original-url: https://api.easypost.com/v2/shipments" \
  -H "x-amazon-order-id: 123-4567890-1234567" \
  -H "x-unique-shipment-id: WMS-SHIP-2024-001" \
  -H "Authorization: Bearer EASYPOST_API_KEY" \
  -d '{
    "shipment": {
      "to_address": {
        "name": "{{ship_to_name}}",
        "street1": "{{ship_to_address1}}",
        "street2": "{{ship_to_address2}}",
        "city": "{{ship_to_city}}",
        "state": "{{ship_to_state}}",
        "zip": "{{ship_to_zip}}",
        "country": "{{ship_to_country}}",
        "phone": "{{ship_to_phone}}"
      },
      "from_address": {
        "name": "ACME Warehouse",
        "street1": "456 Shipping Lane",
        "city": "Chicago",
        "state": "IL",
        "zip": "60601",
        "country": "US"
      },
      "parcel": {
        "length": 10,
        "width": 8,
        "height": 4,
        "weight": 16
      }
    }
  }'

Response

{
  "success": true,
  "data": {
    "scrubbed_response": {
      "id": "shp_abc123",
      "tracking_code": "1Z999AA10123456784",
      "to_address": {
        "name": "[REDACTED]",
        "street1": "[REDACTED]",
        "city": "[REDACTED]",
        "state": "CA",
        "zip": "941**",
        "country": "US"
      },
      "postage_label": {
        "label_url": "[REDACTED - use print API]"
      }
    },
    "shipment_id": "ship_def456ghi789",
    "amazon_order_id": "123-4567890-1234567",
    "unique_shipment_id": "WMS-SHIP-2024-001",
    "documents": [
      {
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "path": "label.pdf"
      }
    ]
  }
}

Notice:

  • Customer PII is [REDACTED] in the response
  • State is preserved (often needed for routing)
  • Partial ZIP is preserved (for carrier reference)
  • Label URL is redacted—use the Print API instead
  • documents array contains UUIDs for printing

Printing Labels

After generating a label, use the Print API to send it to a printer:

curl -X POST https://adb.example.com/api/print/send \
  -H "Content-Type: application/json" \
  -H "x-seller-access-token: YOUR_SELLER_TOKEN" \
  -H "x-amazon-token-secret: YOUR_TOKEN_SECRET" \
  -d '{
    "shipment_id": "ship_def456ghi789",
    "printer_type": "label",
    "printer_id": "warehouse-zebra-1",
    "label_uuids": ["550e8400-e29b-41d4-a716-446655440000"]
  }'

Error Handling

Invalid Placeholders

{
  "is_adb_error": true,
  "success": false,
  "error": {
    "message": "Invalid placeholders in request body",
    "details": "Unknown placeholders: {{invalid_field}}"
  }
}

Carrier Not Whitelisted

{
  "is_adb_error": true,
  "success": false,
  "error": {
    "message": "Carrier origin not in whitelist",
    "details": "The origin of https://malicious.com/api is not a whitelisted carrier API"
  }
}

Missing Headers

{
  "is_adb_error": true,
  "success": false,
  "error": {
    "message": "Missing required header: x-amazon-order-id"
  }
}

Best Practices

Use Unique Shipment IDs

Always provide a unique x-unique-shipment-id that you can reference later:

  • Use your WMS's internal shipment ID
  • Include timestamp or sequence for uniqueness
  • Store the mapping between your ID and Data Border's shipment_id

Handle Carrier Errors Gracefully

If the carrier returns an error, Data Border forwards it in the response. Check for carrier-specific error formats:

{
  "success": true,
  "data": {
    "scrubbed_response": {
      "error": {
        "code": "ADDRESS.VERIFICATION.FAILURE",
        "message": "Unable to verify address"
      }
    }
  }
}

Store Document UUIDs

Save the documents array from the response. You'll need the UUIDs to:

  • Print labels later
  • Reprint labels if needed
  • Track which documents belong to which shipment

Next Steps

Secure Printing

Send labels directly to printers via Device Hub.

API Reference

Complete Label Proxy API documentation.