WePay

API structures

API structures are used in the API calls to pass the structured data in and out.

Address Structure

The address structure contains information about a street address.

Fields:

Field Type Description
address1 String (60 chars) The first line of the street address.
address2 String (60 chars) The second line of the street address.
city String (30 chars) The city.
state String (2 chars) The 2-letters US state code. Only for US addresses.
region String (30 chars) The region. Only for non-US addresses when available.
zip String (10 chars) The US zip or zip-plus code. Only for US addresses.
postcode String (14 chars) The postcode. Only for non-US addresses when available.
country String (2 chars) The 2-letters ISO-3166-1 country code.

Example:

US Address:

{
    "address1":"380 Portage Ave",
    "address2":"",
    "city":"Palo Alto",
    "state":"CA",
    "zip":"94306",
    "country":"US"
}
    

Non-US Address:

{
    "address1":"100 Main St",
    "address2":"",
    "region":"ON",
    "city":"Toronto",
    "postcode":"M4E 1Z5",
    "country":"CA"
}
    

Shipping Address Structure

The shipping address structure contains information about a shipping address.

Fields:

Field Type Description
name String (255 chars) The name of the person.
address1 String (60 chars) The first line of the street address.
address2 String (60 chars) The second line of the street address.
city String (30 chars) The city.
state String (2 chars) The 2-letters US state code. Only for US addresses.
region String (30 chars) The region. Only for non-US addresses when available.
zip String (10 chars) The US zip or zip-plus code. Only for US addresses.
postcode String (14 chars) The postcode. Only for non-US addresses when available.
country String (2 chars) The 2-letters ISO-3166-1 country code.

Example:

US Address:

{
	"name":"Bill Clerico",
	"address1":"380 Portage Ave",
	"address2":"",
	"city":"Palo Alto",
	"state":"CA",
	"zip":"94306",
	"country":"US"
}
	

Non-US Address:

{
	"name":"Bill Clerico",
	"address1":"100 Main St",
	"address2":"",
	"region":"ON",
	"city":"Toronto",
	"postcode":"M4E 1Z5",
	"country":"CA"
}
	

Payments Prefill_Info Structure

The payments prefill_info structure contains prefill information for checkout, preapprovals, and subscription flows.

Fields:

Field Type Description
name String (255 chars) The name of the person.
email String (255 chars) The email address of the person.
phone_number String (15 chars) The phone number of the person.
address String (255 chars) The street address.
city String (30 chars) The city.
state String (2 chars) The 2-letters US state code. Only for US addresses.
region String (30 chars) The region. Only for non-US addresses when available.
zip String (10 chars) The US zip or zip-plus code. Only for US addresses.
postcode String (14 chars) The postcode. Only for non-US addresses when available.
country String (2 chars) The 2-letters ISO-3166-1 country code.

Example:

{
	"name":"Bill Clerico",
    "phone_number":"555-555-5555"
}
    

KYC Prefill_Info Structure

The KYC prefill_info structure contains prefill information for the KYC flow.

Fields:

Field Type Description
name String (255 chars) The name of the person.
email String (255 chars) The email address of the person.
phone_number String (15 chars) The phone number of the person.
address String (255 chars) The street address.
city String (30 chars) The city.
state String (2 chars) The 2-letters US state code. Only for US addresses.
region String (30 chars) The region. Only for non-US addresses when available.
zip String (10 chars) The US zip or zip-plus code. Only for US addresses.
postcode String (14 chars) The postcode. Only for non-US addresses when available.
country String (2 chars) The 2-letters ISO-3166-1 country code.
dob String (10 chars) The person's date of birth in the format YYYY-MM-DD.
entity_name String (255 chars) Legal name of the business or organization.
url String (255 chars) URL of business or organization's website.
description String (255 chars) Description of business or organization

Example:

{
    "name":"Bill Clerico",
    "phone_number":"555-555-5555",
    "entity_name":"My Business Inc.",
    "url":"http://www.mybusiness.com"
}
	

Theme Structure

The theme structure contains information to provide custom look-and-feel for the flows and emails.

Fields:

Field Type Description
theme_id Integer (64 bits) The unique theme ID (assigned by WePay).
name String (64 chars) The name for the theme.
primary_color String (6 chars) The hex triplet for the primary color on important elements such as headers.
secondary_color String (6 chars) The hex triplet for the secondary color on elements such as info boxes, and the focus styles on text inputs.
background_color String (6 chars) The hex triplet for the the background color for onsite and iframe pages.
button_color String (6 chars) The hex triplet for the the color for primary action buttons.

Example:

{
	"theme_id":12345,
	"name":"API Theme for API App: My Sample Application",
	"primary_color":"FFFFFF",
	"secondary_color":"000000",
	"background_color":"004C64",
	"button_color":"0084A0"
}
    

Balances Structure

The balances structure contains information on the account balances and automated withdrawals. Accounts can have multiple balances (one for each currency they support).

Fields:

Field Type Description
currency String (3 chars) The ISO 4217 currency code.
balance Number The available balance for this account (specific to the currency specified).
incoming_pending_amount Number The amount of money that being sent to the account that is still pending.
outgoing_pending_amount Number The amount of money being settled to the merchant (either via check or ACH) that is still pending.
reserved_amount Number The amount of money held in reserves.
disputed_amount Number The amount of money disputed either via chargeback or through WePay.
withdrawal_type String (6 chars) How the money will be settled to the merchant (either "check" or "ach").
withdrawal_period String (6 chars) How often money will be settled to the merchant ("daily", "weekly", or "monthly").
withdrawal_next_time String (6 chars) The unix time stamp for the next scheduled settlement.
withdrawal_bank_name String (6 chars) The masked name of the entity funds will be settled to. If a check is being sent, this will be the name of the entity the check was mailed to (the "pay to the order of" field).

Example:

[
  {
    "currency":"USD",
    "balance":390.50,
    "incoming_pending_amount":635.30,
    "outgoing_pending_amount":210.00,
    "reserved_amount":0,
    "disputed_amount":0,
    "withdrawal_period":"daily",
    "withdrawal_type":"ach",
    "withdrawal_next_time":1370112217,
    "withdrawal_bank_name":"WellsFargo XXXXX3102"
  },
  {
    "currency":"CAD",
    "balance":40.50,
    "incoming_pending_amount":20.30,
    "outgoing_pending_amount":70.00,
    "reserved_amount":0,
    "disputed_amount":0,
    "withdrawal_period":"daily",
    "withdrawal_type":"ach",
    "withdrawal_next_time":1370112217,
    "withdrawal_bank_name":"TD Canada XXXXX4156"
  }
]