Im not getting the list of subscriptions, below link i had refered for the same.
https://developer.paddle.com/api-reference/subscriptions/list-subscriptions
here, there is no required field for query parameters, so if i send {}, then it should return whole list of subscriptions.
Below is my code for getting the list of subscription, below I had used Paddle sdk, and create a Paddle Provider. For the particular user’s subscription I passed the customerId for it also it still not getting any data.
const getUserAllSubscription = async (req, res) => {
try {
const userSubscriptions = paddle.subscriptions.list({
customerId: 'ctm_xxxxxxxxxxxxxxx',
});
console.log("userSubscriptions >>>>>>", userSubscriptions);
return res.status(200).send(userSubscriptions);
} catch (error) {
console.error(`Error from PADDLE > getUserAllSubscription: ${error}`, 'error');
throw error;
}
}
Below is the response, that I’m getting:
userSubscriptions >>>>>> SubscriptionCollection {
client: Client {
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
options: { environment: 'sandbox', logLevel: 'verbose' },
baseUrl: 'https://sandbox-api.paddle.com'
},
hasMore: true,
estimatedTotal: 0,
data: [],
nextLink: '/subscriptions?customer_id=ctm_xxxxxxxxxxxxxxx'
}
See I data is empty, instead of having data.
Harsh Bardolia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.