(CustomsDeclarations)
Customs declarations are relevant information, including one or multiple customs items, you need to provide for customs clearance for your international shipments.
- List - List all customs declarations
- Create - Create a new customs declaration
- Get - Retrieve a customs declaration
Returns a a list of all customs declaration objects
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.CustomsDeclarations.ListAsync(
page: 1,
results: 5,
shippoApiVersion: "2018-02-08"
);
// handle response
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, default 5) | |
ShippoApiVersion |
string | ➖ | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 |
CustomsDeclarationPaginatedList
Error Type | Status Code | Content Type |
---|---|---|
Shippo.Models.Errors.SDKException | 4XX, 5XX | */* |
Creates a new customs declaration object
using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08"
);
var res = await sdk.CustomsDeclarations.CreateAsync(
customsDeclarationCreateRequest: new CustomsDeclarationCreateRequest() {
B13aFilingOption = Shippo.Models.Components.CustomsDeclarationB13AFilingOptionEnum.FiledElectronically,
Certify = true,
CertifySigner = "Shawn Ippotle",
ContentsExplanation = "T-Shirt purchase",
DutiesPayor = new DutiesPayor() {
Account = "2323434543",
Type = Shippo.Models.Components.CustomsDeclarationCreateRequestType.ThirdParty,
Address = new CustomsDeclarationCreateRequestAddress() {
Name = "Patrick Kavanagh",
Zip = "80331",
Country = "DE",
},
},
ExporterIdentification = new CustomsExporterIdentification() {
EoriNumber = "PL123456790ABCDE",
TaxId = new CustomsTaxIdentification() {
Number = "123456789",
Type = Shippo.Models.Components.CustomsTaxIdentificationType.Ein,
},
},
Invoice = "#123123",
Metadata = "Order ID #123123",
AddressImporter = new AddressImporter() {
Name = "Shwan Ippotle",
Company = "Shippo",
Street1 = "Blumenstraße",
Street3 = "",
StreetNo = "22",
City = "München",
State = "CA",
Zip = "80331",
Country = "DE",
Phone = "80331",
Email = "[email protected]",
IsResidential = true,
},
ContentsType = Shippo.Models.Components.CustomsDeclarationContentsTypeEnum.Merchandise,
EelPfc = Shippo.Models.Components.CustomsDeclarationEelPfcEnum.Noeei3037A,
Incoterm = Shippo.Models.Components.CustomsDeclarationIncotermEnum.Ddp,
Items = new List<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",
},
},
NonDeliveryOption = Shippo.Models.Components.CustomsDeclarationNonDeliveryOptionEnum.Return,
Test = true,
},
shippoApiVersion: "2018-02-08"
);
// handle response
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
CustomsDeclarationCreateRequest |
CustomsDeclarationCreateRequest | ✔️ | CustomsDeclaration details. | |
ShippoApiVersion |
string | ➖ | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 |
Error Type | Status Code | Content Type |
---|---|---|
Shippo.Models.Errors.SDKException | 4XX, 5XX | */* |
Returns an existing customs declaration using an object ID
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.CustomsDeclarations.GetAsync(
customsDeclarationId: "<id>",
page: 1,
shippoApiVersion: "2018-02-08"
);
// handle response
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
CustomsDeclarationId |
string | ✔️ | Object ID of the customs declaration | |
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 |
Error Type | Status Code | Content Type |
---|---|---|
Shippo.Models.Errors.SDKException | 4XX, 5XX | */* |