Responses

What the MyParcel API returns: JSON by default, PDF and CSV for labels and exports, the response envelope and the HTTP status codes you can expect.

Overview

Most endpoints return JSON. There are a few exceptions:

  • Labels and invoices come back as PDF.
  • Some exports come back as CSV.
  • A DELETE returns 204 No Content with no body.
  • Long-running work (such as creating shipments or a CSV export) may return 202 Accepted while it is processed.

The response envelope

Successful JSON responses wrap the result in a top-level data object, keyed by the resource:

{
  "data": {
    "shipments": [
      { "id": 100000001 }
    ]
  }
}

The exact fields per resource are documented in the API reference — treat that as the source of truth rather than copying shapes by hand.

HTTP status codes

CodeMeaning
200 OKSuccessful request with a response body.
202 AcceptedAccepted for asynchronous processing (e.g. shipments, CSV).
204 No ContentSuccess with no body — typically after a DELETE.
304 Not ModifiedThe resource hasn't changed since your cached copy.
400 Bad RequestThe request is malformed.
401 UnauthorizedMissing or incorrect API key. See Authentication.
402 Payment RequiredPayment is needed; the response may include an invoice.
403 ForbiddenYour key isn't authorised for this action.
404 Not FoundThe resource doesn't exist.
405 Method Not AllowedThat HTTP method isn't supported on this endpoint.
406 Not AcceptableThe requested response format isn't supported.
409 ConflictThe request conflicts with the current state of the resource.
415 Unsupported Media TypeThe Content-Type isn't supported.
422 Unprocessable EntityThe data is valid JSON but fails validation.
5xxA problem on the MyParcel side — retry later.

Errors

A 4xx response carries an error body with a human-readable message and one or more error codes. Use those codes to handle failures programmatically rather than parsing the message text.

Reading error codes

The full, readable catalogue of error codes lives in the Errors guide. Until then, each endpoint's error responses are listed in the API reference.