Version: v2 2017-02-01

POST Endpoint

https://wepayapi.com/v2/settlement

/settlement_bank/create

This call creates a new settlement bank account object which can be safely referred to using the returned settlement_bank_id. This API call should be invoked using the WePay JavaScript library. However, if you are making this call from a server, you should include the optional Risk Headers on this API call.

Caution

Do not provide an access token for this call. Instead, it must be confirmed using the /settlement_bank/authorize call within 30 minutes of creation.

Arguments

Parameter Required Type Description
client_id Yes Integer (64 bits) The unique ID of your API application. This can be located on your app dashboard.
account_id Yes Integer (64 bits) The unique ID of the account.
email Yes String (255 chars) TThe merchant's email address. This must match the email used in the /user/register call used to setup the merchant.
ca_institution Yes * CA Institution Structure Information about a Canadian bank. Required for Canadian banks only.
gb_institution Yes * GB Institution Structure Information about a bank in the United Kingdom. Required for UK banks only.
us_institution Yes * US Institution Structure Information about a US bank. Required for US Banks only.

Example

{
   "client_id": "56689",
   "account_id": "1993567257",
   "email": "foobar@example.com",
   "ca_institution": {
      "name": "My Canadian Bank",
      "transit_number": "12345",
      "institution_number": "123",
      "account_number": "1234567",
      "account_type": "checking"
   }
}

Response

Response Type Description
settlement_bank_id Integer (64 bit) A unique identifier for the settlement bank.

Example

{
   "settlement_bank_id": 12345
}

/settlement_bank/authorize

After a bank account has been defined using the /settlement_bank/create call, it must be authorized within 30 minutes using the server-to-server /settlement_bank/authorize call. When making this call, you must use the access token associated with the merchant.

Arguments

Parameter Required Type Description
settlement_bank_id Yes Integer (64 bits) The unique ID returned by the /settlement_bank/create call.
account_id Yes Integer (64 bits) The unique ID of the account you want to look up.

Example

{
   "settlement_bank_id": 12345,
   "account_id": 67890
}

Response

Response Type Description
settlement_bank_id Integer (64 bits) The unique ID for the merchant's settlement bank.
bank_name String (255 chars) The name of the merchant's bank.
account_last_four String (255 chars) The last four digits of the merchant's bank account number.

Example

{
   "settlement_bank_id": 12345,
   "bank_name": "Wells Fargo",
   "account_last_four": "6789"
}

Tokenization

WePay provides a JavaScript Library for tokenization of settlement information such that no sensitive information is transmitted through a partner’s server.

The JavaScript tokenization library handles the /settlement_bank/create process. After a successful /settlement_bank/create call, to ensure that the information came from a trusted source, your app must make a /settlement_bank/authorize call within 30 minutes.

Loading the JavaScript Library

You must load the WePay JavaScript Library (kyc.1.latest.js). See the example at right. You must set the endpoint to production when you make your app live.

Apps of API Version 2016-05-04 or earlier

Apps of API Version 2016-05-14 or later

CA Institution Structure

Contains information about a Canadian financial institution.

Fields

Field Required Type Description
name Yes String (255 chars) The name of the financial institution.
transit_number Yes String (255 chars) A number that uniquely identifies a specific financial institution, used for electronic funds transmission.
institution_number Yes String (255 chars) A unique identifier for a Canadian bank or financial institution.
account_number Yes String (255 chars) The merchant's bank account number.
account_type Yes String (255 chars) The type of account to which funds are transmitted.

Possible values: checking and savings.

Example

{
   "ca_institution":{
      "name":"Bank of Canada",
      "transit_number":"12345-123",
      "institution_number": "177",
      "account_number":"123456789",
      "account_type":"checking"
   }  
}

GB Institution Structure

Contains information about a UK financial Institution.

Fields

Field Required Type Description
name Yes String (255 chars) The name of the financial institution
sort_code Yes String (255 chars) A bank code used to route money transfers between banks.
account_number Yes String (255 chars) The merchant's account number.

Example

{
   "gb_institution":{
      "name":"Barclays",
      "sort_code":"20-00-06",
      "account_number":"123445678"    
   }  
}

US Institution Structure

Contains information about a US financial institution.

Fields

Field Required Type Description
name Yes String (255 chars) The name of the institution.
routing_number Yes String (255 chars) A unique identifier indicating a specific US financial institution.
account_number Yes String (255 chars) The merchant's account number.
account_type Yes String (255 chars) The type of account to which funds are transmitted.

Possible values: checking and savings.

Example

{
   "us_institution":{
      "name":"Bank of the West",
      "routing_number": "121100782",
      "account_number": "123456789",
      "account_type": "checking"    
   }
}