Skip to content

Update account

/v2/accounts

Target audience: Developers

Update account

Introduction

This endpoint is used for updating an account. If email is changed, this will be reflected in events to 3:rd party systems, the user will however not be notified.

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
id Required String id of the account to update.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"
email Optional 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 alias.
Size range: ..1024
Supports: __UNSET__
mobile_phone_number Optional String The account's mobile phone number.
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"
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"
company_name Optional String The account's company name.
Size range: ..1024
account_origin Optional String The origin of the account. E.g. the newspaper title.
Size range: ..1024
address Optional Object Address object
atomic Optional Boolean If true, all or nothing. If false, we save what we can and the errors are accumulated into a Multi-Status response.
Default: true

Curl Example

curl --request PUT \
  --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 '{
            "id": "50f3ac249f6aef294d000007",
            "email": "adeprimo.servicedesk@no-reply.com",
            "first_name": "Adeprimo",
            "last_name": "Servicedesk"
          }'

Response

Field Description
id id of the updated account
updated_fields Name of the successfully updated fields
not_updated_fields Name of the unsuccessfully updated fields

Example Response

HTTP 200 Updated
{
    "id": "50f3ac249f6aef294d000007",
    "updated_fields": "social_security_number",
    "not_updated_fields": "address last_name: must_be_set"
}

Errors

This API uses the common error conventions of the Payway API

See common error responses