Node.js
import { PriceOS } from "priceos";
import type { MyFeatures } from "./priceos.types";
const priceos = new PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);
const bonus = await priceos.bonuses.create({
customerId: "customer_123",
featureKey: "api_calls",
amount: 100,
reason: "promotion",
});curl -X POST "https://api.priceos.com/v1/bonuses" \
-H "x-api-key: PRICEOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customerId": "customer_123",
"featureKey": "api_calls",
"amount": 100,
"reason": "promotion"
}'{
"bonusId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remainingAmount": 123,
"counterRemaining": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Bonuses
Create Bonus
Create a one-time bonus amount for a customer feature.
POST
/
v1
/
bonuses
Node.js
import { PriceOS } from "priceos";
import type { MyFeatures } from "./priceos.types";
const priceos = new PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);
const bonus = await priceos.bonuses.create({
customerId: "customer_123",
featureKey: "api_calls",
amount: 100,
reason: "promotion",
});curl -X POST "https://api.priceos.com/v1/bonuses" \
-H "x-api-key: PRICEOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customerId": "customer_123",
"featureKey": "api_calls",
"amount": 100,
"reason": "promotion"
}'{
"bonusId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remainingAmount": 123,
"counterRemaining": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Headers
API key from your PriceOS dashboard.
Body
application/json
Internal customer ID.
Feature key to create bonus for.
Bonus amount to create.
Optional Unix timestamp (ms) when the bonus expires.
Optional reason for the bonus.
Optional metadata for the bonus (string key/value pairs).
Show child attributes
Show child attributes