Stripe.retrieveSubscriptionDetails()

Retrieve details of a subscription.

By default, you can see the 10 most recent active subscriptions stored on a customer directly on the customer object, but you can also retrieve details about a specific active subscription for a customer.

Usage

Hover over inputs/exits for more info.

var Stripe = require('machinepack-stripe');


// Retrieve details of a subscription.

Stripe.retrieveSubscriptionDetails({

subscription: 'sub_someSubIdjsd2isnsd',

: ,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// No Stripe subscription could be found with the specified ID.

notFound: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

subscription required

The ID of the subscription you wish to retrieve details for.

'sub_someSubIdjsd2isnsd'
undefined

Exits

error

An unexpected error occurred.

notFound

No Stripe subscription could be found with the specified ID.

success

OK.

{ id: 'sub_929dHmk5spqvgi',
  object: 'subscription',
  application_fee_percent: 0,
  cancel_at_period_end: false,
  canceled_at: 0,
  created: 1471583633,
  current_period_end: 1474262033,
  current_period_start: 1471583633,
  customer: 'cus_92418YMzH9wiaI',
  discount: 0,
  ended_at: 0,
  livemode: false,
  metadata: {},
  plan: 
   { id: 'pro',
     object: 'plan',
     amount: 3000,
     created: 1471559116,
     currency: 'usd',
     interval: 'month',
     interval_count: 1,
     livemode: false,
     metadata: {},
     name: 'Pro',
     statement_descriptor: 'Pro Plan',
     trial_period_days: 0 },
  quantity: 1,
  start: 1471583633,
  status: 'active',
  tax_percent: 0,
  trial_end: 0,
  trial_start: 0 }