---
updatedAt: 2026-08-18T18:39:20.000Z
agentTools:
  projectIndex: https://stockpit.readme.io/llms.txt
---

# Mutations

See the [Queries](/reference/location-queries) page for a presentation of this resource.

## CreateLocation

Create a location

### Parameters

| input - [LocationInput](/reference/location-mutations#locationinput-data-type) |
| :----------------------------------------------------------------------------- |
| Data of the location                                                           |

### Example

```graphql
mutation {
  CreateLocation (
    input: {
      label: "Warehouse",
      address: {
        country: "RO",
        state: null,
        address_1: "Strada Ciochina 16",
        city: "București",
        postal_code: "041935"
      }
    }
  ) {
    id
    label
    active
    address {
      id
      label
      country
      address_1
      address_2
      postal_code
      city
    }
  }
}
```

### Returned data

```json
{
  "data": {
    "CreateLocation": {
      "id": 100023,
      "label": "Warehouse",
      "active": true,
      "address": {
        "id": 100074,
        "label": null,
        "country": "RO",
        "address_1": "Strada Ciochina 16",
        "address_2": null,
        "postal_code": "041935",
        "city": "București",
      }
    }
  }
}
```

## UpdateLocation

Update an location

### Parameters

| id - [ID](/reference/data-types#id) |
| :---------------------------------- |
| Id of the location                  |

| input - [LocationInput](/reference/location-mutations#locationinput-data-type) |
| :----------------------------------------------------------------------------- |
| Data of the location                                                           |

<br />

### Example

```graphql
mutation UpdateLocation($id: ID!, $input: LocationInput!) {
  UpdateLocation(id: $id, input: $input) {
    id
    label
    active
    address {
      id
      label
      country
      address_1
      address_2
      postal_code
      city
      state
      phone
    }
  }
}
```

```json Variables (JSON)
{
  "id": 100008,
  "input": {
    "label": "London shop",
    "address": {
      "id": 100010,
      "label": "reprehenderit",
      "country": "UK",
      "address_1": "744 Walter Way",
      "address_2": "",
      "postal_code": "48202",
      "city": "London",
      "state": null,
      "phone": "1-901-942-3845"
    }
  }
}
```

### Returned data

```json
{
  "data": {
    "UpdateLocation": {
      "id": 100008,
      "label": "London shop",
      "active": true,
      "address": {
        "id": 100010,
        "label": "reprehenderit",
        "country": "UK",
        "address_1": "744 Walter Way",
        "address_2": null,
        "postal_code": "48202",
        "city": "London",
        "state": null,
        "phone": "1-901-942-3845"
      }
    }
  }
}
```

## DeleteLocation

Delete a location

### Parameters

| id - [ID](/reference/data-types#id) |
| :---------------------------------- |
| Id of the location                  |

### Example

```graphql
mutation DeleteLocation($id: ID!) {
  DeleteLocation(id: $id) {
    id
    active
  }
}
```

```json Variables (JSON)
{
  "id": 100023
}
```

### Returned data

```json
{
  "data": {
    "DeleteLocation": {
      "id": 100023,
      "active": false
    }
  }
}
```

## DisableLocation

Disable a location

### Parameters

| id - [ID](/reference/data-types#id) |
| :---------------------------------- |
| Id of the location                  |

### Example

```graphql
mutation DisableLocation($id: ID!) {
  DisableLocation(id: $id) {
    id
    active
  }
}
```

```json Variables (JSON)
{
  "id": 100023
}
```

### Returned data

```json
{
  "data": {
    "DisableLocation": {
      "id": 100023,
      "active": false
    }
  }
}
```

## EnableLocation

Enable a disabled location

### Parameters

| id - [ID](/reference/data-types#id) |
| :---------------------------------- |
| Id of the location                  |

### Example

```graphql
mutation EnableLocation($id: ID!) {
  EnableLocation(id: $id) {
    id
    active
  }
}
```

```json
{
  "id": 100023
}
```

### Returned data

```json
{
  "data": {
    "EnableLocation": {
      "id": 100023,
      "active": true
    }
  }
}
```

### `DeleteLocations`

Deletes multiple locations.

### Parameters

| ids - Array of [ID](/reference/data-types#id) |
| :-------------------------------------------- |
| Ids of the locations to delete                |

| input - [DeleteLocationInput](/reference/location-mutations#deletelocationinput-data-type) |
| :----------------------------------------------------------------------------------------- |
| Data of the deletion                                                                       |

### Example

```graphql
mutation DeleteLocations($ids: [ID]!, $input: DeleteLocationInput!) {
  DeleteLocations(ids: $ids, input: $input)
}
```

```json Variables (JSON)
{
  "ids": [100023, 100024],
  "input": {
    "backup_location_id": 100025,
    "stock_transferred": true
  }
}
```

### Returned data

```json
{
  "data": {
    "DeleteLocations": true
  }
}
```

## LocationInput data type

| id - [ID](/reference/data-types#id) |
| :---------------------------------- |
| Unique identifier of the location   |

| label - [String](/reference/data-types#string)        |
| :---------------------------------------------------- |
| Name of the location (ex: point of sales, warehouse…) |

| address - [AddressInput](/reference/address-queries) |
| :--------------------------------------------------- |
| Address of the location                              |

## DeleteLocationInput data type

| backup\_location\_id - [ID](/reference/data-types#id) |
| :---------------------------------------------------- |
| Id of the location the stock will be transferred to   |

| stock\_transferred - [Boolean](/reference/data-types#boolean)                     |
| :-------------------------------------------------------------------------------- |
| If true, the stock of the deleted locations is transferred to the backup location |