Dashboard API > Account subscription
Simulate
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.
Simulate costs for a new subscription
Body parameters
typestringRequired
Must be exactly "per_owner_pricing_subscription_simulation".
attributes.recurrenceenumRequired
Type of recurrence (yearly/monthly)
Example:
"monthly"
yearlyOptional
monthlyOptional
attributes.billing_profilenull, objectOptional
address_linestringRequired
citystringRequired
countrystringRequired
zipstringRequired
vat_numbernull, stringOptional
cf_cod_fiscalenull, stringOptional
cf_cod_fiscale_partecipante_gruppo_ivanull, stringOptional
po_numbernull, stringOptional
relationships.plan.dataRequired
Subscription plan
Type:<a href="/docs/content-management-api/resources/per_owner_pricing_plan">ResourceLinkage<"per_owner_pricing_plan"></a>
Examples
POST https://site-api.datocms.com/per-owner-pricing-subscriptions/simulate HTTP/1.1Authorization: Bearer YOUR-API-TOKENAccept: application/jsonX-Api-Version: 3Content-Type: application/vnd.api+json
{ "data": { "type": "per_owner_pricing_subscription_simulation", "attributes": { "recurrence": "monthly" }, "relationships": { "plan": { "data": { "type": "per_owner_pricing_plan", "id": "124" } } } }}curl -g 'https://site-api.datocms.com/per-owner-pricing-subscriptions/simulate' \ -X POST \ -H "Authorization: Bearer YOUR-API-TOKEN" \ -H "Accept: application/json" \ -H "X-Api-Version: 3" \ -H "Content-Type: application/vnd.api+json" \ --data-binary '{"data":{"type":"per_owner_pricing_subscription_simulation","attributes":{"recurrence":"monthly"},"relationships":{"plan":{"data":{"type":"per_owner_pricing_plan","id":"124"}}}}}'await fetch( "https://site-api.datocms.com/per-owner-pricing-subscriptions/simulate", { method: "POST", headers: { Authorization: "Bearer YOUR-API-TOKEN", Accept: "application/json", "X-Api-Version": "3", "Content-Type": "application/vnd.api+json", }, body: JSON.stringify({ data: { type: "per_owner_pricing_subscription_simulation", attributes: { recurrence: "monthly" }, relationships: { plan: { data: { type: "per_owner_pricing_plan", id: "124" } }, }, }, }), },);HTTP/1.1 200 OKContent-Type: application/jsonCache-Control: cache-control: max-age=0, private, must-revalidateX-RateLimit-Limit: 30X-RateLimit-Remaining: 28
{ "data": [ { "type": "next_invoice_estimate", "id": "4235", "attributes": { "amount": 20, "next_billing_at": "2016-09-20T18:50:24.914Z", "tax_label": "" } } ]}