curl https://api.goshippo.com/orders/ \
-H "Authorization: ShippoToken <API_TOKEN>" \
-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"
}'import dateutil.parser
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header='ShippoToken <API_TOKEN>',
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
passimport { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken <API_TOKEN>",
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();using Shippo;
using Shippo.Models.Components;
using System;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken <API_TOKEN>",
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<LineItemBase>() {
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 responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use Shippo\API;
use Shippo\API\Models\Components;
use Shippo\API\Utils;
$sdk = API\Shippo::builder()
->setSecurity(
'ShippoToken <API_TOKEN>'
)
->setShippoApiVersion('2018-02-08')
->build();
$orderCreateRequest = new Components\OrderCreateRequest(
currency: 'USD',
notes: 'This customer is a VIP',
orderNumber: '#1068',
orderStatus: Components\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: Components\WeightUnitEnum::Lb,
fromAddress: new Components\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 Components\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 Components\LineItemBase(
currency: 'USD',
manufactureCountry: 'US',
maxDeliveryTime: Utils\Utils::parseDateTime('2016-07-23T00:00:00Z'),
maxShipTime: Utils\Utils::parseDateTime('2016-07-23T00:00:00Z'),
quantity: 20,
sku: 'HM-123',
title: 'Hippo Magazines',
totalPrice: '12.1',
variantTitle: 'June Edition',
weight: '0.4',
weightUnit: Components\WeightUnitEnum::Lb,
),
],
);
$response = $sdk->orders->create(
orderCreateRequest: $orderCreateRequest,
shippoApiVersion: '2018-02-08'
);
if ($response->order !== null) {
// handle response
}package hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.components.AddressCreateRequest;
import com.goshippo.shippo_sdk.models.components.LineItemBase;
import com.goshippo.shippo_sdk.models.components.OrderCreateRequest;
import com.goshippo.shippo_sdk.models.components.OrderStatusEnum;
import com.goshippo.shippo_sdk.models.components.WeightUnitEnum;
import com.goshippo.shippo_sdk.models.operations.CreateOrderResponse;
import java.lang.Exception;
import java.time.OffsetDateTime;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("ShippoToken <API_TOKEN>")
.shippoApiVersion("2018-02-08")
.build();
CreateOrderResponse res = sdk.orders().create()
.shippoApiVersion("2018-02-08")
.orderCreateRequest(OrderCreateRequest.builder()
.placedAt("2016-09-23T01:28:12Z")
.toAddress(AddressCreateRequest.builder()
.country("US")
.name("Shwan Ippotle")
.company("Shippo")
.street1("215 Clayton St.")
.street3("")
.streetNo("")
.city("San Francisco")
.state("CA")
.zip("94117")
.phone("+1 555 341 9393")
.email("shippotle@shippo.com")
.isResidential(true)
.metadata("Customer ID 123456")
.validate(true)
.build())
.currency("USD")
.notes("This customer is a VIP")
.orderNumber("#1068")
.orderStatus(OrderStatusEnum.PAID)
.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(AddressCreateRequest.builder()
.country("US")
.name("Shwan Ippotle")
.company("Shippo")
.street1("215 Clayton St.")
.street3("")
.streetNo("")
.city("San Francisco")
.state("CA")
.zip("94117")
.phone("+1 555 341 9393")
.email("shippotle@shippo.com")
.isResidential(true)
.metadata("Customer ID 123456")
.validate(true)
.build())
.lineItems(List.of(
LineItemBase.builder()
.currency("USD")
.manufactureCountry("US")
.maxDeliveryTime(OffsetDateTime.parse("2016-07-23T00:00:00Z"))
.maxShipTime(OffsetDateTime.parse("2016-07-23T00:00:00Z"))
.quantity(20L)
.sku("HM-123")
.title("Hippo Magazines")
.totalPrice("12.1")
.variantTitle("June Edition")
.weight("0.4")
.weightUnit(WeightUnitEnum.LB)
.build()))
.build())
.call();
if (res.order().isPresent()) {
// handle response
}
}
}const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
placed_at: '2016-09-23T01:28:12Z',
to_address: {
country: 'US',
name: 'Shwan Ippotle',
company: 'Shippo',
street1: '215 Clayton St.',
street2: '<string>',
street3: '',
street_no: '',
city: 'San Francisco',
state: 'CA',
zip: '94117',
phone: '+1 555 341 9393',
email: 'shippotle@shippo.com',
is_residential: true,
metadata: 'Customer ID 123456',
validate: true
},
currency: 'USD',
notes: 'This customer is a VIP',
order_number: '#1068',
order_status: 'PAID',
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: 'lb',
line_items: [
{
currency: 'USD',
manufacture_country: 'US',
max_delivery_time: '2016-07-23T00:00:00Z',
max_ship_time: '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: 'lb'
}
]
})
};
fetch('https://api.goshippo.com/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goshippo.com/orders"
payload := strings.NewReader("{\n \"placed_at\": \"2016-09-23T01:28:12Z\",\n \"to_address\": {\n \"country\": \"US\",\n \"name\": \"Shwan Ippotle\",\n \"company\": \"Shippo\",\n \"street1\": \"215 Clayton St.\",\n \"street2\": \"<string>\",\n \"street3\": \"\",\n \"street_no\": \"\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zip\": \"94117\",\n \"phone\": \"+1 555 341 9393\",\n \"email\": \"shippotle@shippo.com\",\n \"is_residential\": true,\n \"metadata\": \"Customer ID 123456\",\n \"validate\": true\n },\n \"currency\": \"USD\",\n \"notes\": \"This customer is a VIP\",\n \"order_number\": \"#1068\",\n \"order_status\": \"PAID\",\n \"shipping_cost\": \"12.83\",\n \"shipping_cost_currency\": \"USD\",\n \"shipping_method\": \"USPS First Class Package\",\n \"subtotal_price\": \"12.1\",\n \"total_price\": \"24.93\",\n \"total_tax\": \"0.0\",\n \"weight\": \"0.4\",\n \"weight_unit\": \"lb\",\n \"line_items\": [\n {\n \"currency\": \"USD\",\n \"manufacture_country\": \"US\",\n \"max_delivery_time\": \"2016-07-23T00:00:00Z\",\n \"max_ship_time\": \"2016-07-23T00:00:00Z\",\n \"quantity\": 20,\n \"sku\": \"HM-123\",\n \"title\": \"Hippo Magazines\",\n \"total_price\": \"12.1\",\n \"variant_title\": \"June Edition\",\n \"weight\": \"0.4\",\n \"weight_unit\": \"lb\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.goshippo.com/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"placed_at\": \"2016-09-23T01:28:12Z\",\n \"to_address\": {\n \"country\": \"US\",\n \"name\": \"Shwan Ippotle\",\n \"company\": \"Shippo\",\n \"street1\": \"215 Clayton St.\",\n \"street2\": \"<string>\",\n \"street3\": \"\",\n \"street_no\": \"\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zip\": \"94117\",\n \"phone\": \"+1 555 341 9393\",\n \"email\": \"shippotle@shippo.com\",\n \"is_residential\": true,\n \"metadata\": \"Customer ID 123456\",\n \"validate\": true\n },\n \"currency\": \"USD\",\n \"notes\": \"This customer is a VIP\",\n \"order_number\": \"#1068\",\n \"order_status\": \"PAID\",\n \"shipping_cost\": \"12.83\",\n \"shipping_cost_currency\": \"USD\",\n \"shipping_method\": \"USPS First Class Package\",\n \"subtotal_price\": \"12.1\",\n \"total_price\": \"24.93\",\n \"total_tax\": \"0.0\",\n \"weight\": \"0.4\",\n \"weight_unit\": \"lb\",\n \"line_items\": [\n {\n \"currency\": \"USD\",\n \"manufacture_country\": \"US\",\n \"max_delivery_time\": \"2016-07-23T00:00:00Z\",\n \"max_ship_time\": \"2016-07-23T00:00:00Z\",\n \"quantity\": 20,\n \"sku\": \"HM-123\",\n \"title\": \"Hippo Magazines\",\n \"total_price\": \"12.1\",\n \"variant_title\": \"June Edition\",\n \"weight\": \"0.4\",\n \"weight_unit\": \"lb\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"placed_at": "2016-09-23T01:28:12Z",
"to_address": {
"country": "US",
"name": "Shwan Ippotle",
"company": "Shippo",
"street1": "215 Clayton St.",
"street2": "<string>",
"street3": "",
"street_no": "",
"city": "San Francisco",
"state": "CA",
"zip": "94117",
"phone": "+1 555 341 9393",
"email": "shippotle@shippo.com",
"is_residential": true,
"metadata": "Customer ID 123456",
"is_complete": true,
"latitude": 123,
"longitude": 123,
"object_created": "2014-07-09T02:19:13.174Z",
"object_id": "d799c2679e644279b59fe661ac8fa488",
"object_owner": "shippotle@shippo.com",
"object_updated": "2014-07-09T02:19:13.174Z",
"validation_results": {
"is_valid": false,
"messages": [
{
"code": "Unknown Street",
"source": "Shippo Address Validator",
"text": "City, State and ZIP Code are valid, but street address is not a match.",
"type": "address_warning"
}
]
},
"test": false
},
"currency": "USD",
"notes": "This customer is a VIP",
"order_number": "#1068",
"order_status": "PAID",
"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": "lb",
"from_address": {
"country": "US",
"name": "Shwan Ippotle",
"company": "Shippo",
"street1": "215 Clayton St.",
"street2": "<string>",
"street3": "",
"street_no": "",
"city": "San Francisco",
"state": "CA",
"zip": "94117",
"phone": "+1 555 341 9393",
"email": "shippotle@shippo.com",
"is_residential": true,
"metadata": "Customer ID 123456",
"is_complete": true,
"latitude": 123,
"longitude": 123,
"object_created": "2014-07-09T02:19:13.174Z",
"object_id": "d799c2679e644279b59fe661ac8fa488",
"object_owner": "shippotle@shippo.com",
"object_updated": "2014-07-09T02:19:13.174Z",
"validation_results": {
"is_valid": false,
"messages": [
{
"code": "Unknown Street",
"source": "Shippo Address Validator",
"text": "City, State and ZIP Code are valid, but street address is not a match.",
"type": "address_warning"
}
]
},
"test": false
},
"line_items": [
{
"currency": "USD",
"manufacture_country": "US",
"max_delivery_time": "2016-07-23T00:00:00Z",
"max_ship_time": "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": "lb",
"object_id": "abf7d5675d744b6ea9fdb6f796b28f28"
}
],
"object_id": "adcfdddf8ec64b84ad22772bce3ea37a",
"object_owner": "shippotle@shippo.com",
"shop_app": "Shippo",
"transactions": [
{}
]
}{}Create a new order
Creates a new order object.
curl https://api.goshippo.com/orders/ \
-H "Authorization: ShippoToken <API_TOKEN>" \
-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"
}'import dateutil.parser
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header='ShippoToken <API_TOKEN>',
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
passimport { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken <API_TOKEN>",
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();using Shippo;
using Shippo.Models.Components;
using System;
using System.Collections.Generic;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken <API_TOKEN>",
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<LineItemBase>() {
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 responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use Shippo\API;
use Shippo\API\Models\Components;
use Shippo\API\Utils;
$sdk = API\Shippo::builder()
->setSecurity(
'ShippoToken <API_TOKEN>'
)
->setShippoApiVersion('2018-02-08')
->build();
$orderCreateRequest = new Components\OrderCreateRequest(
currency: 'USD',
notes: 'This customer is a VIP',
orderNumber: '#1068',
orderStatus: Components\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: Components\WeightUnitEnum::Lb,
fromAddress: new Components\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 Components\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 Components\LineItemBase(
currency: 'USD',
manufactureCountry: 'US',
maxDeliveryTime: Utils\Utils::parseDateTime('2016-07-23T00:00:00Z'),
maxShipTime: Utils\Utils::parseDateTime('2016-07-23T00:00:00Z'),
quantity: 20,
sku: 'HM-123',
title: 'Hippo Magazines',
totalPrice: '12.1',
variantTitle: 'June Edition',
weight: '0.4',
weightUnit: Components\WeightUnitEnum::Lb,
),
],
);
$response = $sdk->orders->create(
orderCreateRequest: $orderCreateRequest,
shippoApiVersion: '2018-02-08'
);
if ($response->order !== null) {
// handle response
}package hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.components.AddressCreateRequest;
import com.goshippo.shippo_sdk.models.components.LineItemBase;
import com.goshippo.shippo_sdk.models.components.OrderCreateRequest;
import com.goshippo.shippo_sdk.models.components.OrderStatusEnum;
import com.goshippo.shippo_sdk.models.components.WeightUnitEnum;
import com.goshippo.shippo_sdk.models.operations.CreateOrderResponse;
import java.lang.Exception;
import java.time.OffsetDateTime;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("ShippoToken <API_TOKEN>")
.shippoApiVersion("2018-02-08")
.build();
CreateOrderResponse res = sdk.orders().create()
.shippoApiVersion("2018-02-08")
.orderCreateRequest(OrderCreateRequest.builder()
.placedAt("2016-09-23T01:28:12Z")
.toAddress(AddressCreateRequest.builder()
.country("US")
.name("Shwan Ippotle")
.company("Shippo")
.street1("215 Clayton St.")
.street3("")
.streetNo("")
.city("San Francisco")
.state("CA")
.zip("94117")
.phone("+1 555 341 9393")
.email("shippotle@shippo.com")
.isResidential(true)
.metadata("Customer ID 123456")
.validate(true)
.build())
.currency("USD")
.notes("This customer is a VIP")
.orderNumber("#1068")
.orderStatus(OrderStatusEnum.PAID)
.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(AddressCreateRequest.builder()
.country("US")
.name("Shwan Ippotle")
.company("Shippo")
.street1("215 Clayton St.")
.street3("")
.streetNo("")
.city("San Francisco")
.state("CA")
.zip("94117")
.phone("+1 555 341 9393")
.email("shippotle@shippo.com")
.isResidential(true)
.metadata("Customer ID 123456")
.validate(true)
.build())
.lineItems(List.of(
LineItemBase.builder()
.currency("USD")
.manufactureCountry("US")
.maxDeliveryTime(OffsetDateTime.parse("2016-07-23T00:00:00Z"))
.maxShipTime(OffsetDateTime.parse("2016-07-23T00:00:00Z"))
.quantity(20L)
.sku("HM-123")
.title("Hippo Magazines")
.totalPrice("12.1")
.variantTitle("June Edition")
.weight("0.4")
.weightUnit(WeightUnitEnum.LB)
.build()))
.build())
.call();
if (res.order().isPresent()) {
// handle response
}
}
}const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
placed_at: '2016-09-23T01:28:12Z',
to_address: {
country: 'US',
name: 'Shwan Ippotle',
company: 'Shippo',
street1: '215 Clayton St.',
street2: '<string>',
street3: '',
street_no: '',
city: 'San Francisco',
state: 'CA',
zip: '94117',
phone: '+1 555 341 9393',
email: 'shippotle@shippo.com',
is_residential: true,
metadata: 'Customer ID 123456',
validate: true
},
currency: 'USD',
notes: 'This customer is a VIP',
order_number: '#1068',
order_status: 'PAID',
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: 'lb',
line_items: [
{
currency: 'USD',
manufacture_country: 'US',
max_delivery_time: '2016-07-23T00:00:00Z',
max_ship_time: '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: 'lb'
}
]
})
};
fetch('https://api.goshippo.com/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goshippo.com/orders"
payload := strings.NewReader("{\n \"placed_at\": \"2016-09-23T01:28:12Z\",\n \"to_address\": {\n \"country\": \"US\",\n \"name\": \"Shwan Ippotle\",\n \"company\": \"Shippo\",\n \"street1\": \"215 Clayton St.\",\n \"street2\": \"<string>\",\n \"street3\": \"\",\n \"street_no\": \"\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zip\": \"94117\",\n \"phone\": \"+1 555 341 9393\",\n \"email\": \"shippotle@shippo.com\",\n \"is_residential\": true,\n \"metadata\": \"Customer ID 123456\",\n \"validate\": true\n },\n \"currency\": \"USD\",\n \"notes\": \"This customer is a VIP\",\n \"order_number\": \"#1068\",\n \"order_status\": \"PAID\",\n \"shipping_cost\": \"12.83\",\n \"shipping_cost_currency\": \"USD\",\n \"shipping_method\": \"USPS First Class Package\",\n \"subtotal_price\": \"12.1\",\n \"total_price\": \"24.93\",\n \"total_tax\": \"0.0\",\n \"weight\": \"0.4\",\n \"weight_unit\": \"lb\",\n \"line_items\": [\n {\n \"currency\": \"USD\",\n \"manufacture_country\": \"US\",\n \"max_delivery_time\": \"2016-07-23T00:00:00Z\",\n \"max_ship_time\": \"2016-07-23T00:00:00Z\",\n \"quantity\": 20,\n \"sku\": \"HM-123\",\n \"title\": \"Hippo Magazines\",\n \"total_price\": \"12.1\",\n \"variant_title\": \"June Edition\",\n \"weight\": \"0.4\",\n \"weight_unit\": \"lb\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.goshippo.com/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"placed_at\": \"2016-09-23T01:28:12Z\",\n \"to_address\": {\n \"country\": \"US\",\n \"name\": \"Shwan Ippotle\",\n \"company\": \"Shippo\",\n \"street1\": \"215 Clayton St.\",\n \"street2\": \"<string>\",\n \"street3\": \"\",\n \"street_no\": \"\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zip\": \"94117\",\n \"phone\": \"+1 555 341 9393\",\n \"email\": \"shippotle@shippo.com\",\n \"is_residential\": true,\n \"metadata\": \"Customer ID 123456\",\n \"validate\": true\n },\n \"currency\": \"USD\",\n \"notes\": \"This customer is a VIP\",\n \"order_number\": \"#1068\",\n \"order_status\": \"PAID\",\n \"shipping_cost\": \"12.83\",\n \"shipping_cost_currency\": \"USD\",\n \"shipping_method\": \"USPS First Class Package\",\n \"subtotal_price\": \"12.1\",\n \"total_price\": \"24.93\",\n \"total_tax\": \"0.0\",\n \"weight\": \"0.4\",\n \"weight_unit\": \"lb\",\n \"line_items\": [\n {\n \"currency\": \"USD\",\n \"manufacture_country\": \"US\",\n \"max_delivery_time\": \"2016-07-23T00:00:00Z\",\n \"max_ship_time\": \"2016-07-23T00:00:00Z\",\n \"quantity\": 20,\n \"sku\": \"HM-123\",\n \"title\": \"Hippo Magazines\",\n \"total_price\": \"12.1\",\n \"variant_title\": \"June Edition\",\n \"weight\": \"0.4\",\n \"weight_unit\": \"lb\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"placed_at": "2016-09-23T01:28:12Z",
"to_address": {
"country": "US",
"name": "Shwan Ippotle",
"company": "Shippo",
"street1": "215 Clayton St.",
"street2": "<string>",
"street3": "",
"street_no": "",
"city": "San Francisco",
"state": "CA",
"zip": "94117",
"phone": "+1 555 341 9393",
"email": "shippotle@shippo.com",
"is_residential": true,
"metadata": "Customer ID 123456",
"is_complete": true,
"latitude": 123,
"longitude": 123,
"object_created": "2014-07-09T02:19:13.174Z",
"object_id": "d799c2679e644279b59fe661ac8fa488",
"object_owner": "shippotle@shippo.com",
"object_updated": "2014-07-09T02:19:13.174Z",
"validation_results": {
"is_valid": false,
"messages": [
{
"code": "Unknown Street",
"source": "Shippo Address Validator",
"text": "City, State and ZIP Code are valid, but street address is not a match.",
"type": "address_warning"
}
]
},
"test": false
},
"currency": "USD",
"notes": "This customer is a VIP",
"order_number": "#1068",
"order_status": "PAID",
"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": "lb",
"from_address": {
"country": "US",
"name": "Shwan Ippotle",
"company": "Shippo",
"street1": "215 Clayton St.",
"street2": "<string>",
"street3": "",
"street_no": "",
"city": "San Francisco",
"state": "CA",
"zip": "94117",
"phone": "+1 555 341 9393",
"email": "shippotle@shippo.com",
"is_residential": true,
"metadata": "Customer ID 123456",
"is_complete": true,
"latitude": 123,
"longitude": 123,
"object_created": "2014-07-09T02:19:13.174Z",
"object_id": "d799c2679e644279b59fe661ac8fa488",
"object_owner": "shippotle@shippo.com",
"object_updated": "2014-07-09T02:19:13.174Z",
"validation_results": {
"is_valid": false,
"messages": [
{
"code": "Unknown Street",
"source": "Shippo Address Validator",
"text": "City, State and ZIP Code are valid, but street address is not a match.",
"type": "address_warning"
}
]
},
"test": false
},
"line_items": [
{
"currency": "USD",
"manufacture_country": "US",
"max_delivery_time": "2016-07-23T00:00:00Z",
"max_ship_time": "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": "lb",
"object_id": "abf7d5675d744b6ea9fdb6f796b28f28"
}
],
"object_id": "adcfdddf8ec64b84ad22772bce3ea37a",
"object_owner": "shippotle@shippo.com",
"shop_app": "Shippo",
"transactions": [
{}
]
}{}Authorizations
API key authentication using the ShippoToken scheme. Format: Authorization: ShippoToken <API_TOKEN> Example: Authorization: ShippoToken shippo_live_abc123
Headers
Optional string used to pick a non-default API version to use. See our API version guide.
"2018-02-08"
Body
Order details.
Date and time when the order was placed. This datetime can be different from the datetime of the order object creation on Shippo.
"2016-09-23T01:28:12Z"
Required if total_price is provided
Currency of the total_price and total_tax amounts.
"USD"
Custom buyer- or seller-provided notes about the order.
"This customer is a VIP"
An alphanumeric identifier for the order used by the seller/buyer. This identifier doesn't need to be unique.
"#1068"
Current state of the order. See the orders tutorial for the logic of how the status is handled.
UNKNOWN, AWAITPAY, PAID, REFUNDED, CANCELLED, PARTIALLY_FULFILLED, SHIPPED "PAID"
Amount paid by the buyer for shipping. This amount can be different from the price the seller will actually pay for shipping.
"12.83"
Required if shipping_cost is provided
Currency of the shipping_cost amount.
"USD"
Shipping method (carrier + service or other free text description) chosen by the buyer. This value can be different from the shipping method the seller will actually choose.
"USPS First Class Package"
"12.1"
Total amount paid by the buyer for this order.
"24.93"
Total tax amount paid by the buyer for this order.
"0.0"
Total weight of the order.
"0.4"
The unit used for weight.
g, kg, lb, oz "lb"
Response
Order
Date and time when the order was placed. This datetime can be different from the datetime of the order object creation on Shippo.
"2016-09-23T01:28:12Z"
Required if total_price is provided
Currency of the total_price and total_tax amounts.
"USD"
Custom buyer- or seller-provided notes about the order.
"This customer is a VIP"
An alphanumeric identifier for the order used by the seller/buyer. This identifier doesn't need to be unique.
"#1068"
Current state of the order. See the orders tutorial for the logic of how the status is handled.
UNKNOWN, AWAITPAY, PAID, REFUNDED, CANCELLED, PARTIALLY_FULFILLED, SHIPPED "PAID"
Amount paid by the buyer for shipping. This amount can be different from the price the seller will actually pay for shipping.
"12.83"
Required if shipping_cost is provided
Currency of the shipping_cost amount.
"USD"
Shipping method (carrier + service or other free text description) chosen by the buyer. This value can be different from the shipping method the seller will actually choose.
"USPS First Class Package"
"12.1"
Total amount paid by the buyer for this order.
"24.93"
Total tax amount paid by the buyer for this order.
"0.0"
Total weight of the order.
"0.4"
The unit used for weight.
g, kg, lb, oz "lb"
Unique identifier of the order object.
"adcfdddf8ec64b84ad22772bce3ea37a"
Username of the user who created the object.
"shippotle@shippo.com"
Platform the order was created on and, if applicable, imported from. Orders created via the Shippo API or dashboard will have the value "Shippo".
Amazon, Bigcommerce, CSV_Import, eBay, ePages, Etsy, Godaddy, Magento, Shippo, Shopify, Spreecommerce, StripeRelay, Walmart, Weebly, WooCommerce "Shippo"
Array of transaction objects representing all shipping labels purchased for this order. All objects are returned expanded with a limited number of fields by default.
Was this page helpful?