Update an account-warehouse association
curl --request PATCH \
--url https://clarus-api.com/api/account_warehouses/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "account_warehouses",
"attributes": {
"account_id": 2,
"warehouse_id": 3
}
}
}
'import requests
url = "https://clarus-api.com/api/account_warehouses/{id}"
payload = { "data": {
"type": "account_warehouses",
"attributes": {
"account_id": 2,
"warehouse_id": 3
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {type: 'account_warehouses', attributes: {account_id: 2, warehouse_id: 3}}
})
};
fetch('https://clarus-api.com/api/account_warehouses/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "1",
"type": "account_warehouses",
"relationships": {
"account": {
"data": {
"id": "2",
"type": "accounts"
}
},
"warehouse": {
"data": {
"id": "3",
"type": "warehouses"
}
}
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Account Warehouses
Update an account-warehouse association
Update which account or warehouse is linked. Both account_id and warehouse_id are required. The combination must be unique — duplicates return 422. A nested route alternative exists at /accounts/{account_id}/warehouses/{id}.
PATCH
/
api
/
account_warehouses
/
{id}
Update an account-warehouse association
curl --request PATCH \
--url https://clarus-api.com/api/account_warehouses/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "account_warehouses",
"attributes": {
"account_id": 2,
"warehouse_id": 3
}
}
}
'import requests
url = "https://clarus-api.com/api/account_warehouses/{id}"
payload = { "data": {
"type": "account_warehouses",
"attributes": {
"account_id": 2,
"warehouse_id": 3
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {type: 'account_warehouses', attributes: {account_id: 2, warehouse_id: 3}}
})
};
fetch('https://clarus-api.com/api/account_warehouses/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "1",
"type": "account_warehouses",
"relationships": {
"account": {
"data": {
"id": "2",
"type": "accounts"
}
},
"warehouse": {
"data": {
"id": "3",
"type": "warehouses"
}
}
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "account_warehouses",
"attributes": {
"account_id": 2,
"warehouse_id": 3
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
account_id | Yes | The stock account to associate |
warehouse_id | Yes | The warehouse to associate |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
FlowAuthorization Code
- Authorization URL
- https://clarus-api.com/oauth/authorize
- Token URL
- https://clarus-api.com/oauth/token
FlowClient Credentials
- Token URL
- https://clarus-api.com/oauth/token
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The unique identifier of the account-warehouse association to update
Body
application/json
Show child attributes
Show child attributes
Response
Account-warehouse association updated successfully
Show child attributes
Show child attributes

