Skip to main content

Create New User

This API enables your application to Create new Business Admin or Business user under current user's organization.

Endpoint

GET https://demo-api.frontpayment.no/api/v1/connect/users/create/{{userRoleSlug}}

userRoleSlug can be either user or business-admin

Authorization

Include a Bearer Token in the Authorization header. You can obtain this token from Front Payment.

Example:

Authorization: Bearer YOUR_FRONTPAYMENT_BEARER_TOKEN

Request Payload

Send the following parameters as a JSON object in the request body:

{
    "name": "Swedish BE User",
    "email": "[email protected]",
    "countryCode": "+47",
    "msisdn": "46567468",
    "designation": null,
    "password": "qwerty12",
    "preferredLanguage": "en"
}

Validation Rules

Make sure your request meets the following requirements:

FieldTypeDescription
namestringRequired Name of the user
emailstring, emailRequired Email of the user.
countryCodestringRequired Country code of the user.
msisdnnumericRequired msisdn of the user
designationstringOptional Designation of the user.
passwordstringRequired Password for user login
preferredLanguagestringRequired Code of user's preferred language and one of 'en', 'no', 'de', 'da', 'sv'.

Response

A successful request will return a 200 OK status with the following JSON payload:

{
    "status_code": 201,
    "status_message": "OK",
    "message": "userCreatedSuccessfully",
    "is_data": false,
    "data": null
}

API returns a 400 error, it means user already exists with given email.

{
    "status_code": 400,
    "status_message": "Conflict of Business Logic ",
    "message": "userAlreadyExistsWithSameEmail",
    "is_data": false,
    "data": null
}

API returns a 510 error, it means something failed on the server side

{
    "status_code": 510,
    "status_message": "Execution Exception Occurred",
    "message": "Something Went Wrong",
    "is_error": true,
    "errors": "Array"
}