> ## Documentation Index
> Fetch the complete documentation index at: https://developer.fabric.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Create shipping details for all items specific cart

> Create shipping details for all items in a specified cart. Shipping details are identified by a unique `shippingDetailsId`, and include the shipment's delivery address, shipment method, pickup persons' details, warehouse ID, store ID, and more.



## OpenAPI

````yaml cart-service post /v2/carts/{cartId}/shipping-details
openapi: 3.0.1
info:
  title: Cart API
  description: >-
    fabric's Cart APIs let you add, update, and remove items from your
    Storefront cart, either as a guest user or as a logged-in user. It also
    provides functionality to merge carts when you switch from guest user to
    logged-in user, to apply coupon codes and other attributes (for example,
    gift wrapping) to the cart items. Additionally, it supports more advanced
    use cases such as using multiple carts within a B2B organization and sharing
    of carts, as well as supporting a unified cart experience for multi-region
    and multi-brand businesses. <br /><br />These APIs provide high performance,
    scalability, multi-tenancy, and configurability to the end-to-end order
    processing actions that start from an item being added to the cart, through
    the pre-checkout stage that includes billing, shipping, and payment details,
    to the checkout stage where the order is processed and confirmed by the
    fabric Order Management System (OMS) or alternatively an Order Draft can be
    created. An order draft can be used to coordinate the creation of an order
    in any other downstream systems.
  contact:
    name: Cart Support
    email: support.cnc@fabric.inc
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  version: 2.0.0
servers:
  - url: https://prod.cart.fabric.inc
security: []
tags:
  - name: Cart
    description: >-
      Cart endpoints let you do basic cart operations, such as create a cart,
      add item to the cart, update items, remove items, delete cart, update
      status of the cart, and more.
  - name: Attribute
    description: >-
      Attribute endpoints let you add, update, and remove different types of
      attributes to and from the cart, and items in the cart.
  - name: Shipping
    description: >-
      Shipping endpoints let you do shipping related activities, such as create
      or update shipping details ID, add shipping information to all items of
      the cart, add different shipping details for different items, and more.
  - name: Order Draft
    description: >-
      Order drafts are the final state of a cart, containing all the required
      information needed to create an order. All these information undergoes
      validations before being generated and stored as order drafts. Once an
      order draft is created, it cannot be changed.The following endpoints let
      you create and manage such order drafts.
  - name: Adjustments
    description: >-
      Using these endpoints, you can make adjustments to a cart or to the line
      items within a cart.
paths:
  /v2/carts/{cartId}/shipping-details:
    post:
      tags:
        - Shipping
      summary: Create shipping details for all items specific cart
      description: >-
        Create shipping details for all items in a specified cart. Shipping
        details are identified by a unique `shippingDetailsId`, and include the
        shipment's delivery address, shipment method, pickup persons' details,
        warehouse ID, store ID, and more.
      operationId: createShipTo
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart for which shipping data is being created
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Request body containing shipping details to be created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateShipToPayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipResponse'
        '400':
          description: Bad Request
        '404':
          description: Not found
        '500':
          description: Internal server error
components:
  parameters:
    x-site-context:
      name: x-site-context
      in: header
      description: >-
        The `x-site-context` header is a JSON object that contains information
        about the source you wish to pull from. The mandatory `account` is the
        24 character identifier found in Copilot. The `channel` (Sales channel
        ID), `stage` (environment name), and `date` attributes can be used to
        further narrow the scope of your data source.
      required: true
      schema:
        type: string
        example: >-
          {"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account":
          "1234abcd5678efgh9ijklmno","stage":"production"}
    x-api-key:
      name: x-api-key
      in: header
      description: API Key for Gateway
      required: false
      schema:
        type: string
        example: zaCELgL.0imfnc8mVLWwsAawjYr4Rx-Af50DDqtlx
    authorization:
      name: Authorization
      in: header
      description: Authorization token for the user
      required: true
      schema:
        type: string
        example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
  schemas:
    CreateShipToPayload:
      description: Request body used to create shipping details for a cart
      required:
        - cartId
        - shipToType
      type: object
      properties:
        shipMethod:
          description: Shipping method
          allOf:
            - $ref: '#/components/schemas/ShipMethod'
            - nullable: true
        address:
          description: Shipping address
          allOf:
            - $ref: '#/components/schemas/Address'
            - nullable: true
        shipToType:
          type: string
          description: Shipping type
          example: SHIP_TO_ADDRESS
        taxCode:
          type: string
          description: Shipping tax code
          nullable: true
          example: FR1000
        isPickup:
          description: 'true: Item is set for pickup<br />false: Item is set for delivery'
          type: boolean
          example: true
        altPickupPerson:
          description: Alternative pickup person
          allOf:
            - $ref: '#/components/schemas/Address'
            - nullable: true
        pickupPerson:
          description: Designated pickup person
          allOf:
            - $ref: '#/components/schemas/PickupPerson'
            - nullable: true
        warehouseId:
          type: string
          description: Warehouse ID
          nullable: true
          example: XYZ-1234
        storeId:
          type: string
          description: Store ID
          nullable: true
          example: ABC-123
        estimatedShipDate:
          type: string
          description: Estimated date for shipping
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        estimatedDeliveryDate:
          type: string
          description: Estimated date for delivery
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        shipmentInstructions:
          type: string
          description: Store ID
          nullable: true
          example: Additional user instructions for shipping
    ShipResponse:
      description: Shipping response body
      type: object
      properties:
        shipToId:
          type: string
          description: Shipping details ID
          nullable: true
          example: fef78121-bee3-4448-bf1c-d5b5461dbda2
        cartId:
          description: Cart ID
          type: string
          nullable: true
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        createdAt:
          type: string
          description: Shipping details creation time
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        updatedAt:
          type: string
          description: Last time shipping details were updated
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        shipMethod:
          description: Shipping method and details
          allOf:
            - $ref: '#/components/schemas/ShipMethod'
            - nullable: true
        address:
          description: Shipping address
          allOf:
            - $ref: '#/components/schemas/Address'
            - nullable: true
        shipToType:
          type: string
          description: Shipping type
          nullable: true
          example: SHIP_TO_ADDRESS
        taxCode:
          type: string
          description: Shipping tax code
          nullable: true
          example: FR1000
        isPickup:
          description: 'true: Item is set for pickup<br />false: Item is set for delivery'
          type: boolean
          example: true
        altPickupPerson:
          description: Alternative pickup person
          allOf:
            - $ref: '#/components/schemas/PickupPerson'
            - nullable: true
        pickupPerson:
          description: Designated pickup person
          allOf:
            - $ref: '#/components/schemas/PickupPerson'
            - nullable: true
        warehouseId:
          type: string
          description: Warehouse ID
          nullable: true
          example: XYZ-1234
        storeId:
          type: string
          description: Store ID
          nullable: true
          example: ABC-123
        estimatedShipDate:
          type: string
          description: Estimated date for shipping
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        estimatedDeliveryDate:
          type: string
          description: Estimated date for delivery
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        shipmentInstructions:
          type: string
          description: Store ID
          nullable: true
          example: Additional user instructions for shipping
    ShipMethod:
      description: Shipping method and details
      type: object
      properties:
        cost:
          description: Shipping cost
          allOf:
            - $ref: '#/components/schemas/ShipCost'
            - nullable: true
        shipMethodId:
          type: string
          description: Shipping method ID
          example: '1234'
        shipmentCarrier:
          type: string
          description: Shipment carrier
          nullable: true
          example: FedEx
        shipmentMethod:
          type: string
          description: Shipment method type
          nullable: true
          example: Next Day
    Address:
      description: Shipping address details
      type: object
      properties:
        attention:
          type: string
          description: Address recipient
          nullable: true
          example: Billing manager
        street1:
          type: string
          description: Address line 1
          nullable: true
          example: 100 NE 100th St.
        street2:
          type: string
          description: Address line 2
          nullable: true
          example: Suite 710
        street3:
          type: string
          description: Address line 3
          nullable: true
          example: Seventh floor
        street4:
          type: string
          description: Address line 4
          nullable: true
          example: 'Attention: Pat E. Kake'
        city:
          type: string
          description: City name
          nullable: true
          example: Seattle
        state:
          type: string
          description: State name
          nullable: true
          example: Washington
        country:
          type: string
          description: Country name
          nullable: true
          example: USA
        zipCode:
          type: string
          description: Zip code
          nullable: true
          example: '98125'
        email:
          type: string
          description: Receiver's email address
          nullable: true
          example: test@mail.com
        kind:
          type: string
          description: Address type
          nullable: true
          example: shipping
        name:
          description: Recipient's name
          allOf:
            - $ref: '#/components/schemas/Name'
            - nullable: true
        phone:
          description: address details for the shipping
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Phone'
            - nullable: true
    PickupPerson:
      description: >-
        Details of the designated or alternative person who will pick up the
        cart items
      type: object
      properties:
        name:
          description: Name of pickup person
          allOf:
            - $ref: '#/components/schemas/Name'
            - nullable: true
        phone:
          description: Number of pickup person
          allOf:
            - $ref: '#/components/schemas/Phone'
            - nullable: true
        email:
          type: string
          description: Receiver's email address
          nullable: true
          example: test@mail.com
    ShipCost:
      description: Shipping cost and details
      required:
        - amount
      type: object
      properties:
        amount:
          type: number
          description: Shipping cost
          format: double
          example: 10
        currency:
          type: string
          description: Currency type
          example: USD
          nullable: true
        discount:
          description: Shipping discount
          type: number
          format: double
          nullable: true
          example: 5
    Name:
      description: Person's name
      type: object
      properties:
        first:
          type: string
          description: Individual's first name
          nullable: true
          example: Pat
        middle:
          type: string
          description: Individual's middle name or initial
          nullable: true
          example: E
        last:
          type: string
          description: Individual's last name
          nullable: true
          example: Kake
    Phone:
      description: Phone number details
      required:
        - number
      type: object
      properties:
        number:
          type: string
          description: Phone number
          example: 123-456-7899
        kind:
          type: string
          description: Phone number type
          nullable: true
          example: MOBILE
          enum:
            - MOBILE
            - HOME
            - BUSINESS

````