Update a subscription’s details.
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const subscription = await client.subscriptions.update('subscription_id');
console.log(subscription.product_id);
{
"addons": [
{
"addon_id": "<string>",
"quantity": 123
}
],
"billing": {
"city": "<string>",
"country": "AF",
"state": "<string>",
"street": "<string>",
"zipcode": "<string>"
},
"cancel_at_next_billing_date": true,
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"currency": "AED",
"customer": {
"customer_id": "<string>",
"email": "<string>",
"name": "<string>"
},
"discount_id": "<string>",
"metadata": {},
"next_billing_date": "2023-11-07T05:31:56Z",
"on_demand": true,
"payment_frequency_count": 123,
"payment_frequency_interval": "Day",
"previous_billing_date": "2023-11-07T05:31:56Z",
"product_id": "<string>",
"quantity": 123,
"recurring_pre_tax_amount": 123,
"status": "pending",
"subscription_id": "<string>",
"subscription_period_count": 123,
"subscription_period_interval": "Day",
"tax_inclusive": true,
"trial_period_days": 123
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Subscription Id
Subscription successfully updated
Response struct representing subscription details
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const subscription = await client.subscriptions.update('subscription_id');
console.log(subscription.product_id);
{
"addons": [
{
"addon_id": "<string>",
"quantity": 123
}
],
"billing": {
"city": "<string>",
"country": "AF",
"state": "<string>",
"street": "<string>",
"zipcode": "<string>"
},
"cancel_at_next_billing_date": true,
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"currency": "AED",
"customer": {
"customer_id": "<string>",
"email": "<string>",
"name": "<string>"
},
"discount_id": "<string>",
"metadata": {},
"next_billing_date": "2023-11-07T05:31:56Z",
"on_demand": true,
"payment_frequency_count": 123,
"payment_frequency_interval": "Day",
"previous_billing_date": "2023-11-07T05:31:56Z",
"product_id": "<string>",
"quantity": 123,
"recurring_pre_tax_amount": 123,
"status": "pending",
"subscription_id": "<string>",
"subscription_period_count": 123,
"subscription_period_interval": "Day",
"tax_inclusive": true,
"trial_period_days": 123
}
Update a subscription’s details.
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const subscription = await client.subscriptions.update('subscription_id');
console.log(subscription.product_id);
{
"addons": [
{
"addon_id": "<string>",
"quantity": 123
}
],
"billing": {
"city": "<string>",
"country": "AF",
"state": "<string>",
"street": "<string>",
"zipcode": "<string>"
},
"cancel_at_next_billing_date": true,
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"currency": "AED",
"customer": {
"customer_id": "<string>",
"email": "<string>",
"name": "<string>"
},
"discount_id": "<string>",
"metadata": {},
"next_billing_date": "2023-11-07T05:31:56Z",
"on_demand": true,
"payment_frequency_count": 123,
"payment_frequency_interval": "Day",
"previous_billing_date": "2023-11-07T05:31:56Z",
"product_id": "<string>",
"quantity": 123,
"recurring_pre_tax_amount": 123,
"status": "pending",
"subscription_id": "<string>",
"subscription_period_count": 123,
"subscription_period_interval": "Day",
"tax_inclusive": true,
"trial_period_days": 123
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Subscription Id
Subscription successfully updated
Response struct representing subscription details
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const subscription = await client.subscriptions.update('subscription_id');
console.log(subscription.product_id);
{
"addons": [
{
"addon_id": "<string>",
"quantity": 123
}
],
"billing": {
"city": "<string>",
"country": "AF",
"state": "<string>",
"street": "<string>",
"zipcode": "<string>"
},
"cancel_at_next_billing_date": true,
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"currency": "AED",
"customer": {
"customer_id": "<string>",
"email": "<string>",
"name": "<string>"
},
"discount_id": "<string>",
"metadata": {},
"next_billing_date": "2023-11-07T05:31:56Z",
"on_demand": true,
"payment_frequency_count": 123,
"payment_frequency_interval": "Day",
"previous_billing_date": "2023-11-07T05:31:56Z",
"product_id": "<string>",
"quantity": 123,
"recurring_pre_tax_amount": 123,
"status": "pending",
"subscription_id": "<string>",
"subscription_period_count": 123,
"subscription_period_interval": "Day",
"tax_inclusive": true,
"trial_period_days": 123
}