const response = await fetch("https://algapsa.com/api/v1/products", {
method: "POST",
headers: {
"X-API-Key": "$ALGA_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"service_name": "x",
"custom_service_type_id": "01HN2K7VRB9PQ3Y0000000000",
"billing_method": "usage",
"default_rate": 0,
"currency_code": "USD",
"unit_of_measure": "x",
"category_id": "01HN2K7VRB9PQ3Y0000000000",
"tax_rate_id": "01HN2K7VRB9PQ3Y0000000000",
"description": "string",
"sku": "string",
"cost": 0,
"cost_currency": "USD",
"vendor": "string",
"manufacturer": "string",
"product_category": "string",
"is_license": false,
"license_term": "string",
"license_billing_cadence": "string",
"is_active": true,
"prices": [
{
"currency_code": "xxx",
"rate": 0
}
]
})
});
const data = await response.json();