Update account
/me
Target audience: Developers
Release version: 4.1.4.x
Update account¶
Introduction¶
This endpoint updates an account.
URI¶
Environment | URI |
---|---|
Stage | https://payway-api.stage.adeprimo.se/external/api/v1/me |
Production | https://backend.worldoftulo.com/external/api/v1/me |
Requirements¶
Identity | Scope |
---|---|
Yes | /external/me/w |
Parameters¶
Field | Required | Type | Description |
---|---|---|---|
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 |
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" |
account_origin | Optional | String | The origin of the account. E.g. the newspaper title. Size range: ..1024 |
address | Optional | Object | Address object. Fields marked as required is always required in order to update any field of the address. |
first_name |
Required | String | First name |
last_name |
Required | String | Last name |
street |
Required | String | Streetname |
building |
Required | String | The building |
country_code |
Required | String | SE, FI or AX |
zip_code |
Required | String | The zipcode |
city |
Required | String | The city |
street_number |
Optional | String | The street number, some subscription-systems only allow numerical values |
staircase |
Optional | String | The staircase/entrance |
floor |
Optional | String | The floor |
apartment_number |
Optional | String | The apartment number |
mobile_number |
Optional | String | The mobile number of the customer |
phone_number |
Optional | String | The phone number of the customer |
citizenship_country_code |
Optional | String | The citizenship country code of the customer |
dropbox |
Optional | String | Dropbox |
company_name |
Optional | String | The name of the company |
company_reference |
Optional | String | The reference of the company |
company_department |
Optional | String | The department of the company |
company_crn |
Optional | String | The CRN of the company |
company_vat_number |
Optional | String | The VAT number of the company |
care_of |
Optional | String | The C/O address, if applicable |
Curl Example¶
curl --request PUT \
--url https://payway-api.stage.adeprimo.se/external/api/v1/me \
--header 'accept: application/json' \
--header 'authorization: Bearer <access_token_with_identity>' \
--header 'content-type: application/json' \
--data '{
"mobile_phone_number": "0734567890",
"address": {
"first_name": "Anders",
"last_name": "Andersson",
"street": "Anders Gata 123",
"zip_code": "83145",
"city": "Anderstorp",
"country_code": "SE"
}
}'
Response¶
Field | Description |
---|---|
id | id of the updated account |
ok | Array of strings of the updated fields |
errors | Array of error objects containing the fields that failed to update |
Example Response¶
HTTP 207 Multi-Status
{
"id": "50f3ac249f6aef294d000007",
"ok": ["name","mobile_phone_number"],
"errors": [
{
"field": "social_security_number",
"code": "invalid_parameter",
"message": "Parameter must match format (?-mix:^[0-9]{6}-[0-9]{4}$)"
},
{
"field": "address",
"code": "last_name",
"message": "last_name must_be_set"
}
]
}
This means we update that what we can and inform you of what fields could not be updated.
Errors¶
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 account could not be found |
HTTP 500 Internal Server Error¶
Name | Type | Description |
---|---|---|
internal_server_error | Object | Something unexpected happened server side |