Create account without password
/accounts/create_account_without_password
Target audience: Developers
Create account without password¶
Introduction¶
This endpoint creates a new account with a random secure password. Upon creation, the account will be activated and a password reset mail will be sent if successful.
URI¶
Environment | URI |
---|---|
Stage | https://payway-api.stage.adeprimo.se/external/api/v1/accounts/create_account_without_password |
Production | https://backend.worldoftulo.com/external/api/v1/accounts/create_account_without_password |
Requirements¶
Identity | Scope |
---|---|
No | /external/account/w |
Parameters¶
Field | Required | Type | Description |
---|---|---|---|
Required | String | The account's e-mail address. Will be used as username for login purposes. This value must be unique. Size range: ..1024 Allowed values: "/\A[\w+-.]+@[a-z\d-]+(.[a-z]+)*.[a-z]+\z/i" |
|
first_name | Optional | String | The account's first name. Size range: ..1024 |
last_name | Optional | String | The account's last name. Size range: ..1024 |
alias | Optional | String | The account's alias. Size range: ..100 |
mobile_phone_number | Optional | String | The account's mobile phone number. Size range: 10..12 Allowed values: "/^[+,0]?[0-9]{10,12}$/" |
social_security_number | Optional | String | The account's social security number. This value must be unique. Allowed values: "dddddd-dddd" or YYYYYMMDDXXXX |
birth_date | Optional | String | The account's birth date. Size range: 10 Allowed values: "YYYY-MM-DD" |
company_registration_number | Optional | String | The account's company registration number. Allowed values: "dddddd-dddd" |
account_origin | Optional | String | The origin of the account. E.g. the newspaper title. Size range: ..1024 |
external_ids | Optional | Object | A key-value object containing the external ids of the user. |
custom_urls | Optional | Object | Information about custom URL's, ie. where to send the user afterwards |
reset_password_url |
Optional | String | Absolute URI to a page allowing the customer to reset their current password |
return_url |
Optional | String | Absolute URI to where the customer should be redirected after resetting their password via the reset_password_url |
created_from_source | Optional | Object | From where the account was created. Default value set to application name and client id if not provided Size range: 6..1024 |
Curl Example¶
Minimal¶
curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v1/accounts/create_account_without_password \
--header 'accept: application/json' \
--header 'authorization: Bearer token' \
--header 'content-type: application/json' \
--data '{
"email": "test@example.com"
}'
Complete¶
curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v1/accounts/create_account_without_password \
--header 'accept: application/json' \
--header 'authorization: Bearer token' \
--header 'content-type: application/json' \
--data '{
"email": "test@example.com",
"first_name": "Ove",
"last_name": "Ovesson",
"mobile_phone_number": "0701234567",
"social_security_number": "620817-9256",
"birth_date": "1999-05-14",
"company_registration_number": "556468-3984",
"account_origin": "ADEPRIMO",
"external_ids": {
"External key 1": "external value 1",
"External key 2": "external value 2",
"External key 3": "external value 3"
},
"custom_urls": {
"reset_password_url": "https://my-reset-password-url.example.com",
"return_url": "https://my-return-url.example.com"
},
"created_from_source": "My application name"
}'
Response¶
Field | Description |
---|---|
id | The id of the created account. |
Example Response¶
HTTP 201 Created
{
"id": "56e1741a6fc9365306000002"
}
Errors¶
Example error response¶
HTTP 409 Conflict
{
"code": "already_exists",
"field": "email",
"message": "email already exists"
}
HTTP 400 Bad Request¶
Name | Type | Description |
---|---|---|
invalid_parameter | Object | Validation error on any of the fields in the posted json |
json_parser_error | Object | The request body could not be parsed as valid json |
invalid_content_type_error | Object | The requests Content-Type header isn't set to application/json |
unknown_parameter | Object | One or more of the fields in the posted json was not recognized |
HTTP 404 Not Found¶
Name | Type | Description |
---|---|---|
not_found | Object | The package could not be found |
HTTP 409 Conflict¶
Name | Type | Description |
---|---|---|
already_exists | Object | Indicates that a value that must be unique and already exists have been used. IE a duplicate customer_number or social_security_number. |
HTTP 500 Internal Server Error¶
Name | Type | Description |
---|---|---|
internal_server_error | Object | Something unexpected happened server side |