Update a charge price
curl --request PATCH \
--url https://clarus-api.com/api/charge_prices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "charge_prices",
"attributes": {
"charge_card_id": 1,
"charge_type": "PICK",
"code": "PICK-STD",
"name": "Standard Pick",
"price": 0.5,
"quantity": 1,
"unit_of_measure": "item"
}
}
}
'import requests
url = "https://clarus-api.com/api/charge_prices/{id}"
payload = { "data": {
"type": "charge_prices",
"attributes": {
"charge_card_id": 1,
"charge_type": "PICK",
"code": "PICK-STD",
"name": "Standard Pick",
"price": 0.5,
"quantity": 1,
"unit_of_measure": "item"
}
} }
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: 'charge_prices',
attributes: {
charge_card_id: 1,
charge_type: 'PICK',
code: 'PICK-STD',
name: 'Standard Pick',
price: 0.5,
quantity: 1,
unit_of_measure: 'item'
}
}
})
};
fetch('https://clarus-api.com/api/charge_prices/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "<string>",
"type": "charge_prices",
"attributes": {
"auto_charge": true,
"charge_type": "PICK",
"code": "PICK-STD",
"description": null,
"id": 1,
"name": "Standard Pick",
"nominal_code": null,
"price": 0.5,
"quantity": 1,
"unit_of_measure": "item"
},
"relationships": {
"charge_card": {
"data": {
"id": "<string>",
"type": "charge_cards"
}
},
"storage_unit_type": {
"data": {
"id": "<string>",
"type": "storage_unit_types"
}
}
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Charging: Configuration
Update a charge price
Update an existing charge price’s attributes.
PATCH
/
api
/
charge_prices
/
{id}
Update a charge price
curl --request PATCH \
--url https://clarus-api.com/api/charge_prices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "charge_prices",
"attributes": {
"charge_card_id": 1,
"charge_type": "PICK",
"code": "PICK-STD",
"name": "Standard Pick",
"price": 0.5,
"quantity": 1,
"unit_of_measure": "item"
}
}
}
'import requests
url = "https://clarus-api.com/api/charge_prices/{id}"
payload = { "data": {
"type": "charge_prices",
"attributes": {
"charge_card_id": 1,
"charge_type": "PICK",
"code": "PICK-STD",
"name": "Standard Pick",
"price": 0.5,
"quantity": 1,
"unit_of_measure": "item"
}
} }
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: 'charge_prices',
attributes: {
charge_card_id: 1,
charge_type: 'PICK',
code: 'PICK-STD',
name: 'Standard Pick',
price: 0.5,
quantity: 1,
unit_of_measure: 'item'
}
}
})
};
fetch('https://clarus-api.com/api/charge_prices/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "<string>",
"type": "charge_prices",
"attributes": {
"auto_charge": true,
"charge_type": "PICK",
"code": "PICK-STD",
"description": null,
"id": 1,
"name": "Standard Pick",
"nominal_code": null,
"price": 0.5,
"quantity": 1,
"unit_of_measure": "item"
},
"relationships": {
"charge_card": {
"data": {
"id": "<string>",
"type": "charge_cards"
}
},
"storage_unit_type": {
"data": {
"id": "<string>",
"type": "storage_unit_types"
}
}
}
}
}{
"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": "charge_prices",
"attributes": {
"price": 0.75,
"auto_charge": true
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
price | No | Update the unit price |
quantity | No | Update the quantity |
auto_charge | No | Enable or disable auto-charging |
code | No | Update the charge price code |
name | No | Update the display name |
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.
Path Parameters
The unique identifier of the charge price to update
Body
application/json
Show child attributes
Show child attributes
Response
Charge Price updated successfully
Show child attributes
Show child attributes
⌘I

