Create an account product assignment
curl --request POST \
--url https://clarus-api.com/api/products/{product_id}/account_products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "account_products",
"attributes": {
"account_id": 3
}
}
}
'import requests
url = "https://clarus-api.com/api/products/{product_id}/account_products"
payload = { "data": {
"type": "account_products",
"attributes": { "account_id": 3 }
} }
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: 'account_products', attributes: {account_id: 3}}})
};
fetch('https://clarus-api.com/api/products/{product_id}/account_products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 1,
"account_id": 3,
"product_id": 150
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Products: Accounts
Create an account product assignment
Create a account product assignment.
POST
/
api
/
products
/
{product_id}
/
account_products
Create an account product assignment
curl --request POST \
--url https://clarus-api.com/api/products/{product_id}/account_products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "account_products",
"attributes": {
"account_id": 3
}
}
}
'import requests
url = "https://clarus-api.com/api/products/{product_id}/account_products"
payload = { "data": {
"type": "account_products",
"attributes": { "account_id": 3 }
} }
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: 'account_products', attributes: {account_id: 3}}})
};
fetch('https://clarus-api.com/api/products/{product_id}/account_products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 1,
"account_id": 3,
"product_id": 150
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "account_products",
"attributes": {
"account_id": 3
}
}
}
{product_id}) to a stock account. Create + delete only — there is no update.
| Field | Required | Description |
|---|---|---|
account_id | Yes | Stock account to assign |
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 product ID to assign
Body
application/json
Show child attributes
Show child attributes
Response
Created successfully
The response is of type object.

