Skip to main content
PATCH
/
api
/
warehouses
/
{id}
Update a warehouse
curl --request PATCH \
  --url https://clarus-api.com/api/warehouses/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "warehouses",
    "attributes": {
      "code": "<string>",
      "name": "<string>",
      "is_active": true,
      "timezone": "<string>",
      "string1": "<string>",
      "string2": "<string>",
      "string3": "<string>",
      "string4": "<string>",
      "string5": "<string>"
    },
    "relationships": {
      "address": {
        "data": {
          "type": "addresses",
          "attributes": {
            "name": "John Smith",
            "address_1": "123 Main Street",
            "address_2": "Unit 4B",
            "address_3": "London",
            "address_4": "Greater London",
            "postcode": "SW1A 1AA",
            "country_code": "GB",
            "email_address": "[email protected]",
            "phone_number": "+44 20 7946 0958"
          }
        }
      }
    }
  }
}
'
{
  "data": {
    "id": 123,
    "type": "warehouses",
    "attributes": {
      "code": "<string>",
      "name": "<string>",
      "is_active": true,
      "timezone": "<string>",
      "external_system_reference1": "<string>",
      "external_system_reference2": "<string>",
      "external_system_reference3": "<string>",
      "string1": "<string>",
      "string2": "<string>",
      "string3": "<string>",
      "string4": "<string>",
      "string5": "<string>",
      "integer1": 123,
      "integer2": 123,
      "integer3": 123,
      "integer4": 123,
      "integer5": 123,
      "boolean1": true,
      "boolean2": true,
      "boolean3": true,
      "boolean4": true,
      "boolean5": true
    }
  }
}

Request Structure

{
  "data": {
    "type": "warehouses",
    "attributes": {
      "name": "North Distribution Center - Main"
    },
    "relationships": {
      "address": {
        "data": {
          "type": "addresses",
          "attributes": {
            "address_1": "200 Industrial Park Way",
            "address_3": "Manchester",
            "postcode": "M1 1AA",
            "country_code": "GB"
          }
        }
      }
    }
  }
}

Key Fields

FieldRequiredDescription
codeNoUpdated warehouse code
nameNoUpdated display name

Address

To update the warehouse address, provide it in data.relationships.address (not in data.attributes).

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Path Parameters

id
integer
required

The unique identifier of the warehouse to update

Body

application/json
data
object
required

Response

Warehouse updated successfully

data
object