API Documentation & SDKs
Subscriptions
Discounts
Licenses
Customers
Products
Payouts
Miscellaneous
List subscriptions
Get a list of all subscriptions associated with your account.
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() {
// Automatically fetches more pages as needed.
for await (const subscription of client.subscriptions.list()) {
console.log(subscription.product_id);
}
}
main();
{
"items": [
{
"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",
"payment_frequency_count": 123,
"payment_frequency_interval": "Day",
"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.
Query Parameters
Get events after this created time
Get events created before this time
Page size default is 10 max is 100
x >= 0
Page number default is 0
x >= 0
Filter by customer id
Filter by status
pending
, active
, on_hold
, paused
, cancelled
, failed
, expired
Response
Response struct representing subscription details
Timestamp when the subscription was created
AED
, ALL
, AMD
, ANG
, AOA
, ARS
, AUD
, AWG
, AZN
, BAM
, BBD
, BDT
, BGN
, BHD
, BIF
, BMD
, BND
, BOB
, BRL
, BSD
, BWP
, BYN
, BZD
, CAD
, CHF
, CLP
, CNY
, COP
, CRC
, CUP
, CVE
, CZK
, DJF
, DKK
, DOP
, DZD
, EGP
, ETB
, EUR
, FJD
, FKP
, GBP
, GEL
, GHS
, GIP
, GMD
, GNF
, GTQ
, GYD
, HKD
, HNL
, HRK
, HTG
, HUF
, IDR
, ILS
, INR
, IQD
, JMD
, JOD
, JPY
, KES
, KGS
, KHR
, KMF
, KRW
, KWD
, KYD
, KZT
, LAK
, LBP
, LKR
, LRD
, LSL
, LYD
, MAD
, MDL
, MGA
, MKD
, MMK
, MNT
, MOP
, MRU
, MUR
, MVR
, MWK
, MXN
, MYR
, MZN
, NAD
, NGN
, NIO
, NOK
, NPR
, NZD
, OMR
, PAB
, PEN
, PGK
, PHP
, PKR
, PLN
, PYG
, QAR
, RON
, RSD
, RUB
, RWF
, SAR
, SBD
, SCR
, SEK
, SGD
, SHP
, SLE
, SLL
, SOS
, SRD
, SSP
, STN
, SVC
, SZL
, THB
, TND
, TOP
, TRY
, TTD
, TWD
, TZS
, UAH
, UGX
, USD
, UYU
, UZS
, VES
, VND
, VUV
, WST
, XAF
, XCD
, XOF
, XPF
, YER
, ZAR
, ZMW
Timestamp of the next scheduled billing
Number of payment frequency intervals
Day
, Week
, Month
, Year
Identifier of the product associated with this subscription
Number of units/items included in the subscription
Amount charged before tax for each recurring payment in smallest currency unit (e.g. cents)
pending
, active
, on_hold
, paused
, cancelled
, failed
, expired
Unique identifier for the subscription
Number of subscription period intervals
Day
, Week
, Month
, Year
Indicates if the recurring_pre_tax_amount is tax inclusive
Number of days in the trial period (0 if no trial)
Cancelled timestamp if the subscription is cancelled
The discount id if discount is applied
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() {
// Automatically fetches more pages as needed.
for await (const subscription of client.subscriptions.list()) {
console.log(subscription.product_id);
}
}
main();
{
"items": [
{
"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",
"payment_frequency_count": 123,
"payment_frequency_interval": "Day",
"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
}
]
}