Update Warehouse
Updates an existing Ship From Location (formerly known as warehouse). This call does not currently support partial updates. The entire resource must be provided in the body of the request. If a "returnAddress" object is not specified, your "originAddress" will be used as your "returnAddress".
NOTE In the API, the endpoint is called warehouse, but the process actually affects Ship From locations in the UI on the application side of operations.
Name | Data Type | Description |
---|---|---|
warehouseId |
number, optional | A unique ID generated by ShipStation and assigned to each Ship From Location (formerly known as warehouse). |
Example Request
PUT /warehouses/warehouseId HTTP/1.1
Host: ssapi.shipstation.com
Authorization: __YOUR_AUTH_HERE__
Content-Type: application/json
{
"warehouseId": 12345,
"warehouseName": "API Ship From Location",
"originAddress": {
"name": "API Warehouse",
"company": "ShipStation",
"street1": "2815 Exposition Blvd",
"street2": null,
"street3": null,
"city": "Austin",
"state": "TX",
"postalCode": "78703",
"country": "US",
"phone": "512-555-5555",
"residential": true,
"addressVerified": null
},
"returnAddress": {
"name": "API Ship From Location",
"company": "ShipStation",
"street1": "2815 Exposition Blvd",
"street2": null,
"street3": null,
"city": "Austin",
"state": "TX",
"postalCode": "78703",
"country": "US",
"phone": "512-555-5555",
"residential": null,
"addressVerified": null
},
"createDate": "2015-07-02T08:38:31.4870000",
"isDefault": true
}
curl -iX PUT https://ssapi.shipstation.com/warehouses/warehouseId \
-H 'Authorization: __YOUR_AUTH_HERE__' \
-H 'Content-Type: application/json' \
-d '{
"warehouseId": 12345,
"warehouseName": "API Ship From Location",
"originAddress": {
"name": "API Warehouse",
"company": "ShipStation",
"street1": "2815 Exposition Blvd",
"street2": null,
"street3": null,
"city": "Austin",
"state": "TX",
"postalCode": "78703",
"country": "US",
"phone": "512-555-5555",
"residential": true,
"addressVerified": null
},
"returnAddress": {
"name": "API Ship From Location",
"company": "ShipStation",
"street1": "2815 Exposition Blvd",
"street2": null,
"street3": null,
"city": "Austin",
"state": "TX",
"postalCode": "78703",
"country": "US",
"phone": "512-555-5555",
"residential": null,
"addressVerified": null
},
"createDate": "2015-07-02T08:38:31.4870000",
"isDefault": true
}'
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Host", "ssapi.shipstation.com")
$headers.Add("Authorization", "__YOUR_AUTH_HERE__")
$headers.Add("Content-Type", "application/json")
$body = "{`n `"warehouseId`": 12345,`n `"warehouseName`": `"API Ship From Location`",`n `"originAddress`": {`n `"name`": `"API Warehouse`",`n `"company`": `"ShipStation`",`n `"street1`": `"2815 Exposition Blvd`",`n `"street2`": null,`n `"street3`": null,`n `"city`": `"Austin`",`n `"state`": `"TX`",`n `"postalCode`": `"78703`",`n `"country`": `"US`",`n `"phone`": `"512-555-5555`",`n `"residential`": true,`n `"addressVerified`": null`n },`n `"returnAddress`": {`n `"name`": `"API Ship From Location`",`n `"company`": `"ShipStation`",`n `"street1`": `"2815 Exposition Blvd`",`n `"street2`": null,`n `"street3`": null,`n `"city`": `"Austin`",`n `"state`": `"TX`",`n `"postalCode`": `"78703`",`n `"country`": `"US`",`n `"phone`": `"512-555-5555`",`n `"residential`": null,`n `"addressVerified`": null`n },`n `"createDate`": `"2015-07-02T08:38:31.4870000`",`n `"isDefault`": true`n}"
$response = Invoke-RestMethod 'https://ssapi.shipstation.com/warehouses/warehouseId' -Method 'PUT' -Headers $headers -Body $body
$response | ConvertTo-Json
var myHeaders = new Headers();
myHeaders.append("Host", "ssapi.shipstation.com");
myHeaders.append("Authorization", "__YOUR_AUTH_HERE__");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({"warehouseId":12345,"warehouseName":"API Ship From Location","originAddress":{"name":"API Warehouse","company":"ShipStation","street1":"2815 Exposition Blvd","street2":null,"street3":null,"city":"Austin","state":"TX","postalCode":"78703","country":"US","phone":"512-555-5555","residential":true,"addressVerified":null},"returnAddress":{"name":"API Ship From Location","company":"ShipStation","street1":"2815 Exposition Blvd","street2":null,"street3":null,"city":"Austin","state":"TX","postalCode":"78703","country":"US","phone":"512-555-5555","residential":null,"addressVerified":null},"createDate":"2015-07-02T08:38:31.4870000","isDefault":true});
var requestOptions = {
method: 'PUT',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://ssapi.shipstation.com/warehouses/warehouseId", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://ssapi.shipstation.com/warehouses/warehouseId',
'headers': {
'Host': 'ssapi.shipstation.com',
'Authorization': '__YOUR_AUTH_HERE__',
'Content-Type': 'application/json'
},
body: JSON.stringify({"warehouseId":12345,"warehouseName":"API Ship From Location","originAddress":{"name":"API Warehouse","company":"ShipStation","street1":"2815 Exposition Blvd","street2":null,"street3":null,"city":"Austin","state":"TX","postalCode":"78703","country":"US","phone":"512-555-5555","residential":true,"addressVerified":null},"returnAddress":{"name":"API Ship From Location","company":"ShipStation","street1":"2815 Exposition Blvd","street2":null,"street3":null,"city":"Austin","state":"TX","postalCode":"78703","country":"US","phone":"512-555-5555","residential":null,"addressVerified":null},"createDate":"2015-07-02T08:38:31.4870000","isDefault":true})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://ssapi.shipstation.com/warehouses/warehouseId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS =>"{\n \"warehouseId\": 12345,\n \"warehouseName\": \"API Ship From Location\",\n \"originAddress\": {\n \"name\": \"API Warehouse\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": true,\n \"addressVerified\": null\n },\n \"returnAddress\": {\n \"name\": \"API Ship From Location\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": null,\n \"addressVerified\": null\n },\n \"createDate\": \"2015-07-02T08:38:31.4870000\",\n \"isDefault\": true\n}",
CURLOPT_HTTPHEADER => array(
"Host: ssapi.shipstation.com",
"Authorization: __YOUR_AUTH_HERE__",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://ssapi.shipstation.com/warehouses/warehouseId"
payload = "{\n \"warehouseId\": 12345,\n \"warehouseName\": \"API Ship From Location\",\n \"originAddress\": {\n \"name\": \"API Warehouse\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": true,\n \"addressVerified\": null\n },\n \"returnAddress\": {\n \"name\": \"API Ship From Location\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": null,\n \"addressVerified\": null\n },\n \"createDate\": \"2015-07-02T08:38:31.4870000\",\n \"isDefault\": true\n}"
headers = {
'Host': 'ssapi.shipstation.com',
'Authorization': '__YOUR_AUTH_HERE__',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
require "uri"
require "net/http"
url = URI("https://ssapi.shipstation.com/warehouses/warehouseId")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Host"] = "ssapi.shipstation.com"
request["Authorization"] = "__YOUR_AUTH_HERE__"
request["Content-Type"] = "application/json"
request.body = "{\n \"warehouseId\": 12345,\n \"warehouseName\": \"API Ship From Location\",\n \"originAddress\": {\n \"name\": \"API Warehouse\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": true,\n \"addressVerified\": null\n },\n \"returnAddress\": {\n \"name\": \"API Ship From Location\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": null,\n \"addressVerified\": null\n },\n \"createDate\": \"2015-07-02T08:38:31.4870000\",\n \"isDefault\": true\n}"
response = https.request(request)
puts response.read_body
var client = new RestClient("https://ssapi.shipstation.com/warehouses/warehouseId");
client.Timeout = -1;
var request = new RestRequest(Method.PUT);
request.AddHeader("Host", "ssapi.shipstation.com");
request.AddHeader("Authorization", "__YOUR_AUTH_HERE__");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"warehouseId\": 12345,\n \"warehouseName\": \"API Ship From Location\",\n \"originAddress\": {\n \"name\": \"API Warehouse\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": true,\n \"addressVerified\": null\n },\n \"returnAddress\": {\n \"name\": \"API Ship From Location\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": null,\n \"addressVerified\": null\n },\n \"createDate\": \"2015-07-02T08:38:31.4870000\",\n \"isDefault\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"warehouseId\": 12345,\n \"warehouseName\": \"API Ship From Location\",\n \"originAddress\": {\n \"name\": \"API Warehouse\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": true,\n \"addressVerified\": null\n },\n \"returnAddress\": {\n \"name\": \"API Ship From Location\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": null,\n \"addressVerified\": null\n },\n \"createDate\": \"2015-07-02T08:38:31.4870000\",\n \"isDefault\": true\n}");
Request request = new Request.Builder()
.url("https://ssapi.shipstation.com/warehouses/warehouseId")
.method("PUT", body)
.addHeader("Host", "ssapi.shipstation.com")
.addHeader("Authorization", "__YOUR_AUTH_HERE__")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://ssapi.shipstation.com/warehouses/warehouseId"
method := "PUT"
payload := strings.NewReader("{\n \"warehouseId\": 12345,\n \"warehouseName\": \"API Ship From Location\",\n \"originAddress\": {\n \"name\": \"API Warehouse\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": true,\n \"addressVerified\": null\n },\n \"returnAddress\": {\n \"name\": \"API Ship From Location\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": null,\n \"addressVerified\": null\n },\n \"createDate\": \"2015-07-02T08:38:31.4870000\",\n \"isDefault\": true\n}")
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
}
req.Header.Add("Host", "ssapi.shipstation.com")
req.Header.Add("Authorization", "__YOUR_AUTH_HERE__")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://ssapi.shipstation.com/warehouses/warehouseId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Host": @"ssapi.shipstation.com",
@"Authorization": @"__YOUR_AUTH_HERE__",
@"Content-Type": @"application/json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\n \"warehouseId\": 12345,\n \"warehouseName\": \"API Ship From Location\",\n \"originAddress\": {\n \"name\": \"API Warehouse\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": true,\n \"addressVerified\": null\n },\n \"returnAddress\": {\n \"name\": \"API Ship From Location\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": null,\n \"addressVerified\": null\n },\n \"createDate\": \"2015-07-02T08:38:31.4870000\",\n \"isDefault\": true\n}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"PUT"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
import Foundation
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\n \"warehouseId\": 12345,\n \"warehouseName\": \"API Ship From Location\",\n \"originAddress\": {\n \"name\": \"API Warehouse\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": true,\n \"addressVerified\": null\n },\n \"returnAddress\": {\n \"name\": \"API Ship From Location\",\n \"company\": \"ShipStation\",\n \"street1\": \"2815 Exposition Blvd\",\n \"street2\": null,\n \"street3\": null,\n \"city\": \"Austin\",\n \"state\": \"TX\",\n \"postalCode\": \"78703\",\n \"country\": \"US\",\n \"phone\": \"512-555-5555\",\n \"residential\": null,\n \"addressVerified\": null\n },\n \"createDate\": \"2015-07-02T08:38:31.4870000\",\n \"isDefault\": true\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://ssapi.shipstation.com/warehouses/warehouseId")!,timeoutInterval: Double.infinity)
request.addValue("ssapi.shipstation.com", forHTTPHeaderField: "Host")
request.addValue("__YOUR_AUTH_HERE__", forHTTPHeaderField: "Authorization")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "PUT"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
Example Response
{
"warehouseId": 12345,
"warehouseName": "API Ship From Location",
"originAddress": {
"name": "API Warehouse",
"company": "ShipStation",
"street1": "2815 Exposition Blvd",
"street2": null,
"street3": null,
"city": "Austin",
"state": "TX",
"postalCode": "78703",
"country": "US",
"phone": "512-555-5555",
"residential": true,
"addressVerified": null
},
"returnAddress": {
"name": "API Ship From Location",
"company": "ShipStation",
"street1": "2815 Exposition Blvd",
"street2": null,
"street3": null,
"city": "Austin",
"state": "TX",
"postalCode": "78703",
"country": "US",
"phone": "512-555-5555",
"residential": null,
"addressVerified": null
},
"createDate": "2015-07-02T08:38:31.4870000",
"isDefault": true
}