# 4. Update Card

## Update Registered Card

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

Simply making a request to the address provided above will suffice. You can use the 'Base Address' as you wish for both the Test environment and the Production environment.

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

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

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

<table><thead><tr><th width="162">Parameter</th><th width="79">Type</th><th width="130">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 panel.</td></tr><tr><td>apiclientprivate</td><td>string</td><td>Yes</td><td>The Private Client obtained from the merchant panel.</td></tr></tbody></table>

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

<table><thead><tr><th width="186">Parameter</th><th width="91">Type</th><th width="138">Compulsory </th><th>Description</th></tr></thead><tbody><tr><td>PartnerBased</td><td>bool</td><td>No</td><td>This is applicable to cards registered under the partnership.</td></tr><tr><td>PartnerIdentity</td><td>string</td><td>Yes/No</td><td>This applies to cards registered within the scope of the partnership.</td></tr><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 (identifier) of the stored card.</td></tr><tr><td>Month</td><td>int</td><td>Yes</td><td>The expiration date (Month) of the stored card to be updated.</td></tr><tr><td>Year</td><td>int</td><td>Yes</td><td>The expiration date (Year) of the stored card 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 for the response message sent from the service after the transaction are as follows:**

<table><thead><tr><th width="172.33333333333331">Parameter</th><th width="94">Type</th><th>Description</th></tr></thead><tbody><tr><td>ErrorCode</td><td>int</td><td>It reports the result of the transaction. It returns '0' if the transaction is successful, and '1' otherwise.</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 reports the transaction result message.</td></tr><tr><td>Body</td><td>object</td><td>If the transaction is unsuccessful, this is the detail object for the error.</td></tr></tbody></table>

**Sample Code:**

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

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

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