Skip to content

Latest commit

 

History

History
802 lines (795 loc) · 23.5 KB

list-carriers.md

File metadata and controls

802 lines (795 loc) · 23.5 KB

List Carrier Accounts

ShipEngine allows you to connect your own carrier accounts through the ShipEngine dashboard. You can list all the carrier accounts you have connected with the listCarriers method. To learn more about carrier accounts please see our docs.

Output

The listCarriers method returns an array of connected carriers. If you are using TypeScript, you can import the ListCarriersTypes.Result type into your project to take advantage of your IDE's code completion functionality.

Example

const ShipEngine = require("shipengine");
const shipengine = new ShipEngine("api_key");

async function listCarriers() {
  try {
    const result = await shipengine.listCarriers();

    console.log("The list of carriers:");
    console.log(result);
  } catch (e) {
    console.log("Error listing carriers: ", e.message);
  }
}

listCarriers();

Example Output

Array of carrier accounts

[
  {
    carrierId: "se-423887",
    carrierCode: "stamps_com",
    accountNumber: "test_account_423887",
    requiresFundedAmount: true,
    balance: 8193.28,
    nickname: "ShipEngine Test Account - Stamps.com",
    friendlyName: "Stamps.com",
    primary: false,
    hasMultiPackageSupportingServices: false,
    supportsLabelMessages: true,
    services: [
      {
        carrierId: "se-423887",
        carrierCode: "stamps_com",
        serviceCode: "usps_first_class_mail",
        name: "USPS First Class Mail",
        domestic: true,
        international: false,
        isMultiPackageSupported: false,
      },
      {
        carrierId: "se-423887",
        carrierCode: "stamps_com",
        serviceCode: "usps_media_mail",
        name: "USPS Media Mail",
        domestic: true,
        international: false,
        isMultiPackageSupported: false,
      },
      {
        carrierId: "se-423887",
        carrierCode: "stamps_com",
        serviceCode: "usps_parcel_select",
        name: "USPS Parcel Select Ground",
        domestic: true,
        international: false,
        isMultiPackageSupported: false,
      },
      {
        carrierId: "se-423887",
        carrierCode: "stamps_com",
        serviceCode: "usps_priority_mail",
        name: "USPS Priority Mail",
        domestic: true,
        international: false,
        isMultiPackageSupported: false,
      },
      {
        carrierId: "se-423887",
        carrierCode: "stamps_com",
        serviceCode: "usps_priority_mail_express",
        name: "USPS Priority Mail Express",
        domestic: true,
        international: false,
        isMultiPackageSupported: false,
      },
      {
        carrierId: "se-423887",
        carrierCode: "stamps_com",
        serviceCode: "usps_first_class_mail_international",
        name: "USPS First Class Mail Intl",
        domestic: false,
        international: true,
        isMultiPackageSupported: false,
      },
      {
        carrierId: "se-423887",
        carrierCode: "stamps_com",
        serviceCode: "usps_priority_mail_international",
        name: "USPS Priority Mail Intl",
        domestic: false,
        international: true,
        isMultiPackageSupported: false,
      },
      {
        carrierId: "se-423887",
        carrierCode: "stamps_com",
        serviceCode: "usps_priority_mail_express_international",
        name: "USPS Priority Mail Express Intl",
        domestic: false,
        international: true,
        isMultiPackageSupported: false,
      },
    ],
    packages: [
      {
        packageId: null,
        packageCode: "cubic",
        name: "Cubic",
        description: "Cubic",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "flat_rate_envelope",
        name: "Flat Rate Envelope",
        description:
          'USPS flat rate envelope. A special cardboard envelope provided by the USPS that clearly indicates "Flat Rate".',
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "flat_rate_legal_envelope",
        name: "Flat Rate Legal Envelope",
        description: "Flat Rate Legal Envelope",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "flat_rate_padded_envelope",
        name: "Flat Rate Padded Envelope",
        description: "Flat Rate Padded Envelope",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "large_envelope_or_flat",
        name: "Large Envelope or Flat",
        description:
          'Large envelope or flat. Has one dimension that is between 11 1/2" and 15" long, 6 1/18" and 12" high, or 1/4" and 3/4" thick.',
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "large_flat_rate_box",
        name: "Large Flat Rate Box",
        description: "Large Flat Rate Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "large_package",
        name: 'Large Package (any side > 12")',
        description:
          'Large package. Longest side plus the distance around the thickest part is over 84" and less than or equal to 108".',
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "letter",
        name: "Letter",
        description: "Letter",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "medium_flat_rate_box",
        name: "Medium Flat Rate Box",
        description:
          'USPS flat rate box. A special 11" x 8 1/2" x 5 1/2" or 14" x 3.5" x 12" USPS box that clearly indicates "Flat Rate Box"',
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "non_rectangular",
        name: "Non Rectangular Package",
        description:
          "Non-Rectangular package type that is cylindrical in shape.",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "package",
        name: "Package",
        description:
          'Package. Longest side plus the distance around the thickest part is less than or equal to 84"',
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "regional_rate_box_a",
        name: "Regional Rate Box A",
        description: "Regional Rate Box A",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "regional_rate_box_b",
        name: "Regional Rate Box B",
        description: "Regional Rate Box B",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "small_flat_rate_box",
        name: "Small Flat Rate Box",
        description: "Small Flat Rate Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "thick_envelope",
        name: "Thick Envelope",
        description:
          'Thick envelope. Envelopes or flats greater than 3/4" at the thickest point.',
        dimensions: null,
      },
    ],
    options: [
      { name: "non_machinable", defaultValue: "false", description: null },
      {
        name: "bill_to_account",
        defaultValue: null,
        description: "Bill To Account",
      },
      {
        name: "bill_to_party",
        defaultValue: null,
        description: "Bill To Party",
      },
      {
        name: "bill_to_postal_code",
        defaultValue: null,
        description: "Bill To Postal Code",
      },
      {
        name: "bill_to_country_code",
        defaultValue: null,
        description: "Bill To Country Code",
      },
    ],
  },
  {
    carrierId: "se-423888",
    carrierCode: "ups",
    accountNumber: "test_account_423888",
    requiresFundedAmount: false,
    balance: 0,
    nickname: "ShipEngine Test Account - UPS",
    friendlyName: "UPS",
    primary: false,
    hasMultiPackageSupportingServices: true,
    supportsLabelMessages: true,
    services: [
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_standard_international",
        name: "UPS Standard®",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_next_day_air_early_am",
        name: "UPS Next Day Air® Early",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_worldwide_express",
        name: "UPS Worldwide Express®",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_next_day_air",
        name: "UPS Next Day Air®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_ground_international",
        name: "UPS Ground® (International)",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_worldwide_express_plus",
        name: "UPS Worldwide Express Plus®",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_next_day_air_saver",
        name: "UPS Next Day Air Saver®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_worldwide_expedited",
        name: "UPS Worldwide Expedited®",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_2nd_day_air_am",
        name: "UPS 2nd Day Air AM®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_2nd_day_air",
        name: "UPS 2nd Day Air®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_worldwide_saver",
        name: "UPS Worldwide Saver®",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_2nd_day_air_international",
        name: "UPS 2nd Day Air® (International)",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_3_day_select",
        name: "UPS 3 Day Select®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_ground",
        name: "UPS® Ground",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423888",
        carrierCode: "ups",
        serviceCode: "ups_next_day_air_international",
        name: "UPS Next Day Air® (International)",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
    ],
    packages: [
      {
        packageId: null,
        packageCode: "package",
        name: "Package",
        description:
          'Package. Longest side plus the distance around the thickest part is less than or equal to 84"',
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "ups__express_box_large",
        name: "UPS  Express® Box - Large",
        description: "Express Box - Large",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "ups_10_kg_box",
        name: "UPS 10 KG Box®",
        description: "10 KG Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "ups_25_kg_box",
        name: "UPS 25 KG Box®",
        description: "25 KG Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "ups_express_box",
        name: "UPS Express® Box",
        description: "Express Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "ups_express_box_medium",
        name: "UPS Express® Box - Medium",
        description: "Express Box - Medium",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "ups_express_box_small",
        name: "UPS Express® Box - Small",
        description: "Express Box - Small",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "ups_express_pak",
        name: "UPS Express® Pak",
        description: "Pak",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "ups_letter",
        name: "UPS Letter",
        description: "Letter",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "ups_tube",
        name: "UPS Tube",
        description: "Tube",
        dimensions: null,
      },
    ],
    options: [
      { name: "bill_to_account", defaultValue: null, description: null },
      { name: "bill_to_country_code", defaultValue: null, description: null },
      { name: "bill_to_party", defaultValue: null, description: null },
      { name: "bill_to_postal_code", defaultValue: null, description: null },
      { name: "collect_on_delivery", defaultValue: null, description: null },
      { name: "contains_alcohol", defaultValue: "false", description: null },
      { name: "delivered_duty_paid", defaultValue: "false", description: null },
      { name: "dry_ice", defaultValue: "false", description: null },
      { name: "dry_ice_weight", defaultValue: "0", description: null },
      { name: "freight_class", defaultValue: null, description: null },
      { name: "non_machinable", defaultValue: "false", description: null },
      { name: "saturday_delivery", defaultValue: "false", description: null },
      {
        name: "shipper_release",
        defaultValue: "false",
        description: "Driver may release package without signature",
      },
    ],
  },
  {
    carrierId: "se-423889",
    carrierCode: "fedex",
    accountNumber: "test_account_423889",
    requiresFundedAmount: false,
    balance: 0,
    nickname: "ShipEngine Test Account - FedEx",
    friendlyName: "FedEx",
    primary: false,
    hasMultiPackageSupportingServices: true,
    supportsLabelMessages: true,
    services: [
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_ground",
        name: "FedEx Ground®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_home_delivery",
        name: "FedEx Home Delivery®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_2day",
        name: "FedEx 2Day®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_2day_am",
        name: "FedEx 2Day® A.M.",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_express_saver",
        name: "FedEx Express Saver®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_standard_overnight",
        name: "FedEx Standard Overnight®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_priority_overnight",
        name: "FedEx Priority Overnight®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_first_overnight",
        name: "FedEx First Overnight®",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_1_day_freight",
        name: "FedEx 1Day® Freight",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_2_day_freight",
        name: "FedEx 2Day® Freight",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_3_day_freight",
        name: "FedEx 3Day® Freight",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_first_overnight_freight",
        name: "FedEx First Overnight® Freight",
        domestic: true,
        international: false,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_ground_international",
        name: "FedEx International Ground®",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_international_economy",
        name: "FedEx International Economy®",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_international_priority",
        name: "FedEx International Priority®",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_international_first",
        name: "FedEx International First®",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_international_economy_freight",
        name: "FedEx International Economy® Freight",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_international_priority_freight",
        name: "FedEx International Priority® Freight",
        domestic: false,
        international: true,
        isMultiPackageSupported: true,
      },
      {
        carrierId: "se-423889",
        carrierCode: "fedex",
        serviceCode: "fedex_international_connect_plus",
        name: "FedEx International Connect Plus®",
        domestic: false,
        international: true,
        isMultiPackageSupported: false,
      },
    ],
    packages: [
      {
        packageId: null,
        packageCode: "fedex_envelope_onerate",
        name: "FedEx One Rate® Envelope",
        description: "FedEx® Envelope",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_extra_large_box_onerate",
        name: "FedEx One Rate® Extra Large Box",
        description: "FedEx® Extra Large Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_large_box_onerate",
        name: "FedEx One Rate® Large Box",
        description: "FedEx® Large Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_medium_box_onerate",
        name: "FedEx One Rate® Medium Box",
        description: "FedEx® Medium Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_pak_onerate",
        name: "FedEx One Rate® Pak",
        description: "FedEx® Pak",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_small_box_onerate",
        name: "FedEx One Rate® Small Box",
        description: "FedEx® Small Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_tube_onerate",
        name: "FedEx One Rate® Tube",
        description: "FedEx® Tube",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_10kg_box",
        name: "FedEx® 10kg Box",
        description: "FedEx® 10kg Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_25kg_box",
        name: "FedEx® 25kg Box",
        description: "FedEx® 25kg Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_box",
        name: "FedEx® Box",
        description: "FedEx® Box",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_envelope",
        name: "FedEx® Envelope",
        description: "FedEx® Envelope",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_pak",
        name: "FedEx® Pak",
        description: "FedEx® Pak",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "fedex_tube",
        name: "FedEx® Tube",
        description: "FedEx® Tube",
        dimensions: null,
      },
      {
        packageId: null,
        packageCode: "package",
        name: "Package",
        description:
          'Package. Longest side plus the distance around the thickest part is less than or equal to 84"',
        dimensions: null,
      },
    ],
    options: [
      { name: "bill_to_account", defaultValue: null, description: null },
      { name: "bill_to_country_code", defaultValue: null, description: null },
      { name: "bill_to_party", defaultValue: null, description: null },
      { name: "bill_to_postal_code", defaultValue: null, description: null },
      { name: "collect_on_delivery", defaultValue: null, description: null },
      { name: "contains_alcohol", defaultValue: "false", description: null },
      { name: "delivered_duty_paid", defaultValue: "false", description: null },
      { name: "dry_ice", defaultValue: "false", description: null },
      { name: "dry_ice_weight", defaultValue: "0", description: null },
      { name: "non_machinable", defaultValue: "false", description: null },
      { name: "saturday_delivery", defaultValue: "false", description: null },
    ],
  },
];