Label
POST /api/system/packages/register
Creates a label and returns Base64 buffers for the requested format (ZPL/PDF/PNG).
- Staging:
https://parcelconnect-stage.apc-pli.com/api/system/packages/register - Production:
https://parcelconnect.apc-pli.com/api/system/packages/register
Authentication is sent in the request body — see the userID, accountNumber, and passcode fields below.
Request
- cURL
- Node.js
- Python
curl -X POST -H "Content-Type: application/json" \
-d '{
"userID": "{{userID}}",
"accountNumber": "{{accountNumber}}",
"passcode": "{{passcode}}",
"importerVATNumber": "",
"shipFromAttention": "",
"shipFromName": "APC",
"shipFromAddress1": "140 East Union Avenue",
"shipFromAddress2": "",
"shipFromCity": "East Rutherford",
"shipFromStateProv": "NJ",
"shipFromPostalCode": "07073",
"shipFromCountryISO2": "US",
"shipFromPhone": "(201) 372-9700",
"shipFromEmail": "apisupport@apc-pli.com",
"sender": "APC_NJ",
"company": "Destination Company",
"contact": "Destination Contact",
"address1": "123 Main St",
"address2": "",
"address3": "",
"city": "Toronto",
"stateProv": "ON",
"postalCode": "M5V 3L9",
"countryISO2": "CA",
"phone": "(201) 372-9700",
"email": "apisupport@apc-pli.com",
"taxCode": "",
"ref1": "",
"ref2": "",
"costCenter": "",
"exportReason": "",
"labelFormat": "ZPL",
"serviceCode": "APC.PRIPDC",
"shipDateTime": "01/01/2026",
"timeZone": "",
"parcelLength": 2,
"parcelWidth": 2,
"parcelHeight": 2,
"parcelWeight": 1,
"parcelContents": "M",
"commodityItems": [
{
"itemID": "123",
"itemDescription": "Shirt",
"itemQuantity": 1,
"itemWeight": 1,
"itemWeightUOM": "lb",
"itemValue": 9.95,
"itemTariffCode": "610910",
"itemCountryOfOriginISO2": "US"
}
]
}' \
"https://parcelconnect-stage.apc-pli.com/api/system/packages/register"
// Requires Node.js 18+ (built-in fetch).
const body = {
userID: process.env.APC_USER_ID,
accountNumber: process.env.APC_ACCOUNT_NUMBER,
passcode: process.env.APC_PASSCODE,
importerVATNumber: "",
shipFromAttention: "",
shipFromName: "APC",
shipFromAddress1: "140 East Union Avenue",
shipFromAddress2: "",
shipFromCity: "East Rutherford",
shipFromStateProv: "NJ",
shipFromPostalCode: "07073",
shipFromCountryISO2: "US",
shipFromPhone: "(201) 372-9700",
shipFromEmail: "apisupport@apc-pli.com",
sender: "APC_NJ",
company: "Destination Company",
contact: "Destination Contact",
address1: "123 Main St",
address2: "",
address3: "",
city: "Toronto",
stateProv: "ON",
postalCode: "M5V 3L9",
countryISO2: "CA",
phone: "(201) 372-9700",
email: "apisupport@apc-pli.com",
taxCode: "",
ref1: "",
ref2: "",
costCenter: "",
exportReason: "",
labelFormat: "ZPL",
serviceCode: "APC.PRIPDC",
shipDateTime: "01/01/2026",
timeZone: "",
parcelLength: 2,
parcelWidth: 2,
parcelHeight: 2,
parcelWeight: 1,
parcelContents: "M",
commodityItems: [
{
itemID: "123",
itemDescription: "Shirt",
itemQuantity: 1,
itemWeight: 1,
itemWeightUOM: "lb",
itemValue: 9.95,
itemTariffCode: "610910",
itemCountryOfOriginISO2: "US",
},
],
};
const res = await fetch(
"https://parcelconnect-stage.apc-pli.com/api/system/packages/register",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
}
);
const data = await res.json();
console.log(data.trackingNumber, data.packageId);
import os
import requests
body = {
"userID": os.environ["APC_USER_ID"],
"accountNumber": os.environ["APC_ACCOUNT_NUMBER"],
"passcode": os.environ["APC_PASSCODE"],
"importerVATNumber": "",
"shipFromAttention": "",
"shipFromName": "APC",
"shipFromAddress1": "140 East Union Avenue",
"shipFromAddress2": "",
"shipFromCity": "East Rutherford",
"shipFromStateProv": "NJ",
"shipFromPostalCode": "07073",
"shipFromCountryISO2": "US",
"shipFromPhone": "(201) 372-9700",
"shipFromEmail": "apisupport@apc-pli.com",
"sender": "APC_NJ",
"company": "Destination Company",
"contact": "Destination Contact",
"address1": "123 Main St",
"address2": "",
"address3": "",
"city": "Toronto",
"stateProv": "ON",
"postalCode": "M5V 3L9",
"countryISO2": "CA",
"phone": "(201) 372-9700",
"email": "apisupport@apc-pli.com",
"taxCode": "",
"ref1": "",
"ref2": "",
"costCenter": "",
"exportReason": "",
"labelFormat": "ZPL",
"serviceCode": "APC.PRIPDC",
"shipDateTime": "01/01/2026",
"timeZone": "",
"parcelLength": 2,
"parcelWidth": 2,
"parcelHeight": 2,
"parcelWeight": 1,
"parcelContents": "M",
"commodityItems": [
{
"itemID": "123",
"itemDescription": "Shirt",
"itemQuantity": 1,
"itemWeight": 1,
"itemWeightUOM": "lb",
"itemValue": 9.95,
"itemTariffCode": "610910",
"itemCountryOfOriginISO2": "US",
}
],
}
resp = requests.post(
"https://parcelconnect-stage.apc-pli.com/api/system/packages/register",
json=body,
)
resp.raise_for_status()
data = resp.json()
print(data["trackingNumber"], data["packageId"])
Response
{
"errorCode": 0,
"errorMessage": null,
"trackingNumber": "12345P01234567890",
"packageId": "P0123456789",
"labelBuf1": "<base64 ZPL/PDF/PNG buffer>",
"labelBuf2": null,
"labelBuf3": null
}
Request body parameters
All fields are case-sensitive.
| Field | Type | Description | Max length / Example |
|---|---|---|---|
userID | string | Authorization data | — |
accountNumber | string | Authorization data | — |
passcode | string | Authorization data | — |
importerVATNumber | string | Importer VAT number | 50 |
shipFromAttention | string | Ship-from attention line | 50 |
shipFromName | string | Sender company or facility name | 50 |
shipFromAddress1 | string | Sender address line 1 | 50 |
shipFromAddress2 | string | Sender address line 2 | 50 |
shipFromCity | string | City of origin | 50 |
shipFromStateProv | string | State or province code | 10 |
shipFromPostalCode | string | Postal or ZIP code | 10 |
shipFromCountryISO2 | string | 2-character country ISO code | 2 (e.g., US) |
shipFromPhone | string | Sender phone number | 25 |
shipFromEmail | string | Sender email address | 50 |
sender | string | Warehouse facility (APC_NJ, APC_IL, APC_CA) | — |
company | string | Destination company name | 50 |
contact | string | Recipient contact name | 50 |
address1 | string | Destination address line 1 | 50 |
address2 | string | Destination address line 2 | 50 |
address3 | string | Destination address line 3 | 50 |
city | string | Destination city | 50 |
stateProv | string | Destination state/province code | 50 |
postalCode | string | Destination postal code | 10 |
countryISO2 | string | Destination country code | 2 (e.g., CA) |
phone | string | Destination phone number | 20 |
email | string | Destination email address | 100 |
taxCode | string | Recipient VAT / tax number | 50 |
ref1 | string | Custom reference value 1 (echoed back in tracking responses) | 50 |
ref2 | string | Custom reference value 2 (echoed back in tracking responses) | 50 |
costCenter | string | Cost center to charge the shipment to (e.g., shipping) | 100 |
exportReason | string | Reason for export (e.g., Gift, Samples) | 50 |
labelFormat | string | Label format to return | ZPL, PDF, PNG |
serviceCode | string | Service identifier (e.g., APC.PRIPDC). The full list of services available to your account can be retrieved from the Services endpoint. | 20 |
shipDateTime | string | Ship date, format MM/DD/YYYY. Optional. | Example: 01/01/2026 |
timeZone | string | Sender timezone. Free-form text; not validated. | Max length 50 |
parcelLength | decimal | Longest parcel dimension in inches. Optional. | Example: 10 or 10.00 |
parcelWidth | decimal | Second longest dimension in inches. Optional. | Example: 8 or 8.50 |
parcelHeight | decimal | Shortest dimension in inches. Optional. | Example: 6 or 6.25 |
parcelWeight | decimal | Total weight in pounds. Required. | Example: 2 or 2.25 |
parcelContents | string | Item category. M (Merchandise) is the typical default. | M = MerchandiseG = GiftD = DocumentsZ = Hazardous MaterialsS = Commercial SampleH = Humanitarian DonationO = Other |
commodityItems | array | Line items with tariff and value details. At least one item is currently required for all shipments. | — |
commodityItems.itemID | string | Internal item identifier | 50 |
commodityItems.itemDescription | string | Plain-text item description | 100 |
commodityItems.itemQuantity | integer | Item quantity | 5 |
commodityItems.itemWeight | decimal | Item weight | — |
commodityItems.itemWeightUOM | string | Weight unit of measure | lb, kg |
commodityItems.itemValue | decimal | Declared value per item | — |
commodityItems.itemTariffCode | string | HS code for customs | 13 |
commodityItems.itemCountryOfOriginISO2 | string | Country of manufacture | 2 |