Create account
/accounts
Target audience: Developers
Create account¶
Introduction¶
This endpoint creates a new account. Upon creation, the account will be activated and a confirmation mail will be sent if successful.
By default the account is created as verified. If you want to require the user to verify their email address before the account becomes active, set the require_verification parameter to true. Note that if the organisation has email verification disabled via the rule engine, the account will always be created as verified regardless of this parameter.
URI¶
| Environment | URI |
|---|---|
| Stage | https://payway-api.stage.adeprimo.se/external/api/v2/accounts |
| Production | https://backend.worldoftulo.com/external/api/v2/accounts |
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" |
|
| password | Required | String | The account's password. Size range: 6..1024 |
| first_name | Optional | String | The account's first name. Size range: ..1024 |
| last_name | Optional | String | The account's last name. Size range: ..1024 |
| 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_name | Optional | String | The account's company name Size range: ..1024 |
| company_registration_number | Optional | String | The account's company registration number. Allowed values: "dddddd-dddd" OR "ddddddd-d" |
| 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. More commonly known as Identity Mapping. |
| 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 |
| address | Optional | Object | Address object |
| tags | Optional | Array | Free-text string array containing names of tags that should be applied to the account |
| require_verification | Optional | Boolean | If set to true, the account will be created as unverified and the user must verify their email address before the account becomes active. Default: false |
Curl Example¶
Minimal¶
curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v2/accounts \
--header 'accept: application/json' \
--header 'authorization: Bearer token' \
--header 'content-type: application/json' \
--data '{
"email": "test@example.com",
"password": "Df7Vdd8!!vnM"
}'
Complete¶
curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v2/accounts \
--header 'accept: application/json' \
--header 'authorization: Bearer token' \
--header 'content-type: application/json' \
--data '{
"email": "test@example.com",
"password": "Df7Vdd8!!vnM",
"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"
},
"created_from_source": "My application name",
"address": {
"first_name": "Kalle",
"last_name": "Anka",
"street": "Södra Vollsjövägen",
"zip_code": "27567",
"city": "Vollsjö",
"country_code": "SE"
},
"tags": [ "foo", "bar" ],
"require_verification": true
}'
Response¶
| Field | Description |
|---|---|
| id | The id of the created account. |
Example Response¶
HTTP 201 Created
{
"id": "56e1741a6fc9365306000002"
}
Errors¶
This API uses the common error conventions of the Payway API