import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.priceVariants.update({
id: "<id>",
priceVariantUpdateRequest: {},
});
console.log(result);
}
run();{
"id": "<string>",
"object": "<string>",
"name": "<string>",
"amount": 123,
"amount_type": "free",
"billing_type": "subscription",
"recurring_interval": "day",
"interval_count": 123,
"installment_count": 123,
"setup_fee_amount": 123,
"trial_period_days": 123,
"revoke_after_days": 123,
"quantity_available": 123,
"archived": true,
"position": 123,
"hidden": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"discounted_from_amount": 123,
"minimum_amount": 123,
"maximum_amount": 123,
"preset_amount": 123,
"waitlist": true,
"purchase_url": "<string>",
"product": "<string>",
"benefits": [
"<string>"
]
}Updates an existing price variant. Set archived to true to archive it.
import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.priceVariants.update({
id: "<id>",
priceVariantUpdateRequest: {},
});
console.log(result);
}
run();{
"id": "<string>",
"object": "<string>",
"name": "<string>",
"amount": 123,
"amount_type": "free",
"billing_type": "subscription",
"recurring_interval": "day",
"interval_count": 123,
"installment_count": 123,
"setup_fee_amount": 123,
"trial_period_days": 123,
"revoke_after_days": 123,
"quantity_available": 123,
"archived": true,
"position": 123,
"hidden": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"discounted_from_amount": 123,
"minimum_amount": 123,
"maximum_amount": 123,
"preset_amount": 123,
"waitlist": true,
"purchase_url": "<string>",
"product": "<string>",
"benefits": [
"<string>"
]
}API key in the format: Bearer {api_token}
The resource ID (e.g., "prod_abc123") or slug (e.g., "my-product")
free, fixed, custom subscription, one_time, payment_plan day, week, month, year Price variant updated
free, fixed, custom subscription, one_time, payment_plan day, week, month, year, null Was this page helpful?