# 4. Update Card

## Update Saved Card

<mark style="color:orange;">`PUT`</mark> `{{Base Adres}}/paywall/card/insurance`

It will be sufficient to send the request to the address provided above. You can use the 'Base Address' as desired for both the test environment and the production environment.

{% hint style="info" %}
Important: Card transactions are high-security operations. Therefore, you must send the '**apikeyprivate**' and '**apiclientprivate**' parameters in the 'Header' section.

\
[<mark style="color:green;">**CardWallAPI Address**</mark>](https://developer.paywall.one/payment-orchestration-integration-document/environment)
{% endhint %}

**The parameters to be sent to the service (HEADERS) are as follows:**

<table><thead><tr><th width="162">Parameter</th><th width="103">Type</th><th width="125">Compulsory</th><th width="403">Description</th></tr></thead><tbody><tr><td>apikeyprivate</td><td>string</td><td>Yes</td><td>The Private Key obtained from the merchant's admin panel.</td></tr><tr><td>apiclientprivate</td><td>string</td><td>Yes</td><td>The Private Client obtained from the merchant's admin panel.</td></tr></tbody></table>

**The parameters to be sent to the service (BODY) are as follows:**

<table><thead><tr><th width="199">Parameter</th><th width="108">Type</th><th width="152">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>RelationalId1</td><td>string</td><td>Yes</td><td>The unique information associated with the card.</td></tr><tr><td>RelationalId2</td><td>string</td><td>No</td><td>The second unique information associated with the card.</td></tr><tr><td>RelationalId3</td><td>string</td><td>No</td><td>The third unique information associated with the card.</td></tr><tr><td>UniqueCode</td><td>string</td><td>Yes</td><td>The unique information (identity) of the saved card.</td></tr><tr><td>Month</td><td>int</td><td>Yes</td><td>The expiration month (Month) of the saved card that is to be updated.</td></tr><tr><td>Year</td><td>int</td><td>Yes</td><td>The expiration year (Year) of the saved card that is to be updated.</td></tr></tbody></table>

{% tabs %}
{% tab title="JSON" %}
{% code overflow="wrap" lineNumbers="true" %}

```json5
{
    "RelationalId1": "003",
    "RelationalId2": "004",
    "RelationalId3": "",
    "UniqueCode": "921245xQN85D0+Zuf7oAJv5@@@@@G86eN7RA4cX8L4hHo7Ma3hg7AW7Bq232yPyw2iVPkrt1qEw==",
    "Month": 12,
    "Year": 2030
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

**The parameters related to the response message sent by the service after the transaction are as follows:**

<table><thead><tr><th width="185.33333333333331">Parameter</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td>ErrorCode</td><td>int</td><td>It indicates the result of the transaction. If the transaction is successful, it returns '0'; if not, it returns '1'.</td></tr><tr><td>Result</td><td>string</td><td>If the transaction is successful, it returns 'true'; otherwise, it returns 'false'.</td></tr><tr><td>Message</td><td>string</td><td>It provides the result message of the transaction.</td></tr><tr><td>Body</td><td>object</td><td>If the transaction is erroneous, this is the detailed object related to the error.</td></tr></tbody></table>

**Example Code:**

{% tabs %}
{% tab title="JSON" %}
{% code overflow="wrap" lineNumbers="true" %}

```json5
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": ""
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
