Carriers


Carrier Resource Model

Properties

  • Name
    id
    Type
    string,null
    Restrictions
    Description
  • Name
    name
    Type
    string,null
    Restrictions
    Description
  • Name
    handle
    Type
    string,null
    Restrictions
    Description
  • Name
    description
    Type
    string,null
    Restrictions
    Description

    If available, a description for the carrier resource.

{
  "id": "car_2iBgUOHPuWh0Hvjc81euqKXTW5N",
  "name": "UPS",
  "handle": "ups",
  "description": "United Parcel Service"
}

Carrier Model

Properties

  • Name
    id
    Type
    string
    Restrictions
    Description

    A unique ID for the carrier. This is not the same as the carrier account identifier.

  • Name
    name
    Type
    string
    Restrictions
    Description

    The name of the carrier.

  • Name
    handle
    Type
    string
    Restrictions
    Description

    The handle for the carrier, used when referencing the carrier in other endpoints & operations.

  • Name
    services
    Type
    array,null
    Restrictions
    Description

    An array of the available services for the carrier.

  • Name
    predefined_packages
    Type
    array,null
    Restrictions
    Description

    For carriers where predefined package sizes are used for shipments, this is an array of all available packages.

  • Name
    account_fields
    Type
    array,null
    Restrictions
    Description

    When creating a carrier account, this contains the metadata on which account fields are available and required when creating an account for the carrier.

  • Name
    accounts
    Type
    array,null
    Restrictions
    Description

    An array of accounts that have been setup for the carrier.

