Show examples in:
JavascriptHTTP
Endpoint info
Available examples
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&#x3C;"per_owner_pricing_plan"></a>

Examples

POST https://site-api.datocms.com/per-owner-pricing-subscriptions/simulate HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Content-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"
}
}
}
}
}
Terminal window
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 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": [
{
"type": "next_invoice_estimate",
"id": "4235",
"attributes": {
"amount": 20,
"next_billing_at": "2016-09-20T18:50:24.914Z",
"tax_label": ""
}
}
]
}