Skip to content

Latest commit

 

History

History
103 lines (72 loc) · 10.3 KB

File metadata and controls

103 lines (72 loc) · 10.3 KB

CarrierParcelTemplates

(CarrierParcelTemplates)

Overview

A carrier parcel template represents a package used for shipping that has preset dimensions defined by a carrier. Some examples of a carrier parcel template include USPS Flat Rate Box and Fedex Small Pak. When using a carrier parcel template, the rates returned may be limited to the carrier that provides the box. You can create user parcel templates using a carrier parcel template. Shippo takes the dimensions of the carrier parcel template but you must configure the weight.

Available Operations

  • List - List all carrier parcel templates
  • Get - Retrieve a carrier parcel templates

List

List all carrier parcel template objects.
Use the following query string params to filter the results as needed.

  • `include=all` (the default). Includes templates from all carriers
  • `include=user`. Includes templates only from carriers which the user has added (whether or not they're currently enabled)
  • `include=enabled`. includes templates only for carriers which the user has added and enabled
  • `carrier=*token*`. filter by specific carrier, e.g. fedex, usps

Example Usage

using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;

var sdk = new ShippoSDK(
    apiKeyHeader: "<YOUR_API_KEY_HERE>",
    shippoApiVersion: "2018-02-08"
);

var res = await sdk.CarrierParcelTemplates.ListAsync(
    include: Shippo.Models.Requests.Include.Enabled,
    carrier: "fedex",
    shippoApiVersion: "2018-02-08"
);

// handle response

Parameters

Parameter Type Required Description Example
Include Include filter by user or enabled
Carrier string filter by specific carrier fedex
ShippoApiVersion string Optional string used to pick a non-default API version to use. See our API version guide. 2018-02-08

Response

CarrierParcelTemplateList

Errors

Error Type Status Code Content Type
Shippo.Models.Errors.SDKException 4XX, 5XX */*

Get

Fetches the parcel template information for a specific carrier parcel template, identified by the token.

Example Usage

using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;

var sdk = new ShippoSDK(
    apiKeyHeader: "<YOUR_API_KEY_HERE>",
    shippoApiVersion: "2018-02-08"
);

var res = await sdk.CarrierParcelTemplates.GetAsync(
    carrierParcelTemplateToken: "<value>",
    shippoApiVersion: "2018-02-08"
);

// handle response

Parameters

Parameter Type Required Description Example
CarrierParcelTemplateToken string ✔️ The unique string representation of the carrier parcel template
ShippoApiVersion string Optional string used to pick a non-default API version to use. See our API version guide. 2018-02-08

Response

CarrierParcelTemplate

Errors

Error Type Status Code Content Type
Shippo.Models.Errors.SDKException 4XX, 5XX */*