openapi: 3.1.0
info:
title: Shippo external API.
version: '2018-02-08'
x-logo:
url: https://docs.goshippo.com/images/shippo-logo.svg
contact:
name: Shippo Developer Platform
url: https://goshippo.com/contact/
description: Use this API to integrate with the Shippo service
servers:
- url: https://api.goshippo.com
security:
- APIKeyHeader: []
tags:
- name: Overview
description: |-
First-time users and those looking for specific integration tutorials,
see our full API documentation and guides.
Download the API Specification yaml file
API Resources
All API URLs listed in this documentation are relative to https://api.goshippo.com/.
For example, the `/addresses/` resource is reachable at `https://api.goshippo.com/addresses/`.
Authentication
The API requires Shippo's token HTTP Authentication with your Shippo token (live or test).
In order to authenticate properly, please put `Authorization: ShippoToken ` in your header. You can find your token on the
Shippo API settings page.
For more information about authentication and test mode,
please visit our Authentication guide.
The API is available via Secure Socket Layer (SSL) only. All requests to the Shippo API must use TLS version 1.2 or higher.
Request & Response Data
Request data is passed to the API by POSTing JSON objects with the appropriate key/value-pairs to the respective
resource. The documentation for each API resource contains more details on the values accepted by a given resource.
Response data also formatted as JSON object. You can specify how many results per page are to be returned. For instance,
`/rates/?results=25` will return up to 25 results.
REST & Disposable Objects
The Shippo API is built around REST principles.
Use POST requests to create objects, GET requests to retrieve objects, and PUT requests to update objects.
Only the Carrier Accounts object can be updated via PUT requests. All other objects such as Addresses, Parcels,
Shipments, Rates, Transactions, Refunds, Customs Items, and Customs Declarations are disposable. This means that
once you have created an object, you cannot change it. Instead, create a new one with the desired values.
API Version
This reference guide supports the Shippo API version: `2018-02-08` .
To see reference guides for older API versions, see our legacy reference guide.
For more information about Shippo API versions, see our API versions guide.
- name: Addresses
description: |-
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.
- name: Parcels
description: |-
A parcel is an item you are shipping. The parcel object includes details about its physical make-up of the parcel. It includes dimensions and weight that Shippo uses to calculate rates.
# Parcel Extras
The following values are supported for the `extra` field of the parcel object.
- name: Shipments
description: |-
A shipment is the act of transporting goods. A shipment object contains **to** and **from** addresses, and the parcel details that you are shipping. You can use the shipment object to retrieve shipping rates and purchase a shipping label.
# Shipment Extras
The following values are supported for the `extra` field of the shipment object.
- name: Rates
description: |-
A rate is the cost to ship a parcel from a carrier. The rate object details the service level including the cost and transit time.
- name: Transactions
x-displayName: Transactions (shipping labels)
description: |-
A transaction is the purchase of a shipping label from a shipping provider for a specific service. You can print purchased labels and used them to ship a parcel with a carrier, such as USPS or FedEx.
- name: Customs Items
description: |-
Customs declarations are relevant information, including one or multiple customs items, you need to provide for customs clearance for your international shipments.
- name: Customs Declarations
description: |-
Customs declarations are relevant information, including one or multiple customs items, you need to provide for
customs clearance for your international shipments.
- name: Refunds
description: |-
Refunds are reimbursements for successfully created but unused shipping labels or other charges.
- name: Manifests
description: |-
A manifest is a single-page document with a barcode that carriers can scan to accept all packages into transit without the need to scan each item individually.
They are close-outs of shipping labels of a certain day. Some carriers require manifests to process the shipments.
# Manifest Errors
The following codes and messages are the possible errors that may occur when creating Manifests.
- name: Carrier Accounts
description: |-
Carriers are the companies who deliver your package. Shippo uses Carrier account objects as credentials to retrieve shipping rates and purchase labels from shipping Carriers.
- name: Webhooks
description: |-
Webhooks are a way for Shippo to notify your application when a specific event occurs. For example, when a label is purchased or when a shipment tracking status has changed. You can use webhooks to trigger actions in your application, such as sending an email or updating a database.
# Webhook Payload
The payload is the body of the POST request Shippo sends to the URL specified at the time of webhook registration.
- name: Tracking Status
description: |-
If you purchased your shipping label through Shippo, you can also get all the tracking details of your Shipment
from the Transaction object.
A tracking status of a package is an indication of current location of a package in the supply chain. For example, sorting, warehousing, or out for delivery. Use the tracking status object to track the location of your shipments.
When using your Test token for tracking, you need to use Shippo's
predefined tokens for testing different tracking statuses. You can find more information in our
Tracking tutorial on how to do this, and what the
payloads look like.
- name: Batches
description: |-
A batch is a technique for creating multiple labels at once. Use the batch object to create and purchase many shipments in two API calls. After creating the batch, retrieve the batch to verify that all shipments are valid. You can add and remove shipments after you have created the batch. When all shipments are valid you can purchase the batch and retrieve all the shipping labels.
# Batch Shipment
The batch shipment object is a wrapper around a shipment object, which include shipment-specific information
for batch processing.
Note: batch shipments can only be created on the batch endpoint, either when creating a batch object or by through
the `/batches/{BATCH_OBJECT_ID}/add_shipments` endpoint
- name: Orders
x-displayName: Orders (beta)
description: |-
An order is a request from a customer to purchase goods from a merchant.
Use the orders object to load orders from your system to the Shippo dashboard.
You can use the orders object to create, retrieve, list, and manage orders programmatically.
You can also retrieve shipping rates, purchase labels, and track shipments for each order.
# Line Item
Line Items, and their corresponding abstract Products and Variants, might be exposed as a separate resource
in the future. Currently it's a nested object within the order resource.
A line item is an individual object in an order. For example, if your order contains a t-shirt, shorts, and a jacket, each item is represented by a line item.
- name: Pickups
description: |-
A pickup is when you schedule a carrier to collect a package for delivery.
Use Shippo’s pickups endpoint to schedule pickups with USPS and DHL Express for eligible shipments that you have already created.
- name: Service Groups
description: |-
A service group is a set of service levels grouped together.
Rates at checkout uses services groups to present available shipping options to customers in their shopping basket.
- name: Carrier Parcel Templates
description: |-
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.
- name: User Parcel Templates
description: |-
A user parcel template represents a package used for shipping that has preset dimensions and attributes defined
by you. They are useful for capturing attributes of parcel-types you frequently use for shipping, allowing
them to be defined once and then used for many shipments. These parcel templates can also be used for live rates.
User parcel templates can also be created using a carrier parcel template, where the dimensions will be copied from
the carrier presets, but the weight can be configured by you.
- name: Rates at Checkout
description: |-
Rates at checkout is a tool for merchants to display up-to-date shipping estimates based on what's in their customers cart and where they’re shipping to.
Merchants set up curated shipping options for customers in the checkout flow based on data in the shopping cart. The request must include the **to** address and item information. Optional fields are the **from** address and package information. If the optional fields are not included, the service will use the default address and/or package configured for rates at checkout. The response is a list of shipping options based on the Service Group configuration.
(see Service Group configuration for details).
# Default Parcel Template
Assign one of your user parcel templates to be the default used when generating Live Rates. This template will be used by default when generating Live Rates, unless you explicitly provide a parcel in the Live Rates request.
- name: Carriers
description:
- name: Service Levels
description:
- name: Parcel Templates
description: |-
A predefined package used by one or multiple carriers. See below for all available values and the corresponding tokens.
When a template is given, the parcel dimensions do not have to be sent, the dimensions below will instead be used.
The parcel weight is not affected by the use of a template.
- name: Shippo Accounts
description: |-
Shippo Accounts are used by Shippo Platform Accounts to create and manage Managed Shippo Accounts.
Managed Shippo Accounts are headless accounts that represent your customers. They are opaque to your end customers, meaning customers do not need to create their own Shippo login or have a billing relationship with Shippo.
They can be used by marketplaces, e-commerce platforms, and third-party logistics providers who want to offer, seamless, built-in shipping functionality to their customers. See our guide for more details.
- name: Customs Declaration B13A Filing Option
description:
- name: Customs Declaration Contents Type
description:
- name: Customs Declaration EEL/PFC
description:
- name: Customs Declaration Incoterm
description:
- name: Customs Declaration Non Delivery Option
description:
- name: Address Validation Source
description:
- name: Address Validation Codes
description:
paths:
/addresses:
get:
description: Returns a list of all address objects that have been created in this account.
operationId: ListAddresses
parameters:
- $ref: '#/components/parameters/PageNumberQueryParam'
- $ref: '#/components/parameters/ResultsPerPageDefault5QueryParam'
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/addressPaginatedResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all addresses
tags:
- Addresses
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/addresses/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.addresses.list(page=1, results=5)
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# List all addresses
Shippo::Address.all()
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.addresses.list(1, 5);
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// List all addresses
Shippo_Address::all();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Addresses.ListAsync(
page: 1,
results: 5,
shippoApiVersion: "2018-02-08");
// handle response
post:
description: Creates a new address object. You can use address objects to create new shipments, calculate rates, and to create orders.
operationId: CreateAddress
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AddressCreateRequest'
description: Address details.
responses:
'201':
$ref: '#/components/responses/addressResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a new address
tags:
- Addresses
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/addresses/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-d name="Shawn Ippotle" \
-d company="Shippo" \
-d street1="215 Clayton St." \
-d street2="" \
-d city="San Francisco" \
-d state="CA" \
-d zip=94117 \
-d country="US" \
-d phone="+1 555 341 9393" \
-d email="shippotle@shippo.com"\
-d is_residential=True\
-d metadata="Customer ID 123456"
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.addresses.create(request=components.AddressCreateRequest(
name='Shwan Ippotle',
company='Shippo',
street1='215 Clayton St.',
street3='',
street_no='',
city='San Francisco',
state='CA',
zip='94117',
country='US',
phone='+1 555 341 9393',
email='shippotle@shippo.com',
is_residential=True,
metadata='Customer ID 123456',
validate=True,
))
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Create address object
address_from = Shippo::Address.create(
:name => "Shawn Ippotle",
:company => "Shippo",
:street1 => "Clayton St.",
:street_no => "215",
:street2 => "",
:city => "San Francisco",
:state => "CA",
:zip => "94117",
:country => "US",
:phone => "+1 555 341 9393",
:email => "shippotle@shippo.com"
)
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.addresses.create({
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: "shippotle@shippo.com",
isResidential: true,
metadata: "Customer ID 123456",
validate: true,
});
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Create address object
$fromAddress = Shippo_Address::create( array(
"name" => "Shawn Ippotle",
"company" => "Shippo",
"street1" => "215 Clayton St.",
"city" => "San Francisco",
"state" => "CA",
"zip" => "94117",
"country" => "US",
"phone" => "+1 555 341 9393",
"email" => "shippotle@shippo.com"
));
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
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 = "shippotle@shippo.com",
IsResidential = true,
Metadata = "Customer ID 123456",
Validate = true,
},
shippoApiVersion: "2018-02-08");
// handle response
/addresses/{AddressId}:
get:
description: Returns an existing address using an object ID.
operationId: GetAddress
parameters:
- description: Object ID of the address
in: path
name: AddressId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/addressResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve an address
tags:
- Addresses
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/addresses/d799c2679e644279b59fe661ac8fa488/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.addresses.get(address_id='')
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Retrieve an existing address by object_id
Shippo::Address.get('d799c2679e644279b59fe661ac8fa488')
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.addresses.get("");
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Retrieve an existing address by object_id
Shippo_Address::retrieve('d799c2679e644279b59fe661ac8fa488');
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Addresses.GetAsync(
addressId: "",
shippoApiVersion: "2018-02-08");
// handle response
/addresses/{AddressId}/validate:
get:
description: Validates an existing address using an object ID
operationId: ValidateAddress
parameters:
- description: Object ID of the address
in: path
name: AddressId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/addressResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Validate an address
tags:
- Addresses
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/addresses/d799c2679e644279b59fe661ac8fa488/validate/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.addresses.validate(address_id='')
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Validate an existing address by object_id
Shippo::Address.get("d799c2679e644279b59fe661ac8fa488").validate()
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.addresses.validate("");
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Validate an existing address by object_id
Shippo_Address::validate('d799c2679e644279b59fe661ac8fa488');
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Addresses.ValidateAsync(
addressId: "",
shippoApiVersion: "2018-02-08");
// handle response
x-speakeasy-name-override: validate
/batches:
post:
description: Creates a new batch object for purchasing shipping labels for many shipments at once. Batches are created asynchronously. This means that the API response won't include your batch shipments yet. You need to retrieve the batch later to verify that all batch shipments are valid.
operationId: CreateBatch
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BatchCreateRequest'
description: Batch details.
responses:
'201':
$ref: '#/components/responses/batchResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a batch
tags:
- Batches
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/batches/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-H "Content-Type: application/json" \
-d '{
"default_carrier_account": "078870331023437cb917f5187429b093",
"default_servicelevel_token": "usps_priority",
"label_filetype": "PDF_4x6",
"metadata": "BATCH #170",
"batch_shipments": [
{
"shipment": {
"address_from": {
"name": "Mr Hippo",
"street1": "965 Mission St",
"street2": "Ste 201",
"city": "San Francisco",
"state": "CA",
"zip": "94103",
"country": "US",
"phone": "4151234567",
"email": "mrhippo@shippo.com"
},
"address_to": {
"name": "Mrs Hippo",
"company": "",
"street1": "Broadway 1",
"street2": "",
"city": "New York",
"state": "NY",
"zip": "10007",
"country": "US",
"phone": "4151234567",
"email": "mrshippo@shippo.com"
},
"parcels": [{
"length": "5",
"width": "5",
"height": "5",
"distance_unit": "in",
"weight": "2",
"mass_unit": "oz"
}]
}
},
{
"shipment": {
"address_from": {
"name": "Mr Hippo",
"street1": "1092 Indian Summer Ct",
"city": "San Jose",
"state": "CA",
"zip": "95122",
"country": "US",
"phone": "4151234567",
"email": "mrhippo@shippo.com"
},
"address_to": {
"name": "Mrs Hippo",
"company": "",
"street1": "Broadway 1",
"street2": "",
"city": "New York",
"state": "NY",
"zip": "10007",
"country": "US",
"phone": "4151234567",
"email": "mrshippo@shippo.com"
},
"parcels": [{
"length": "5",
"width": "5",
"height": "5",
"distance_unit": "in",
"weight": "20",
"mass_unit": "lb"
}]
},
"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3",
"servicelevel_token": "fedex_2_day"
}
]
}'
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.batches.create(request=components.BatchCreateRequest(
default_carrier_account='078870331023437cb917f5187429b093',
default_servicelevel_token='usps_priority',
label_filetype=components.LabelFileTypeEnum.PDF_4X6,
metadata='BATCH #1',
batch_shipments=[
components.BatchShipmentCreateRequest(
carrier_account='a4391cd4ab974f478f55dc08b5c8e3b3',
metadata='SHIPMENT #1',
servicelevel_token='fedex_ground',
shipment=components.ShipmentCreateRequest(
extra=components.ShipmentExtra(
accounts_receivable_customer_account=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
appropriation_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
bill_of_lading_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
cod=components.Cod(
amount='5.5',
currency='USD',
payment_method=components.PaymentMethod.CASH,
),
cod_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
customer_reference=components.CustomerReference(
ref_sort=1,
),
dealer_order_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
dept_number=components.DepartmentNumber(
ref_sort=3,
),
fda_product_code=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
insurance=components.Insurance(
amount='5.5',
currency='USD',
),
invoice_number=components.InvoiceNumber(
ref_sort=2,
),
manifest_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
model_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
part_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
po_number=components.PoNumber(
ref_sort=2,
),
production_code=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
purchase_request_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
rma_number=components.RmaNumber(
ref_sort=1,
),
salesperson_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
serial_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
store_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
transaction_reference_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
),
metadata='Customer ID 123456',
shipment_date='2021-03-22T12:00:00Z',
address_from=components.AddressCreateRequest(
name='Shwan Ippotle',
company='Shippo',
street1='215 Clayton St.',
street3='',
street_no='',
city='San Francisco',
state='CA',
zip='94117',
country='US',
phone='+1 555 341 9393',
email='shippotle@shippo.com',
is_residential=True,
metadata='Customer ID 123456',
validate=True,
),
address_return=components.AddressCreateRequest(
name='Shwan Ippotle',
company='Shippo',
street1='215 Clayton St.',
street3='',
street_no='',
city='San Francisco',
state='CA',
zip='94117',
country='US',
phone='+1 555 341 9393',
email='shippotle@shippo.com',
is_residential=True,
metadata='Customer ID 123456',
validate=True,
),
address_to='d799c2679e644279b59fe661ac8fa489',
customs_declaration='adcfdddf8ec64b84ad22772bce3ea37a',
carrier_accounts=[
'065a4a8c10d24a34ab932163a1b87f52',
'73f706f4bdb94b54a337563840ce52b0',
],
parcels=[
components.ParcelCreateFromTemplateRequest(
extra=components.ParcelExtra(
cod=components.Cod(
amount='5.5',
currency='USD',
payment_method=components.PaymentMethod.CASH,
),
insurance=components.ParcelInsurance(
amount='5.5',
content='Laptop',
currency='USD',
provider=components.ParcelInsuranceProvider.UPS,
),
),
metadata='Customer ID 123456',
mass_unit=components.WeightUnitEnum.LB,
weight='1',
template=components.USPSParcelTemplate.USPS_FLAT_RATE_GIFT_CARD_ENVELOPE,
),
],
),
),
],
))
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
Shippo::batch.create({
:default_carrier_account => DEFAULT_CARRIER_ACCOUNT,
:default_servicelevel_token => 'usps_priority',
:label_filetype => 'ZPLII',
:metadata => 'BATCH #170',
:batch_shipments => [
{
:shipment => {
:address_from => address_from_one,
:address_to => address_to_one,
:parcel => parcel_one,
:async => false
}
},
{
:shipment => {
:address_from => address_from_two,
:address_to => address_to_two,
:parcel => parcel_two,
:async => false
}
}
]
})
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.batches.create({
defaultCarrierAccount: "078870331023437cb917f5187429b093",
defaultServicelevelToken: "usps_priority",
labelFiletype: "PDF_4x6",
metadata: "BATCH #1",
batchShipments: [
{
carrierAccount: "a4391cd4ab974f478f55dc08b5c8e3b3",
metadata: "SHIPMENT #1",
servicelevelToken: "fedex_ground",
shipment: {
extra: {
accountsReceivableCustomerAccount: {
prefix: "ABC",
value: "value",
refSort: 1,
},
appropriationNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
billOfLadingNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
cod: {
amount: "5.5",
currency: "USD",
paymentMethod: "CASH",
},
codNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
customerReference: {
refSort: 1,
},
dealerOrderNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
deptNumber: {
refSort: 3,
},
fdaProductCode: {
prefix: "ABC",
value: "value",
refSort: 1,
},
insurance: {
amount: "5.5",
currency: "USD",
},
invoiceNumber: {
refSort: 2,
},
manifestNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
modelNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
partNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
poNumber: {
refSort: 2,
},
productionCode: {
prefix: "ABC",
value: "value",
refSort: 1,
},
purchaseRequestNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
rmaNumber: {
refSort: 1,
},
salespersonNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
serialNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
storeNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
transactionReferenceNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
},
metadata: "Customer ID 123456",
shipmentDate: "2021-03-22T12:00:00Z",
addressFrom: {
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: "shippotle@shippo.com",
isResidential: true,
metadata: "Customer ID 123456",
validate: true,
},
addressReturn: {
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: "shippotle@shippo.com",
isResidential: true,
metadata: "Customer ID 123456",
validate: true,
},
addressTo: "d799c2679e644279b59fe661ac8fa489",
customsDeclaration: "adcfdddf8ec64b84ad22772bce3ea37a",
carrierAccounts: [
"065a4a8c10d24a34ab932163a1b87f52",
"73f706f4bdb94b54a337563840ce52b0",
],
parcels: [
{
extra: {
cod: {
amount: "5.5",
currency: "USD",
paymentMethod: "CASH",
},
insurance: {
amount: "5.5",
content: "Laptop",
currency: "USD",
provider: "UPS",
},
},
metadata: "Customer ID 123456",
massUnit: "lb",
weight: "1",
template: "USPS_FlatRateGiftCardEnvelope",
},
],
},
},
],
});
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
$batch = Shippo_Batch::create(array(
'default_carrier_account' => $carrier,
'default_servicelevel_token' => 'usps_priority',
'label_filetype' => 'PDF_4x6',
'metadata' => '',
'batch_shipments' => array(
array(
'shipment' => array(
'address_from' => array(
'name' => 'Mr Hippo',
'street1' => '965 Mission St',
'street2' => 'Ste 201',
'city' => 'San Francisco',
'state' => 'CA',
'zip' => '94103',
'country' => 'US',
'phone' => '4151234567',
'email' => 'mrhippo@shippo.com'
),
'address_to' => array(
'name' => 'Mrs Hippo',
'company' => '',
'street1' => 'Broadway 1',
'street2' => '',
'city' => 'New York',
'state' => 'NY',
'zip' => '10007',
'country' => 'US',
'phone' => '4151234567',
'email' => 'mrshippo@shippo.com'
),
'parcels' => array(
array(
'length' => '5',
'width' => '5',
'height' => '5',
'distance_unit' => 'in',
'weight' => '2',
'mass_unit' => 'oz'
)
)
)
)
)
))
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Batches.CreateAsync(
batchCreateRequest: new BatchCreateRequest() {
DefaultCarrierAccount = "078870331023437cb917f5187429b093",
DefaultServicelevelToken = "usps_priority",
LabelFiletype = LabelFileTypeEnum.Pdf4x6,
Metadata = "BATCH #1",
BatchShipments = new List() {
new BatchShipmentCreateRequest() {
CarrierAccount = "a4391cd4ab974f478f55dc08b5c8e3b3",
Metadata = "SHIPMENT #1",
ServicelevelToken = "fedex_ground",
Shipment = new ShipmentCreateRequest() {
Extra = new ShipmentExtra() {
AccountsReceivableCustomerAccount = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
AppropriationNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
BillOfLadingNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
Cod = new Cod() {
Amount = "5.5",
Currency = "USD",
PaymentMethod = PaymentMethod.Cash,
},
CodNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
CustomerReference = new CustomerReference() {
RefSort = 1,
},
DealerOrderNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
DeptNumber = new DepartmentNumber() {
RefSort = 3,
},
FdaProductCode = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
Insurance = new Insurance() {
Amount = "5.5",
Currency = "USD",
},
InvoiceNumber = new InvoiceNumber() {
RefSort = 2,
},
ManifestNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
ModelNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
PartNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
PoNumber = new PoNumber() {
RefSort = 2,
},
ProductionCode = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
PurchaseRequestNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
RmaNumber = new RmaNumber() {
RefSort = 1,
},
SalespersonNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
SerialNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
StoreNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
TransactionReferenceNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
},
Metadata = "Customer ID 123456",
ShipmentDate = "2021-03-22T12:00:00Z",
AddressFrom = AddressFrom.CreateAddressFromAddressCreateRequest(
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 = "shippotle@shippo.com",
IsResidential = true,
Metadata = "Customer ID 123456",
Validate = true,
},
),
AddressReturn = AddressReturn.CreateAddressReturnAddressCreateRequest(
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 = "shippotle@shippo.com",
IsResidential = true,
Metadata = "Customer ID 123456",
Validate = true,
},
),
AddressTo = AddressTo.CreateAddressToStr(
"d799c2679e644279b59fe661ac8fa489",
),
CustomsDeclaration = ShipmentCreateRequestCustomsDeclaration.CreateShipmentCreateRequestCustomsDeclarationStr(
"adcfdddf8ec64b84ad22772bce3ea37a",
),
CarrierAccounts = new List() {
"065a4a8c10d24a34ab932163a1b87f52",
"73f706f4bdb94b54a337563840ce52b0",
},
Parcels = new List() {
Parcels.CreateParcelsParcelCreateFromTemplateRequest(
new ParcelCreateFromTemplateRequest() {
Extra = new ParcelExtra() {
Cod = new Cod() {
Amount = "5.5",
Currency = "USD",
PaymentMethod = PaymentMethod.Cash,
},
Insurance = new ParcelInsurance() {
Amount = "5.5",
Content = "Laptop",
Currency = "USD",
Provider = ParcelInsuranceProvider.Ups,
},
},
Metadata = "Customer ID 123456",
MassUnit = Shippo.Models.Components.WeightUnitEnum.Lb,
Weight = "1",
Template = ParcelTemplateEnumSet.CreateParcelTemplateEnumSetUSPSParcelTemplate(
Shippo.Models.Components.USPSParcelTemplate.USPSFlatRateGiftCardEnvelope,
),
},
),
},
},
},
},
},
shippoApiVersion: "2018-02-08");
// handle response
/batches/{BatchId}:
get:
description: |-
Returns a batch using an object ID.
Batch shipments are displayed 100 at a time. You can iterate
through each `page` using the `?page= query` parameter. You can also filter based on batch shipment
status, for example, by passing a query param like `?object_results=creation_failed`.
For more details on filtering results, see our guide on filtering.
operationId: GetBatch
parameters:
- description: Object ID of the batch
in: path
name: BatchId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/batchResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve a batch
tags:
- Batches
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/batches/?page=2&object_results=creation_failed \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.batches.get(batch_id='')
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: Shippo::batch.retrieve(batch_object_id)
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.batches.get("");
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: Shippo_Batch::retrieve($batch_object_id)
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Batches.GetAsync(
batchId: "",
shippoApiVersion: "2018-02-08");
// handle response
/batches/{BatchId}/add_shipments:
post:
description: Adds batch shipments to an existing batch.
operationId: AddShipmentsToBatch
parameters:
- description: Object ID of the batch
in: path
name: BatchId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
items:
$ref: '#/components/schemas/BatchShipmentCreateRequest'
type: array
description: Array of shipments to add to the batch
responses:
'200':
$ref: '#/components/responses/batchResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Add shipments to a batch
tags:
- Batches
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl -X POST https://api.goshippo.com/batches//add_shipments \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-H "Content-Type: application/json" \
-d '[
{
"shipment": {
"address_from": {
"name": "Mr Hippo",
"street1": "965 Mission St",
"street2": "Ste 201",
"city": "San Francisco",
"state": "CA",
"zip": "94103",
"country": "US",
"phone": "4151234567",
},
"address_to": {
"name": "Hippo Jr",
"street1": "915 Broadway",
"street2": "19th Floor",
"city": "New York",
"state": "NY",
"zip": "10010",
"country": "US",
"phone": "2129947880",
},
"parcels": [{
"length": "12",
"width": "12",
"height": "12",
"distance_unit": "in",
"weight": "12",
"mass_unit": "oz"
}]
}
},
{
"shipment": {
"address_from": {
"name": "Ms Hippo",
"street1": "1092 Indian Summer Ct",
"city": "San Jose",
"state": "CA",
"zip": "95122",
"country": "US",
"phone": "4151234567",
},
"address_to": {
"name": "Mr Hippo",
"street1": "965 Mission St",
"street2": "Ste 201",
"city": "San Francisco",
"state": "CA",
"zip": "94103",
"country": "US",
"phone": "4151234567",
},
"parcels": [{
"length": "5",
"width": "5",
"height": "5",
"distance_unit": "in",
"weight": "2",
"mass_unit": "lb"
}]
},
"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3",
"servicelevel_token": "fedex_2_day"
}
]'
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.batches.add_shipments(batch_id='', request_body=[
components.BatchShipmentCreateRequest(
carrier_account='a4391cd4ab974f478f55dc08b5c8e3b3',
metadata='SHIPMENT #1',
servicelevel_token='fedex_ground',
shipment=components.ShipmentCreateRequest(
extra=components.ShipmentExtra(
accounts_receivable_customer_account=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
appropriation_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
bill_of_lading_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
cod=components.Cod(
amount='5.5',
currency='USD',
payment_method=components.PaymentMethod.CASH,
),
cod_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
customer_reference=components.CustomerReference(
ref_sort=1,
),
dealer_order_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
dept_number=components.DepartmentNumber(
ref_sort=3,
),
fda_product_code=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
insurance=components.Insurance(
amount='5.5',
currency='USD',
),
invoice_number=components.InvoiceNumber(
ref_sort=2,
),
manifest_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
model_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
part_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
po_number=components.PoNumber(
ref_sort=2,
),
production_code=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
purchase_request_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
rma_number=components.RmaNumber(
ref_sort=1,
),
salesperson_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
serial_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
store_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
transaction_reference_number=components.UPSReferenceFields(
prefix='ABC',
value='value',
ref_sort=1,
),
),
metadata='Customer ID 123456',
shipment_date='2021-03-22T12:00:00Z',
address_from='d799c2679e644279b59fe661ac8fa488',
address_return='d799c2679e644279b59fe661ac8fa488',
address_to=components.AddressCreateRequest(
name='Shwan Ippotle',
company='Shippo',
street1='215 Clayton St.',
street3='',
street_no='',
city='San Francisco',
state='CA',
zip='94117',
country='US',
phone='+1 555 341 9393',
email='shippotle@shippo.com',
is_residential=True,
metadata='Customer ID 123456',
validate=True,
),
customs_declaration='adcfdddf8ec64b84ad22772bce3ea37a',
carrier_accounts=[
'065a4a8c10d24a34ab932163a1b87f52',
'73f706f4bdb94b54a337563840ce52b0',
],
parcels=[
components.ParcelCreateRequest(
extra=components.ParcelExtra(
cod=components.Cod(
amount='5.5',
currency='USD',
payment_method=components.PaymentMethod.CASH,
),
insurance=components.ParcelInsurance(
amount='5.5',
content='Laptop',
currency='USD',
provider=components.ParcelInsuranceProvider.UPS,
),
),
metadata='Customer ID 123456',
mass_unit=components.WeightUnitEnum.LB,
weight='1',
distance_unit=components.DistanceUnitEnum.IN,
height='1',
length='1',
width='1',
),
],
),
),
])
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.batches.addShipments("", [
{
carrierAccount: "a4391cd4ab974f478f55dc08b5c8e3b3",
metadata: "SHIPMENT #1",
servicelevelToken: "fedex_ground",
shipment: {
extra: {
accountsReceivableCustomerAccount: {
prefix: "ABC",
value: "value",
refSort: 1,
},
appropriationNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
billOfLadingNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
cod: {
amount: "5.5",
currency: "USD",
paymentMethod: "CASH",
},
codNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
customerReference: {
refSort: 1,
},
dealerOrderNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
deptNumber: {
refSort: 3,
},
fdaProductCode: {
prefix: "ABC",
value: "value",
refSort: 1,
},
insurance: {
amount: "5.5",
currency: "USD",
},
invoiceNumber: {
refSort: 2,
},
manifestNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
modelNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
partNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
poNumber: {
refSort: 2,
},
productionCode: {
prefix: "ABC",
value: "value",
refSort: 1,
},
purchaseRequestNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
rmaNumber: {
refSort: 1,
},
salespersonNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
serialNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
storeNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
transactionReferenceNumber: {
prefix: "ABC",
value: "value",
refSort: 1,
},
},
metadata: "Customer ID 123456",
shipmentDate: "2021-03-22T12:00:00Z",
addressFrom: "d799c2679e644279b59fe661ac8fa488",
addressReturn: "d799c2679e644279b59fe661ac8fa488",
addressTo: {
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: "shippotle@shippo.com",
isResidential: true,
metadata: "Customer ID 123456",
validate: true,
},
customsDeclaration: "adcfdddf8ec64b84ad22772bce3ea37a",
carrierAccounts: [
"065a4a8c10d24a34ab932163a1b87f52",
"73f706f4bdb94b54a337563840ce52b0",
],
parcels: [
{
extra: {
cod: {
amount: "5.5",
currency: "USD",
paymentMethod: "CASH",
},
insurance: {
amount: "5.5",
content: "Laptop",
currency: "USD",
provider: "UPS",
},
},
metadata: "Customer ID 123456",
massUnit: "lb",
weight: "1",
distanceUnit: "in",
height: "1",
length: "1",
width: "1",
},
],
},
},
]);
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Batches.AddShipmentsAsync(
batchId: "",
requestBody: new List() {
new BatchShipmentCreateRequest() {
CarrierAccount = "a4391cd4ab974f478f55dc08b5c8e3b3",
Metadata = "SHIPMENT #1",
ServicelevelToken = "fedex_ground",
Shipment = new ShipmentCreateRequest() {
Extra = new ShipmentExtra() {
AccountsReceivableCustomerAccount = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
AppropriationNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
BillOfLadingNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
Cod = new Cod() {
Amount = "5.5",
Currency = "USD",
PaymentMethod = PaymentMethod.Cash,
},
CodNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
CustomerReference = new CustomerReference() {
RefSort = 1,
},
DealerOrderNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
DeptNumber = new DepartmentNumber() {
RefSort = 3,
},
FdaProductCode = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
Insurance = new Insurance() {
Amount = "5.5",
Currency = "USD",
},
InvoiceNumber = new InvoiceNumber() {
RefSort = 2,
},
ManifestNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
ModelNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
PartNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
PoNumber = new PoNumber() {
RefSort = 2,
},
ProductionCode = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
PurchaseRequestNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
RmaNumber = new RmaNumber() {
RefSort = 1,
},
SalespersonNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
SerialNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
StoreNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
TransactionReferenceNumber = new UPSReferenceFields() {
Prefix = "ABC",
Value = "value",
RefSort = 1,
},
},
Metadata = "Customer ID 123456",
ShipmentDate = "2021-03-22T12:00:00Z",
AddressFrom = AddressFrom.CreateAddressFromStr(
"d799c2679e644279b59fe661ac8fa488",
),
AddressReturn = AddressReturn.CreateAddressReturnStr(
"d799c2679e644279b59fe661ac8fa488",
),
AddressTo = AddressTo.CreateAddressToAddressCreateRequest(
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 = "shippotle@shippo.com",
IsResidential = true,
Metadata = "Customer ID 123456",
Validate = true,
},
),
CustomsDeclaration = ShipmentCreateRequestCustomsDeclaration.CreateShipmentCreateRequestCustomsDeclarationStr(
"adcfdddf8ec64b84ad22772bce3ea37a",
),
CarrierAccounts = new List() {
"065a4a8c10d24a34ab932163a1b87f52",
"73f706f4bdb94b54a337563840ce52b0",
},
Parcels = new List() {
Parcels.CreateParcelsParcelCreateRequest(
new ParcelCreateRequest() {
Extra = new ParcelExtra() {
Cod = new Cod() {
Amount = "5.5",
Currency = "USD",
PaymentMethod = PaymentMethod.Cash,
},
Insurance = new ParcelInsurance() {
Amount = "5.5",
Content = "Laptop",
Currency = "USD",
Provider = ParcelInsuranceProvider.Ups,
},
},
Metadata = "Customer ID 123456",
MassUnit = Shippo.Models.Components.WeightUnitEnum.Lb,
Weight = "1",
DistanceUnit = Shippo.Models.Components.DistanceUnitEnum.In,
Height = "1",
Length = "1",
Width = "1",
},
),
},
},
},
},
shippoApiVersion: "2018-02-08");
// handle response
x-speakeasy-name-override: addShipments
/batches/{BatchId}/purchase:
post:
description: |-
Purchases an existing batch with a status of `VALID`.
Once you send a POST request to the purchase endpoint the batch status will change to `PURCHASING`.
When all the shipments are purchased, the status will change to `PURCHASED` and you will receive a
`batch_purchased` webhook indicating that the batch has been purchased
operationId: PurchaseBatch
parameters:
- description: Object ID of the batch
in: path
name: BatchId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'202':
$ref: '#/components/responses/batchResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Purchase a batch
tags:
- Batches
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl -X POST https://api.goshippo.com/batches//purchase \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.batches.purchase(batch_id='')
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.batches.purchase("");
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Batches.PurchaseAsync(
batchId: "",
shippoApiVersion: "2018-02-08");
// handle response
x-speakeasy-name-override: purchase
/batches/{BatchId}/remove_shipments:
post:
description: Removes shipments from an existing batch shipment.
operationId: RemoveShipmentsFromBatch
parameters:
- description: Object ID of the batch
in: path
name: BatchId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
items:
type: string
type: array
description: Array of shipments object ids to remove from the batch
responses:
'200':
$ref: '#/components/responses/batchResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Remove shipments from a batch
tags:
- Batches
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl -X POST https://api.goshippo.com/batches//remove_shipments \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-H "Content-Type: application/json" \
-d '[
"aa7dea463a5a48b0b8fb21f90e72d779",
"f11b46440c144ce3b97fb5ddf02b8c71",
"5400f9078f764b1bbb121bcd08de127f",
"2ab2b452392545908d2cef8861a39c35"
]'
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.batches.remove_shipments(batch_id='', request_body=[
'',
])
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.batches.removeShipments("", [
"",
]);
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Batches.RemoveShipmentsAsync(
batchId: "",
requestBody: new List() {
"",
},
shippoApiVersion: "2018-02-08");
// handle response
x-speakeasy-name-override: removeShipments
/carrier_accounts:
get:
description: |-
Returns a list of all carrier accounts connected to your Shippo account. These carrier accounts include both Shippo carrier accounts and your own carrier accounts that you have connected to your Shippo account.
Additionally, you can get information about the service levels associated with each carrier account by passing in the `?service_levels=true` query parameter.
Using it appends the property `service_levels` to each carrier account.
By default, if the query parameter is omitted, the `service_levels` property will not be included in the response.
operationId: ListCarrierAccounts
parameters:
- description: Appends the property `service_levels` to each returned carrier account
in: query
name: service_levels
required: false
schema:
type: boolean
- description: Filter the response by the specified carrier
in: query
name: carrier
required: false
schema:
$ref: '#/components/schemas/CarriersEnum'
- description: Filter the response by the specified carrier account Id
in: query
name: account_id
required: false
schema:
type: string
- $ref: '#/components/parameters/PageNumberQueryParam'
- $ref: '#/components/parameters/ResultsPerPageDefault5QueryParam'
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/carrierAccountPaginatedResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all carrier accounts
tags:
- Carrier Accounts
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/carrier_accounts?service_levels=true \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
from shippo.models import operations
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.carrier_accounts.list(request=operations.ListCarrierAccountsRequest())
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# List all carrier accounts
Shippo::CarrierAccount.all()
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierAccounts.list({});
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// List all carrier accounts
Shippo_CarrierAccount::all();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
ListCarrierAccountsRequest req = new ListCarrierAccountsRequest() {};
var res = await sdk.CarrierAccounts.ListAsync(req);
// handle response
post:
description: Creates a new carrier account or connects an existing carrier account to the Shippo account.
operationId: CreateCarrierAccount
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectExistingOwnAccountRequest'
description: Examples.
x-examples:
application/json:
fedex-existing-account-example:
summary: Connect an existing Fedex account to Shippo
value:
account_id: 321123
carrier: fedex
metadata: FedEx Account
parameters:
first_name: Hippo
from_address_city: San Francisco
from_address_country_iso2: US
from_address_st: 250 Union St
from_address_state: CA
from_address_zip: 94133
last_name: Hippovich
meter: 118599345
phone_number: 1112223333
smartpost_id: 5902
test: false
ups-existing-account-example:
summary: Connect an existing UPS account to Shippo
value:
account_id: 123456
active: true
carrier: ups
metadata: UPS Account
parameters:
account_number: 94567e
aia_country_iso2: US
billing_address_city: San Francisco
billing_address_country_iso2: US
billing_address_state: CA
billing_address_street1: 731 Market St
billing_address_street2: STE 200
billing_address_zip: 94103
collec_country_iso2: US
collec_zip: 94103
company: Shippo
currency_code: USD
email: hippo@shippo.com
full_name: Shippo Meister
has_invoice: false
invoice_controlid: 1234
invoice_date: 20210529
invoice_number: 1112234
invoice_value: 11.23
phone: 1112223333
title: Manager
ups_agreements: true
test: false
ups-new-account-example:
summary: Create a new UPS account
value:
account_id: 123456
active: true
carrier: ups
metadata: UPS Account
parameters:
billing_address_city: San Francisco
billing_address_country_iso2: US
billing_address_state: CA
billing_address_street1: 731 Market St
billing_address_street2: STE 200
billing_address_zip: 94103
company: Shippo
email: hippo@shippo.com
full_name: Shippo Meister
phone: 1112223333
pickup_address_city: San Francisco
pickup_address_country_iso2: US
pickup_address_same_as_billing_address: false
pickup_address_state: CA
pickup_address_street1: 731 Market St
pickup_address_street2: STE 200
pickup_address_zip: 94103
ups_agreements: true
test: false
responses:
'201':
$ref: '#/components/responses/carrierAccountResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a new carrier account
tags:
- Carrier Accounts
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl --location --request POST 'https://api.goshippo.com/carrier_accounts/' \
--header 'Authorization: ShippoToken {{token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"account_id": "string",
"active": true,
"carrier": "ups",
"metadata": "UPS Account",
"parameters": {
"billing_address_city": "San Francisco",
"billing_address_country_iso2": "US",
"billing_address_state": "CA",
"billing_address_street1": "731 Market St",
"billing_address_street2": "STE 200",
"billing_address_zip": "94103",
"company": "Shippo",
"email": "hippo@shippo.com",
"full_name": "Thorn Hall",
"phone": "1112223333",
"pickup_address_city": "San Francisco",
"pickup_address_country_iso2": "US",
"pickup_address_same_as_billing_address": false,
"pickup_address_state": "CA",
"pickup_address_street1": "731 Market St",
"pickup_address_street2": "STE 200",
"pickup_address_zip": "94103",
"ups_agreements": true
},
"test": false
}'
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.carrier_accounts.create(request=components.ConnectExistingOwnAccountRequest(
account_id='321123',
carrier='fedex',
metadata='FEDEX Account',
parameters=components.FedExConnectExistingOwnAccountParameters(
first_name='Jena',
last_name='Nienow',
phone_number='',
from_address_st='',
from_address_city='',
from_address_state='',
from_address_zip='',
from_address_country_iso2='',
),
test=False,
))
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Create a carrier account
fedex_account = Shippo::CarrierAccount.create(
:carrier => 'fedex',
:account_id => '321123',
:parameters => {:meter => '789987'},
:active => true)
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierAccounts.create({
accountId: "321123",
carrier: "fedex",
metadata: "FEDEX Account",
parameters: {
firstName: "Jena",
lastName: "Nienow",
phoneNumber: "",
fromAddressSt: "",
fromAddressCity: "",
fromAddressState: "",
fromAddressZip: "",
fromAddressCountryIso2: "",
},
test: false,
});
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
$fedex_account = Shippo_CarrierAccount::create(array(
'carrier' => 'fedex',
'account_id' => '321123',
'parameters' => array('meter' => '789987'),
'active' => true
));
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CarrierAccounts.CreateAsync(
connectExistingOwnAccountRequest: new ConnectExistingOwnAccountRequest() {
AccountId = "321123",
Carrier = "fedex",
Metadata = "FEDEX Account",
Parameters = ConnectExistingOwnAccountRequestParameters.CreateConnectExistingOwnAccountRequestParametersFedExConnectExistingOwnAccountParameters(
new FedExConnectExistingOwnAccountParameters() {
FirstName = "Jena",
LastName = "Nienow",
PhoneNumber = "",
FromAddressSt = "",
FromAddressCity = "",
FromAddressState = "",
FromAddressZip = "",
FromAddressCountryIso2 = "",
},
),
Test = false,
},
shippoApiVersion: "2018-02-08");
// handle response
/carrier_accounts/{CarrierAccountId}:
get:
description: Returns an existing carrier account using an object ID.
operationId: GetCarrierAccount
parameters:
- description: Object ID of the carrier account
in: path
name: CarrierAccountId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/carrierAccountResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve a carrier account
tags:
- Carrier Accounts
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/carrier_accounts/b741b99f95e841639b54272834bc478c \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.carrier_accounts.get(carrier_account_id='')
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Retrieve an existing carrier account by object_id
Shippo::CarrierAccount.get('b741b99f95e841639b54272834bc478c');
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierAccounts.get("");
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Retrieve an existing carrier account by object_id
Shippo_CarrierAccount::retrieve('b741b99f95e841639b54272834bc478c');
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CarrierAccounts.GetAsync(
carrierAccountId: "",
shippoApiVersion: "2018-02-08");
// handle response
put:
description: Updates an existing carrier account object. The account_id and carrier can't be updated. This is because they form the unique identifier together.
operationId: UpdateCarrierAccount
parameters:
- description: Object ID of the carrier account
in: path
name: CarrierAccountId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CarrierAccountUpdateRequest'
description: Examples.
x-examples:
application/json:
update-carrier-account:
summary: Update a carrier account
value:
account_id: 123356
active: true
carrier: ups
parameters: {}
responses:
'200':
$ref: '#/components/responses/carrierAccountResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Update a carrier account
tags:
- Carrier Accounts
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/carrier_accounts/b741b99f95e841639b54272834bc478c/ \
-X PUT \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-d parameters='{
"meter": "123987"
}'
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.carrier_accounts.update(carrier_account_id='', carrier_account_base=components.CarrierAccountBase(
account_id='****',
carrier='usps',
parameters=components.UPSConnectExistingOwnAccountParameters(
account_number='94567e',
aia_country_iso2='US',
billing_address_city='San Francisco',
billing_address_country_iso2='US',
billing_address_state='CA',
billing_address_street1='731 Market St',
billing_address_street2='STE 200',
billing_address_zip='94103',
collec_country_iso2='US',
collec_zip='94103',
company='Shippo',
currency_code='USD',
email='hippo@shippo.com',
full_name='Shippo Meister',
has_invoice=False,
invoice_controlid='1234',
invoice_date='20210529',
invoice_number='1112234',
invoice_value='11.23',
phone='1112223333',
title='Manager',
ups_agreements=False,
),
))
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# To update a carrier account we need the account's object_id.
# If you haven't stored it in your system, retrieve it first.
# You can list all your accounts like this.
accounts = Shippo::CarrierAccount.all()
puts accounts
# Now you can update the account with the corresponding object_id.
fedex_account = Shippo::CarrierAccount.update('b741b99f95e841639b54272834bc478c', :active => true)
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierAccounts.update("", {
accountId: "****",
carrier: "usps",
parameters: {
accountNumber: "94567e",
aiaCountryIso2: "US",
billingAddressCity: "San Francisco",
billingAddressCountryIso2: "US",
billingAddressState: "CA",
billingAddressStreet1: "731 Market St",
billingAddressStreet2: "STE 200",
billingAddressZip: "94103",
collecCountryIso2: "US",
collecZip: "94103",
company: "Shippo",
currencyCode: "USD",
email: "hippo@shippo.com",
fullName: "Shippo Meister",
hasInvoice: false,
invoiceControlid: "1234",
invoiceDate: "20210529",
invoiceNumber: "1112234",
invoiceValue: "11.23",
phone: "1112223333",
title: "Manager",
upsAgreements: false,
},
});
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// To update a carrier account we need the account's object_id.
// If you haven't stored it in your system, retrieve it first.
// You can list all your accounts like this.
$accounts = Shippo_CarrierAccount::all();
var_dump($accounts);
// Now you can update the account with the corresponding object_id.
$fedex_account = Shippo_CarrierAccount::update('b741b99f95e841639b54272834bc478c', array('active' => true));
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CarrierAccounts.UpdateAsync(
carrierAccountId: "",
shippoApiVersion: "2018-02-08",
carrierAccountBase: new CarrierAccountBase() {
AccountId = "****",
Carrier = "usps",
Parameters = CarrierAccountBaseParameters.CreateCarrierAccountBaseParametersUPSConnectExistingOwnAccountParameters(
new UPSConnectExistingOwnAccountParameters() {
AccountNumber = "94567e",
AiaCountryIso2 = "US",
BillingAddressCity = "San Francisco",
BillingAddressCountryIso2 = "US",
BillingAddressState = "CA",
BillingAddressStreet1 = "731 Market St",
BillingAddressStreet2 = "STE 200",
BillingAddressZip = "94103",
CollecCountryIso2 = "US",
CollecZip = "94103",
Company = "Shippo",
CurrencyCode = "USD",
Email = "hippo@shippo.com",
FullName = "Shippo Meister",
HasInvoice = false,
InvoiceControlid = "1234",
InvoiceDate = "20210529",
InvoiceNumber = "1112234",
InvoiceValue = "11.23",
Phone = "1112223333",
Title = "Manager",
UpsAgreements = false,
},
),
});
// handle response
/carrier_accounts/{CarrierAccountObjectId}/signin/initiate:
get:
description: Used by client applications to setup or reconnect an existing carrier account with carriers that support OAuth 2.0
summary: Connect an existing carrier account using OAuth 2.0
operationId: InitiateOauth2Signin
parameters:
- description: The carrier account ID (UUID) to start a signin process.
in: path
name: CarrierAccountObjectId
required: true
schema:
type: string
- description: Callback URL. The URL that tells the authorization server where to send the user back to after they approve the request.
in: query
name: redirect_uri
required: true
schema:
type: string
format: uri
- description: A random string generated by the consuming application and included in the request to prevent CSRF attacks. The consuming application checks that the same value is returned after the user authorizes Shippo.
in: query
name: state
required: false
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'302':
description: Redirects the browser to the carrier login page, with the needed parameters
headers:
Location:
description: Carrier login page URI, with the needed parameters set as query string
schema:
type: string
format: uri
example: https://www.ups.com/lasso/signin?client_id=testClientID&redirect_uri=https://client.example.com/cb&response_type=code&scope=read&type=ups_com_api
'400':
description: Invalid parameters provided by the user
content:
application/json:
schema:
properties:
title:
type: string
example: Missing required parameter
detail:
type: string
example: redirect_uri
'401':
description: Invalid ShippoToken or unsupported carrier account provided by the user
content:
application/json:
schema:
properties:
title:
type: string
example: Unsupported OAuth Carrier Account
detail:
type: string
example: The carrier account 3c49f998b1234a2097ea0911a7e95bea does not support OAuth authorization
'404':
description: Invalid carrier account provided by the user
content:
application/json:
schema:
properties:
title:
type: string
example: Carrier Account not found
detail:
type: string
example: 'Carrier Account not found for object_id: 3c49f998b1234a2097ea0911a7e95bea'
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl "https://api.goshippo.com/carrier_accounts/2ccf5af209bb484cb20190d9cadbb61c/signin/initiate?redirect_uri=https://client.example.com/cb&state=SplxlOBeZQQYbYS6WxSbIA" \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.carrier_accounts.initiate_oauth2_signin(carrier_account_object_id='', redirect_uri='http://fine-cummerbund.biz', state='')
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierAccounts.initiateOauth2Signin("", "http://fine-cummerbund.biz", "");
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
InitiateOauth2SigninRequest req = new InitiateOauth2SigninRequest() {
CarrierAccountObjectId = "",
RedirectUri = "http://fine-cummerbund.biz",
};
var res = await sdk.CarrierAccounts.InitiateOauth2SigninAsync(req);
// handle response
tags:
- Carrier Accounts
/carrier_accounts/register/new:
post:
description: Adds a Shippo carrier account
operationId: RegisterCarrierAccount
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/CarrierAccountCanadaPostCreateRequest'
- $ref: '#/components/schemas/CarrierAccountChronopostCreateRequest'
- $ref: '#/components/schemas/CarrierAccountColissimoCreateRequest'
- $ref: '#/components/schemas/CarrierAccountCorreosCreateRequest'
- $ref: '#/components/schemas/CarrierAccountDeutschePostCreateRequest'
- $ref: '#/components/schemas/CarrierAccountDHLExpressCreateRequest'
- $ref: '#/components/schemas/CarrierAccountDpdDeCreateRequest'
- $ref: '#/components/schemas/CarrierAccountDPDUKCreateRequest'
- $ref: '#/components/schemas/CarrierAccountFedExCreateRequest'
- $ref: '#/components/schemas/CarrierAccountHermesUKCreateRequest'
- $ref: '#/components/schemas/CarrierAccountMondialRelayCreateRequest'
- $ref: '#/components/schemas/CarrierAccountPosteItalianeCreateRequest'
- $ref: '#/components/schemas/CarrierAccountUPSCreateRequest'
- $ref: '#/components/schemas/CarrierAccountUSPSCreateRequest'
- $ref: '#/components/schemas/CarrierAccountSendleCreateRequest'
description: Examples.
responses:
'201':
$ref: '#/components/responses/carrierAccountResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Add a Shippo carrier account
tags:
- Carrier Accounts
x-codeSamples:
- label: CLI
lang: cURL
source: |-
curl --location --request POST '/carrier_accounts/register/new' \
--header 'Authorization: ShippoToken {{token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"carrier": "canada_post",
"parameters": {
"company": "Shippo",
"full_name": "Shippo Meister",
"email": "hippo@shippo.com",
"phone": "1112221122",
"canada_post_terms": true
}
}'
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.carrier_accounts.register(request=components.CarrierAccountColissimoCreateRequest(
carrier='colissimo',
parameters=components.CarrierAccountColissimoCreateRequestParameters(),
))
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierAccounts.register({
carrier: "colissimo",
parameters: {},
});
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CarrierAccounts.RegisterAsync(
requestBody: RegisterCarrierAccountRequestBody.CreateRegisterCarrierAccountRequestBodyCarrierAccountColissimoCreateRequest(
new CarrierAccountColissimoCreateRequest() {
Carrier = "colissimo",
Parameters = new CarrierAccountColissimoCreateRequestParameters() {},
},
),
shippoApiVersion: "2018-02-08");
// handle response
x-speakeasy-name-override: register
/carrier_accounts/reg-status:
get:
description: Returns the registration status for the given account for the given carrier
operationId: GetCarrierRegistrationStatus
parameters:
- in: query
description: filter by specific carrier
name: carrier
required: true
schema:
type: string
enum:
- ups
- usps
- canada_post
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/carrierAccountRegistrationStatusResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Get Carrier Registration status
tags:
- Carrier Accounts
x-speakeasy-name-override: getRegistrationStatus
x-codeSamples:
- lang: python
label: Python
source: |-
import shippo
from shippo.models import operations
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.carrier_accounts.get_registration_status(carrier=operations.Carrier.USPS)
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierAccounts.getRegistrationStatus("usps");
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CarrierAccounts.GetRegistrationStatusAsync(
carrier: Shippo.Models.Requests.Carrier.Usps,
shippoApiVersion: "2018-02-08");
// handle response
/customs/declarations:
get:
description: Returns a a list of all customs declaration objects
operationId: ListCustomsDeclarations
parameters:
- $ref: '#/components/parameters/PageNumberQueryParam'
- $ref: '#/components/parameters/ResultsPerPageDefault5QueryParam'
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/customsDeclarationPaginatedResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all customs declarations
tags:
- Customs Declarations
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/customs/declarations/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.customs_declarations.list(page=1, results=5)
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# List all customs delcarations
Shippo::CustomsDeclaration.all()
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.customsDeclarations.list(1, 5);
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// List all customs declarations
Shippo_CustomsDeclaration::all();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CustomsDeclarations.ListAsync(
page: 1,
results: 5,
shippoApiVersion: "2018-02-08");
// handle response
post:
description: Creates a new customs declaration object
operationId: CreateCustomsDeclaration
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CustomsDeclarationCreateRequest'
description: CustomsDeclaration details.
responses:
'201':
$ref: '#/components/responses/customsDeclarationResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a new customs declaration
tags:
- Customs Declarations
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/customs/declarations/ \
-H "Authorization: ShippoToken " \
-H "Content-Type: application/json" \
-d '{
"contents_type": "MERCHANDISE",
"non_delivery_option": "RETURN",
"certify": true,
"certify_signer": "Simon Kreuz",
"incoterm": "DDU",
"items": [{
"description": "T-shirt",
"quantity": 20,
"net_weight": "5",
"mass_unit": "lb",
"value_amount": "200",
"value_currency": "USD",
"tariff_number": "",
"origin_country": "US"
}]
}'
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.customs_declarations.create(request=components.CustomsDeclarationCreateRequest(
b13a_filing_option=components.CustomsDeclarationB13AFilingOptionEnum.FILED_ELECTRONICALLY,
certify=True,
certify_signer='Shawn Ippotle',
contents_explanation='T-Shirt purchase',
exporter_identification=components.CustomsExporterIdentification(
eori_number='PL123456790ABCDE',
tax_id=components.CustomsTaxIdentification(
number='123456789',
type=components.CustomsTaxIdentificationType.EIN,
),
),
invoice='#123123',
metadata='Order ID #123123',
address_importer=components.AddressImporter(
name='Shwan Ippotle',
company='Shippo',
street1='Blumenstraße',
street3='',
street_no='22',
city='München',
state='CA',
zip='80331',
country='DE',
phone='80331',
email='shippotle@shippo.com',
is_residential=True,
),
contents_type=components.CustomsDeclarationContentsTypeEnum.MERCHANDISE,
eel_pfc=components.CustomsDeclarationEelPfcEnum.NOEEI_30_37_A,
incoterm=components.CustomsDeclarationIncotermEnum.DDP,
items=[
components.CustomsItemCreateRequest(
description='T-Shirt',
mass_unit=components.WeightUnitEnum.LB,
metadata='Order ID "123454"',
net_weight='5',
origin_country='',
quantity=20,
sku_code='HM-123',
hs_code='0901.21',
value_amount='200',
value_currency='USD',
),
],
non_delivery_option=components.CustomsDeclarationNonDeliveryOptionEnum.RETURN,
test=True,
))
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
customs_item = {
:description => "T-Shirt",
:quantity => 20,
:net_weight => "1",
:mass_unit => "lb",
:value_amount => "200",
:value_currency => "USD",
:origin_country => "US"
}
customs_declaration = Shippo::CustomsDeclaration.create(
:contents_type => "MERCHANDISE",
:contents_explanation => "T-Shirt purchase",
:non_delivery_option => "RETURN",
:certify => true,
:certify_signer => "Simon Kreuz",
:items => [customs_item]
)
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.customsDeclarations.create({
b13aFilingOption: "FILED_ELECTRONICALLY",
certify: true,
certifySigner: "Shawn Ippotle",
contentsExplanation: "T-Shirt purchase",
exporterIdentification: {
eoriNumber: "PL123456790ABCDE",
taxId: {
number: "123456789",
type: "EIN",
},
},
invoice: "#123123",
metadata: "Order ID #123123",
addressImporter: {
name: "Shwan Ippotle",
company: "Shippo",
street1: "Blumenstraße",
street3: "",
streetNo: "22",
city: "München",
state: "CA",
zip: "80331",
country: "DE",
phone: "80331",
email: "shippotle@shippo.com",
isResidential: true,
},
contentsType: "MERCHANDISE",
eelPfc: "NOEEI_30_37_a",
incoterm: "DDP",
items: [
{
description: "T-Shirt",
massUnit: "lb",
metadata: "Order ID \"123454\"",
netWeight: "5",
originCountry: "",
quantity: 20,
skuCode: "HM-123",
hsCode: "0901.21",
valueAmount: "200",
valueCurrency: "USD",
},
],
nonDeliveryOption: "RETURN",
test: true,
});
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
$customs_item = array(
'description'=> 'T-Shirt',
'quantity'=> '20',
'net_weight'=> '1',
'mass_unit'=> 'lb',
'value_amount'=> '200',
'value_currency'=> 'USD',
'origin_country'=> 'US');
$customs_declaration = Shippo_CustomsDeclaration::create(
array(
'contents_type'=> 'MERCHANDISE',
'contents_explanation'=> 'T-Shirt purchase',
'non_delivery_option'=> 'RETURN',
'certify'=> 'true',
'certify_signer'=> 'Simon Kreuz',
'items'=> array($customs_item)
));
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CustomsDeclarations.CreateAsync(
customsDeclarationCreateRequest: new CustomsDeclarationCreateRequest() {
B13aFilingOption = CustomsDeclarationB13AFilingOptionEnum.FiledElectronically,
Certify = true,
CertifySigner = "Shawn Ippotle",
ContentsExplanation = "T-Shirt purchase",
ExporterIdentification = new CustomsExporterIdentification() {
EoriNumber = "PL123456790ABCDE",
TaxId = new CustomsTaxIdentification() {
Number = "123456789",
Type = 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 = "shippotle@shippo.com",
IsResidential = true,
},
ContentsType = Shippo.Models.Components.CustomsDeclarationContentsTypeEnum.Merchandise,
EelPfc = CustomsDeclarationEelPfcEnum.Noeei3037A,
Incoterm = CustomsDeclarationIncotermEnum.Ddp,
Items = new List() {
new CustomsItemCreateRequest() {
Description = "T-Shirt",
MassUnit = Shippo.Models.Components.WeightUnitEnum.Lb,
Metadata = "Order ID \"123454\"",
NetWeight = "5",
OriginCountry = "",
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
/customs/declarations/{CustomsDeclarationId}:
get:
description: Returns an existing customs declaration using an object ID
operationId: GetCustomsDeclaration
parameters:
- description: Object ID of the customs declaration
in: path
name: CustomsDeclarationId
required: true
schema:
type: string
- $ref: '#/components/parameters/PageNumberQueryParam'
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/customsDeclarationResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve a customs declaration
tags:
- Customs Declarations
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/customs/declarations/e2197a54da9d470480f4f8796cc419cb \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.customs_declarations.get(customs_declaration_id='', page=1)
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Retrieve an existing customs declaration by object_id
Shippo::CustomsDeclaration.get('b741b99f95e841639b54272834bc478c')
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.customsDeclarations.get("", 1);
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Retrieve an existing customs declaration by object_id
Shippo_CustomsDeclaration::retrieve('e2197a54da9d470480f4f8796cc419cb');
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CustomsDeclarations.GetAsync(
customsDeclarationId: "",
page: 1,
shippoApiVersion: "2018-02-08");
// handle response
/customs/items:
get:
description: Returns a list all customs items objects.
operationId: ListCustomsItems
parameters:
- $ref: '#/components/parameters/PageNumberQueryParam'
- $ref: '#/components/parameters/ResultsPerPageQueryParam'
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/customsItemPaginatedResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all customs items
tags:
- Customs Items
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/customs/items/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.customs_items.list(page=1, results=25)
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# List all customs items
Shippo::CustomsItem.all()
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.customsItems.list(1, 25);
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// List all customs items
Shippo_CustomsItem::all();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CustomsItems.ListAsync(
page: 1,
results: 25,
shippoApiVersion: "2018-02-08");
// handle response
post:
description: Creates a new customs item object.
operationId: CreateCustomsItem
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CustomsItemCreateRequest'
description: CustomsItem details.
responses:
'201':
$ref: '#/components/responses/customsItemResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a new customs item
tags:
- Customs Items
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/customs/items/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-d description="T-Shirt" \
-d quantity=2 \
-d net_weight="400" \
-d mass_unit="g" \
-d value_amount="20" \
-d value_currency="USD" \
-d tariff_number="" \
-d origin_country="US" \
-d metadata="Order ID '123123'"
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.customs_items.create(request=components.CustomsItemCreateRequest(
description='T-Shirt',
mass_unit=components.WeightUnitEnum.LB,
metadata='Order ID "123454"',
net_weight='5',
origin_country='',
quantity=20,
sku_code='HM-123',
hs_code='0901.21',
value_amount='200',
value_currency='USD',
))
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.customsItems.create({
description: "T-Shirt",
massUnit: "lb",
metadata: "Order ID \"123454\"",
netWeight: "5",
originCountry: "",
quantity: 20,
skuCode: "HM-123",
hsCode: "0901.21",
valueAmount: "200",
valueCurrency: "USD",
});
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Create customs item
$customs_item = Shippo_CustomsItem::create(
array(
"description" => 'T-Shirt',
"quantity" => 2,
"net_weight" => '400',
"mass_unit" => 'g',
"value_amount" => '20',
"value_currency" => 'USD',
"tariff_number" => '',
"origin_country" => 'US',
"metadata" => 'Order ID #123123'
)
);
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
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 = "",
Quantity = 20,
SkuCode = "HM-123",
HsCode = "0901.21",
ValueAmount = "200",
ValueCurrency = "USD",
},
shippoApiVersion: "2018-02-08");
// handle response
/customs/items/{CustomsItemId}:
get:
description: Returns an existing customs item using an object ID
operationId: GetCustomsItem
parameters:
- description: Object ID of the customs item
in: path
name: CustomsItemId
required: true
schema:
type: string
- $ref: '#/components/parameters/PageNumberQueryParam'
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/customsItemResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve a customs item
tags:
- Customs Items
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/customs/items/55358464c7b740aca199b395536981bd \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.customs_items.get(customs_item_id='', page=1)
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Retrieve an existing customs item by object_id
Shippo::CustomsItem.get('55358464c7b740aca199b395536981bd')
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.customsItems.get("", 1);
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Retrieve an existing customs item by object_id
Shippo_CustomsItem::retrieve('55358464c7b740aca199b395536981bd');
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CustomsItems.GetAsync(
customsItemId: "",
page: 1,
shippoApiVersion: "2018-02-08");
// handle response
/live-rates:
post:
description: |-
Initiates a live rates request. Include either the object ID for
an existing address record or a fully formed address object when entering
an address value. You can also enter the object ID of an existing user parcel
template or a fully formed user parcel template object as the parcel value.
operationId: CreateLiveRate
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LiveRateCreateRequest'
description: Generate rates at checkout
responses:
'200':
$ref: '#/components/responses/liveRatePaginatedResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Generate a live rates request
tags:
- Rates at Checkout
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/live-rates \
-H "Authorization: ShippoToken " \
-H "Content-Type: application/json"
--data-raw '{
"address_from": {
"name": "S. Hippo",
"company": "Shippo",
"street1": "731 Market St #200",
"street_no": "",
"street2": "",
"street3": "",
"city": "San Francisco",
"state": "CA",
"zip": "94103",
"country": "US"
},
"address_to": {
"name": "Bob Bloat",
"company": "SF Zoo",
"street1": "Sloat Blvd. & Upper Great Hwy.",
"street_no": "",
"street2": "",
"street3": "",
"city": "San Francisco",
"state": "CA",
"zip": "94132",
"country": "US"
},
"line_items": [
{
"quantity": 1,
"total_price": "12.00",
"currency": "USD",
"weight": "1.0",
"weight_unit": "lb",
"title": "Hippo Snax",
"manufacture_country": "US",
"sku": "HM-123"
}
],
"parcel": {
"length": "10",
"width": "15",
"height": "10",
"distance_unit": "in",
"weight": "1",
"mass_unit": "lb"
}
}'
- lang: python
label: Python
source: |-
import dateutil.parser
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.rates_at_checkout.create(request=components.LiveRateCreateRequest(
address_from='',
address_to='',
line_items=[
components.LineItem(
currency='USD',
manufacture_country='US',
max_delivery_time=dateutil.parser.isoparse('2016-07-23T00:00:00Z'),
max_ship_time=dateutil.parser.isoparse('2016-07-23T00:00:00Z'),
quantity=20,
sku='HM-123',
title='Hippo Magazines',
total_price='12.1',
variant_title='June Edition',
weight='0.4',
weight_unit=components.WeightUnitEnum.LB,
object_id='abf7d5675d744b6ea9fdb6f796b28f28',
),
],
parcel='5df144dca289442cv7a06',
))
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.ratesAtCheckout.create({
addressFrom: "",
addressTo: "",
lineItems: [
{
currency: "USD",
manufactureCountry: "US",
maxDeliveryTime: new Date("2016-07-23T00:00:00Z"),
maxShipTime: new Date("2016-07-23T00:00:00Z"),
quantity: 20,
sku: "HM-123",
title: "Hippo Magazines",
totalPrice: "12.1",
variantTitle: "June Edition",
weight: "0.4",
weightUnit: "lb",
objectId: "abf7d5675d744b6ea9fdb6f796b28f28",
},
],
parcel: "5df144dca289442cv7a06",
});
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.RatesAtCheckout.CreateAsync(
liveRateCreateRequest: new LiveRateCreateRequest() {
AddressFrom = LiveRateCreateRequestAddressFrom.CreateLiveRateCreateRequestAddressFromStr(
"",
),
AddressTo = LiveRateCreateRequestAddressTo.CreateLiveRateCreateRequestAddressToStr(
"",
),
LineItems = new List() {
new LineItem() {
Currency = "USD",
ManufactureCountry = "US",
MaxDeliveryTime = System.DateTime.Parse("2016-07-23T00:00:00Z"),
MaxShipTime = System.DateTime.Parse("2016-07-23T00:00:00Z"),
Quantity = 20,
Sku = "HM-123",
Title = "Hippo Magazines",
TotalPrice = "12.1",
VariantTitle = "June Edition",
Weight = "0.4",
WeightUnit = WeightUnitEnum.Lb,
ObjectId = "abf7d5675d744b6ea9fdb6f796b28f28",
},
},
Parcel = LiveRateCreateRequestParcel.CreateLiveRateCreateRequestParcelStr(
"5df144dca289442cv7a06",
),
},
shippoApiVersion: "2018-02-08");
// handle response
/live-rates/settings/parcel-template:
get:
description: Retrieve and display the currently configured default parcel template for live rates.
operationId: GetDefaultParcelTemplate
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/defaultParcelTemplateResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Show current default parcel template
tags:
- Rates at Checkout
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/live-rates/settings/parcel-template \
-H "Authorization: ShippoToken " \
-H "Content-Type: application/json"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.rates_at_checkout.get_default_parcel_template()
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.ratesAtCheckout.getDefaultParcelTemplate();
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.RatesAtCheckout.GetDefaultParcelTemplateAsync(shippoApiVersion: "2018-02-08");
// handle response
x-speakeasy-name-override: getDefaultParcelTemplate
put:
description: Update the currently configured default parcel template for live rates. The object_id in the request payload should identify the user parcel template to be the new default.
operationId: UpdateDefaultParcelTemplate
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DefaultParcelTemplateUpdateRequest'
responses:
'200':
$ref: '#/components/responses/defaultParcelTemplateResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Update default parcel template
tags:
- Rates at Checkout
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl -X PUT https://api.goshippo.com/live-rates/settings/parcel-template \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-d '
{
"object_id": "b958d3690bb04bb8b2986724872750f5"
}
'
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.rates_at_checkout.update_default_parcel_template(object_id='b958d3690bb04bb8b2986724872750f5')
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.ratesAtCheckout.updateDefaultParcelTemplate("b958d3690bb04bb8b2986724872750f5");
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.RatesAtCheckout.UpdateDefaultParcelTemplateAsync(
shippoApiVersion: "2018-02-08",
defaultParcelTemplateUpdateRequest: new DefaultParcelTemplateUpdateRequest() {
ObjectId = "b958d3690bb04bb8b2986724872750f5",
});
// handle response
x-speakeasy-name-override: updateDefaultParcelTemplate
delete:
description: Clears the currently configured default parcel template for live rates.
operationId: DeleteDefaultParcelTemplate
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'204':
description: The parcel template was successfully deleted.
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Clear current default parcel template
tags:
- Rates at Checkout
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl -X DELETE https://api.goshippo.com/live-rates/settings/parcel-template \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
s.rates_at_checkout.delete_default_parcel_template()
# Use the SDK ...
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
await shippo.ratesAtCheckout.deleteDefaultParcelTemplate();
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
await sdk.RatesAtCheckout.DeleteDefaultParcelTemplateAsync(shippoApiVersion: "2018-02-08");
x-speakeasy-name-override: deleteDefaultParcelTemplate
/manifests:
get:
description: Returns a list of all manifest objects.
operationId: ListManifests
parameters:
- $ref: '#/components/parameters/PageNumberQueryParam'
- $ref: '#/components/parameters/ResultsPerPageDefault5QueryParam'
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/manifestPaginatedResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all manifests
tags:
- Manifests
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/manifests/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.manifests.list(page=1, results=5)
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# List all manifests
Shippo::Manifest.all()
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.manifests.list(1, 5);
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// List all manifests
Shippo_Manifest::all();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Manifests.ListAsync(
page: 1,
results: 5,
shippoApiVersion: "2018-02-08");
// handle response
post:
description: Creates a new manifest object.
operationId: CreateManifest
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ManifestCreateRequest'
description: Manifest details and contact info.
responses:
'201':
$ref: '#/components/responses/manifestResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a new manifest
tags:
- Manifests
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/manifests/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-d carrier_account="b741b99f95e841639b54272834bc478c", \
-d shipment_date="2014-05-16T23:59:59Z" \
-d address_from="d799c2679e644279b59fe661ac8fa488" \
-d transactions=["64bba01845ef40d29374032599f22588", "c169aa586a844cc49da00d0272b590e1"] \
-d async=false
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.manifests.create(request=components.ManifestCreateRequest(
carrier_account='adcfdddf8ec64b84ad22772bce3ea37a',
shipment_date='2014-05-16T23:59:59Z',
transactions=[
'adcfdddf8ec64b84ad22772bce3ea37a',
],
address_from=components.AddressCreateRequest(
name='Shwan Ippotle',
company='Shippo',
street1='215 Clayton St.',
street3='',
street_no='',
city='San Francisco',
state='CA',
zip='94117',
country='US',
phone='+1 555 341 9393',
email='shippotle@shippo.com',
is_residential=True,
metadata='Customer ID 123456',
validate=True,
),
))
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
manifest = Shippo::Manifest.create(
:carrier_account => "b741b99f95e841639b54272834bc478c",
:shipment_date => "2014-05-16T23:59:59Z",
:transactions => ["64bba01845ef40d29374032599f22588", "c169aa586a844cc49da00d0272b590e1"]
)
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.manifests.create({
carrierAccount: "adcfdddf8ec64b84ad22772bce3ea37a",
shipmentDate: "2014-05-16T23:59:59Z",
transactions: [
"adcfdddf8ec64b84ad22772bce3ea37a",
],
addressFrom: {
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: "shippotle@shippo.com",
isResidential: true,
metadata: "Customer ID 123456",
validate: true,
},
});
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
$manifest = Shippo_Manifest::create(
array(
'carrier_account'=> 'b741b99f95e841639b54272834bc478c',
'shipment_date'=> '2014-05-16T23:59:59Z',
'transactions'=> array('64bba01845ef40d29374032599f22588', 'c169aa586a844cc49da00d0272b590e1')
));
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Manifests.CreateAsync(
manifestCreateRequest: new ManifestCreateRequest() {
CarrierAccount = "adcfdddf8ec64b84ad22772bce3ea37a",
ShipmentDate = "2014-05-16T23:59:59Z",
Transactions = new List() {
"adcfdddf8ec64b84ad22772bce3ea37a",
},
AddressFrom = ManifestCreateRequestAddressFrom.CreateManifestCreateRequestAddressFromAddressCreateRequest(
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 = "shippotle@shippo.com",
IsResidential = true,
Metadata = "Customer ID 123456",
Validate = true,
},
),
},
shippoApiVersion: "2018-02-08");
// handle response
/manifests/{ManifestId}:
get:
description: Returns an existing manifest using an object ID.
operationId: GetManifest
parameters:
- description: Object ID of the manifest to update
in: path
name: ManifestId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/manifestResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve a manifest
tags:
- Manifests
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/manifests/0fadebf6f60c4aca95fa01bcc59c79ae \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.manifests.get(manifest_id='')
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Retrieve an existing manifest by object_id
Shippo::Manifest.get('0fadebf6f60c4aca95fa01bcc59c79ae')
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.manifests.get("");
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Retrieve an existing manifest by object_id
Shippo_Manifest::retrieve('0fadebf6f60c4aca95fa01bcc59c79ae');
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Manifests.GetAsync(
manifestId: "",
shippoApiVersion: "2018-02-08");
// handle response
/orders:
get:
description: Returns a list of all order objects.
operationId: ListOrders
parameters:
- $ref: '#/components/parameters/PageNumberQueryParam'
- $ref: '#/components/parameters/ResultsPerPageQueryParam'
- $ref: '#/components/parameters/ShippoApiVersionHeader'
- description: Filter orders by order status
in: query
name: order_status[]
required: false
schema:
items:
$ref: '#/components/schemas/OrderStatusEnum'
type: array
- description: Filter orders by shop app
in: query
name: shop_app
required: false
schema:
$ref: '#/components/schemas/OrderShopAppEnum'
- description: |-
Filter orders created after the input date and time (ISO 8601 UTC format). This is based on the
`placed_at` field, meaning when the order has been placed, not when the order object was created.
in: query
name: start_date
required: false
schema:
type: string
- description: |-
Filter orders created before the input date and time (ISO 8601 UTC format). This is based on the
`placed_at` field, meaning when the order has been placed, not when the order object was created.
in: query
name: end_date
required: false
schema:
type: string
responses:
'200':
$ref: '#/components/responses/orderPaginatedResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all orders
tags:
- Orders
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/orders/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components, operations
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.orders.list(request=operations.ListOrdersRequest(
order_status=[
components.OrderStatusEnum.PAID,
],
shop_app=components.OrderShopAppEnum.SHIPPO,
))
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.orders.list({
orderStatus: [
"PAID",
],
shopApp: "Shippo",
});
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
ListOrdersRequest req = new ListOrdersRequest() {
OrderStatus = new List() {
Shippo.Models.Components.OrderStatusEnum.Paid,
},
ShopApp = OrderShopAppEnum.Shippo,
};
var res = await sdk.Orders.ListAsync(req);
// handle response
post:
description: Creates a new order object.
operationId: CreateOrder
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OrderCreateRequest'
description: Order details.
responses:
'201':
$ref: '#/components/responses/orderResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a new order
tags:
- Orders
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/orders/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-d '{
"to_address": {
"city": "San Francisco",
"company": "Shippo",
"country": "US",
"email": "shippotle@shippo.com",
"name": "Mr Hippo",
"phone": "15553419393",
"state": "CA",
"street1": "215 Clayton St.",
"zip": "94117"
},
"line_items": [
{
"quantity": 1,
"sku": "HM-123",
"title": "Hippo Magazines",
"total_price": "12.10",
"currency": "USD",
"weight": "0.40",
"weight_unit": "lb"
}
],
"placed_at": "2016-09-23T01:28:12Z",
"order_number": "#1068",
"order_status": "PAID",
"shipping_cost": "12.83",
"shipping_cost_currency": "USD",
"shipping_method": "USPS First Class Package",
"subtotal_price": "12.10",
"total_price": "24.93",
"total_tax": "0.00",
"currency": "USD",
"weight": "0.40",
"weight_unit": "lb"
}'
- lang: python
label: Python
source: |-
import dateutil.parser
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.orders.create(request=components.OrderCreateRequest(
currency='USD',
notes='This customer is a VIP',
order_number='#1068',
order_status=components.OrderStatusEnum.PAID,
placed_at='2016-09-23T01:28:12Z',
shipping_cost='12.83',
shipping_cost_currency='USD',
shipping_method='USPS First Class Package',
subtotal_price='12.1',
total_price='24.93',
total_tax='0.0',
weight='0.4',
weight_unit=components.WeightUnitEnum.LB,
from_address=components.AddressCreateRequest(
name='Shwan Ippotle',
company='Shippo',
street1='215 Clayton St.',
street3='',
street_no='',
city='San Francisco',
state='CA',
zip='94117',
country='US',
phone='+1 555 341 9393',
email='shippotle@shippo.com',
is_residential=True,
metadata='Customer ID 123456',
validate=True,
),
to_address=components.AddressCreateRequest(
name='Shwan Ippotle',
company='Shippo',
street1='215 Clayton St.',
street3='',
street_no='',
city='San Francisco',
state='CA',
zip='94117',
country='US',
phone='+1 555 341 9393',
email='shippotle@shippo.com',
is_residential=True,
metadata='Customer ID 123456',
validate=True,
),
line_items=[
components.LineItemBase(
currency='USD',
manufacture_country='US',
max_delivery_time=dateutil.parser.isoparse('2016-07-23T00:00:00Z'),
max_ship_time=dateutil.parser.isoparse('2016-07-23T00:00:00Z'),
quantity=20,
sku='HM-123',
title='Hippo Magazines',
total_price='12.1',
variant_title='June Edition',
weight='0.4',
weight_unit=components.WeightUnitEnum.LB,
),
],
))
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.orders.create({
currency: "USD",
notes: "This customer is a VIP",
orderNumber: "#1068",
orderStatus: "PAID",
placedAt: "2016-09-23T01:28:12Z",
shippingCost: "12.83",
shippingCostCurrency: "USD",
shippingMethod: "USPS First Class Package",
subtotalPrice: "12.1",
totalPrice: "24.93",
totalTax: "0.0",
weight: "0.4",
weightUnit: "lb",
fromAddress: {
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: "shippotle@shippo.com",
isResidential: true,
metadata: "Customer ID 123456",
validate: true,
},
toAddress: {
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: "shippotle@shippo.com",
isResidential: true,
metadata: "Customer ID 123456",
validate: true,
},
lineItems: [
{
currency: "USD",
manufactureCountry: "US",
maxDeliveryTime: new Date("2016-07-23T00:00:00Z"),
maxShipTime: new Date("2016-07-23T00:00:00Z"),
quantity: 20,
sku: "HM-123",
title: "Hippo Magazines",
totalPrice: "12.1",
variantTitle: "June Edition",
weight: "0.4",
weightUnit: "lb",
},
],
});
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Orders.CreateAsync(
orderCreateRequest: new OrderCreateRequest() {
Currency = "USD",
Notes = "This customer is a VIP",
OrderNumber = "#1068",
OrderStatus = OrderStatusEnum.Paid,
PlacedAt = "2016-09-23T01:28:12Z",
ShippingCost = "12.83",
ShippingCostCurrency = "USD",
ShippingMethod = "USPS First Class Package",
SubtotalPrice = "12.1",
TotalPrice = "24.93",
TotalTax = "0.0",
Weight = "0.4",
WeightUnit = WeightUnitEnum.Lb,
FromAddress = 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 = "shippotle@shippo.com",
IsResidential = true,
Metadata = "Customer ID 123456",
Validate = true,
},
ToAddress = 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 = "shippotle@shippo.com",
IsResidential = true,
Metadata = "Customer ID 123456",
Validate = true,
},
LineItems = new List() {
new LineItemBase() {
Currency = "USD",
ManufactureCountry = "US",
MaxDeliveryTime = System.DateTime.Parse("2016-07-23T00:00:00Z"),
MaxShipTime = System.DateTime.Parse("2016-07-23T00:00:00Z"),
Quantity = 20,
Sku = "HM-123",
Title = "Hippo Magazines",
TotalPrice = "12.1",
VariantTitle = "June Edition",
Weight = "0.4",
WeightUnit = WeightUnitEnum.Lb,
},
},
},
shippoApiVersion: "2018-02-08");
// handle response
/orders/{OrderId}:
get:
description: Retrieves an existing order using an object ID.
operationId: GetOrder
parameters:
- description: Object ID of the order
in: path
name: OrderId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/orderResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve an order
tags:
- Orders
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/orders/4f2bc588e4e5446cb3f9fdb7cd5e190b/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.orders.get(order_id='')
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.orders.get("");
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Orders.GetAsync(
orderId: "",
shippoApiVersion: "2018-02-08");
// handle response
/parcel-templates:
get:
description: |-
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
operationId: ListCarrierParcelTemplates
parameters:
- name: include
description: filter by user or enabled
in: query
schema:
type: string
enum:
- all
- user
- enabled
- name: carrier
description: filter by specific carrier
example: fedex
in: query
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/carrierParcelTemplateListResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all carrier parcel templates
tags:
- Carrier Parcel Templates
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/parcel-templates \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-H "Content-Type: application/json"
- lang: python
label: Python
source: |-
import shippo
from shippo.models import operations
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.carrier_parcel_templates.list(include=operations.Include.ENABLED, carrier='fedex')
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierParcelTemplates.list("enabled", "fedex");
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CarrierParcelTemplates.ListAsync(
include: Include.Enabled,
carrier: "fedex",
shippoApiVersion: "2018-02-08");
// handle response
/parcel-templates/{CarrierParcelTemplateToken}:
get:
description: Fetches the parcel template information for a specific carrier parcel template, identified by the token.
operationId: GetCarrierParcelTemplate
parameters:
- description: The unique string representation of the carrier parcel template
in: path
name: CarrierParcelTemplateToken
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/carrierParcelTemplateResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve a carrier parcel templates
tags:
- Carrier Parcel Templates
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/parcel-templates/Fedex_Box_Small_1 \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-H "Content-Type: application/json"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.carrier_parcel_templates.get(carrier_parcel_template_token='')
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierParcelTemplates.get("");
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.CarrierParcelTemplates.GetAsync(
carrierParcelTemplateToken: "",
shippoApiVersion: "2018-02-08");
// handle response
/parcels:
get:
description: Returns a list of all parcel objects.
operationId: ListParcels
parameters:
- $ref: '#/components/parameters/PageNumberQueryParam'
- $ref: '#/components/parameters/ResultsPerPageQueryParam'
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/parcelPaginatedResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all parcels
tags:
- Parcels
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/parcels/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.parcels.list(page=1, results=25)
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# List all parcels
Shippo::Parcel.all()
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.parcels.list(1, 25);
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// List all parcels
Shippo_Parcel::all();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Parcels.ListAsync(
page: 1,
results: 25,
shippoApiVersion: "2018-02-08");
// handle response
post:
description: Creates a new parcel object.
operationId: CreateParcel
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/ParcelCreateRequest'
- $ref: '#/components/schemas/ParcelCreateFromTemplateRequest'
description: Parcel details.
responses:
'201':
$ref: '#/components/responses/parcelResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a new parcel
tags:
- Parcels
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/parcels/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-d length=5 \
-d width=5 \
-d height=5 \
-d distance_unit="cm" \
-d weight=2 \
-d mass_unit="lb" \
-d template="" \
-d metadata="Customer ID 123456"
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.parcels.create(request=components.ParcelCreateRequest(
extra=components.ParcelExtra(
cod=components.Cod(
amount='5.5',
currency='USD',
payment_method=components.PaymentMethod.CASH,
),
insurance=components.ParcelInsurance(
amount='5.5',
content='Laptop',
currency='USD',
provider=components.ParcelInsuranceProvider.UPS,
),
),
metadata='Customer ID 123456',
mass_unit=components.WeightUnitEnum.LB,
weight='1',
distance_unit=components.DistanceUnitEnum.IN,
height='1',
length='1',
width='1',
))
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Create parcel object
parcel = Shippo::Parcel.create(
:length => 5,
:width => 1,
:height => 5.555,
:distance_unit => :cm,
:weight => 2,
:mass_unit => :lb
)
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.parcels.create({
extra: {
cod: {
amount: "5.5",
currency: "USD",
paymentMethod: "CASH",
},
insurance: {
amount: "5.5",
content: "Laptop",
currency: "USD",
provider: "UPS",
},
},
metadata: "Customer ID 123456",
massUnit: "lb",
weight: "1",
distanceUnit: "in",
height: "1",
length: "1",
width: "1",
});
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Create parcel object
$parcel = Shippo_Parcel::create(array(
"length"=> "5",
"width"=> "5",
"height"=> "5",
"distance_unit"=> "in",
"weight"=> "2",
"mass_unit"=> "lb",
));
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Parcels.CreateAsync(
requestBody: CreateParcelRequestBody.CreateCreateParcelRequestBodyParcelCreateRequest(
new ParcelCreateRequest() {
Extra = new ParcelExtra() {
Cod = new Cod() {
Amount = "5.5",
Currency = "USD",
PaymentMethod = PaymentMethod.Cash,
},
Insurance = new ParcelInsurance() {
Amount = "5.5",
Content = "Laptop",
Currency = "USD",
Provider = ParcelInsuranceProvider.Ups,
},
},
Metadata = "Customer ID 123456",
MassUnit = Shippo.Models.Components.WeightUnitEnum.Lb,
Weight = "1",
DistanceUnit = Shippo.Models.Components.DistanceUnitEnum.In,
Height = "1",
Length = "1",
Width = "1",
},
),
shippoApiVersion: "2018-02-08");
// handle response
/parcels/{ParcelId}:
get:
description: Returns parcel details using an existing parcel object ID (this will not return parcel details associated with un-purchased shipment/rate parcel object IDs).
operationId: GetParcel
parameters:
- description: Object ID of the parcel
in: path
name: ParcelId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/parcelResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve an existing parcel
tags:
- Parcels
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/parcels/7df2ecf8b4224763ab7c71fae7ec8274/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.parcels.get(parcel_id='')
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Retrieve an existing parcel by object_id
Shippo::Parcel.get('fcd9c72b564d4bfa8c03299ed6545132')
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.parcels.get("");
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Retrieve an existing parcel by object_id
Shippo_Parcel::retrieve('fcd9c72b564d4bfa8c03299ed6545132');
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Parcels.GetAsync(
parcelId: "",
shippoApiVersion: "2018-02-08");
// handle response
/pickups:
post:
description: Creates a pickup object. This request is for a carrier to come to a specified location to take a package for shipping.
operationId: CreatePickup
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PickupCreateRequest'
description: Shippo’s pickups endpoint allows you to schedule pickups with USPS and DHL Express for eligible shipments that you have already created.
responses:
'201':
$ref: '#/components/responses/pickupResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a pickup
tags:
- Pickups
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/pickups/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-H "Content-Type: application/json" \
-d '{
"carrier_account":"6c51273296864869829b96a80fb13ea1",
"location":{
"building_location_type": "Other",
"building_type": "suite",
"instructions": "Behind screen door",
"address": {
"name": "Mrs Hippo",
"company": "Hungry Hippos",
"street1": "965 Mission St #201",
"city": "San Francisco",
"state": "CA",
"zip": "95122",
"country": "US",
"phone": "+14159876543",
"email": "mrshippo@shippo.com"
}
},
"transactions": ["7439c279b374494c9a80ca24f59e6fc5"],
"requested_start_time":"2020-05-12T12:00:00Z",
"requested_end_time": "2020-05-12T16:00:00Z",
"metadata": "Customer ID 123456",
"is_test": false
}'
- lang: python
label: Python
source: |-
import dateutil.parser
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.pickups.create(request=components.PickupBase(
carrier_account='adcfdddf8ec64b84ad22772bce3ea37a',
location=components.Location(
address=components.AddressCompleteCreateRequest(
name='Shwan Ippotle',
company='Shippo',
street1='215 Clayton St.',
street3='',
street_no='',
city='San Francisco',
state='CA',
zip='94117',
country='US',
phone='+1 555 341 9393',
email='shippotle@shippo.com',
is_residential=True,
metadata='Customer ID 123456',
validate=True,
),
building_location_type=components.BuildingLocationType.FRONT_DOOR,
building_type=components.BuildingType.APARTMENT,
instructions='Behind screen door',
),
requested_end_time=dateutil.parser.isoparse('2023-06-18T07:14:55.676Z'),
requested_start_time=dateutil.parser.isoparse('2023-06-21T08:42:38.998Z'),
transactions=[
'adcfdddf8ec64b84ad22772bce3ea37a',
],
))
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.pickups.create({
carrierAccount: "adcfdddf8ec64b84ad22772bce3ea37a",
location: {
address: {
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: "shippotle@shippo.com",
isResidential: true,
metadata: "Customer ID 123456",
validate: true,
},
buildingLocationType: "Front Door",
buildingType: "apartment",
instructions: "Behind screen door",
},
requestedEndTime: new Date("2023-06-18T07:14:55.676Z"),
requestedStartTime: new Date("2023-06-21T08:42:38.998Z"),
transactions: [
"adcfdddf8ec64b84ad22772bce3ea37a",
],
});
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Pickups.CreateAsync(
pickupBase: new PickupBase() {
CarrierAccount = "adcfdddf8ec64b84ad22772bce3ea37a",
Location = new Location() {
Address = new AddressCompleteCreateRequest() {
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 = "shippotle@shippo.com",
IsResidential = true,
Metadata = "Customer ID 123456",
Validate = true,
},
BuildingLocationType = Shippo.Models.Components.BuildingLocationType.FrontDoor,
BuildingType = BuildingType.Apartment,
Instructions = "Behind screen door",
},
RequestedEndTime = System.DateTime.Parse("2023-06-18T07:14:55.676Z"),
RequestedStartTime = System.DateTime.Parse("2023-06-21T08:42:38.998Z"),
Transactions = new List() {
"adcfdddf8ec64b84ad22772bce3ea37a",
},
},
shippoApiVersion: "2018-02-08");
// handle response
/rates/{RateId}:
get:
description: Returns an existing rate using a rate object ID.
operationId: GetRate
parameters:
- description: Object ID of the rate
in: path
name: RateId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/rateResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve a rate
tags:
- Rates
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/rates/ee81fab0372e419ab52245c8952ccaeb \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.rates.get(rate_id='')
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Wait for rates to be generated
timeout_rates_request = 10 # seconds
while ["QUEUED","WAITING"].include? shipment.status do
Timeout::timeout(timeout_rates_request) do
shipment = Shippo::Shipment.get(shipment["object_id"])
end
end
# Retrieve all rates
rates = shipment.rates()
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.rates.get("");
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Check if rate generation has been finished
$attempts = 0;
while ( ( $shipment["status"] == "QUEUED" || $shipment["status"] == "WAITING" ) && $attempts < 10 ){
$shipment = Shippo_Shipment::retrieve( $shipment["object_id"] );
$attempts += 1;
}
// Retrieve all rates
$rates = Shippo_Shipment::get_shipping_rates( array( 'id'=> $shipment["object_id"] ) );
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Rates.GetAsync(
rateId: "",
shippoApiVersion: "2018-02-08");
// handle response
/refunds:
post:
description: Creates a new refund object.
operationId: CreateRefund
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RefundRequestBody'
description: Refund details
responses:
'201':
$ref: '#/components/responses/refundResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a refund
tags:
- Refunds
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/refunds/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-d transaction="4503427478ea45a899e9b54abc4c5803"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.refunds.create(transaction='915d94940ea54c3a80cbfa328722f5a1', async_=False)
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: refund = Shippo::Refund.create(:transaction => "35ed59f23a514ecfa2faeaed93a00086", :async => false)
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.refunds.create("915d94940ea54c3a80cbfa328722f5a1", false);
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: $refund = Shippo_Refund::create( array("transaction" => "35ed59f23a514ecfa2faeaed93a00086", "async" => false));
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Refunds.CreateAsync(
refundRequestBody: new RefundRequestBody() {
Async = false,
Transaction = "915d94940ea54c3a80cbfa328722f5a1",
},
shippoApiVersion: "2018-02-08");
// handle response
/refunds/:
get:
description: Returns a list all refund objects.
operationId: ListRefunds
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/refundPaginatedResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all refunds
tags:
- Refunds
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/refunds/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.refunds.list()
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# List all refunds
Shippo::Refund.all()
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.refunds.list();
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// List all refunds
Shippo_Refund::all();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Refunds.ListAsync(shippoApiVersion: "2018-02-08");
// handle response
/refunds/{RefundId}:
get:
description: Returns an existing rate using a rate object ID.
operationId: GetRefund
parameters:
- description: Object ID of the refund to update
in: path
name: RefundId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/refundResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Retrieve a refund
tags:
- Refunds
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/refunds/d7c811cff9e24e4387418876f1ffd371 \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.refunds.get(refund_id='')
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# Retrieve an existing refund by object_id
Shippo::Refund.get('d7c811cff9e24e4387418876f1ffd371')
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.refunds.get("");
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// Retrieve an existing refund by object_id
Shippo_Refund::retrieve('d7c811cff9e24e4387418876f1ffd371');
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.Refunds.GetAsync(
refundId: "",
shippoApiVersion: "2018-02-08");
// handle response
/service-groups:
get:
description: Returns a list of service group objects.
operationId: ListServiceGroups
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/serviceGroupListResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all service groups
tags:
- Service Groups
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/service-groups \
-H "Authorization: ShippoToken " \
-H "Content-Type: application/json"
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.service_groups.list()
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.serviceGroups.list();
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.ServiceGroups.ListAsync(shippoApiVersion: "2018-02-08");
// handle response
post:
description: Creates a new service group.
operationId: CreateServiceGroup
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceGroupCreateRequest'
responses:
'201':
$ref: '#/components/responses/serviceGroupResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a new service group
tags:
- Service Groups
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl -X POST https://api.goshippo.com/service-groups \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-H "Content-Type: application/json" \
-d '{
"name": "UPS shipping",
"description": "UPS shipping options",
"flat_rate": "5",
"flat_rate_currency": "USD",
"type": "LIVE_RATE",
"rate_adjustment": 15,
"service_levels": [
{
"account_object_id": "80feb1633d4a43c898f0058506cfd82d",
"service_level_token": "ups_next_day_air_saver"
},
{
"account_object_id": "80feb1633d4a43c898f0058506cfd82d",
"service_level_token": "ups_ground"
}
]
}'
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.service_groups.create(request=components.ServiceGroupCreateRequest(
description='USPS shipping options',
flat_rate='5',
flat_rate_currency='USD',
free_shipping_threshold_currency='USD',
free_shipping_threshold_min='5',
name='USPS Shipping',
rate_adjustment=15,
type=components.ServiceGroupTypeEnum.FLAT_RATE,
service_levels=[
components.ServiceGroupAccountAndServiceLevel(
account_object_id='80feb1633d4a43c898f0058506cfd82d',
service_level_token='ups_next_day_air_saver',
),
],
))
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.serviceGroups.create({
description: "USPS shipping options",
flatRate: "5",
flatRateCurrency: "USD",
freeShippingThresholdCurrency: "USD",
freeShippingThresholdMin: "5",
name: "USPS Shipping",
rateAdjustment: 15,
type: "FLAT_RATE",
serviceLevels: [
{
accountObjectId: "80feb1633d4a43c898f0058506cfd82d",
serviceLevelToken: "ups_next_day_air_saver",
},
],
});
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.ServiceGroups.CreateAsync(
serviceGroupCreateRequest: new ServiceGroupCreateRequest() {
Description = "USPS shipping options",
FlatRate = "5",
FlatRateCurrency = "USD",
FreeShippingThresholdCurrency = "USD",
FreeShippingThresholdMin = "5",
Name = "USPS Shipping",
RateAdjustment = 15,
Type = Shippo.Models.Components.ServiceGroupTypeEnum.FlatRate,
ServiceLevels = new List() {
new ServiceGroupAccountAndServiceLevel() {
AccountObjectId = "80feb1633d4a43c898f0058506cfd82d",
ServiceLevelToken = "ups_next_day_air_saver",
},
},
},
shippoApiVersion: "2018-02-08");
// handle response
put:
description: Updates an existing service group object.
The object_id cannot be updated as it is the unique identifier for the object.
operationId: UpdateServiceGroup
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceGroupUpdateRequest'
responses:
'200':
$ref: '#/components/responses/serviceGroupResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Update an existing service group
tags:
- Service Groups
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl -X PUT https://api.goshippo.com/service-groups \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-H "Content-Type: application/json" \
-d '{
"object_id": "7552000a5f71473c9378e98fc7322c99",
"name": "UPS shipping",
"description": "UPS shipping options, updated",
"flat_rate": "20",
"flat_rate_currency": "USD",
"type": "LIVE_RATE",
"rate_adjustment": 15,
"service_levels": [
{
"account_object_id": "80feb1633d4a43c898f0058506cfd82d",
"service_level_token": "ups_next_day_air_saver"
},
{
"account_object_id": "80feb1633d4a43c898f0058506cfd82d",
"service_level_token": "ups_ground"
}
]
}'
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.service_groups.update(request=components.ServiceGroupUpdateRequest(
description='USPS shipping options',
flat_rate='5',
flat_rate_currency='USD',
free_shipping_threshold_currency='USD',
free_shipping_threshold_min='5',
name='USPS Shipping',
rate_adjustment=15,
type=components.ServiceGroupTypeEnum.FLAT_RATE,
object_id='80feb1633d4a43c898f005850',
is_active=True,
service_levels=[
components.ServiceGroupAccountAndServiceLevel(
account_object_id='80feb1633d4a43c898f0058506cfd82d',
service_level_token='ups_next_day_air_saver',
),
],
))
if res is not None:
# handle response
pass
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.serviceGroups.update({
description: "USPS shipping options",
flatRate: "5",
flatRateCurrency: "USD",
freeShippingThresholdCurrency: "USD",
freeShippingThresholdMin: "5",
name: "USPS Shipping",
rateAdjustment: 15,
type: "FLAT_RATE",
objectId: "80feb1633d4a43c898f005850",
isActive: true,
serviceLevels: [
{
accountObjectId: "80feb1633d4a43c898f0058506cfd82d",
serviceLevelToken: "ups_next_day_air_saver",
},
],
});
// Handle the result
console.log(result)
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
var res = await sdk.ServiceGroups.UpdateAsync(
shippoApiVersion: "2018-02-08",
serviceGroupUpdateRequest: new ServiceGroupUpdateRequest() {
Description = "USPS shipping options",
FlatRate = "5",
FlatRateCurrency = "USD",
FreeShippingThresholdCurrency = "USD",
FreeShippingThresholdMin = "5",
Name = "USPS Shipping",
RateAdjustment = 15,
Type = Shippo.Models.Components.ServiceGroupTypeEnum.FlatRate,
ObjectId = "80feb1633d4a43c898f005850",
IsActive = true,
ServiceLevels = new List() {
new ServiceGroupAccountAndServiceLevel() {
AccountObjectId = "80feb1633d4a43c898f0058506cfd82d",
ServiceLevelToken = "ups_next_day_air_saver",
},
},
});
// handle response
/service-groups/{ServiceGroupId}:
delete:
description: Deletes an existing service group using an object ID.
operationId: DeleteServiceGroup
parameters:
- description: Object ID of the service group
in: path
name: ServiceGroupId
required: true
schema:
type: string
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'204':
description: The service group was successfully deleted.
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Delete a service group
tags:
- Service Groups
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl -x DELETE https://api.goshippo.com/service-groups/80feb1633d4a43c898f0058506cfd82d \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
- lang: python
label: Python
source: |-
import shippo
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
s.service_groups.delete(service_group_id='')
# Use the SDK ...
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
await shippo.serviceGroups.delete("");
}
run();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
await sdk.ServiceGroups.DeleteAsync(
serviceGroupId: "",
shippoApiVersion: "2018-02-08");
/shipments:
get:
description: |-
Returns a list of all shipment objects.
In order to filter results, you must use the below path parameters.
A maximum date range of 90 days is permitted.
Provided dates should be ISO 8601 UTC dates (timezone offsets are currently not supported).
Optional path parameters:
`object_created_gt`- object(s) created greater than a provided date time
`object_created_gte` - object(s) created greater than or equal to a provided date time
`object_created_lt` - object(s) created less than a provided date time
`object_created_lte` - object(s) created less than or equal to a provided date time
Date format examples:
`2017-01-01`
`2017-01-01T03:30:30` or `2017-01-01T03:30:30.5`
`2017-01-01T03:30:30Z`
Example URL:
`https://api.goshippo.com/shipments/?object_created_gte=2017-01-01T00:00:30&object_created_lt=2017-04-01T00:00:30`
operationId: ListShipments
parameters:
- $ref: '#/components/parameters/PageNumberQueryParam'
- $ref: '#/components/parameters/ResultsPerPageQueryParam'
- $ref: '#/components/parameters/ObjectCreatedGtQueryParam'
- $ref: '#/components/parameters/ObjectCreatedGteQueryParam'
- $ref: '#/components/parameters/ObjectCreatedLtQueryParam'
- $ref: '#/components/parameters/ObjectCreatedLteQueryParam'
- $ref: '#/components/parameters/ShippoApiVersionHeader'
responses:
'200':
$ref: '#/components/responses/shipmentPaginatedResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: List all shipments
tags:
- Shipments
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/shipments/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"
- lang: python
label: Python
source: |-
import shippo
from shippo.models import operations
s = shippo.Shippo(
api_key_header="ShippoToken ",
shippo_api_version='2018-02-08',
)
res = s.shipments.list(request=operations.ListShipmentsRequest())
if res is not None:
# handle response
pass
- label: Ruby
lang: Ruby
source: |-
# List all shipments
Shippo::Shipment.list()
- lang: typescript
label: Typescript
source: |-
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.shipments.list({});
// Handle the result
console.log(result)
}
run();
- label: PHP
lang: PHP
source: |-
// List all shipments
Shippo_Shipment::all();
- lang: csharp
label: C#
source: |-
using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken ",
shippoApiVersion: "2018-02-08");
ListShipmentsRequest req = new ListShipmentsRequest() {};
var res = await sdk.Shipments.ListAsync(req);
// handle response
post:
description: Creates a new shipment object.
operationId: CreateShipment
parameters:
- $ref: '#/components/parameters/ShippoApiVersionHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ShipmentCreateRequest'
description: Shipment details and contact info.
responses:
'201':
$ref: '#/components/responses/shipmentResponse'
'400':
$ref: '#/components/responses/badRequestResponse'
summary: Create a new shipment
tags:
- Shipments
x-codeSamples:
- label: cURL
lang: cURL
source: |-
curl https://api.goshippo.com/shipments/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-H "Content-Type: application/json" \
-d $'{
"address_to": {
"name": "Mr Hippo",
"street1": "965 Mission St #572",
"city": "San Francisco",
"state": "CA",
"zip": "94103",
"country": "US",
"phone": "4151234567",
"email": "mrhippo@shippo.com"
},
"address_from": {
"name": "Mrs Hippo",
"street1": "1092 Indian Summer Ct",
"city": "San Jose",
"state": "CA",
"zip": "95122",
"country": "US",
"phone": "4159876543",
"email": "mrshippo@shippo.com"
},
"parcels": [{
"length": "10",
"width": "15",
"height": "10",
"distance_unit": "in",
"weight": "1",
"mass_unit": "lb"
}],
"async": false
}'
- lang: python
label: Python
source: |-
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="ShippoToken