> 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 Card

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

Update specific details of a member card, such as expiry date or PIN code. This endpoint allows for modifications to card attributes without needing to replace the entire card.

Reference: https://docs.navipartner.com/apis/api-reference/memberships/service-card/patch-card

## 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)
- `cardId` (UUID, required) — Unique identifier for a card.

### Body (application/json)

This endpoint expects a PatchCardRequest.

- `expiryDate` (date, optional) — The expiry date of the card.
- `pinCode` (string, optional) — The PIN code associated with the card.
- `temporary` (boolean, optional) — Indicates whether the card is temporary.

## Response

### 200

- `card` (MemberCardEntity, required) — The MemberCardEntity describes the attributes of a card linked to a Member. It is used within other composite DTOs to represent the cards associated with a member or membership.

## Types

### MemberCardEntity

The MemberCardEntity describes the attributes of a card linked to a Member. It is used within other composite DTOs to represent the cards associated with a member or membership.

- `cardNumber` (string, required) — Unique identifier for a card.
- `temporary` (boolean, required) — Indicates whether the card is temporary.
- `createdAt` (datetime, required) — Date and time when the entity was created.
- `modifiedAt` (datetime, required) — Date and time when the entity was updated.
- `cardId` (UUID, optional) — Unique identifier for a card.
- `expiryDate` (date, optional) — The expiry date of the card.
- `blocked` (boolean, optional) — Indicates whether the entity is blocked.
- `blockedAt` (datetime, optional) — Date and time when the entity was blocked.
- `pinCode` (string, optional) — The PIN code associated with the card.

## Examples

**Request**

```json
{
  "expiryDate": "2029-09-17",
  "pinCode": "1234",
  "temporary": false
}
```

**Response**

```json
{
  "card": {
    "cardNumber": "MC1234567890",
    "temporary": false,
    "createdAt": "2024-09-17T00:00:00",
    "modifiedAt": "2024-09-18T00:00:00",
    "cardId": "12345678-abcd-1234-5678-1234567890ab",
    "expiryDate": "2029-09-17",
    "blocked": false,
    "pinCode": "1234"
  }
}
```

**SDK Code**

```python Update Card Response
import requests

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

payload = {
    "expiryDate": "2029-09-17",
    "pinCode": "1234",
    "temporary": False
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update Card Response
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/card/12345678-abcd-1234-5678-1234567890ab';
const options = {
  method: 'PATCH',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"expiryDate":"2029-09-17","pinCode":"1234","temporary":false}'
};

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

```go Update Card Response
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/card/12345678-abcd-1234-5678-1234567890ab"

	payload := strings.NewReader("{\n  \"expiryDate\": \"2029-09-17\",\n  \"pinCode\": \"1234\",\n  \"temporary\": false\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 Update Card Response
require 'uri'
require 'net/http'

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

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  \"expiryDate\": \"2029-09-17\",\n  \"pinCode\": \"1234\",\n  \"temporary\": false\n}"

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

```java Update Card Response
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/card/12345678-abcd-1234-5678-1234567890ab")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"expiryDate\": \"2029-09-17\",\n  \"pinCode\": \"1234\",\n  \"temporary\": false\n}")
  .asString();
```

```php Update Card Response
<?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/card/12345678-abcd-1234-5678-1234567890ab', [
  'body' => '{
  "expiryDate": "2029-09-17",
  "pinCode": "1234",
  "temporary": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Update Card Response
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/card/12345678-abcd-1234-5678-1234567890ab");
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  \"expiryDate\": \"2029-09-17\",\n  \"pinCode\": \"1234\",\n  \"temporary\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Card Response
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "expiryDate": "2029-09-17",
  "pinCode": "1234",
  "temporary": false
] 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/card/12345678-abcd-1234-5678-1234567890ab")! 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()
```