WePay.accountDelete()

Delete an existing payment account.

Delete the account specified. The user associated with the access token used must have permission to delete the account. An account may not be deleted if it has a balance or pending payments.

Usage

Hover over inputs/exits for more info.

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


// Delete an existing payment account.

WePay.accountDelete({

accessToken: '604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184',

accountId: 12345,

reason: 'No longer being used.',

useProduction: false,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

accessToken required

The string access token of the user with permission to delete this account.

'604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184'
accountId required

The unique ID of the account you want to delete.

12345
reason

Reason for deleting the account.

'No longer being used.'
useProduction

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

false

Exits

error

An unexpected error occurred.

success

OK.

{ account_id: 12345, state: 'deleted' }