Skip to main content

Create a new shipping group for a cart

POST 

https://useast.api.elasticpath.com/v2/carts/:cartID/shipping-groups

Create a new shipping group for a cart

Request

Path Parameters

    cartID stringrequired

    The ID of the cart

Bodyrequired

    data object
    typestring

    Possible values: [shipping_group]

    shipping_typestring
    tracking_referencestring
    shipping_price object
    totalnumber
    basenumber
    taxnumber
    feesnumber
    discountnumber
    address object
    first_namestringrequired

    First name of the shipping recipient.

    last_namestringrequired

    Last name of the shipping recipient.

    phone_numberstringrequired

    Phone number of the shipping recipient.

    company_namestringrequired

    Company of the shipping recipient.

    line_1stringrequired

    First line of the shipping address.

    line_2stringrequired

    Second line of the shipping address.

    citystringrequired

    City of the shipping address.

    postcodestringrequired

    Post code of the shipping address.

    countystringrequired

    County of the shipping address.

    countrystringrequired

    Country of the shipping address.

    regionstringrequired

    State, province, or region of the shipping address.

    instructionsstringrequired

    Delivery instructions.

    includes_taxboolean
    delivery_estimate object
    startdate-time
    enddate-time

Responses

Shipping group created successfully

Schema
    typestring

    Possible values: [shipping_group]

    idstring
    relationstring
    cart_idstring
    order_idstring
    shipping_typestring
    tracking_referencestring
    address object
    first_namestringrequired

    First name of the shipping recipient.

    last_namestringrequired

    Last name of the shipping recipient.

    phone_numberstringrequired

    Phone number of the shipping recipient.

    company_namestringrequired

    Company of the shipping recipient.

    line_1stringrequired

    First line of the shipping address.

    line_2stringrequired

    Second line of the shipping address.

    citystringrequired

    City of the shipping address.

    postcodestringrequired

    Post code of the shipping address.

    countystringrequired

    County of the shipping address.

    countrystringrequired

    Country of the shipping address.

    regionstringrequired

    State, province, or region of the shipping address.

    instructionsstringrequired

    Delivery instructions.

    delivery_estimate object
    startdate-time
    enddate-time
    createdAtdate-time
    updatedAtdate-time
    relationships object
    cart object

    Array of relationships

    data object[]

    Individual relationships

  • Array [
  • typestring

    The type of related resource.

    iduuid

    The ID of the related resource.

  • ]
  • order object

    Array of relationships

    data object[]

    Individual relationships

  • Array [
  • typestring

    The type of related resource.

    iduuid

    The ID of the related resource.

  • ]
  • discounts object[]
  • Array [
  • amount objectrequired
    amountintegerrequired

    Amount in minor currency units (e.g., cents).

    currencystringrequired

    ISO 4217 currency code (e.g., "USD").

    includes_taxbooleanrequired

    Whether the amount includes tax.

    codestring

    The discount code used, if applicable.

    idstringrequired

    Unique identifier for the discount.

    promotion_sourcestring

    The source or origin of the promotion, if applicable.

    is_cart_discountboolean

    Indicates whether the discount applies to the entire cart.

    ordinalinteger

    Order in which the discount was applied.

  • ]
  • meta object
    shipping_display_price object
    total objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    base objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    tax object
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    fees object
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    discount object
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    total_display_price object
    with_tax objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    without_tax objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    tax objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    discount objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    balance_owing objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    paid objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    authorized objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    without_discount objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    shipping objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

    shipping_discount objectrequired
    amountnumber

    The raw total.

    currencystring

    The currency set for this amount.

    formattedstring

    The formatted total based on the amount and currency.

Authorization: http

name: bearerAuthtype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://useast.api.elasticpath.com/v2/carts/:cartID/shipping-groups");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"shipping_group\",\n \"shipping_type\": \"string\",\n \"tracking_reference\": \"string\",\n \"shipping_price\": {\n \"total\": 0,\n \"base\": 0,\n \"tax\": 0,\n \"fees\": 0,\n \"discount\": 0\n },\n \"address\": {\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"phone_number\": \"string\",\n \"company_name\": \"string\",\n \"line_1\": \"string\",\n \"line_2\": \"string\",\n \"city\": \"string\",\n \"postcode\": \"string\",\n \"county\": \"string\",\n \"country\": \"string\",\n \"region\": \"string\",\n \"instructions\": \"string\"\n },\n \"includes_tax\": true,\n \"delivery_estimate\": {\n \"start\": \"2024-07-29T15:51:28.071Z\",\n \"end\": \"2024-07-29T15:51:28.071Z\"\n }\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://useast.api.elasticpath.com
Auth
Parameters
— pathrequired
Body required
{
  "data": {
    "type": "shipping_group",
    "shipping_type": "string",
    "tracking_reference": "string",
    "shipping_price": {
      "total": 0,
      "base": 0,
      "tax": 0,
      "fees": 0,
      "discount": 0
    },
    "address": {
      "first_name": "string",
      "last_name": "string",
      "phone_number": "string",
      "company_name": "string",
      "line_1": "string",
      "line_2": "string",
      "city": "string",
      "postcode": "string",
      "county": "string",
      "country": "string",
      "region": "string",
      "instructions": "string"
    },
    "includes_tax": true,
    "delivery_estimate": {
      "start": "2024-07-29T15:51:28.071Z",
      "end": "2024-07-29T15:51:28.071Z"
    }
  }
}
ResponseClear

Click the Send API Request button above and see the response here!