{"_id":"5b27be486814190003f63e1b","project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"5b197473be7bb50003d5dbd6","project":"57336fd5a6a9c40e00e13a0b","__v":2,"forked_from":"5addf90f94fe9d0003cd9d29","createdAt":"2018-04-23T15:17:35.680Z","releaseDate":"2018-04-23T15:17:35.680Z","categories":["5b197473be7bb50003d5db9c","5b197473be7bb50003d5db9d","5b197473be7bb50003d5db9e","5b197473be7bb50003d5db9f","5b197473be7bb50003d5dba0","5b197473be7bb50003d5dba1","5b197473be7bb50003d5dba2","5b197473be7bb50003d5dba3","5b197473be7bb50003d5dba4","5b197473be7bb50003d5dba5","5b197473be7bb50003d5dba6","5b27bded4799c70003f36389","5b34c737e0dca2000311de6a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.26 Release","version_clean":"8976.0.0-Tools","version":"8976-Tools"},"category":{"_id":"5b27bded4799c70003f36389","project":"57336fd5a6a9c40e00e13a0b","version":"5b197473be7bb50003d5dbd6","__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","__v":78,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-06-18T14:14:32.641Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"code":"","language":"text"}]},"settings":"57ee593a21ceb20e0061959e","examples":{"codes":[]},"method":"post","auth":"optional","params":[],"url":""},"isReference":false,"order":2,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/cp/user?onbehalfofmid=</span>\n\n<hr>\n\n##Documentation\n\nThe BlueSnap Create User API is a RESTful web service enabling you to create a user in your BlueSnap account or any of your linked accounts. After creating your user, that user will have access to the BlueSnap Console.\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;<span style=\"color:#F37500\">**required**</span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`lastName` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`email` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`username` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\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  \"title\": \"Note:\",\n  \"body\": \"Any of the permissions described in [User Permissions](doc:user-permissions) can be included with a value of \\\"true.\\\"\"\n}\n[/block]\n<hr>\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response contains the user's attributes, one of which is the ID. \nThe `userId` appears in the response body and the location header.\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 POST https://sandbox.bluesnap.com/services/2/cp/user \\\\\\n-H 'Content-Type: application/json' \\n-H 'Accept: application/json' \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\\n{\\n  \\\"firstName\\\": \\\"New\\\",\\n  \\\"lastName\\\": \\\"User\\\",\\n  \\\"email\\\": \\\"new.user:::at:::email.com\\\",\\n  \\\"username\\\": \\\"finance1234\\\"\\n}\",\n      \"language\": \"curl\",\n      \"name\": \"Create User\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/cp/user \\\\\\n-H 'Content-Type: application/json' \\n-H 'Accept: application/json' \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\\n{\\n  \\\"firstName\\\": \\\"New\\\",\\n  \\\"lastName\\\": \\\"User\\\",\\n  \\\"email\\\": \\\"new.user@email.com\\\",\\n  \\\"username\\\": \\\"finance1234\\\",\\n  \\\"password\\\": \\\"passQ!W@E1\\\",\\n  \\\"admin\\\": \\\"true\\\"\\n}\",\n      \"language\": \"curl\",\n      \"name\": \"Create User with Permission\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/cp/user?onbehalfofmid=12345\\n-H 'Content-Type: application/json' \\n-H 'Accept: application/json' \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\\n{\\n  \\\"firstName\\\": \\\"New\\\",\\n  \\\"lastName\\\": \\\"User\\\",\\n  \\\"email\\\": \\\"new.user@email.com\\\",\\n  \\\"username\\\": \\\"finance1234\\\"\\n}\",\n      \"language\": \"curl\",\n      \"name\": \"Create 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  \\\"userId\\\": \\\"1111001\\\",\\n  \\\"firstName\\\": \\\"New\\\",\\n  \\\"lastName\\\": \\\"User\\\",\\n  \\\"email\\\": \\\"new.user@email.com\\\",\\n  \\\"username\\\": \\\"finance1234\\\",\\n  \\\"admin\\\": \\\"true\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Create User Response: 200 OK\"\n    }\n  ]\n}\n[/block]\n##Example Descriptions\n\nFor details about the above examples, see:\n\n* [Create User](https://developers.bluesnap.com/v8976-Tools/docs/create-user-api#section-create-user)\n* [Create User with permission](https://developers.bluesnap.com/v8976-Tools/docs/create-user-api#section-create-user-with-permission)\n* [Create User on behalf of linked BlueSnap account](https://developers.bluesnap.com/v8976-Tools/docs/create-user-api#section-create-user-on-behalf-of-linked-bluesnap-account)\n\n###Create User\nThis example shows a Create User request with the `firstName`, `lastName`, `email`, and `username` values set. You will want to use these values to define your user's information.\n\n###Create User with permission\nThis example shows a Create User request with the `admin` permissions value set to \"true\".\n\n###Create User on behalf of linked BlueSnap account\nThis example shows a Create 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    \"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    \"3-0\": \"email\",\n    \"3-1\": \"Consists of 4 to 100 characters\",\n    \"6-1\": \"If sent, value should be **true **or **false **(otherwise, WS call fails)\\n\\n**Note:** This is an optional setting. Can be used to include as many permissions as necessary.\",\n    \"6-0\": \"permissions\",\n    \"2-0\": \"lastName\",\n    \"2-1\": \"Consists of 2 to 100 characters\\n\\n**Note:** Cannot contain the following symbols: <>!\",\n    \"4-0\": \"username\",\n    \"4-1\": \"Unique name per BlueSnap account, consisting of 4 to 20 characters \\n\\n**Note:** This name *must *begin with a letter, followed by any letter, number, symbol, or dot combination.\",\n    \"5-0\": \"password\",\n    \"5-1\": \"Consists of 6 to 20 characters, in any letter or number combination; allowed characters: a-z A-Z 0-9 _~!@#&$%^*()|'-\",\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\": 7\n}\n[/block]","excerpt":"","slug":"create-user-api","type":"endpoint","title":"Create User"}

