Create a charge window
curl --request POST \
--url https://clarus-api.com/api/charge_windows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "charge_windows",
"attributes": {
"frequency": "Day",
"name": "Weekly Monday",
"numbers": [
1
]
}
}
}
'import requests
url = "https://clarus-api.com/api/charge_windows"
payload = { "data": {
"type": "charge_windows",
"attributes": {
"frequency": "Day",
"name": "Weekly Monday",
"numbers": [1]
}
} }
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: 'charge_windows',
attributes: {frequency: 'Day', name: 'Weekly Monday', numbers: [1]}
}
})
};
fetch('https://clarus-api.com/api/charge_windows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "1",
"type": "charge_windows",
"attributes": {
"frequency": "Day",
"id": 1,
"name": "Weekly Monday",
"numbers": [
1
]
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Charging: Configuration
Create a charge window
Create a new charge window for defining recurring billing schedules.
POST
/
api
/
charge_windows
Create a charge window
curl --request POST \
--url https://clarus-api.com/api/charge_windows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "charge_windows",
"attributes": {
"frequency": "Day",
"name": "Weekly Monday",
"numbers": [
1
]
}
}
}
'import requests
url = "https://clarus-api.com/api/charge_windows"
payload = { "data": {
"type": "charge_windows",
"attributes": {
"frequency": "Day",
"name": "Weekly Monday",
"numbers": [1]
}
} }
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: 'charge_windows',
attributes: {frequency: 'Day', name: 'Weekly Monday', numbers: [1]}
}
})
};
fetch('https://clarus-api.com/api/charge_windows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "1",
"type": "charge_windows",
"attributes": {
"frequency": "Day",
"id": 1,
"name": "Weekly Monday",
"numbers": [
1
]
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "charge_windows",
"attributes": {
"frequency": "Day",
"name": "Weekly Monday",
"numbers": [1]
}
}
}
Required Fields
| Field | Description |
|---|---|
frequency | Frequency type: Day or Month |
numbers | Array of day/date numbers for the schedule |
Optional Fields
| Field | Description |
|---|---|
name | Display name for the charge window |
Numbers Field Values
- Day frequency: 0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday
- Month frequency: 1-31 for day of month
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.
Body
application/json
Show child attributes
Show child attributes
Response
Charge Window created successfully
Show child attributes
Show child attributes

