Skip to content

Latest commit

 

History

History
42 lines (37 loc) · 31.5 KB

servicegroup.md

File metadata and controls

42 lines (37 loc) · 31.5 KB

ServiceGroup

Example Usage

import { ServiceGroup } from "shippo/models/components";

let value: ServiceGroup = {
  description: "USPS shipping options",
  flatRate: "5",
  flatRateCurrency: "USD",
  freeShippingThresholdCurrency: "USD",
  freeShippingThresholdMin: "5",
  name: "USPS Shipping",
  rateAdjustment: 15,
  type: "FLAT_RATE",
  objectId: "80feb1633d4a43c898f005850",
  isActive: true,
  serviceLevels: [
    {
      accountObjectId: "80feb1633d4a43c898f0058506cfd82d",
      serviceLevelToken: "ups_next_day_air_saver",
    },
  ],
};

Fields

Field Type Required Description Example
description string ✔️ Description for the service group USPS shipping options
flatRate string String representation of an amount to be returned as the flat rate
if 1. The service group is of type LIVE_RATE and no matching rates
were found; or 2. The service group is of type FLAT_RATE. Either
integers or decimals are accepted. Required unless type is
FREE_SHIPPING
5
flatRateCurrency string required unless type is FREE_SHIPPING. (ISO 4217 currency) USD
freeShippingThresholdCurrency string optional unless type is FREE_SHIPPING. (ISO 4217 currency) USD
freeShippingThresholdMin string For service groups of type FREE_SHIPPING, this field must be required to configure the minimum
cart total (total cost of items in the cart) for this service group to be returned for rates at
checkout. Optional unless type is FREE_SHIPPING
5
name string ✔️ Name for the service group that will be shown to customers in the response USPS Shipping
rateAdjustment number The amount in percent (%) that the service group's returned rate should be adjusted. For example, if this field is set to 5 and the matched rate price is $5.00, the returned value of the service group will be $5.25. Negative integers are also accepted and will discount the rate price by the defined percentage amount. 15
type components.ServiceGroupTypeEnum ✔️ The type of the service group.

LIVE_RATE - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.

FLAT_RATE - Returns a shipping option with the specified flat rate amount.

FREE_SHIPPING - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by free_shipping_threshold_min
FLAT_RATE
objectId string ✔️ The unique identifier of the given Service Group object. 80feb1633d4a43c898f005850
isActive boolean True if the service group is enabled, false otherwise. true
serviceLevels components.ServiceGroupAccountAndServiceLevel[] ✔️ N/A