WePay.accountCreate()

Create a new payment account.

Create a new payment account for the user associated with the access token used to make this call.

Usage

Hover over inputs/exits for more info.

var WePay = require('machinepack-wepay');


// Create a new payment account.

WePay.accountCreate({

accessToken: '604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184',

name: 'My Payment Account',

description: 'My payment account is for money.',

useProduction: false,

referenceId: 'ABCD1234',

type: 'business',

imageUri: 'http://s3.amazonaws.com/myphoto.jpg',

gaqDomains: [ 'mydomain.com', 'myotherdomain.com' ],

themeObject: {},

mcc: 7392,

callbackUri: 'https://www.baggins.com/callback',

country: 'US',

currencies: [ 'USD' ],

countryOptions: {},

feeScheduleSlot: 9,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

accessToken required

The string access token of the user you want to create a payment account for.

'604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184'
name required

The name of the account you want to create.

'My Payment Account'
description required

The description of the account you want to create.

'My payment account is for money.'
useProduction

Use WePay production API - payments will be charged. Defaults to WePay staging - payments are not charged.

false
referenceId

The reference id of the account. Can be any string, but must be unique for the application/user pair.

'ABCD1234'
type

The type of account you are creating. Can be "nonprofit", "business", or "personal".

'business'
imageUri

The uri for an image that you want to use for the accounts icon. This image will be used in the co-branded checkout process.

'http://s3.amazonaws.com/myphoto.jpg'
gaqDomains

An array of Google Analytics domains associated with the account. See the analytics tutorial (https://stage.wepay.com/developer/reference/analytics) for more details.

[ 'mydomain.com', 'myotherdomain.com' ]
themeObject

The theme structure (a JSON object, not a JSON serialized string) you want to be used for account's flows and emails. See https://stage.wepay.com/deeloper/reference/structures#theme.

{}
mcc

The mcc code that is relevant to the type of account this is. See the mcc reference page (https://stage.wepay.com/developer/reference/mcc) for more information.

7392
callbackUri

The uri that will receive IPNs for this account. You will receive an IPN whenever the account is verified or deleted.

'https://www.baggins.com/callback'
country

The account's country of origin 2-letter ISO code (e.g. "US" or "CA")

'US'
currencies

Array of supported currency strings for this account (e.g. ["USD"]) Both "USD" and "CAD" are currently supported. Only one currency string per account is allowed at this time.

[ 'USD' ]
countryOptions

{"debit_opt_in":true|false}. Used for Canadian accounts only.

{}
feeScheduleSlot

The custom fee schedule value to use for the merchant. Values start at 0, not 1. Passing null will remove the custom fee schedule. NOTE: Use of this parameter requires permission from WePay.

9

Exits

error

An unexpected error occurred.

success

OK.

{ account_id: 12345,
  name: 'Example account',
  state: 'active',
  description: 'this account is just an example.',
  owner_user_id: 539291,
  reference_id: '123abc',
  type: 'personal',
  create_time: 1367958263,
  disablement_time: 'null',
  country: 'US',
  currencies: [ 'USD' ],
  balances: 
   [ { currency: 'USD',
       balance: 390.5,
       incoming_pending_amount: 635.3,
       outgoing_pending_amount: 210,
       reserved_amount: 0,
       disputed_amount: 0,
       withdrawal_period: 'daily',
       withdrawal_type: 'ach',
       withdrawal_next_time: 1370112217,
       withdrawal_bank_name: 'WellsFargo XXXXX3102' } ],
  statuses: 
   [ { currency: 'USD',
       incoming_payments_status: 'ok',
       outgoing_payments_status: 'ok',
       account_review_status: 'pending' } ],
  image_uri: 'https://stage.wepay.com/img/logo.png',
  action_reasons: [ 'bank_account', 'kyc' ],
  supported_card_types: 
   [ 'visa',
     'mastercard',
     'american_express',
     'discover',
     'jcb',
     'diners_club' ],
  disabled_reasons: 
   [ 'country_not_supported',
     'fraud',
     'high_risk_chargeback',
     'no_settlement_path',
     'reported_user',
     'tos_violation' ],
  fee_schedule: [ { slot: 9, description: '2.9% + $0.30', currency: 'USD' } ] }