Stripe.createCustomer()

Create a new customer.

Usage

Hover over inputs/exits for more info.

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


// Create a new customer.

Stripe.createCustomer({

: ,

email: 'john.doe@somebody.com',

description: 'sdjasnd928u8duasd',

source: 'tok_18epPlAE8iIXJx4mLWRYLRj6',

plan: 'pro',

metadata: {},

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

undefined

email

An email address to associate with the customer.

'john.doe@somebody.com'
description

Arbitrary string to attach to the customer in Stripe.

'sdjasnd928u8duasd'
source

A token used to set the new customer's default charging source.

'tok_18epPlAE8iIXJx4mLWRYLRj6'
plan

The identifier of a plan to subscribe the customer to.

'pro'
metadata

Arbitrary metadata to attach to the new customer.

{}

Exits

error

An unexpected error occurred.

success

OK.

{ id: 'cus_92418YMzH9wiaI',
  object: 'customer',
  account_balance: 0,
  created: 1471562736,
  currency: 'usd',
  default_source: '',
  delinquent: false,
  description: 'Stripe Test Customer #5',
  discount: 0,
  email: 'somebody@email.com',
  livemode: false,
  metadata: {},
  shipping: 0,
  sources: 
   { object: 'list',
     data: 
      [ { id: 'ba_18k5KBAE8iIXJx4mnWV35Rnl',
          object: 'bank_account or card or bitcoin_receiver',
          address_city: '',
          address_country: '',
          address_line1: '',
          address_line1_check: '',
          address_line2: '',
          address_state: '',
          address_zip: '',
          address_zip_check: '',
          brand: 'Visa',
          country: 'US',
          customer: '',
          cvc_check: '',
          dynamic_last4: '',
          exp_month: 8,
          exp_year: 2017,
          funding: 'credit',
          last4: '4242',
          name: '',
          tokenization_method: '',
          account: 'acct_18epKhAE8iIXJx4m',
          account_holder_name: 'Jane Austen',
          account_holder_type: 'individual',
          bank_name: 'STRIPE TEST BANK',
          currency: 'usd',
          default_for_currency: false,
          fingerprint: 'rNUOheo5Mxi8lCO6',
          routing_number: '110000000',
          status: 'new',
          active: false,
          amount: 100,
          amount_received: 0,
          bitcoin_amount: 1757908,
          bitcoin_amount_received: 0,
          bitcoin_uri: 'bitcoin:test_7i9Fo4b5wXcUAuoVBFrc7nc9HDxD1?amount=0.01757908',
          created: 1471583627,
          description: 'Receiver for John Doe',
          email: 'test@example.com',
          filled: false,
          inbound_address: 'test_7i9Fo4b5wXcUAuoVBFrc7nc9HDxD1',
          livemode: false,
          metadata: {},
          refund_address: '',
          uncaptured_funds: false,
          used_for_payment: false } ],
     has_more: false,
     total_count: 0,
     url: '/v1/customers/cus_92418YMzH9wiaI/sources' },
  subscriptions: 
   { object: 'list',
     data: 
      [ { 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 } ],
     has_more: false,
     total_count: 0,
     url: '/v1/customers/cus_92418YMzH9wiaI/subscriptions' } }