Update
PATCH /api/customer/packages/update
Updates a package record using its packageId (the short P-prefixed identifier returned when the label was created, e.g., P0001311322). Supports modifying key shipment fields such as reference data, recipient address, and declared values.
- URL:
https://parcelconnect.apc-pli.com/api/customer/packages/update - Auth: HTTP Basic — see Authentication.
note
This endpoint requires the short-form packageId (e.g., P0001311322), not the full tracking number.
The request body is a JSON array of update objects. Each object must include packageId; every other field is optional and is applied only when present. Fields you can update:
| Group | Fields |
|---|---|
| Recipient address | company, contact, address1, address2, address3, city, stateProv, postalCode, countryISO2, phone, email |
| Ship-from address | shipFromAttention, shipFromName, shipFromAddress1, shipFromAddress2, shipFromCity, shipFromStateProv, shipFromPostalCode, shipFromCountryISO2, shipFromPhone, shipFromEmail |
| References & misc | ref1, ref2, exportReason, serviceCode, shipDateTime, timeZone, parcelContents, labelFormat, importerVATNumber |
| Parcel | parcelWeight, parcelHeight, parcelLength, parcelWidth |
| Commodity items | commodityItems[] (declared values, descriptions, tariff codes, etc.) |
See the Label reference for the meaning and format of each field.
note
- A maximum of 20 packages may be updated per request.
serviceCodemay only be changed to another APC service (a code beginning withAPC).shipDateTimemust use the formatMM/DD/YYYY.
Request
- cURL
- Node.js
- Python
curl -X PATCH -H "Authorization: Basic {{basic_token}}" \
-H "Content-Type: application/json" \
-d '[
{
"packageId": "P0123456789",
"company": "",
"contact": "John Smith",
"address1": "123 Main St",
"address2": "",
"address3": "",
"city": "Toronto",
"stateProv": "ON",
"postalCode": "M5V 3L9",
"countryISO2": "CA",
"phone": "(201) 372-9700",
"email": "apisupport@apc-pli.com",
"ref1": "Order#1002",
"ref2": "",
"exportReason": "",
"serviceCode": "APC.PRIPDC",
"shipDateTime": "01/01/2026",
"timeZone": "",
"parcelContents": "M",
"labelFormat": "ZPL",
"importerVATNumber": "",
"parcelWeight": 1,
"parcelHeight": 2,
"parcelLength": 2,
"parcelWidth": 2,
"commodityItems": [
{
"itemID": "123",
"itemDescription": "Shirt",
"itemQuantity": 1,
"itemWeight": 1,
"itemWeightUOM": "lb",
"itemValue": 9.95,
"itemTariffCode": "610910",
"itemCountryOfOriginISO2": "US"
}
]
}
]' \
"https://parcelconnect.apc-pli.com/api/customer/packages/update"
// Requires Node.js 18+ (built-in fetch).
const auth = Buffer
.from(`${process.env.APC_ACCOUNT_NUMBER}:${process.env.APC_PASSCODE}`)
.toString("base64");
const updates = [
{
packageId: "P0123456789",
company: "",
contact: "John Smith",
address1: "123 Main St",
address2: "",
address3: "",
city: "Toronto",
stateProv: "ON",
postalCode: "M5V 3L9",
countryISO2: "CA",
phone: "(201) 372-9700",
email: "apisupport@apc-pli.com",
ref1: "Order#1002",
ref2: "",
exportReason: "",
serviceCode: "APC.PRIPDC",
shipDateTime: "01/01/2026",
timeZone: "",
parcelContents: "M",
labelFormat: "ZPL",
importerVATNumber: "",
parcelWeight: 1,
parcelHeight: 2,
parcelLength: 2,
parcelWidth: 2,
commodityItems: [
{
itemID: "123",
itemDescription: "Shirt",
itemQuantity: 1,
itemWeight: 1,
itemWeightUOM: "lb",
itemValue: 9.95,
itemTariffCode: "610910",
itemCountryOfOriginISO2: "US",
},
],
},
];
const res = await fetch(
"https://parcelconnect.apc-pli.com/api/customer/packages/update",
{
method: "PATCH",
headers: {
Authorization: `Basic ${auth}`,
"Content-Type": "application/json",
},
body: JSON.stringify(updates),
}
);
const data = await res.json();
console.log(data.successfulUpdates, "of", data.totalPackages, "updated");
import os
import requests
updates = [
{
"packageId": "P0123456789",
"company": "",
"contact": "John Smith",
"address1": "123 Main St",
"address2": "",
"address3": "",
"city": "Toronto",
"stateProv": "ON",
"postalCode": "M5V 3L9",
"countryISO2": "CA",
"phone": "(201) 372-9700",
"email": "apisupport@apc-pli.com",
"ref1": "Order#1002",
"ref2": "",
"exportReason": "",
"serviceCode": "APC.PRIPDC",
"shipDateTime": "01/01/2026",
"timeZone": "",
"parcelContents": "M",
"labelFormat": "ZPL",
"importerVATNumber": "",
"parcelWeight": 1,
"parcelHeight": 2,
"parcelLength": 2,
"parcelWidth": 2,
"commodityItems": [
{
"itemID": "123",
"itemDescription": "Shirt",
"itemQuantity": 1,
"itemWeight": 1,
"itemWeightUOM": "lb",
"itemValue": 9.95,
"itemTariffCode": "610910",
"itemCountryOfOriginISO2": "US",
}
],
}
]
resp = requests.patch(
"https://parcelconnect.apc-pli.com/api/customer/packages/update",
auth=(os.environ["APC_ACCOUNT_NUMBER"], os.environ["APC_PASSCODE"]),
json=updates,
)
resp.raise_for_status()
data = resp.json()
print(f"{data['successfulUpdates']} of {data['totalPackages']} updated")
Response
{
"totalPackages": 1,
"successfulUpdates": 1,
"failedUpdates": 0,
"results": [
{ "success": true, "packageId": "P0123456789", "message": "Package updated successfully" }
]
}