Update for everyone, found the "degenerate" service that's breaking everything: "Registered Mail COD Charge" is not assigned a code when returning through the API. So for example:
{
"totalBasePrice": 33.25,
"rates": [
{
"description": "Priority Mail Express Flat Rate Envelope",
"priceType": "RETAIL",
"price": 33.25,
"weight": 0.299999999999999988897769753748434595763683319091796875,
"dimWeight": 0,
"fees": [
],
"startDate": "2026-01-18",
"endDate": "",
"mailClass": "PRIORITY_MAIL_EXPRESS",
"zone": "05",
"productName": "Priority Mail Express Flat Rate Envelope",
"productDefinition": "1-2 day specific guaranteed delivery by 6:00pm local delivery time",
"processingCategory": "FLATS",
"rateIndicator": "E4",
"destinationEntryFacilityType": "NONE",
"SKU": "DEFE0XXXXR00700"
}
],
"extraServices": [
... snipped ...
{
"name": "Registered Mail COD Charge",
"priceType": "RETAIL",
"price": 9.0999999999999996447286321199499070644378662109375,
"warnings": [
],
"SKU": "DXGX0XCXXRX0000"
},
{
"extraService": "940",
"name": "Registered Mail",
"priceType": "RETAIL",
"price": 20.39999999999999857891452847979962825775146484375,
"warnings": [
],
"SKU": "DXGX0XXXXRX0100"
},
]
},
}
What's effectively happening is that for some reason, USPS API decided to return the Registered Mail COD Charge for certain services. I do not know why or how this is even applied. I'll look this up later this evening.
To squelch the error, for now, I suggest the post from njcyx:
njcyx:
My walkaround/temp fix for "extraService" warning.
At line 668, change from
$lookup[$name]['extraService'][$svc['extraService']] = $svc;
to
$lookup[$name]['extraService' ?? ""][$svc['extraService'] ?? ""] = $svc;
No further warning, at least for half a day...
That seems to work for now. I'll go ahead and try to come up with a better solution. My apologies to the ZenCart mod team who (this weekend) had to quickly go through four of my edits. (The last one, v1.8.2, was approved just recently.)