Void
POST /api/customer/void-labels
Voids one or more labels. Accepts either the short-form packageId (e.g., P0001311322) or the full tracking number (e.g., 15255P0326260001311322).
warning
This action cannot be undone once processed.
- URL:
https://parcelconnect.apc-pli.com/api/customer/void-labels - Auth: HTTP Basic — see Authentication.
Request
- cURL
- Node.js
- Python
curl -X POST -H "Authorization: Basic {{basic_token}}" \
-H "Content-Type: application/json" \
-d '[
"15255P1029250000007738",
"P0123456789"
]' \
"https://parcelconnect.apc-pli.com/api/customer/void-labels"
// Requires Node.js 18+ (built-in fetch).
const auth = Buffer
.from(`${process.env.APC_ACCOUNT_NUMBER}:${process.env.APC_PASSCODE}`)
.toString("base64");
const ids = ["15255P1029250000007738", "P0123456789"];
const res = await fetch(
"https://parcelconnect.apc-pli.com/api/customer/void-labels",
{
method: "POST",
headers: {
Authorization: `Basic ${auth}`,
"Content-Type": "application/json",
},
body: JSON.stringify(ids),
}
);
const results = await res.json();
for (const r of results) {
console.log(r.packageId, r.success ? "voided" : "FAILED", r.message);
}
import os
import requests
ids = ["15255P1029250000007738", "P0123456789"]
resp = requests.post(
"https://parcelconnect.apc-pli.com/api/customer/void-labels",
auth=(os.environ["APC_ACCOUNT_NUMBER"], os.environ["APC_PASSCODE"]),
json=ids,
)
resp.raise_for_status()
for r in resp.json():
status = "voided" if r["success"] else "FAILED"
print(r["packageId"], status, r["message"])
Response
[
{ "success": true, "message": "Package voided successfully", "packageId": "P0000959990" },
{ "success": true, "message": "Package voided successfully", "packageId": "P0123456789" }
]