(shippoAccounts)
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.
- list - List all Shippo Accounts
- create - Create a Shippo Account
- get - Retrieve a Shippo Account
- update - Update a Shippo Account
Returns a list of Shippo Accounts objects
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.shippoAccounts.list();
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { ShippoCore } from "shippo/core.js";
import { shippoAccountsList } from "shippo/funcs/shippoAccountsList.js";
// Use `ShippoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const shippo = new ShippoCore({
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const res = await shippoAccountsList(shippo);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
page |
number | ➖ | The page number you want to select |
results |
number | ➖ | The number of results to return per page (max 100) |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ShippoAccountPaginatedList>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Creates a Shippo Account object
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.shippoAccounts.create({
email: "hippo@shippo.com",
firstName: "Shippo",
lastName: "Meister",
companyName: "Acme",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { ShippoCore } from "shippo/core.js";
import { shippoAccountsCreate } from "shippo/funcs/shippoAccountsCreate.js";
// Use `ShippoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const shippo = new ShippoCore({
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const res = await shippoAccountsCreate(shippo, {
email: "hippo@shippo.com",
firstName: "Shippo",
lastName: "Meister",
companyName: "Acme",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.ShippoAccountUpdateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ShippoAccount>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Returns a Shippo Account using an object ID
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.shippoAccounts.get("<value>");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { ShippoCore } from "shippo/core.js";
import { shippoAccountsGet } from "shippo/funcs/shippoAccountsGet.js";
// Use `ShippoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const shippo = new ShippoCore({
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const res = await shippoAccountsGet(shippo, "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
shippoAccountId |
string | ✔️ | Object ID of the ShippoAccount |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ShippoAccount>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Updates a Shippo Account object
import { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.shippoAccounts.update("<value>", {
email: "hippo@shippo.com",
firstName: "Shippo",
lastName: "Meister",
companyName: "Acme",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { ShippoCore } from "shippo/core.js";
import { shippoAccountsUpdate } from "shippo/funcs/shippoAccountsUpdate.js";
// Use `ShippoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const shippo = new ShippoCore({
apiKeyHeader: "<YOUR_API_KEY_HERE>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const res = await shippoAccountsUpdate(shippo, "<value>", {
email: "hippo@shippo.com",
firstName: "Shippo",
lastName: "Meister",
companyName: "Acme",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
shippoAccountId |
string | ✔️ | Object ID of the ShippoAccount |
shippoAccountUpdateRequest |
components.ShippoAccountUpdateRequest | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ShippoAccount>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |