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

# Update a Stock Location

> Updates a Stock Location



## OpenAPI

````yaml /api-reference/platform.yaml patch /api/v2/platform/stock_locations/{id}
openapi: 3.0.3
info:
  title: Platform API
  contact:
    name: Vendo Connect Inc.
    url: https://getvendo.com
    email: sales@getvendo.com
  description: Spree Platform API
  version: v2
servers:
  - url: http://{defaultHost}
    variables:
      defaultHost:
        default: localhost:3000
security: []
tags:
  - name: Addresses
  - name: Adjustments
  - name: Classifications
  - name: Countries
  - name: CMS Pages
  - name: CMS Sections
  - name: Digital Assets
  - name: Digital Links
  - name: Line Items
  - name: Menus
  - name: Menu Items
  - name: Option Types
  - name: Option Values
  - name: Orders
  - name: Payments
  - name: Payment Methods
  - name: Products
  - name: Promotions
  - name: Promotion Actions
  - name: Promotion Categories
  - name: Promotion Rules
  - name: Roles
  - name: Shipments
  - name: Shipping Categories
  - name: Shipping Methods
  - name: States
  - name: Stock Items
  - name: Stock Locations
  - name: Store Credit Categories
  - name: Store Credit Types
  - name: Store Credits
  - name: Tax Categories
  - name: Tax Rates
  - name: Taxons
  - name: Taxonomies
  - name: Users
  - name: Variants
  - name: Vendors
  - name: Webhook Events
  - name: Webhook Subscribers
  - name: Wishlists
  - name: Wished Items
  - name: Zones
paths:
  /api/v2/platform/stock_locations/{id}:
    patch:
      tags:
        - Stock Locations
      summary: Update a Stock Location
      description: Updates a Stock Location
      operationId: update-stock-location
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: include
          in: query
          description: >-
            Select which associated resources you would like to fetch, see: <a
            href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>
          example: country
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update_stock_location_params'
      responses:
        '200':
          description: Record updated
          content:
            application/vnd.api+json:
              examples:
                Example:
                  value:
                    data:
                      id: '182'
                      type: stock_location
                      attributes:
                        name: Warehouse 3
                        created_at: '2022-11-08T19:35:32.309Z'
                        updated_at: '2022-11-08T19:35:32.538Z'
                        default: true
                        address1: South Street 8/2
                        address2: null
                        city: Los Angeles
                        state_name: null
                        zipcode: '11223'
                        phone: (202) 456-1111
                        active: true
                        backorderable_default: true
                        propagate_all_variants: false
                        admin_name: null
                      relationships:
                        country:
                          data:
                            id: '420'
                            type: country
              schema:
                $ref: '#/components/schemas/resource'
        '401':
          description: Authentication Failed
          content:
            application/vnd.api+json:
              examples:
                Example:
                  value:
                    error: The access token is invalid
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Record not found
          content:
            application/vnd.api+json:
              examples:
                Example:
                  value:
                    error: The resource you were looking for could not be found.
              schema:
                $ref: '#/components/schemas/error'
        '422':
          description: Invalid request
          content:
            application/vnd.api+json:
              examples:
                Example:
                  value:
                    error: Name can't be blank
                    errors:
                      name:
                        - can't be blank
              schema:
                $ref: '#/components/schemas/validation_errors'
      security:
        - bearer_auth: []
components:
  schemas:
    update_stock_location_params:
      type: object
      properties:
        stock_location:
          type: object
          required:
            - name
          properties:
            name:
              type: string
              example: Warehouse 3
            default:
              type: boolean
            address1:
              type: string
              example: South St. 8
            address2:
              type: string
              example: South St. 109
            country_id:
              type: string
              example: '2'
            state_id:
              type: string
              example: '4'
            city:
              type: string
              example: Los Angeles
            state_name:
              type: string
              example: California
            zipcode:
              type: string
              example: '90005'
            phone:
              type: string
              example: '23333456'
            active:
              type: boolean
            backorderable_default:
              type: boolean
            propagate_all_variants:
              type: boolean
            admin_name:
              type: string
      required:
        - stock_location
      x-internal: false
    resource:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/resource_properties'
      required:
        - data
      x-internal: false
    error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      x-internal: false
    validation_errors:
      type: object
      properties:
        error:
          type: string
        errors:
          type: object
      required:
        - error
        - errors
      x-internal: false
    resource_properties:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
        relationships:
          type: object
      required:
        - id
        - type
        - attributes
      x-internal: false
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````