cURL
curl -X PUT https://api.goshippo.com/live-rates/settings/parcel-template \
-H "Authorization: ShippoToken <API_TOKEN>" \
-d '
{
"object_id": "b958d3690bb04bb8b2986724872750f5"
}
'import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header='ShippoToken <API_TOKEN>',
shippo_api_version='2018-02-08',
)
res = s.rates_at_checkout.update_default_parcel_template(request=components.DefaultParcelTemplateUpdateRequest(
object_id='b958d3690bb04bb8b2986724872750f5',
))
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.ratesAtCheckout.updateDefaultParcelTemplate({
objectId: "b958d3690bb04bb8b2986724872750f5",
});
// Handle the result
console.log(result);
}
run();using Shippo;
using Shippo.Models.Components;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08"
);
var res = await sdk.RatesAtCheckout.UpdateDefaultParcelTemplateAsync(
shippoApiVersion: "2018-02-08",
defaultParcelTemplateUpdateRequest: new DefaultParcelTemplateUpdateRequest() {
ObjectId = "b958d3690bb04bb8b2986724872750f5",
}
);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use Shippo\API;
use Shippo\API\Models\Components;
$sdk = API\Shippo::builder()
->setSecurity(
'ShippoToken <API_TOKEN>'
)
->setShippoApiVersion('2018-02-08')
->build();
$defaultParcelTemplateUpdateRequest = new Components\DefaultParcelTemplateUpdateRequest(
objectId: 'b958d3690bb04bb8b2986724872750f5',
);
$response = $sdk->ratesAtCheckout->updateDefaultParcelTemplate(
shippoApiVersion: '2018-02-08',
defaultParcelTemplateUpdateRequest: $defaultParcelTemplateUpdateRequest
);
if ($response->defaultParcelTemplate !== null) {
// handle response
}package hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.components.DefaultParcelTemplateUpdateRequest;
import com.goshippo.shippo_sdk.models.operations.UpdateDefaultParcelTemplateResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("ShippoToken <API_TOKEN>")
.shippoApiVersion("2018-02-08")
.build();
UpdateDefaultParcelTemplateResponse res = sdk.ratesAtCheckout().updateDefaultParcelTemplate()
.shippoApiVersion("2018-02-08")
.defaultParcelTemplateUpdateRequest(DefaultParcelTemplateUpdateRequest.builder()
.objectId("b958d3690bb04bb8b2986724872750f5")
.build())
.call();
if (res.defaultParcelTemplate().isPresent()) {
// handle response
}
}
}const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({object_id: 'b958d3690bb04bb8b2986724872750f5'})
};
fetch('https://api.goshippo.com/live-rates/settings/parcel-template', 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/live-rates/settings/parcel-template"
payload := strings.NewReader("{\n \"object_id\": \"b958d3690bb04bb8b2986724872750f5\"\n}")
req, _ := http.NewRequest("PUT", 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/live-rates/settings/parcel-template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"object_id\": \"b958d3690bb04bb8b2986724872750f5\"\n}"
response = http.request(request)
puts response.read_body{
"result": {
"distance_unit": "in",
"height": "6",
"length": "10",
"name": "My Custom Template",
"weight": "12",
"weight_unit": "lb",
"width": "8",
"object_created": "2013-12-11T19:38:09.729Z",
"object_id": "b958d3690bb04bb8b2986724872750f5",
"object_owner": "shippotle@shippo.com",
"object_updated": "2013-12-12T19:38:09.729Z",
"template": {
"carrier": "FedEx",
"distance_unit": "in",
"height": "1.5",
"is_variable_dimensions": false,
"length": "12.375",
"name": "FedEx® Small Box (S1)",
"token": "FedEx_Box_Small_1",
"width": "10.875"
}
}
}{}Rates at Checkout
Update default parcel template
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.
PUT
/
live-rates
/
settings
/
parcel-template
cURL
curl -X PUT https://api.goshippo.com/live-rates/settings/parcel-template \
-H "Authorization: ShippoToken <API_TOKEN>" \
-d '
{
"object_id": "b958d3690bb04bb8b2986724872750f5"
}
'import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header='ShippoToken <API_TOKEN>',
shippo_api_version='2018-02-08',
)
res = s.rates_at_checkout.update_default_parcel_template(request=components.DefaultParcelTemplateUpdateRequest(
object_id='b958d3690bb04bb8b2986724872750f5',
))
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.ratesAtCheckout.updateDefaultParcelTemplate({
objectId: "b958d3690bb04bb8b2986724872750f5",
});
// Handle the result
console.log(result);
}
run();using Shippo;
using Shippo.Models.Components;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08"
);
var res = await sdk.RatesAtCheckout.UpdateDefaultParcelTemplateAsync(
shippoApiVersion: "2018-02-08",
defaultParcelTemplateUpdateRequest: new DefaultParcelTemplateUpdateRequest() {
ObjectId = "b958d3690bb04bb8b2986724872750f5",
}
);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use Shippo\API;
use Shippo\API\Models\Components;
$sdk = API\Shippo::builder()
->setSecurity(
'ShippoToken <API_TOKEN>'
)
->setShippoApiVersion('2018-02-08')
->build();
$defaultParcelTemplateUpdateRequest = new Components\DefaultParcelTemplateUpdateRequest(
objectId: 'b958d3690bb04bb8b2986724872750f5',
);
$response = $sdk->ratesAtCheckout->updateDefaultParcelTemplate(
shippoApiVersion: '2018-02-08',
defaultParcelTemplateUpdateRequest: $defaultParcelTemplateUpdateRequest
);
if ($response->defaultParcelTemplate !== null) {
// handle response
}package hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.components.DefaultParcelTemplateUpdateRequest;
import com.goshippo.shippo_sdk.models.operations.UpdateDefaultParcelTemplateResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("ShippoToken <API_TOKEN>")
.shippoApiVersion("2018-02-08")
.build();
UpdateDefaultParcelTemplateResponse res = sdk.ratesAtCheckout().updateDefaultParcelTemplate()
.shippoApiVersion("2018-02-08")
.defaultParcelTemplateUpdateRequest(DefaultParcelTemplateUpdateRequest.builder()
.objectId("b958d3690bb04bb8b2986724872750f5")
.build())
.call();
if (res.defaultParcelTemplate().isPresent()) {
// handle response
}
}
}const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({object_id: 'b958d3690bb04bb8b2986724872750f5'})
};
fetch('https://api.goshippo.com/live-rates/settings/parcel-template', 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/live-rates/settings/parcel-template"
payload := strings.NewReader("{\n \"object_id\": \"b958d3690bb04bb8b2986724872750f5\"\n}")
req, _ := http.NewRequest("PUT", 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/live-rates/settings/parcel-template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"object_id\": \"b958d3690bb04bb8b2986724872750f5\"\n}"
response = http.request(request)
puts response.read_body{
"result": {
"distance_unit": "in",
"height": "6",
"length": "10",
"name": "My Custom Template",
"weight": "12",
"weight_unit": "lb",
"width": "8",
"object_created": "2013-12-11T19:38:09.729Z",
"object_id": "b958d3690bb04bb8b2986724872750f5",
"object_owner": "shippotle@shippo.com",
"object_updated": "2013-12-12T19:38:09.729Z",
"template": {
"carrier": "FedEx",
"distance_unit": "in",
"height": "1.5",
"is_variable_dimensions": false,
"length": "12.375",
"name": "FedEx® Small Box (S1)",
"token": "FedEx_Box_Small_1",
"width": "10.875"
}
}
}{}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.
Example:
"2018-02-08"
Body
application/json
Example:
"b958d3690bb04bb8b2986724872750f5"
Response
Default parcel template
Show child attributes
Show child attributes
Was this page helpful?
⌘I