Skip to content

Latest commit

 

History

History
151 lines (108 loc) · 14.6 KB

File metadata and controls

151 lines (108 loc) · 14.6 KB

CustomsItems

(CustomsItems)

Overview

Customs declarations are relevant information, including one or multiple customs items, you need to provide for customs clearance for your international shipments.

Available Operations

  • List - List all customs items
  • Create - Create a new customs item
  • Get - Retrieve a customs item

List

Returns a list all customs items objects.

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.CustomsItems.ListAsync(
    page: 1,
    results: 25,
    shippoApiVersion: "2018-02-08"
);

// handle response

Parameters

Parameter Type Required Description Example
Page long The page number you want to select
Results long The number of results to return per page (max 100)
ShippoApiVersion string Optional string used to pick a non-default API version to use. See our API version guide. 2018-02-08

Response

CustomsItemPaginatedList

Errors

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

Create

Creates a new customs item object.

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.CustomsItems.CreateAsync(
    customsItemCreateRequest: new CustomsItemCreateRequest() {
        Description = "T-Shirt",
        MassUnit = Shippo.Models.Components.WeightUnitEnum.Lb,
        Metadata = "Order ID \"123454\"",
        NetWeight = "5",
        OriginCountry = "<value>",
        Quantity = 20,
        SkuCode = "HM-123",
        HsCode = "0901.21",
        ValueAmount = "200",
        ValueCurrency = "USD",
    },
    shippoApiVersion: "2018-02-08"
);

// handle response

Parameters

Parameter Type Required Description Example
CustomsItemCreateRequest CustomsItemCreateRequest ✔️ CustomsItem details.
ShippoApiVersion string Optional string used to pick a non-default API version to use. See our API version guide. 2018-02-08

Response

CustomsItem

Errors

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

Get

Returns an existing customs item using an object ID

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.CustomsItems.GetAsync(
    customsItemId: "<id>",
    page: 1,
    shippoApiVersion: "2018-02-08"
);

// handle response

Parameters

Parameter Type Required Description Example
CustomsItemId string ✔️ Object ID of the customs item
Page long The page number you want to select
ShippoApiVersion string Optional string used to pick a non-default API version to use. See our API version guide. 2018-02-08

Response

CustomsItem

Errors

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