The /user API calls
Upgrade to new version
You are viewing old calls for version 2011-01-15. Please upgrade user object calls to version 2014-01-08 for latest functionality.
The "user" object represents a single user registered on WePay. The following calls let you create, view, and modify "user" objects on WePay:
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.
/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 |
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:
/user/register
Registers a new user and returns an access token for that user. If the call fails for any reason the application must use the normal /oauth2/authorize flow to obtain authorization from the user.
Use /oauth2/authorize instead
This API call is only available for legacy v1 API applications. If you are using the WePay API for the first time, this call, and the associated /user/resend_confirmation call will not be available to you.
This call only works for users who are not already registered on WePay. If you try to register a user who is already on WePay, you will receive an error and must use the normal /oauth2/authorize flow.
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.
If a new user is registered using this call then an email is sent to that user asking them to confirm the registration, setup the password, and confirm the permissions grant to the application. If the user does not confirm the registration within 14 calendar days of the registration, then WePay will automatically revoke the authentication token granted to the user.
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 |
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. |
Example:
{ "client_id":12345, "client_secret":"6446c521bd", "email":"api@wepay.com", "scope":"manage_accounts,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:
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 |
first_name | String (127 chars) | The first name of the user |
last_name | String (127 chars) | The last name of the user |
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" }