Skip to Content

Errors

Error Format

Application errors return a consistent envelope:

{ "code": 404, "status": "error", "message": "Shipment not found!" }
FieldTypeDescription
codenumberMirrors the HTTP status code
statusstringAlways error
messagestringHuman readable explanation

Validation Errors

Requests that fail input validation return 422 in Laravel’s standard shape instead:

{ "message": "The given data was invalid.", "errors": { "ldv": ["The ldv field is required."] } }

Always send Accept: application/json. Without it the platform may answer validation and authentication failures with an HTML redirect instead of JSON.

Response Codes

CodeMeaningTypical cause
200OKRequest succeeded
201CreatedWebhook or subscription created
204No ContentThe shipment exists but has no tracking events yet
400Bad RequestThe shipment number is not 12 characters
401UnauthorizedMissing, malformed, expired or revoked access token
404Not FoundUnknown shipment, no webhook registered, or unknown subscription
409ConflictA webhook already exists, or subscriptions used without one
422Unprocessable EntityValidation failed
429Too Many RequestsThrottled
500Internal Server ErrorUnexpected platform error

Messages by Endpoint

EndpointCodemessage
GET /tracking/{ldv}400Shipment number not valid!
GET /tracking/{ldv}404Shipment not found!
GET /tracking/{ldv}204No content!
POST /webhook409A webhook already exists. Delete it before creating a new one.
GET / DELETE /webhook404No webhook registered.
*/webhook/subscriptions409No webhook registered. Create a webhook before managing subscriptions.
DELETE /webhook/subscriptions/{ldv}404Subscription not found.

Match on the HTTP status code, never on the message string — wording can change without notice.

Troubleshooting

SymptomCheck
Every request returns 401The header is exactly Bearer <token>; the token has not expired; you are hitting the right environment
Token request returns 401client_id / client_secret are correct and grant_type is client_credentials
Subscription calls return 409Register a webhook first with POST /webhook
Tracking returns 404 for a real shipmentThe shipment is older than the 90-day lookup window
Tracking returns 400The ldv is not exactly 12 characters — check for stray whitespace
No notifications arrivingGET /webhook — is is_active still true? Is failures_count climbing? Is the shipment actually subscribed?
Notifications arrive but signatures never matchYou are signing the re-serialised body instead of the raw one, or including X-Timestamp in the signed string (it is not part of it)

Still stuck? Contact supporto@spedisci.online with the ldv, the timestamp of the request and the response you received.

Last updated on