WePay Developer

The /user API calls

The "user" object represents a single user registered on WePay. The following calls let you create, view, and modify "user" objects on WePay:

Older version?

You can view the older version 2011-01-15 here.

User States

The "user" object has the following states and the following possible state transitions (you can receive callback notifications when the user changes state, please read our IPN Tutorial for more details):

pending
The user registered with /user/register and did not confirm the registration yet.
registered
The user's registration on WePay is complete.
deleted
The user's registration was deleted.

API User State Diagram

/user

This call allows you to lookup the details of the user associated with the access token you are using to make the call.

Arguments:

There are no arguments necessary for this call. Only an access token is required.

Response:

Response Type Description
user_id Integer (64 bits) The unique ID of the user
user_name String (255 chars) The full name of the user
first_name String (127 chars) The first name of the user
last_name String (127 chars) The last name of the user
email String (255 chars) The email of the user
state String (255 chars) Either "registered" if the user has registered, or "pending" if the user still needs to confirm their registration
{
  "user_id":12345,
  "first_name":"Bill",
  "last_name":"Clerico",
  "email":"api@wepay.com",
  "state":"registered"
}

/user/modify

This call allows you to add a callback_uri to the user object. If you add a callback_uri you will receive IPNs with the user_id each time the user revokes their access_token or is deleted.

Arguments:

Parameter Required Type Description
callback_uri No String (2083 chars) The callback_uri you want to receive IPNs on. Must be a full URI.

Example:

{
  "callback_uri":"https://www.everribbon.com/ipn/12345"
}

Response:

This call returns the same information as /user.

/user/register

Registers a user with your application and returns a temporary access token for that user.

The temporary access token will expire 90 days after its creation if not approved. You can send the user an email to confirm their WePay account using the /user/resend_confirmation call.

Accounts created with a temporary access token have a few restrictions.

  1. They will deleted when the temporary access token expires.
  2. They will also be deleted 14 days after they accept their first payment.
  3. They can only accept $5,000.

Once an account created with a temporary access token is deleted, all accepted payments will be refunded.

This call does not use OAuth2 authorization so you should not pass an access token, and you must specify the client_id and client_secret for your application.

Arguments:

Parameter Required Type Description
client_id Yes Integer (64 bits) The integer client ID issued to the app, found on your application's dashboard
client_secret Yes String (255 chars) The string client secret issued to the app, found on your application's dashboard
email Yes String (255 chars) The email of the user you want to register
scope Yes String (255 chars) A comma separated list of permissions.
first_name Yes String (127 chars) The first name of the user you want to register
last_name Yes String (127 chars) The last name of the user you want to register
original_ip Yes String (16 chars) The IP address of the user you want to register
original_device Yes String (255 chars) The user-agent (for web) or the IMEI (for mobile) of the user you want to register
redirect_uri No String (2083 chars) The uri the user will be redirected to after they have confirmed they wanted to be registered on WePay. By default this will be your application's homepage.
callback_uri No String (2083 chars) The callback_uri you want to receive IPNs on. Must be a full URI.
tos_acceptance_time No Integer (64 bits) A unix_timestamp referencing the time the user accepted WePay's terms of service.

Example:

{
  "client_id":12345,
  "client_secret":"6446c521bd",
  "email":"api@wepay.com",
  "scope":"manage_accounts,view_balance,collect_payments,view_user",
  "first_name":"Bill",
  "last_name":"Clerico",
  "original_ip":"74.125.224.84",
  "original_device":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; 
                     en-US) AppleWebKit/534.13 (KHTML, like Gecko) 
                     Chrome/9.0.597.102 Safari/534.13"
}

Response:

Response Type Description
user_id Integer (64 bits) The unique integer user ID of the user
access_token String (255 chars) The string access token that you can use to make calls on behalf of the user
token_type String (255 chars) The token type - for now only "BEARER" is supported
expires_in Integer (64 bits) How much time till the access_token expires in seconds. If NULL or not present, the access token will be valid until the user revokes the access_token

Example:

{
  "user_id":567235,
  "access_token":"604f39f41e364951ced74070c6e8bfa49d346cdfee6191b03c2c2d9c9cda9184",
  "token_type":"BEARER",
  "expires_in":1209600
}

/user/resend_confirmation

For users who were registered via the /user/register call, this API call lets you resend the API registration confirmation email.

Arguments:

Parameter Required Type Description
email_message No String (65535 chars) A short message that will be included in the email to the user.

Example:

{
  "email_message":"Welcome to my <strong>application</strong>"
}

Response:

Response Type Description
user_id Integer (64 bits) The unique ID of the user
first_name String (127 chars) The first name of the user
last_name String (127 chars) The last name of the user
email String (255 chars) The email of the user
state String (255 chars) Either "registered" if the user has registered, or "pending" if the user still needs to confirm their registration

Example:

{
  "user_id":12345,
  "first_name":"Bill",
  "last_name":"Clerico",
  "email":"api@wepay.com",
  "state":"registered"
}