v1

latestOpenAPI 3.1.02026-07-1270243932.3 KB
Service Groups

Create a new service group

Creates a new service group.

post/service-groups

Headers

SHIPPO-API-VERSIONstring
Example:2018-02-08

Optional string used to pick a non-default API version to use. See our <a href="https://docs.goshippo.com/docs/api_concepts/apiversioning/">API version</a> guide.

Request body

descriptionstring required

Description for the service group

flat_ratestring

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

flat_rate_currencystring

required unless type is FREE_SHIPPING. (ISO 4217 currency)

free_shipping_threshold_currencystring

optional unless type is FREE_SHIPPING. (ISO 4217 currency)

free_shipping_threshold_minstring

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

namestring required

Name for the service group that will be shown to customers in the response

rate_adjustmentinteger

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.

type'LIVE_RATE' | 'FLAT_RATE' | 'FREE_SHIPPING' required

The type of the service group.<br> 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.<br> FLAT_RATE - Returns a shipping option with the specified flat rate amount.<br> 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

Example request

{
  "description": "USPS shipping options",
  "flat_rate": "5",
  "flat_rate_currency": "USD",
  "free_shipping_threshold_currency": "USD",
  "free_shipping_threshold_min": "5",
  "name": "USPS Shipping",
  "rate_adjustment": 15,
  "type": "FLAT_RATE",
  "service_levels": [
    {
      "account_object_id": "80feb1633d4a43c898f0058506cfd82d",
      "service_level_token": "ups_next_day_air_saver"
    }
  ]
}

Response

Service group

descriptionstring required

Description for the service group

flat_ratestring

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

flat_rate_currencystring

required unless type is FREE_SHIPPING. (ISO 4217 currency)

free_shipping_threshold_currencystring

optional unless type is FREE_SHIPPING. (ISO 4217 currency)

free_shipping_threshold_minstring

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

namestring required

Name for the service group that will be shown to customers in the response

rate_adjustmentinteger

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.

type'LIVE_RATE' | 'FLAT_RATE' | 'FREE_SHIPPING' required

The type of the service group.<br> 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.<br> FLAT_RATE - Returns a shipping option with the specified flat rate amount.<br> 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

object_idstring required

The unique identifier of the given Service Group object.

is_activeboolean

True if the service group is enabled, false otherwise.

Example response

{
  "description": "USPS shipping options",
  "flat_rate": "5",
  "flat_rate_currency": "USD",
  "free_shipping_threshold_currency": "USD",
  "free_shipping_threshold_min": "5",
  "name": "USPS Shipping",
  "rate_adjustment": 15,
  "type": "FLAT_RATE",
  "object_id": "80feb1633d4a43c898f005850",
  "is_active": true,
  "service_levels": [
    {
      "account_object_id": "80feb1633d4a43c898f0058506cfd82d",
      "service_level_token": "ups_next_day_air_saver"
    }
  ]
}