> This page is for API Reference.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.navipartner.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.navipartner.com/_mcp/server.

# Update Member

PATCH https://api.npretail.app/{tenant}/{environment}/{company}/membership/member/{memberId}
Content-Type: application/json

Update the details of an existing member. This endpoint is used when a member's information needs to be changed, such as updating their contact details, name, or personal information.

Reference: https://docs.navipartner.com/apis/api-reference/memberships/service-member/update-member

## Authentication

- `x-np-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `tenant` (string, required) — Your Entra Tenant ID. [More details.](/paths#1-tenant)
- `environment` (string, required) — Your Business Central Environment. [More details.](/paths#2-environment)
- `company` (string, required) — Your Business Central Company. [More details.](/paths#3-company)
- `memberId` (UUID, required) — Unique identifier for a member.

### Query parameters

- `allowMergeOnConflict` (integer, optional) — Determines how the system should handle member uniqueness conflicts when adding or updating a member. This setting enforces community rules regarding member duplication and allows for automated resolution through member merging. **Options:** - **`0` (default)**: Do not merge. - If a member conflict is detected (i.e., another member exists that violates uniqueness rules), the request will be rejected with an error indicating a member conflict. - This ensures no changes are made to existing members and prevents unintended merges. - **`1` (allow merge)**: Merge members according to the community’s uniqueness configuration. - The member specified in the request (being added or updated) will take precedence. - All other conflicting members will be **deleted** and their associations (e.g., memberships, cards) will be **transferred** to the surviving member. - Merging occurs only if the community setup explicitly permits member merging for the detected conflict scenario. - No merge will occur if the community configuration disallows merging, even if this parameter is set to `1`. **Important Notes:** - Member merges are irreversible. Deleted members cannot be recovered after a successful merge. - Transferred associations include memberships, cards and other data linked to the conflicting members. - If no conflicts are found, setting this parameter has no effect.

### Body (application/json)

This endpoint expects an UpdateMemberRequest.

- `member` (MemberEntityRequest, required) — The MemberEntityRequest defines the basic properties required to create or update a Member.

## Response

### 200

- `member` (MemberEntityResponse, required) — The MemberEntityResponse extends the MemberEntityRequest and includes additional properties such as the member's ID, membership number, and blocked status. This DTO is used when returning a member's details.

## Types

### MemberEntityRequest

The MemberEntityRequest defines the basic properties required to create or update a Member.

- `address` (string, optional) — The address of the member.
- `attributes` (list of SetAttributeValue, optional)
- `birthday` (date, optional) — The birth date of the member.
- `city` (string, optional) — The city where the member resides.
- `country` (string, optional) — The country where the member resides.
- `email` (string, optional) — The email address of the member.
- `firstName` (string, optional) — The first name of the member.
- `gdprConsent` (enum, optional) — Indicates if the member has given GDPR approval.
  - Allowed values: `pending`, `accepted`, `rejected`, `delegated`, `notApplicable`
- `gender` (enum, optional) — The gender of the member.
  - Allowed values: `notSpecified`, `female`, `male`, `other`
- `lastName` (string, optional) — The last name of the member.
- `middleName` (string, optional) — The middle name of the member.
- `nationalIdentifier` (NationalIdentifierRequest, optional) — A NationalIdentifier is used to represent a person's national identification number in a structured way. It includes the type of identifier and its value.
- `newsletter` (enum, optional) — Indicates whether the member is subscribed to the newsletter.
  - Allowed values: `unknown`, `yes`, `no`
- `phoneNo` (string, optional) — The phone number of the member.
- `postCode` (string, optional) — The postal code of the member's address.
- `preassignedContactNumber` (string, optional) — A preassigned contact number for the member. When there is no contact number, the system will generate one.
- `preferredLanguage` (string, optional) — The preferred language of the member.
- `storeCode` (string, optional) — A unique identifier for a store - a logical grouping defining a subset of membership items. This is used to filter the list of membership related items returned by the API.

### MemberEntityResponse

The MemberEntityResponse extends the MemberEntityRequest and includes additional properties such as the member's ID, membership number, and blocked status. This DTO is used when returning a member's details.

- `blocked` (boolean, required) — Indicates whether the entity is blocked.
- `memberId` (UUID, required) — Unique identifier for a member.
- `memberNumber` (string, required) — Unique number identifying the member.
- `address` (string, optional) — The address of the member.
- `attributes` (list of AttributeValueListResponse, optional)
- `birthday` (date, optional) — The birth date of the member.
- `blockedAt` (datetime, optional) — Date and time when the entity was blocked.
- `city` (string, optional) — The city where the member resides.
- `country` (string, optional) — The country where the member resides.
- `email` (string, optional) — The email address of the member.
- `firstName` (string, optional) — The first name of the member.
- `gender` (enum, optional) — The gender of the member.
  - Allowed values: `notSpecified`, `female`, `male`, `other`
- `hasNotes` (boolean, optional) — Indicates if the member has extra information such as notes attached.
- `hasPicture` (boolean, optional) — Indicates if the member has a picture.
- `lastName` (string, optional) — The last name of the member.
- `middleName` (string, optional) — The middle name of the member.
- `nationalIdentifier` (NationalIdentifierResponse, optional) — A NationalIdentifier is used to represent a person's national identification number in a structured way. It includes the type of identifier and its value.
- `newsletter` (enum, optional) — Indicates whether the member is subscribed to the newsletter.
  - Allowed values: `unknown`, `yes`, `no`
- `phoneNo` (string, optional) — The phone number of the member.
- `postCode` (string, optional) — The postal code of the member's address.
- `preferredLanguage` (string, optional) — The preferred language of the member.
- `storeCode` (string, optional) — A unique identifier for a store - a logical grouping defining a subset of membership items. This is used to filter the list of membership related items returned by the API.

### SetAttributeValue

This request is used to set the value of an attribute for a specific membership entity.

- `code` (string, required) — The key code for the attribute. This is a unique identifier for the attribute.
- `value` (string, required) — The value of the attribute. This is the actual data associated with the attribute.

### NationalIdentifierRequest

A NationalIdentifier is used to represent a person's national identification number in a structured way. It includes the type of identifier and its value.

- `type` (string, required) — Type of national ID. Available values are implementation dependent. Common values are - *none* : No national ID provided / free text, without validation is always allowed - *dk_cpr* : (example) Danish CPR number [dk_cpr, dk_cvr, dk_vat] requires customization. - *se_pnr* : (example) Swedish PNR number [se_pnr, se_cnr, se_onr, se_vat] requires customization.
- `value` (string, required) — User provided form of the national ID, it will be validated according to the type

### AttributeValueListResponse

This response contains a list of attribute values associated with a specific membership entity.

- `id` (UUID, required)
- `code` (string, required) — The key code for the attribute. This is a unique identifier for the attribute.
- `type` (enum, required) — The datatype of the attribute.
  - Allowed values: `text`, `code`, `date`, `datetime`, `decimal`, `integer`, `boolean`, `unknown`
- `caption` (string, required) — The caption of the attribute.
- `value` (string, required) — The value of the attribute. This is the actual data associated with the attribute.

### NationalIdentifierResponse

A NationalIdentifier is used to represent a person's national identification number in a structured way. It includes the type of identifier and its value.

- `type` (string, required) — Type of national ID. Available values are implementation dependent. Common values are - *none* : No national ID provided / free text, without validation is always allowed - *dk_cpr* : (example) Danish CPR number [dk_cpr, dk_cvr, dk_vat] requires customization. - *se_pnr* : (example) Swedish PNR number [se_pnr, se_cnr, se_onr, se_vat] requires customization.
- `description` (string, required) — Description of the national ID
- `canonical` (string, required) — Canonical form of the national ID
- `unmasked` (string, required) — Unmasked form of the national ID
- `masked` (string, required) — Masked form of the national ID

## Examples

**Request**

```json
{
  "member": {
    "address": "123 Main Street",
    "attributes": [],
    "birthday": "1980-01-01",
    "city": "New York",
    "country": "USA",
    "email": "john.doe@acme.com",
    "firstName": "John",
    "gender": "male",
    "lastName": "Doe",
    "middleName": "A.",
    "nationalIdentifier": {
      "type": "dk_cpr",
      "value": "111111-1118"
    },
    "newsletter": "yes",
    "phoneNo": "+1234567890",
    "postCode": "12345"
  }
}
```

**Response**

```json
{
  "member": {
    "blocked": false,
    "memberId": "12345678-abcd-1234-5678-1234567890ab",
    "memberNumber": "M123456789",
    "address": "123 Main Street",
    "birthday": "1980-01-01",
    "city": "New York",
    "country": "USA",
    "email": "john.doe@acme.com",
    "firstName": "John",
    "gender": "male",
    "hasNotes": true,
    "hasPicture": true,
    "lastName": "Doe",
    "middleName": "A.",
    "nationalIdentifier": {
      "type": "dk_cpr",
      "description": "DK CPR number",
      "canonical": "1111111118",
      "unmasked": "111111-1118",
      "masked": "111111-****"
    },
    "newsletter": "yes",
    "phoneNo": "+1234567890",
    "postCode": "12345",
    "preferredLanguage": "EN",
    "storeCode": "EN"
  }
}
```

**SDK Code**

```python Example Update Member
import requests

