GET
/
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.retrieve('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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

subscription_id
string
required

Subscription Id

Response

200 - application/json

Response struct representing subscription details