Node.js
import { PriceOS } from "priceos";
import type { MyFeatures } from "./priceos.types";
const priceos = new PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);
const result = await priceos.usage.updateEvent({
id: "event_123",
amount: 2,
metadata: {
source: "admin_tool",
},
});curl -X PUT "https://api.priceos.com/v1/usage/event_123" \
-H "x-api-key: PRICEOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 2,
"metadata": {
"source": "admin_tool"
}
}'{
"id": "<string>",
"amount": 123,
"occurredAt": 123,
"source": "usage",
"eventKey": "<string>",
"metadata": {}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Usage
Update Usage Event
Update a usage event by ID.
PUT
/
v1
/
usage
/
{id}
Node.js
import { PriceOS } from "priceos";
import type { MyFeatures } from "./priceos.types";
const priceos = new PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);
const result = await priceos.usage.updateEvent({
id: "event_123",
amount: 2,
metadata: {
source: "admin_tool",
},
});curl -X PUT "https://api.priceos.com/v1/usage/event_123" \
-H "x-api-key: PRICEOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 2,
"metadata": {
"source": "admin_tool"
}
}'{
"id": "<string>",
"amount": 123,
"occurredAt": 123,
"source": "usage",
"eventKey": "<string>",
"metadata": {}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Body
application/json
Response
Usage event updated
Updated usage event.