Skip to content

Update

/accounts

Target audience: Developers

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/v1/accounts
Production https://backend.worldoftulo.com/external/api/v1/accounts

Required scope

1
/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
mobile_phone_number Optional String The account's mobile phone number.
Allowed values: "^[0-9]{10,11}$"
social_security_number Optional String The account's social security number. This value must be unique.
Allowed values: "dddddd-dddd"
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
address Optional Object Address object, this is used as a default address when purchasing new packages. Individual parts of the address can be updated.
street Optional String Streetname
street_number Optional String The street number, some subscription-systems only allow numerical values
zip_code Optional String The zipcode
floor Optional String The floor
apartment_number Optional String The apartment number
entrance Optional String The entrance
city Optional String The city
dropbox Optional String Dropbox

Curl Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
curl --request PUT \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/accounts \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
            "id": "50f3ac249f6aef294d000007",
            "mobile_phone_number": "0734567890",
            "address": {
              "zip_code": "83145"
            }
          }'

Response

Field Description
id id of the updated account

Example Response

1
2
3
4
HTTP 200 Updated
{
    "id": "50f3ac249f6aef294d000007"
}

Errors

Example error response

1
2
3
4
5
6
HTTP 400 Bad Request
{
  "code": "invalid_parameter",
  "field": "email",
  "message": "Parameter must match format (?i-mx:\\\\A[\\\\w+\\\\-.]+@[a-z\\\\d\\\\-]+(\\\\.[a-z]+)*\\\\.[a-z]+\\\\z)"
}

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 403 Forbidden

Name Type Description
email Object Not allowed to update email for an administrator.

HTTP 404 Not Found

Name Type Description
not_found Object The package could not be found

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side