Subscription
Get Subscription
Returns the workspace subscription
For more information, see the Stripe Subscription Object.
const { setToken, Workspaces } = require('@evecloud/sdk');
setToken('TOKEN');
Workspaces.subscription.get('WORKSPACE_ID').then(data => {
console.log(data);
}).catch((error) => {
console.log(error);
});
{
"id": "sub_1O06LVBe5KiwCS6efqEhk2u8",
"object": "subscription",
"application": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": true
},
"billing_cycle_anchor": 1697045841,
"billing_thresholds": null,
"cancel_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"cancellation_details": {
"comment": null,
"feedback": null,
"reason": null
},
"collection_method": "charge_automatically",
"created": 1697045841,
"currency": "eur",
"current_period_end": 1699724241,
"current_period_start": 1697045841,
"customer": "cus_OnhZY7R1nEhACO",
"days_until_due": null,
"default_payment_method": null,
"default_source": null,
"default_tax_rates": [],
"description": null,
"discount": null,
"ended_at": null,
"items": {
"object": "list",
"data": [
{
"id": "si_OnhlJB3zXNjVHl",
"object": "subscription_item",
"billing_thresholds": null,
"created": 1697045841,
"metadata": {},
"plan": {
"id": "price_1NigXEBe5KiwCS6ePvBcBmuO",
"object": "plan",
"active": true,
"aggregate_usage": "sum",
"amount": 14,
"amount_decimal": "14",
"billing_scheme": "per_unit",
"created": 1692895048,
"currency": "eur",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {},
"nickname": null,
"product": "prod_OVhxJvq0m43q6Y",
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "metered"
},
"price": {
"id": "price_1NigXEBe5KiwCS6ePvBcBmuO",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1692895048,
"currency": "eur",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_OVhxJvq0m43q6Y",
"recurring": {
"aggregate_usage": "sum",
"interval": "month",
"interval_count": 1,
"trial_period_days": null,
"usage_type": "metered"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 14,
"unit_amount_decimal": "14"
},
"subscription": "sub_1O06LVBe5KiwCS6efqEhk2u8",
"tax_rates": []
},
{
"id": "si_OnhlLMOvAXlOGx",
"object": "subscription_item",
"billing_thresholds": null,
"created": 1697045841,
"metadata": {},
"plan": {
"id": "price_1NX48tBe5KiwCS6e6SiYkgOu",
"object": "plan",
"active": true,
"aggregate_usage": "sum",
"amount": 4,
"amount_decimal": "4",
"billing_scheme": "per_unit",
"created": 1690125859,
"currency": "eur",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {},
"nickname": null,
"product": "prod_OJhA6fub8gevOK",
"tiers_mode": null,
"transform_usage": {
"divide_by": 1024,
"round": "up"
},
"trial_period_days": null,
"usage_type": "metered"
},
"price": {
"id": "price_1NX48tBe5KiwCS6e6SiYkgOu",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1690125859,
"currency": "eur",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_OJhA6fub8gevOK",
"recurring": {
"aggregate_usage": "sum",
"interval": "month",
"interval_count": 1,
"trial_period_days": null,
"usage_type": "metered"
},
"tax_behavior": "inclusive",
"tiers_mode": null,
"transform_quantity": {
"divide_by": 1024,
"round": "up"
},
"type": "recurring",
"unit_amount": 4,
"unit_amount_decimal": "4"
},
"subscription": "sub_1O06LVBe5KiwCS6efqEhk2u8",
"tax_rates": []
}
],
"has_more": false,
"total_count": 2,
"url": "/v1/subscription_items?subscription=sub_1O06LVBe5KiwCS6efqEhk2u8"
},
"latest_invoice": "in_1O06LVBe5KiwCS6eVdpRZDWL",
"livemode": false,
"metadata": {},
"next_pending_invoice_item_invoice": null,
"on_behalf_of": null,
"pause_collection": null,
"payment_settings": {
"payment_method_options": null,
"payment_method_types": null,
"save_default_payment_method": "off"
},
"pending_invoice_item_interval": null,
"pending_setup_intent": null,
"pending_update": null,
"plan": null,
"quantity": null,
"schedule": null,
"start_date": 1697045841,
"status": "active",
"test_clock": null,
"transfer_data": null,
"trial_end": null,
"trial_settings": {
"end_behavior": {
"missing_payment_method": "create_invoice"
}
},
"trial_start": null
}
Was this page helpful?
const { setToken, Workspaces } = require('@evecloud/sdk');
setToken('TOKEN');
Workspaces.subscription.get('WORKSPACE_ID').then(data => {
console.log(data);
}).catch((error) => {
console.log(error);
});
{
"id": "sub_1O06LVBe5KiwCS6efqEhk2u8",
"object": "subscription",
"application": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": true
},
"billing_cycle_anchor": 1697045841,
"billing_thresholds": null,
"cancel_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"cancellation_details": {
"comment": null,
"feedback": null,
"reason": null
},
"collection_method": "charge_automatically",
"created": 1697045841,
"currency": "eur",
"current_period_end": 1699724241,
"current_period_start": 1697045841,
"customer": "cus_OnhZY7R1nEhACO",
"days_until_due": null,
"default_payment_method": null,
"default_source": null,
"default_tax_rates": [],
"description": null,
"discount": null,
"ended_at": null,
"items": {
"object": "list",
"data": [
{
"id": "si_OnhlJB3zXNjVHl",
"object": "subscription_item",
"billing_thresholds": null,
"created": 1697045841,
"metadata": {},
"plan": {
"id": "price_1NigXEBe5KiwCS6ePvBcBmuO",
"object": "plan",
"active": true,
"aggregate_usage": "sum",
"amount": 14,
"amount_decimal": "14",
"billing_scheme": "per_unit",
"created": 1692895048,
"currency": "eur",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {},
"nickname": null,
"product": "prod_OVhxJvq0m43q6Y",
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "metered"
},
"price": {
"id": "price_1NigXEBe5KiwCS6ePvBcBmuO",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1692895048,
"currency": "eur",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_OVhxJvq0m43q6Y",
"recurring": {
"aggregate_usage": "sum",
"interval": "month",
"interval_count": 1,
"trial_period_days": null,
"usage_type": "metered"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 14,
"unit_amount_decimal": "14"
},
"subscription": "sub_1O06LVBe5KiwCS6efqEhk2u8",
"tax_rates": []
},
{
"id": "si_OnhlLMOvAXlOGx",
"object": "subscription_item",
"billing_thresholds": null,
"created": 1697045841,
"metadata": {},
"plan": {
"id": "price_1NX48tBe5KiwCS6e6SiYkgOu",
"object": "plan",
"active": true,
"aggregate_usage": "sum",
"amount": 4,
"amount_decimal": "4",
"billing_scheme": "per_unit",
"created": 1690125859,
"currency": "eur",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {},
"nickname": null,
"product": "prod_OJhA6fub8gevOK",
"tiers_mode": null,
"transform_usage": {
"divide_by": 1024,
"round": "up"
},
"trial_period_days": null,
"usage_type": "metered"
},
"price": {
"id": "price_1NX48tBe5KiwCS6e6SiYkgOu",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1690125859,
"currency": "eur",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_OJhA6fub8gevOK",
"recurring": {
"aggregate_usage": "sum",
"interval": "month",
"interval_count": 1,
"trial_period_days": null,
"usage_type": "metered"
},
"tax_behavior": "inclusive",
"tiers_mode": null,
"transform_quantity": {
"divide_by": 1024,
"round": "up"
},
"type": "recurring",
"unit_amount": 4,
"unit_amount_decimal": "4"
},
"subscription": "sub_1O06LVBe5KiwCS6efqEhk2u8",
"tax_rates": []
}
],
"has_more": false,
"total_count": 2,
"url": "/v1/subscription_items?subscription=sub_1O06LVBe5KiwCS6efqEhk2u8"
},
"latest_invoice": "in_1O06LVBe5KiwCS6eVdpRZDWL",
"livemode": false,
"metadata": {},
"next_pending_invoice_item_invoice": null,
"on_behalf_of": null,
"pause_collection": null,
"payment_settings": {
"payment_method_options": null,
"payment_method_types": null,
"save_default_payment_method": "off"
},
"pending_invoice_item_interval": null,
"pending_setup_intent": null,
"pending_update": null,
"plan": null,
"quantity": null,
"schedule": null,
"start_date": 1697045841,
"status": "active",
"test_clock": null,
"transfer_data": null,
"trial_end": null,
"trial_settings": {
"end_behavior": {
"missing_payment_method": "create_invoice"
}
},
"trial_start": null
}