Skip to main content

Get subscriptions in Stripe

📜 This job is an official example from OpenFn.

Metadata​

  • Name: Get subscriptions in Stripe
  • Adaptor: @openfn/language-stripe
  • Adaptor Version: latest
  • Created date unknown
  • Updated date unknown
  • Score: 100 (an indicator of how useful this job may be)

Key Functions​

each, get

Expression​

// Get subscription data
fn(state => {
state.subscriptions = state.data;
state.subscriptionsData = [];
return state;
});

each(
'$.subscriptions',
get('subscriptions', $.data).then(state => {
state.subscriptionsData.push(state.data.data);
return state;
})
);