url = "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/member/12345678-abcd-1234-5678-1234567890ab"

querystring = {"allowMergeOnConflict":"1"}

payload = { "member": {
        "address": "123 Main Street",
        "attributes": [],
        "birthday": "1980-01-01",
        "city": "New York",
        "country": "USA",
        "email": "john.doe@acme.com",
        "firstName": "John",
        "gender": "male",
        "lastName": "Doe",
        "middleName": "A.",
        "nationalIdentifier": {
            "type": "dk_cpr",
            "value": "111111-1118"
        },
        "newsletter": "yes",
        "phoneNo": "+1234567890",
        "postCode": "12345"
    } }
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript Example Update Member
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/member/12345678-abcd-1234-5678-1234567890ab?allowMergeOnConflict=1';
const options = {
  method: 'PATCH',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"member":{"address":"123 Main Street","attributes":[],"birthday":"1980-01-01","city":"New York","country":"USA","email":"john.doe@acme.com","firstName":"John","gender":"male","lastName":"Doe","middleName":"A.","nationalIdentifier":{"type":"dk_cpr","value":"111111-1118"},"newsletter":"yes","phoneNo":"+1234567890","postCode":"12345"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example Update Member
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/member/12345678-abcd-1234-5678-1234567890ab?allowMergeOnConflict=1"

	payload := strings.NewReader("{\n  \"member\": {\n    \"address\": \"123 Main Street\",\n    \"attributes\": [],\n    \"birthday\": \"1980-01-01\",\n    \"city\": \"New York\",\n    \"country\": \"USA\",\n    \"email\": \"john.doe@acme.com\",\n    \"firstName\": \"John\",\n    \"gender\": \"male\",\n    \"lastName\": \"Doe\",\n    \"middleName\": \"A.\",\n    \"nationalIdentifier\": {\n      \"type\": \"dk_cpr\",\n      \"value\": \"111111-1118\"\n    },\n    \"newsletter\": \"yes\",\n    \"phoneNo\": \"+1234567890\",\n    \"postCode\": \"12345\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example Update Member
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/member/12345678-abcd-1234-5678-1234567890ab?allowMergeOnConflict=1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["x-np-api-key"] = '<NaviPartner API Key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"member\": {\n    \"address\": \"123 Main Street\",\n    \"attributes\": [],\n    \"birthday\": \"1980-01-01\",\n    \"city\": \"New York\",\n    \"country\": \"USA\",\n    \"email\": \"john.doe@acme.com\",\n    \"firstName\": \"John\",\n    \"gender\": \"male\",\n    \"lastName\": \"Doe\",\n    \"middleName\": \"A.\",\n    \"nationalIdentifier\": {\n      \"type\": \"dk_cpr\",\n      \"value\": \"111111-1118\"\n    },\n    \"newsletter\": \"yes\",\n    \"phoneNo\": \"+1234567890\",\n    \"postCode\": \"12345\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Example Update Member
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/member/12345678-abcd-1234-5678-1234567890ab?allowMergeOnConflict=1")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"member\": {\n    \"address\": \"123 Main Street\",\n    \"attributes\": [],\n    \"birthday\": \"1980-01-01\",\n    \"city\": \"New York\",\n    \"country\": \"USA\",\n    \"email\": \"john.doe@acme.com\",\n    \"firstName\": \"John\",\n    \"gender\": \"male\",\n    \"lastName\": \"Doe\",\n    \"middleName\": \"A.\",\n    \"nationalIdentifier\": {\n      \"type\": \"dk_cpr\",\n      \"value\": \"111111-1118\"\n    },\n    \"newsletter\": \"yes\",\n    \"phoneNo\": \"+1234567890\",\n    \"postCode\": \"12345\"\n  }\n}")
  .asString();
```

```php Example Update Member
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/member/12345678-abcd-1234-5678-1234567890ab?allowMergeOnConflict=1', [
  'body' => '{
  "member": {
    "address": "123 Main Street",
    "attributes": [],
    "birthday": "1980-01-01",
    "city": "New York",
    "country": "USA",
    "email": "john.doe@acme.com",
    "firstName": "John",
    "gender": "male",
    "lastName": "Doe",
    "middleName": "A.",
    "nationalIdentifier": {
      "type": "dk_cpr",
      "value": "111111-1118"
    },
    "newsletter": "yes",
    "phoneNo": "+1234567890",
    "postCode": "12345"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

echo $response->getBody();
```

```csharp Example Update Member
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/member/12345678-abcd-1234-5678-1234567890ab?allowMergeOnConflict=1");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"member\": {\n    \"address\": \"123 Main Street\",\n    \"attributes\": [],\n    \"birthday\": \"1980-01-01\",\n    \"city\": \"New York\",\n    \"country\": \"USA\",\n    \"email\": \"john.doe@acme.com\",\n    \"firstName\": \"John\",\n    \"gender\": \"male\",\n    \"lastName\": \"Doe\",\n    \"middleName\": \"A.\",\n    \"nationalIdentifier\": {\n      \"type\": \"dk_cpr\",\n      \"value\": \"111111-1118\"\n    },\n    \"newsletter\": \"yes\",\n    \"phoneNo\": \"+1234567890\",\n    \"postCode\": \"12345\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example Update Member
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = ["member": [
    "address": "123 Main Street",
    "attributes": [],
    "birthday": "1980-01-01",
    "city": "New York",
    "country": "USA",
    "email": "john.doe@acme.com",
    "firstName": "John",
    "gender": "male",
    "lastName": "Doe",
    "middleName": "A.",
    "nationalIdentifier": [
      "type": "dk_cpr",
      "value": "111111-1118"
    ],
    "newsletter": "yes",
    "phoneNo": "+1234567890",
    "postCode": "12345"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/member/12345678-abcd-1234-5678-1234567890ab?allowMergeOnConflict=1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```