Subscriptions
Update Subscription
API Documentation & SDKs
- Introduction
- Code Integration Tutorial
- SDKs - Node, Python, PHP, Go, Ruby, Java & Kotlin
- Payments Integration Guide
- Subscription Integration Guide
- Mobile Integration Guide
- On Demand Subscriptions
- Webhooks Details
- Managing Products Via API
- Metadata Guide
- Configuring Allowed Payment Methods
- MCP Server
- Technical - FAQs
Subscriptions
Discounts
Licenses
Customers
Products
Payouts
Miscellaneous
Subscriptions
Update Subscription
Update a subscription’s details.
PATCH
/
subscriptions
/
{subscription_id}
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
async function main() {
const subscription = await client.subscriptions.update('subscription_id');
console.log(subscription.product_id);
}
main();
{
"addons": [
{
"addon_id": "<string>",
"quantity": 123
}
],
"billing": {
"city": "<string>",
"country": "AF",
"state": "<string>",
"street": "<string>",
"zipcode": "<string>"
},
"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
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Subscription Id
Body
application/json
Response
200 - application/json
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
});
async function main() {
const subscription = await client.subscriptions.update('subscription_id');
console.log(subscription.product_id);
}
main();
{
"addons": [
{
"addon_id": "<string>",
"quantity": 123
}
],
"billing": {
"city": "<string>",
"country": "AF",
"state": "<string>",
"street": "<string>",
"zipcode": "<string>"
},
"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
}