{
  "id": "string",
  "name": "string",
  "handle": "string",
  "services": [
    null
  ],
  "predefined_packages": [
    {
      "id": "pkg_2iHViqpO8v81j2e1nrpWkRuVfmo",
      "name": "Tube",
      "handle": "tube",
      "description": "Triangular tube for rolled papers"
    }
  ],
  "account_fields": [
    {
      "name": "FedEx Cross Border Origin Hub",
      "key": "origin_hub",
      "type": "option",
      "optional": false,
      "option_values": [
        "Fontana"
      ]
    }
  ],
  "accounts": [
    {
      "id": "string",
      "name": "UPS Main Account",
      "description": "The main account for shipping all non-hazmat packages.",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ]
}

Carrier Package Model

Properties

  • Name
    id
    Type
    string
    Restrictions
    Description

    A unique ID for the predefined package.

  • Name
    name
    Type
    string
    Restrictions
    Description

    The display name of the predefined package

  • Name
    handle
    Type
    string
    Restrictions
    Description

    A handle for the predefined package, referenced by other endpoints.

  • Name
    description
    Type
    string,null
    Restrictions
    Description

    A description for the predefined package if present.

{
  "id": "pkg_2iHViqpO8v81j2e1nrpWkRuVfmo",
  "name": "Tube",
  "handle": "tube",
  "description": "Triangular tube for rolled papers"
}

Carrier Account Model

Properties

  • Name
    id
    Type
    string
    Restrictions
    Description

    A unique ID for the carrier account.

  • Name
    name
    Type
    string,null
    Restrictions
    Description

    A name for the carrier account.

  • Name
    description
    Type
    string,null
    Restrictions
    Description

    A description for the carrier account.

  • Name
    created_at
    Type
    string,null(date-time)
    Description
  • Name
    updated_at
    Type
    string,null(date-time)
    Description
{
  "id": "string",
  "name": "UPS Main Account",
  "description": "The main account for shipping all non-hazmat packages.",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Carrier Account Field Model

Properties

  • Name
    name
    Type
    string
    Restrictions
    Description

    The human readable name for the parameter.

  • Name
    key
    Type
    string
    Restrictions
    Description

    The key that should be sent in the request to ppopulate this parameter.

  • Name
    type
    Type
    string
    Restrictions
    Description

    The data type of the parameter.

    Possible Enum Values

    text
    text-readonly
    text-masked
    option
    boolean
    hidden
    password
  • Name
    optional
    Type
    boolean,null
    Restrictions
    Description

    Whether the parameter is optional or not.

  • Name
    option_values
    Type
    array,null
    Restrictions
    Description

    In the event of the type being option, the list of possible values for the option.

{
  "name": "FedEx Cross Border Origin Hub",
  "key": "origin_hub",
  "type": "option",
  "optional": false,
  "option_values": [
    "Fontana"
  ]
}

GET/carriers

List Carriers

Retrieves all carriers available to the organisation.

Query Parameters

  • Name
    handle
    Type
    string
    Restrictions
    Description

    A handle for a carrier that can be used to return only the specified carrier.

  • Name
    include_fields
    Type
    array[string]
    Restrictions
    Description

    A comma-separated list of fields to return in each object.

Enumerated Values

ParameterValue
include_fieldsservices
include_fieldspredefined_packages
include_fieldsaccount_fields
include_fieldsaccounts

Request

GET
/carriers
curl --request GET \
--url https://api.envoy.one/carriers \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'

Response

{
  "data": {
    "id": "string",
    "name": "string",
    "handle": "string",
    "services": [
      null
    ],
    "predefined_packages": [
      {
        "id": "pkg_2iHViqpO8v81j2e1nrpWkRuVfmo",
        "name": "Tube",
        "handle": "tube",
        "description": "Triangular tube for rolled papers"
      }
    ],
    "account_fields": [
      {
        "name": "FedEx Cross Border Origin Hub",
        "key": "origin_hub",
        "type": "option",
        "optional": false,
        "option_values": [
          "Fontana"
        ]
      }
    ],
    "accounts": [
      {
        "id": "string",
        "name": "UPS Main Account",
        "description": "The main account for shipping all non-hazmat packages.",
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z"
      }
    ]
  },
  "next_cursor": "WyIyMDIzLTAzLTIxVDAwOjM1OjU5LjczMDYyMVoiXQ==",
  "previous_cursor": "WyIyMDIzLTAzLTE5VDA0OjI4OjAxLjQ4NDg5WiJd",
  "limit": 20
}

undefined


GET/carriers/{handle}

Get Carrier Details

Retrieves the details for a specific carrier by the handle. All fields are populated.

Path Parameters

  • Name
    handle
    Type
    string
    Restrictions
    Description

    The handle for the carrier to retrieve details for.

Request

GET
/carriers/{handle}
curl --request GET \
--url https://api.envoy.one/carriers/string \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'

Response

{
  "id": "string",
  "name": "string",
  "handle": "string",
  "services": [
    null
  ],
  "predefined_packages": [
    {
      "id": "pkg_2iHViqpO8v81j2e1nrpWkRuVfmo",
      "name": "Tube",
      "handle": "tube",
      "description": "Triangular tube for rolled papers"
    }
  ],
  "account_fields": [
    {
      "name": "FedEx Cross Border Origin Hub",
      "key": "origin_hub",
      "type": "option",
      "optional": false,
      "option_values": [
        "Fontana"
      ]
    }
  ],
  "accounts": [
    {
      "id": "string",
      "name": "UPS Main Account",
      "description": "The main account for shipping all non-hazmat packages.",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ]
}

undefined


POST/carrier_accounts

Create Carrier Account

Creates an account for a specified carrier.

Request

POST
/carrier_accounts
curl --request POST \
--url https://api.envoy.one/carrier_accounts \
--header 'Authorization: Bearer {access-token}'

undefined


GET/carrier_accounts

List Carrier Accounts

List all carrier accounts associated with the organisation.

Request

GET
/carrier_accounts
curl --request GET \
--url https://api.envoy.one/carrier_accounts \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'

Response

{
  "data": [
    {
      "id": "string",
      "name": "UPS Main Account",
      "description": "The main account for shipping all non-hazmat packages.",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ]
}

undefined