Definition

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


Documentation

The BlueSnap Create User API is a RESTful web service enabling you to create a user in your BlueSnap account or any of your linked accounts. After creating your user, that user will have access to the BlueSnap Console.

Request Content

Send a JSON object, with the following:

      firstName     string    required

      lastName     string    required

      email     string    required

      username     string    required

      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.
The response contains the user's attributes, one of which is the ID.
The userId appears in the response body and the location header.


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 POST https://sandbox.bluesnap.com/services/2/cp/user \
-H 'Content-Type: application/json' 
-H 'Accept: application/json' 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
{
  "firstName": "New",
  "lastName": "User",
  "email": "new.user@email.com",
  "username": "finance1234"
}
curl -v -X POST https://sandbox.bluesnap.com/services/2/cp/user \
-H 'Content-Type: application/json' 
-H 'Accept: application/json' 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
{
  "firstName": "New",
  "lastName": "User",
  "email": "new.user@email.com",
  "username": "finance1234",
  "password": "passQ!W@E1",
  "admin": "true"
}
curl -v -X POST https://sandbox.bluesnap.com/services/2/cp/user?onbehalfofmid=12345
-H 'Content-Type: application/json' 
-H 'Accept: application/json' 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
{
  "firstName": "New",
  "lastName": "User",
  "email": "new.user@email.com",
  "username": "finance1234"
}

Response Example

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

{
  "userId": "1111001",
  "firstName": "New",
  "lastName": "User",
  "email": "new.user@email.com",
  "username": "finance1234",
  "admin": "true"
}

Example Descriptions

For details about the above examples, see:

Create User

This example shows a Create User request with the firstName, lastName, email, and username values set. You will want to use these values to define your user's information.

Create User with permission

This example shows a Create User request with the admin permissions value set to "true".

Create User on behalf of linked BlueSnap account

This example shows a Create 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

username

Unique name per BlueSnap account, consisting of 4 to 20 characters

Note: This name must begin with a letter, followed by any letter, number, symbol, or dot combination.

password

Consists of 6 to 20 characters, in any letter or number combination; allowed characters: a-z A-Z 0-9 _~!@#&$%^*()|'-

permissions

If sent, value should be true or false (otherwise, WS call fails)

Note: This is an optional setting. Can be used to include as many permissions as necessary.