# Update Member

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v3/{loyalty_club_slug}/members/me:
    put:
      summary: Update Member
      deprecated: false
      description: >-
        Update member's properties, consents and other with given ones.


        It is intended for partial updates:

        * not given properties are neither deleted nor overwritten,

        * not given attributes (like consents) won't be changed in any way.


        When validating partially properties can not be deleted use [Remove
        Member Properties](api-4045391)  endpoint instead


        This endpoint may return validation errors (`422`) even for current
        member properties.

        That's because loyalty club schema may get changed over time which
        results in invalidating existing users.


        To bypass such validation errors, you may provide `validate_partially:
        true` param which will validate and update only

        attributes that were provided in payload.


        ## URL Parameters


        Parameter | Description | Type

        -----------|-------------|---------

        id        | Member's ID | integer


        ## Body Parameters


        Parameter          |
        Description                                                                          
        | Type        | Default

        --------------------|---------------------------------------------------------------------------------------|-------------|----------------

        properties         | JSON with properties for
        member                                                       | JSON
        Object | null

        consents           | Member's consents (similar to [Member's consents
        JSON model](doc-342131#members-consents-json-model)) | JSON Object |
        null

        password           | Member's
        password                                                                    
        | string      | null

        sms_enabled        | Should SMS channel be enabled for
        member?                                             | Boolean     | null

        email_enabled      | Should email channel be enabled for
        member?                                           | Boolean     | null

        push_enabled       | Should push channel will be enabled for
        member?                                       | Boolean     | null

        validate_partially | Should only provided data be
        validated?                                               | Boolean     |
        false

        event_occurred_at  | See: [`event_occurred_at`
        param](api-3510820#event_occurred_at-param)                      |
        Date        | (current time)

        favorite_stores    | IDs of member favorite stores. See
        [Stores](doc-341692)                       | integer[]        | []


        ### `event_occurred_at` param


        When actual member data change occurred at the time different than
        request's time, you can utilize the `event_occurred_at' param to pass

        the actual update time.


        This may be relevant when you want this to be reflected in the member's
        changes history.


        ## Response Body


        Member properties after update - see: [Member model](doc-342131#member)


        ## Error Responses


        Status | Description

        --------|---------------------------------------------------------- 
         `404`  | Member could not be found                                
         `422`  | [validation errors](doc-342131#validation-on-members) JSON object.

        ## Example


        ```shell


        curl -X PUT \
          https://api.mpc.placewise.com/v3/infinity-mall/members/me \
          -H 'content-type: application/json' \
          -H 'x-client-authorization: B7t9U9tsoWsGhrv2ouUoSqpM' \
          -H 'x-product-name: default' \
          -H 'x-user-agent: CURL manual test' \
          -H 'authorization: Bearer 8433d608645345a45ce5a0f5ba1225e57546e86ac49e5fec842159dc82218522' \
          -d \
          '{
            "properties": {
              "last_name": "Doge"
            },
            "password": "new_password"
          }'
        ```


        When successful, returns JSON structured like this:


        ```json

        {
          "id": 42,
          "properties": {
            "first_name": "Ola",
            "last_name": "Nordmann",
            "birthday": "1990-10-23",
            "interests": [
              "bikes_and_cars",
              "sportwear"
            ],
            "child_birth_years": [
              2010,
              2011,
              2011
            ],
            "language": "no"
          },
          "consents": {
            "consent1": { "status": true, "updated_at": "2018-12-14T21:57:20.063Z" },
            "consent2": { "status": false, "updated_at": "2018-10-25T21:57:43.738Z" }
          },
          "sms_status": "enabled",
          "email_status": "hard_bounced",
          "push_status": "disabled",
          "optin_channel": "webforms",
          "optin_subchannel": "campaign-10-2017",
          "created_at": "2017-01-19T10:07:08.336+01:00",
          "updated_at": "2017-04-03T09:35:19.313+02:00",
          "banned_until": "2137-04-03T09:35:19.313+02:00",
          "person_id": 99,
          "has_password": false,
          "subunit_ids": [1, 2],
          "has_push_token": false,
          "social_logins": [],
          "favorite_stores": [],
          "registration_medium": "other"
        }

        ```


        When payload is invalid, validation errors like this are returned:


        ```json

        {
            "email": [
                {

                    "property": "email",
                    "error": "duplicated_email_in_community"
                }
            ]
        }

        ```
      tags:
        - API Reference/Public API/Member/Profile
      parameters:
        - name: loyalty_club_slug
          in: path
          description: ''
          required: true
          example: infinity-mall
          schema:
            type: string
        - name: Content-Type
          in: header
          description: '[Details](doc-341635)'
          required: true
          example: application/json
          schema:
            type: string
            default: application/json
            const: application/json
        - name: X-User-Agent
          in: header
          description: Arbitrary identifier of your client. [Details](doc-341635)
          required: true
          example: '{{X_USER_AGENT}}'
          schema:
            type: string
            default: '{{X_USER_AGENT}}'
        - name: X-Product-Name
          in: header
          description: API Product for API context. [Details](doc-341635)
          required: true
          example: '{{PRODUCT_NAME}}'
          schema:
            type: string
            default: '{{PRODUCT_NAME}}'
        - name: X-Loyalty-Club-Slug
          in: header
          description: LoyaltyClub for API context. [Details](doc-342138)
          required: false
          example: '{{LOYALTY_CLUB_SLUG}}'
          schema:
            type: string
            default: '{{LOYALTY_CLUB_SLUG}}'
        - name: X-Customer
          in: header
          description: Customer for API context.  [Details](doc-342139)
          required: false
          example: '{{CUSTOMER_ID}}'
          schema:
            type: string
            default: '{{CUSTOMER_ID}}'
        - name: Authorization
          in: header
          description: '[Member](doc-342129) or [User](doc-342130) Authorization.'
          required: false
          example: Bearer {{_OAUTH_TOKEN}}
          schema:
            type: string
            default: Bearer {{_OAUTH_TOKEN}}
        - name: X-Client-Authorization
          in: header
          description: '[Token](doc-342128) Authorization.'
          example: '{{API_TOKEN}}'
          schema:
            type: string
            default: '{{API_TOKEN}}'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: API Reference/Public API/Member/Profile
      x-apidog-status: pending
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-3510820-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```