(Addresses)
Addresses are the locations a parcel is being shipped from and to. They represent company and residential places. Among other things, you can use address objects to create shipments, calculate shipping rates, and purchase shipping labels.
- List - List all addresses
- Create - Create a new address
- Get - Retrieve an address
- Validate - Validate an address
Returns a list of all address objects that have been created in this account.
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.Addresses.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 |
AddressPaginatedList
Error Type |
Status Code |
Content Type |
Shippo.Models.Errors.SDKException |
4XX, 5XX |
*/* |
Creates a new address object. You can use address objects to create new shipments, calculate rates, and to create orders.
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.Addresses.CreateAsync(
addressCreateRequest: new AddressCreateRequest() {
Name = "Shwan Ippotle",
Company = "Shippo",
Street1 = "215 Clayton St.",
Street3 = "",
StreetNo = "",
City = "San Francisco",
State = "CA",
Zip = "94117",
Country = "US",
Phone = "+1 555 341 9393",
Email = "[email protected]",
IsResidential = true,
Metadata = "Customer ID 123456",
Validate = true,
},
shippoApiVersion: "2018-02-08"
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
AddressCreateRequest |
AddressCreateRequest |
✔️ |
Address details. |
|
ShippoApiVersion |
string |
➖ |
Optional string used to pick a non-default API version to use. See our API version guide. |
2018-02-08 |
Address
Error Type |
Status Code |
Content Type |
Shippo.Models.Errors.SDKException |
4XX, 5XX |
*/* |
Returns an existing address 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.Addresses.GetAsync(
addressId: "<id>",
shippoApiVersion: "2018-02-08"
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
AddressId |
string |
✔️ |
Object ID of the address |
|
ShippoApiVersion |
string |
➖ |
Optional string used to pick a non-default API version to use. See our API version guide. |
2018-02-08 |
Address
Error Type |
Status Code |
Content Type |
Shippo.Models.Errors.SDKException |
4XX, 5XX |
*/* |
Validates an existing address 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.Addresses.ValidateAsync(
addressId: "<id>",
shippoApiVersion: "2018-02-08"
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
AddressId |
string |
✔️ |
Object ID of the address |
|
ShippoApiVersion |
string |
➖ |
Optional string used to pick a non-default API version to use. See our API version guide. |
2018-02-08 |
Address
Error Type |
Status Code |
Content Type |
Shippo.Models.Errors.SDKException |
4XX, 5XX |
*/* |