Set the information about the authenticated user

PATCH /user

Request

Authentication

This endpoint requires authentication.

Header Value
Authorization Set the value to Bearer + + access_token

Body

Pass the following properties via application/json or form encoding in the body of the request.

Information about a user

Field Type Description
firstname String A String value
lastname String A String value
email Email Email address
telephone Phone International phone number
notifications UserNotifications Information about the notifications a user want to receive

Example request 1 Set the user firstname

PATCH /user HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer ae73dc7c6a6ca63df2f95858d83439cfc1bcf810c75ecbf20bc2dd6963e3bf815b829ec65d8b65d5ee65ac44c342ff67b1eb831cdef3ac9e2441ef2e0ba54b88d39427b9ff14779e31cd845071f279735777cc0a51f850f10db695e8161799315c71b17f
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 27
{
    "firstname": "Carl"
}

Example request 2 Set the user notification settings

PATCH /user HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer ae73dc7c6a6ca63df2f95858d83439cfc1bcf810c75ecbf20bc2dd6963e3bf815b829ec65d8b65d5ee65ac44c342ff67b1eb831cdef3ac9e2441ef2e0ba54b88d39427b9ff14779e31cd845071f279735777cc0a51f850f10db695e8161799315c71b17f
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 112
{
    "notifications": {
        "email_when_comment": false,
        "email_when_order_confirmed": true
    }
}

Example request 3 Change the email

PATCH /user HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer ae73dc7c6a6ca63df2f95858d83439cfc1bcf810c75ecbf20bc2dd6963e3bf815b829ec65d8b65d5ee65ac44c342ff67b1eb831cdef3ac9e2441ef2e0ba54b88d39427b9ff14779e31cd845071f279735777cc0a51f850f10db695e8161799315c71b17f
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 72
{
    "email": "other-email-settings.529400574-1618995670@example.com"
}

Example request 4 Change the email and notifications at once

PATCH /user HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer ae73dc7c6a6ca63df2f95858d83439cfc1bcf810c75ecbf20bc2dd6963e3bf815b829ec65d8b65d5ee65ac44c342ff67b1eb831cdef3ac9e2441ef2e0ba54b88d39427b9ff14779e31cd845071f279735777cc0a51f850f10db695e8161799315c71b17f
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 184
{
    "email": "2.other-email-settings.529400574-1618995670@example.com",
    "notifications": {
        "email_when_comment": true,
        "email_when_order_confirmed": false
    }
}

Example request 5 Can't set the user's bank account

PATCH /user HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer ae73dc7c6a6ca63df2f95858d83439cfc1bcf810c75ecbf20bc2dd6963e3bf815b829ec65d8b65d5ee65ac44c342ff67b1eb831cdef3ac9e2441ef2e0ba54b88d39427b9ff14779e31cd845071f279735777cc0a51f850f10db695e8161799315c71b17f
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 47
{
    "bank_account_number": "BE123123123123"
}

Example request 6 Update to an email address that already exists

PATCH /user HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer ae73dc7c6a6ca63df2f95858d83439cfc1bcf810c75ecbf20bc2dd6963e3bf815b829ec65d8b65d5ee65ac44c342ff67b1eb831cdef3ac9e2441ef2e0ba54b88d39427b9ff14779e31cd845071f279735777cc0a51f850f10db695e8161799315c71b17f
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
Content-Length: 65
{
    "email": "existing-mail-630872394-1618995670@example.com"
}

Response

Information about a user

Field Type Description
firstname String A String value
lastname String A String value
email Email Email address
telephone Phone International phone number
notifications UserNotifications Information about the notifications a user want to receive
id Int An integer value
delivery_address Address.simple? Nullable. An address
company Checkout.Company? Nullable.
bank_account_number String? Nullable. A String value

Example response 1 Set the user firstname

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 449

{
    "firstname": "Carl",
    "lastname": "Claes",
    "email": "femke808990705@example.org",
    "telephone": "+32479567345",
    "notifications": {
        "email_when_order": true,
        "email_when_comment": true,
        "email_when_order_confirmed": true,
        "email_when_order_cancel": true,
        "email_when_newsletter": true
    },
    "id": 2946,
    "delivery_address": null,
    "company": null,
    "bank_account_number": ""
}

Example response 2 Set the user notification settings

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 450

{
    "firstname": "Carl",
    "lastname": "Claes",
    "email": "femke808990705@example.org",
    "telephone": "+32479567345",
    "notifications": {
        "email_when_order": true,
        "email_when_comment": false,
        "email_when_order_confirmed": true,
        "email_when_order_cancel": true,
        "email_when_newsletter": true
    },
    "id": 2946,
    "delivery_address": null,
    "company": null,
    "bank_account_number": ""
}

Example response 3 Change the email

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 477

{
    "firstname": "Carl",
    "lastname": "Claes",
    "email": "other-email-settings.529400574-1618995670@example.com",
    "telephone": "+32479567345",
    "notifications": {
        "email_when_order": true,
        "email_when_comment": false,
        "email_when_order_confirmed": true,
        "email_when_order_cancel": true,
        "email_when_newsletter": true
    },
    "id": 2946,
    "delivery_address": null,
    "company": null,
    "bank_account_number": ""
}

Example response 4 Change the email and notifications at once

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 479

{
    "firstname": "Carl",
    "lastname": "Claes",
    "email": "2.other-email-settings.529400574-1618995670@example.com",
    "telephone": "+32479567345",
    "notifications": {
        "email_when_order": true,
        "email_when_comment": true,
        "email_when_order_confirmed": false,
        "email_when_order_cancel": true,
        "email_when_newsletter": true
    },
    "id": 2946,
    "delivery_address": null,
    "company": null,
    "bank_account_number": ""
}

Example response 5 Can't set the user's bank account

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 136

[
    {
        "code": "unknown_field",
        "message": "Field bank_account_number is not expected",
        "field": "data"
    }
]

Example response 6 Update to an email address that already exists

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 76

{
    "code": "invalid_field",
    "message": "3350",
    "field": "email"
}
Version update available Please adjust your integration to the latest stable version (1.5.2)
1.5.0 stable