Create a reason code
curl --request POST \
--url https://clarus-api.com/api/reason_codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "reason_codes",
"attributes": {
"code": "ADJ-NEG-01",
"name": "Damaged in transit",
"description": "Negative stock adjustment for damaged goods",
"reason_type": "negative_adjustment",
"active": true,
"generic": false
}
}
}
'import requests
url = "https://clarus-api.com/api/reason_codes"
payload = { "data": {
"type": "reason_codes",
"attributes": {
"code": "ADJ-NEG-01",
"name": "Damaged in transit",
"description": "Negative stock adjustment for damaged goods",
"reason_type": "negative_adjustment",
"active": True,
"generic": False
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'reason_codes',
attributes: {
code: 'ADJ-NEG-01',
name: 'Damaged in transit',
description: 'Negative stock adjustment for damaged goods',
reason_type: 'negative_adjustment',
active: true,
generic: false
}
}
})
};
fetch('https://clarus-api.com/api/reason_codes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "1",
"type": "reason_codes",
"attributes": {
"code": "ADJ-NEG-01",
"name": "Damaged in transit",
"description": "Negative stock adjustment for damaged goods",
"reason_type": "negative_adjustment",
"active": true,
"generic": false
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Reason Codes
Create a reason code
Create a reason code.
POST
/
api
/
reason_codes
Create a reason code
curl --request POST \
--url https://clarus-api.com/api/reason_codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "reason_codes",
"attributes": {
"code": "ADJ-NEG-01",
"name": "Damaged in transit",
"description": "Negative stock adjustment for damaged goods",
"reason_type": "negative_adjustment",
"active": true,
"generic": false
}
}
}
'import requests
url = "https://clarus-api.com/api/reason_codes"
payload = { "data": {
"type": "reason_codes",
"attributes": {
"code": "ADJ-NEG-01",
"name": "Damaged in transit",
"description": "Negative stock adjustment for damaged goods",
"reason_type": "negative_adjustment",
"active": True,
"generic": False
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'reason_codes',
attributes: {
code: 'ADJ-NEG-01',
name: 'Damaged in transit',
description: 'Negative stock adjustment for damaged goods',
reason_type: 'negative_adjustment',
active: true,
generic: false
}
}
})
};
fetch('https://clarus-api.com/api/reason_codes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "1",
"type": "reason_codes",
"attributes": {
"code": "ADJ-NEG-01",
"name": "Damaged in transit",
"description": "Negative stock adjustment for damaged goods",
"reason_type": "negative_adjustment",
"active": true,
"generic": false
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "reason_codes",
"attributes": {
"code": "ADJ-NEG-01",
"name": "Damaged in transit",
"description": "Negative stock adjustment",
"reason_type": "negative_adjustment"
}
}
}
| Field | Required | Description |
|---|---|---|
code | Yes | Unique code (max 30) |
name | Yes | Name (max 50) |
description | Yes | Description (max 150) |
reason_type | Yes | One of negative_adjustment, positive_adjustment, hold, release, short_order_lines, transfer, stock_check |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
application/json
Show child attributes
Show child attributes
Response
Created successfully
The response is of type object.
⌘I

