Skip to main content
PUT
/
carrier_accounts
/
{CarrierAccountId}
cURL
curl https://api.goshippo.com/carrier_accounts/b741b99f95e841639b54272834bc478c/ \
-X PUT  \
-H "Authorization: ShippoToken <API_TOKEN>" \
-d parameters='{
    "meter": "123987"
}'
import shippo
from shippo.models import components

s = shippo.Shippo(
api_key_header='ShippoToken <API_TOKEN>',
shippo_api_version='2018-02-08',
)


res = s.carrier_accounts.update(carrier_account_id='<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=True,
),
))

if res is not None:
# handle response
pass
import { Shippo } from "shippo";

const shippo = new Shippo({
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08",
});

async function run() {
const result = await shippo.carrierAccounts.update("<id>", {
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: true,
},
});

// Handle the result
console.log(result);
}

run();
declare(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();

$carrierAccountBase = new Components\CarrierAccountBase(
accountId: '****',
carrier: 'usps',
parameters: new Components\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,
),
);

$response = $sdk->carrierAccounts->update(
carrierAccountId: '<id>',
shippoApiVersion: '2018-02-08',
carrierAccountBase: $carrierAccountBase

);

if ($response->carrierAccount !== null) {
// handle response
}
using Shippo;
using Shippo.Models.Components;

var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08"
);

var res = await sdk.CarrierAccounts.UpdateAsync(
carrierAccountId: "<id>",
shippoApiVersion: "2018-02-08",
carrierAccountBase: new CarrierAccountBase() {
AccountId = "****",
Carrier = "usps",
Parameters = CarrierAccountBaseParameters.CreateUPSConnectExistingOwnAccountParameters(
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
package hello.world;

import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.components.CarrierAccountBase;
import com.goshippo.shippo_sdk.models.components.CarrierAccountBaseParameters;
import com.goshippo.shippo_sdk.models.components.UPSConnectExistingOwnAccountParameters;
import com.goshippo.shippo_sdk.models.operations.UpdateCarrierAccountResponse;
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();

UpdateCarrierAccountResponse res = sdk.carrierAccounts().update()
.carrierAccountId("<id>")
.shippoApiVersion("2018-02-08")
.carrierAccountBase(CarrierAccountBase.builder()
.accountId("****")
.carrier("usps")
.parameters(CarrierAccountBaseParameters.of(UPSConnectExistingOwnAccountParameters.builder()
.accountNumber("94567e")
.billingAddressCity("San Francisco")
.billingAddressCountryIso2("US")
.billingAddressState("CA")
.billingAddressStreet1("731 Market St")
.billingAddressZip("94103")
.collecCountryIso2("US")
.collecZip("94103")
.company("Shippo")
.email("hippo@shippo.com")
.fullName("Shippo Meister")
.hasInvoice(false)
.phone("1112223333")
.title("Manager")
.upsAgreements(true)
.aiaCountryIso2("US")
.billingAddressStreet2("STE 200")
.currencyCode("USD")
.invoiceControlid("1234")
.invoiceDate("20210529")
.invoiceNumber("1112234")
.invoiceValue("11.23")
.build()))
.build())
.call();

if (res.carrierAccount().isPresent()) {
// handle response
}
}
}
const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '****', carrier: 'usps', active: true, parameters: {}})
};

fetch('https://api.goshippo.com/carrier_accounts/{CarrierAccountId}', 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/carrier_accounts/{CarrierAccountId}"

payload := strings.NewReader("{\n \"account_id\": \"****\",\n \"carrier\": \"usps\",\n \"active\": true,\n \"parameters\": {}\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/carrier_accounts/{CarrierAccountId}")

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 \"account_id\": \"****\",\n \"carrier\": \"usps\",\n \"active\": true,\n \"parameters\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "account_id": "****",
  "carrier": "usps",
  "active": true,
  "parameters": {},
  "carrier_name": "USPS",
  "is_shippo_account": false,
  "metadata": "<string>",
  "object_id": "6aa34d5f6865448fbb1ee93636e98999",
  "object_owner": "bob+22@gmail.com",
  "service_levels": [
    {
      "name": "Priority Mail Express",
      "token": "usps_priority_express",
      "supports_return_labels": true
    }
  ],
  "test": false
}
{}

Authorizations

Authorization
string
header
default:ShippoToken
required

API key authentication using the ShippoToken scheme. Format: Authorization: ShippoToken <API_TOKEN> Example: Authorization: ShippoToken shippo_live_abc123

Headers

SHIPPO-API-VERSION
string
default:2018-02-08

Optional string used to pick a non-default API version to use. See our API version guide.

Example:

"2018-02-08"

Path Parameters

CarrierAccountId
string
required

Object ID of the carrier account

Body

application/json

Examples.

account_id
string
required

Unique identifier of the account. Please check the carrier accounts tutorial page for the account_id per carrier.
To protect account information, this field will be masked in any API response.

Example:

"****"

carrier
string
required

Carrier token, see Carriers
Please check the carrier accounts tutorial page for all supported carriers.

Example:

"usps"

active
boolean

Determines whether the account is active. When creating a shipment, if no carrier_accounts are explicitly passed Shippo will query all carrier accounts that have this field set. By default, this is set to True.

parameters
Account parameters · object

An array of additional parameters for the account, such as e.g. password or token. Please check our carrier accounts guide for the parameters per carrier. To protect account information, this field will be masked in any API response. In the case of masked fields, they should be handled carefully.

Fields also must consider:

  • Not providing a fields in parameters will not result in a change to any configured value
  • Providing a value in a masked field with ****** (exactly 6 asterisks) will not change the configured value
  • Providing field with null will clear the configured value
  • Providing field with any other value will change the configured value and may affect the behavior of the account.

Response

Carrier account

account_id
string
required

Unique identifier of the account. Please check the carrier accounts tutorial page for the account_id per carrier.
To protect account information, this field will be masked in any API response.

Example:

"****"

carrier
string
required

Carrier token, see Carriers
Please check the carrier accounts tutorial page for all supported carriers.

Example:

"usps"

active
boolean

Determines whether the account is active. When creating a shipment, if no carrier_accounts are explicitly passed Shippo will query all carrier accounts that have this field set. By default, this is set to True.

parameters
Account parameters · object

An array of additional parameters for the account, such as e.g. password or token. Please check our carrier accounts guide for the parameters per carrier. To protect account information, this field will be masked in any API response. In the case of masked fields, they should be handled carefully.

Fields also must consider:

  • Not providing a fields in parameters will not result in a change to any configured value
  • Providing a value in a masked field with ****** (exactly 6 asterisks) will not change the configured value
  • Providing field with null will clear the configured value
  • Providing field with any other value will change the configured value and may affect the behavior of the account.
carrier_name
any

Carrier name, see Carriers

Example:

"USPS"

is_shippo_account
boolean
Example:

false

metadata
string
object_id
string

Unique identifier of the carrier account object.

Example:

"6aa34d5f6865448fbb1ee93636e98999"

object_owner
string

Username of the user who created the carrier account object.

Example:

"bob+22@gmail.com"

service_levels
object[]
test
boolean

Indicates whether the object has been created in test mode.

Example:

false