Carriers

A carrier resource represents one of the many postal carriers that MyParcel.com works with to provide you with a broad range of contracts. This endpoint can be used to get a list of the postal carriers we support that the client can access. Carriers are included as relationships of services, contracts and pickup dropoff locations.

Carrier

Attribute

Type

Description

name

string

Carrier name, useful for displaying to users.

code

string

Unique slugified version of the carrier name.

logo_url

string

Url pointing to the carrier’s logo.

credentials_format

object

The format of credentials for this carrier’s contracts described using JSON Schema.

label_formats

array

The label mime-type and size combinations this carrier offers for shipments.

collections

object

Information about the carrier’s collection services.

The collections attribute

The collections attribute is an object containing two properties:

Property

Type

Description

offers_collections

boolean

Indicates whether this carrier offers collections.

voids_registered_collections

boolean

Indicates whether the carrier supports voiding of registered collections.

allows_adding_registered_shipments_to_collection

boolean

Indicates whether the carrier supports adding registered shipments to a collection.

Endpoints

GET /carriers

Retrieving a list of carriers.

Scope

No scopes are required to retrieve carriers.

Request

GET /carriers HTTP/1.1
Accept: application/vnd.api+json
Example: https://api.sandbox.myparcel.com/carriers

Response

{
  "data": [
    {
      "type": "carriers",
      "id": "be7f6752-34e0-49a1-a832-bcc209450ea9",
      "attributes": {
        "name": "MyParcel.com",
        "code": "my-parcel-com",
        "logo_url": "https://cdn.myparcel.com/images/myparcelcom-black.svg",
        "credentials_format": {
          "additionalProperties": false,
          "required": [
            "api_user",
            "api_password"
          ],
          "properties": {
            "api_user": {
              "type": "string"
            },
            "api_password": {
              "type": "string"
            }
          }
        },
        "label_formats": [
          {
            "mime_type": "application/pdf",
            "size": "A6"
          }
        ],
        "collections": {
          "offers_collections": true,
          "voids_registered_collections": true,
          "allows_adding_registered_shipments_to_collection": true
        }
      },
      "links": {
        "self": "https://api.sandbox.myparcel.com/carriers/be7f6752-34e0-49a1-a832-bcc209450ea9"
      }
    }
  ],
  "meta": {
    "total_pages": 13,
    "total_records": 373
  },
  "links": {
    "self": "https://api.sandbox.myparcel.com/carriers?page[number]=3&page[size]=30",
    "first": "https://api.sandbox.myparcel.com/carriers?page[number]=1&page[size]=30",
    "prev": "https://api.sandbox.myparcel.com/carriers?page[number]=2&page[size]=30",
    "next": "https://api.sandbox.myparcel.com/carriers?page[number]=4&page[size]=30",
    "last": "https://api.sandbox.myparcel.com/carriers?page[number]=13&page[size]=30"
  }
}
GET /carriers/{carrier_id}

Retrieve a specific carrier.

Scope

No scopes are required to retrieve carriers.

Request

GET /carriers/{carrier_id} HTTP/1.1
Accept: application/vnd.api+json
Example: https://api.sandbox.myparcel.com/carriers/be7f6752-34e0-49a1-a832-bcc209450ea9

Response

{
  "data": {
    "type": "carriers",
    "id": "be7f6752-34e0-49a1-a832-bcc209450ea9",
    "attributes": {
      "name": "MyParcel.com",
      "code": "my-parcel-com",
      "logo_url": "https://cdn.myparcel.com/images/myparcelcom-black.svg",
      "credentials_format": {
        "additionalProperties": false,
        "required": [
          "api_user",
          "api_password"
        ],
        "properties": {
          "api_user": {
            "type": "string"
          },
          "api_password": {
            "type": "string"
          }
        }
      },
      "label_formats": [
        {
          "mime_type": "application/pdf",
          "size": "A6"
        }
      ],
      "collections": {
        "offers_collections": true,
        "voids_registered_collections": true,
        "allows_adding_registered_shipments_to_collection": true
      }
    },
    "links": {
      "self": "https://api.sandbox.myparcel.com/carriers/be7f6752-34e0-49a1-a832-bcc209450ea9"
    }
  }
}