The /account/membership API calls
Use the membership calls to modify account objects.
Summary
Use the /account/membership API calls below to add users to an account, modify their roles, and delete (remove) them.
Granting Account Access
Use the /create call when the user does not currently have access to an account (in any role).
Modifying A User’s Role
Use the /modify call to change the role of a user that already has access to an account. In either case, the user must already be set up with WePay via /user/register.
Changing Account Administrator
Using the Account Membership APIs to add or change an account admin requires WePay permission. A user must have confirmed their account before they can be added or modified into an admin role (financial owner). When a call is changing admin, admin_context
and reason
are required. Partners must construct a user interface that asks merchants the reason for the change, so that WePay’s risk management system can process the change appropriately.
Important: The admin of an account can only be changed on the condition that the account has not previously settled any funds to a bank account or via paper check.
Version: v2 2019-04-03
POST Endpoint
https://wepayapi.com/v2/account/membership
/account/membership/create
Use this call to add a user to an account.
If you want the new user to have the role
set to admin
, you must specify an admin_context
with a reason
. The WePay Risk team reviews these requests and must approve them before the new user is granted admin privileges.
Note: In the Admin Context Structure, if you specify the reason
, you must provide an explanation.
Arguments
Parameter | Required | Type | Description |
account_id | Yes | Integer (64 bits) | The unique ID of the account for which you want to add a user. |
member_access_token | Yes | String (10 chars) | Access token for the user to be added. |
role | No | String (10 chars) | The role assigned to the new user.
Possible values: moderator , admin , and member .
A new user defaults to moderator , which permits the user to make any changes to the account besides viewing or changing KYC and banking info. An admin is the financial owner and may access and edit all information. A member has view-only privileges.
Default: moderator |
admin_context | No | Admin Context Structure | Required if role is admin . |
Example
{
"account_id": 82031118,
"member_access_token": "STAGE_84e470b9618baa95c4e9954fc09b854b45dec8074d7493a781928c6892c98z"
}
Response
Response | Type | Description |
account_id | Integer (64 bits) | The unique ID of the account. |
user_id | Integer (64 bits) | The unique ID of the user that was added. |
role | String (10 chars) | The role assigned to the new user. |
Example
{
"account_id": 82031118,
"user_id": 2704640,
"role": "moderator"
}
/account/membership/modify
Use this to modify the role of a user that already has access to an account. To remove access completely, use the /account/membership/remove call. The access token must be the token associated with the current admin, not the user to be modified.
Arguments
Parameter | Required | Type | Description |
account_id | Yes | Integer (64 bits) | The unique ID of the account for which you want to modify a user. |
user_id | Yes | Integer (64 bits) | The unique ID of the user to be modified. |
role | Yes | String (10 chars) | New role.
Possible values: moderator and member .
|
admin_context | No | Admin Context Structure | Required if role is admin . |
Example
{
"account_id": 82031118,
"user_id": 2704640,
"role": "moderator"
}
Response
Response | Type | Description |
account_id | Integer (64 bits) | The unique ID of the account. |
user_id | Integer (64 bits) | The unique ID of the user that was modified. |
role | String (10 chars) | The role assigned to the modified user. |
Example
{
"account_id": 82031118,
"user_id": 2704640,
"role": "moderator"
}
/account/membership/remove
Allows a partner to remove a user from a specific account. The user being removed must not be the only current admin (see /account/membership/create or /account/membership/modify to add a new member as an admin or modify a current member to assume the role of admin).
Caution
The access token sent in the header must be that of the financial admin. The user_id
is for the user to be removed.
Arguments
Parameter | Required | Type | Description |
account_id | Yes | Integer (64 bits) | The unique ID of the account from which the user should be removed. |
user_id | Yes | Integer (64 bits) | The unique ID of the user to be removed from this account. |
Example
{
"account_id": 123456,
"user_id": "234298324"
}
Response
Response | Type | Description |
account_id | Integer (64 bits) | Unique ID of the account. |
user_id | Integer (64 bits) | Unique ID of the user that was removed. |
role | String (10 chars) | The role assigned to the user. When successful, this will return none. |
Example
{
"account_id": 123456,
"user_id": "234298324",
"role": "none"
}