{"_id":"5bc48b4f9919d4000df5ea72","project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"5bc48b4f9919d4000df5ea7b","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5b8ec64c7ef0f4000350182a","createdAt":"2018-04-23T15:17:35.680Z","releaseDate":"2018-04-23T15:17:35.680Z","categories":["5bc48b4f9919d4000df5ea33","5bc48b4f9919d4000df5ea34","5bc48b4f9919d4000df5ea35","5bc48b4f9919d4000df5ea36","5bc48b4f9919d4000df5ea37","5bc48b4f9919d4000df5ea38","5bc48b4f9919d4000df5ea39","5bc48b4f9919d4000df5ea3a","5bc48b4f9919d4000df5ea3b","5bc48b4f9919d4000df5ea3c","5bc48b4f9919d4000df5ea3d","5bc48b4f9919d4000df5ea3e","5b34c737e0dca2000311de6a","5bc48b4f9919d4000df5ea3f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.27.1 Release","version_clean":"8976.0.0-Tools","version":"8976-Tools"},"category":{"_id":"5bc48b4f9919d4000df5ea3e","project":"57336fd5a6a9c40e00e13a0b","version":"5bc48b4f9919d4000df5ea7b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2018-06-18T14:13:01.902Z","from_sync":false,"order":11,"slug":"merchant-single-signon","title":"User Management"},"user":"5b155c2c3fbcd30003e76908","githubsync":"","__v":56,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-06-18T14:15:15.954Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"57ee593a21ceb20e0061959e","examples":{"codes":[]},"method":"put","auth":"optional","params":[],"url":""},"isReference":false,"order":5,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/cp/user/<userId>?onbehalfofmid=</span>\n\n<hr>\n\n##Documentation\n\nThe Update User API enables you to update a user in your BlueSnap account or any of your linked accounts. As part of the update functionality you can add or remove [permissions](doc:user-permissions) from the user.\n\n###Request Content\n\nSend a JSON object, with the following:\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`firstName` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`lastName` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`email` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`password` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional (if empty, a new password is generated)\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Any of the permissions described in [User Permissions](doc:user-permissions) can be included with a value of \\\"true.\\\"\",\n  \"title\": \"Note:\"\n}\n[/block]\n###Response Details\n\nIf successful, the response HTTP status code is 200 OK.\n\n<hr>\n\n##Examples\n\n###Request Example\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you need to manage an operation on behalf of a linked BlueSnap account, use the \\\"onbehalfofmid\\\" parameter.\",\n  \"title\": \"Note:\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/cp/userId \\\\\\n-H 'Content-Type: application/json' \\n-H 'Accept: application/json' \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\\n{\\n\\t\\\"userfirstName\\\": \\\"New\\\",\\n\\t\\\"userlastName\\\": \\\"User\\\",\\n\\t\\\"userEmail\\\": \\\"new.email:::at:::email.com\\\" ,\\n\\t\\\"userName\\\": \\\"finance 1234\\\",  \\n\\t\\\"allowViewFinancialInfo\\\": true,\\n\\t\\\"allowReports\\\": false\\n}\",\n      \"language\": \"curl\",\n      \"name\": \"Update User\"\n    },\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/cp/user/23645623?onbehalfofmid=34234\\n-H 'Content-Type: application/json' \\n-H 'Accept: application/json' \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\\n{\\n\\t\\\"userEmail\\\": \\\"new.email@email.com\\\" ,\\n\\t\\\"allowViewFinancialInfo\\\": true,\\n\\t\\\"allowReports\\\": false\\n}\",\n      \"language\": \"curl\",\n      \"name\": \"Update User on behalf of linked BlueSnap account\"\n    }\n  ]\n}\n[/block]\n###Response Example\n\nIf successful, the response HTTP status code is 200 OK.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"userId\\\": \\\"1111001\\\",\\n\\t\\\"merchantId\\\": \\\"1111111111\\\",\\n\\t\\\"userfirstName\\\": \\\"New\\\",\\n\\t\\\"userlastName\\\": \\\"User\\\",\\n\\t\\\"userEmail\\\": \\\"new.email@email.com\\\",\\n\\t\\\"userName\\\": \\\"finance 1234\\\",\\n\\t\\\"allowViewFinancialInfo\\\": true\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Update User Response: 200 OK\"\n    }\n  ]\n}\n[/block]\n##Example Descriptions\n\nFor details about the above examples, see:\n\n* [Update User](https://developers.bluesnap.com/v8976-Tools/docs/update-user-api#section-update-user)\n* [Update User on behalf of linked BlueSnap account](https://developers.bluesnap.com/v8976-Tools/docs/update-user-api#section-update-user-on-behalf-of-linked-bluesnap-account) \n\n###Update User\nThis example shows an Update User request with the `userId`, `merchantId`, `userfirstName`, `userlastName`, `userEmail`, and `userName` values set. You will want to use these values to update your user's information. This example also has the `allowViewFinancialInfo` permissions value set to \"true.\"\n\n###Update User on behalf of linked BlueSnap account\nThis example shows an Update User request on behalf of a linked BlueSnap account.\n\n###Parameter Reference\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"onbehalfofmid\",\n    \"2-0\": \"lastName\",\n    \"3-0\": \"email\",\n    \"4-0\": \"password\",\n    \"0-1\": \"Creates, updates, retrieves, or deletes users on behalf of a linked BlueSnap account\\n\\n**Note:** This parameter specifies the ID of the BlueSnap account that owns the user, which should be linked to the BlueSnap account executing the call.\",\n    \"2-1\": \"Consists of 2 to 100 characters\\n\\n**Note:** Cannot contain the following symbols: <>!\\n\",\n    \"3-1\": \"Consists of 4 to 100 characters\",\n    \"4-1\": \"Consists of 6 to 20 characters, in any letter or number combination\\n\\n**Note:** The password is only returned in the response, if it was included in the request.\",\n    \"1-0\": \"firstName\",\n    \"1-1\": \"Consists of 2 to 100 characters\\n\\n**Note:** Cannot contain the following symbols: <>!\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"* Username: Unique name; 4 to 20 characters \\n* Password: 6 to 20 characters; allowed characters: a-z A-Z 0-9 _~!@#&$%^*()|'-\\n* Email: 4 to 100 characters\",\n  \"title\": \"Parameter rules\"\n}\n[/block]","excerpt":"","slug":"update-user-api","type":"endpoint","title":"Update User"}

Definition

https://sandbox.bluesnap.com/services/2/cp/user/<userId>?onbehalfofmid=


Documentation

The Update User API enables you to update a user in your BlueSnap account or any of your linked accounts. As part of the update functionality you can add or remove permissions from the user.

Request Content

Send a JSON object, with the following:

      firstName     string    optional

      lastName     string    optional

      email     string    optional

      password     string    optional (if empty, a new password is generated)

Note:

Any of the permissions described in User Permissions can be included with a value of "true."

Response Details

If successful, the response HTTP status code is 200 OK.


Examples

Request Example

Note:

If you need to manage an operation on behalf of a linked BlueSnap account, use the "onbehalfofmid" parameter.

curl -v -X PUT https://sandbox.bluesnap.com/services/2/cp/userId \
-H 'Content-Type: application/json' 
-H 'Accept: application/json' 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
{
	"userfirstName": "New",
	"userlastName": "User",
	"userEmail": "new.email@email.com" ,
	"userName": "finance 1234",  
	"allowViewFinancialInfo": true,
	"allowReports": false
}
curl -v -X PUT https://sandbox.bluesnap.com/services/2/cp/user/23645623?onbehalfofmid=34234
-H 'Content-Type: application/json' 
-H 'Accept: application/json' 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
{
	"userEmail": "new.email@email.com" ,
	"allowViewFinancialInfo": true,
	"allowReports": false
}

Response Example

If successful, the response HTTP status code is 200 OK.

{
	"userId": "1111001",
	"merchantId": "1111111111",
	"userfirstName": "New",
	"userlastName": "User",
	"userEmail": "new.email@email.com",
	"userName": "finance 1234",
	"allowViewFinancialInfo": true
}

Example Descriptions

For details about the above examples, see:

Update User

This example shows an Update User request with the userId, merchantId, userfirstName, userlastName, userEmail, and userName values set. You will want to use these values to update your user's information. This example also has the allowViewFinancialInfo permissions value set to "true."

Update User on behalf of linked BlueSnap account

This example shows an Update User request on behalf of a linked BlueSnap account.

Parameter Reference

Parameter
Description

onbehalfofmid

Creates, updates, retrieves, or deletes users on behalf of a linked BlueSnap account

Note: This parameter specifies the ID of the BlueSnap account that owns the user, which should be linked to the BlueSnap account executing the call.

firstName

Consists of 2 to 100 characters

Note: Cannot contain the following symbols: <>!

lastName

Consists of 2 to 100 characters

Note: Cannot contain the following symbols: <>!

email

Consists of 4 to 100 characters

password

Consists of 6 to 20 characters, in any letter or number combination

Note: The password is only returned in the response, if it was included in the request.

Parameter rules

  • Username: Unique name; 4 to 20 characters
  • Password: 6 to 20 characters; allowed characters: a-z A-Z 0-9 _~!@#&$%^*()|'-
  • Email: 4 to 100 characters