Dashboard API > Account subscription
Create a new subscription
Warning: Experimental API
Please note that the Dashboard API is an experimental, prerelease API. This API method is considered unstable, and should be avoided in production environments and automations. Changes may occur at any time without warning.
Body parameters
recurrenceenumRequired
Type of recurrence (yearly/monthly)
Example:
"monthly"
yearlyOptional
monthlyOptional
payment_intent_idstringOptional
billing_profilenull, objectOptional
address_linestringRequired
citystringRequired
countrystringRequired
emailstringRequired
first_namestringRequired
last_namestringRequired
statestringRequired
zipstringRequired
companynull, stringOptional
vat_numbernull, stringOptional
cf_cod_fiscalenull, stringOptional
cf_cod_fiscale_partecipante_gruppo_ivanull, stringOptional
po_numbernull, stringOptional
downgrade_reasonstringOptional
Reason for the downgrade (only considered in case of switch to free plan)
Example:
"I'm facing technical issues with the product"
planRequired
Subscription plan
Type:<a href="/docs/content-management-api/resources/per_owner_pricing_plan">ResourceLinkage<"per_owner_pricing_plan"></a>
Returns
Returns a resource object of type per_owner_pricing_subscription
Examples
import { buildClient } from "@datocms/dashboard-client";
async function run() { const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const perOwnerPricingSubscription = await client.perOwnerPricingSubscription.create({ recurrence: "monthly", plan: { type: "per_owner_pricing_plan", id: "124" }, });
// Check the 'Returned output' tab for the result ☝️ console.log(perOwnerPricingSubscription);}
run();{ id: "124", created_at: "2020-04-21T07:57:11.124Z", recurrence: "monthly", price: 20, extra_packets: [{ id: "", quantity: 20 }], meta: { manual_payments_collection: true }, plan: { type: "per_owner_pricing_plan", id: "124" },}