# 1. New Card

## Save New Card

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

{% hint style="info" %}
Important: Card transactions are high-security operations. Therefore, you need to send the parameters '**apikeyprivate**' and '**apiclientprivate**' 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="91">Type</th><th width="146">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="244">Parameter</th><th width="92">Type</th><th width="157">Compulsory</th><th width="336">Description</th></tr></thead><tbody><tr><td>RelationalId1</td><td>string</td><td>Yes</td><td>The unique information requested to associate the card.</td></tr><tr><td>RelationalId2</td><td>string</td><td>No</td><td>The unique second piece of information requested to associate the card (all information must be sent at the time of listing).</td></tr><tr><td>RelationalId3</td><td>string</td><td>No</td><td>The unique third piece of information requested to associate the card (all information must be sent at the time of listing).</td></tr><tr><td>Nickname</td><td>string</td><td>Yes</td><td>The card's nickname (Example: My high-limit card )</td></tr><tr><td>HolderName</td><td>string</td><td>Yes</td><td>The cardholder's name on the card.</td></tr><tr><td>CardBin</td><td>string</td><td>Yes</td><td>The first 6 or 8 digits of the card.</td></tr><tr><td>CardLastFour</td><td>string</td><td>Yes</td><td>The last 4 digits of the card number.</td></tr><tr><td>Identity</td><td>string</td><td>Yes</td><td>The cardholder's identity number or tax identification number.</td></tr><tr><td>Month</td><td>int</td><td>Yes</td><td>The card's expiration date (month).</td></tr><tr><td>Year</td><td>int</td><td>Yes</td><td>The card's expiration date (year) - The parameter must be 4 characters.</td></tr><tr><td>IncludeDetails</td><td>boolean</td><td>No</td><td>If you want the card's detailed information (BIN, Type, Brand, Bank, etc.) to be returned, you should send TRUE.</td></tr></tbody></table>

**An example JSON file to be sent to the service is as follows:**

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

```json5
{
    "RelationalId1": "003", 
    "RelationalId2": null,
    "RelationalId3": null,
    "Card": {
        "Nickname": "test kartı",
        "HolderName": "Test Kartı",
        "CardBin": "41197901",
        "CardLastFour": "6389",
        "Identity": "17654932298",
        "Month": 11,
        "Year": 2040
    },
    "IncludeDetails": true
}

```

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

**The parameters returned by the service are as follows:**

<table><thead><tr><th width="189">Parameter</th><th width="100.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>ErrorCode</td><td>int</td><td>Error code. If the transaction is successful, it returns the value '0'.</td></tr><tr><td>Result</td><td>bool</td><td>It returns a true or false value. If the transaction is successful, it returns the value 'true'.</td></tr><tr><td>Message</td><td>string</td><td>If the transaction is erroneous, this is the message related to the error, and it provides language support based on the locale parameter.</td></tr><tr><td>Body</td><td>object</td><td>If the transaction is erroneous, this is the detail object related to the error.</td></tr></tbody></table>

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

```json
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "Scope": 2,
        "Name": "test kartı",
        "Identity": "176****298",
        "CardBin": "41197901",
        "CardLastFour": "6389",
        "CardHolderName": "Test Kartı",
        "CardTypeId": 1,
        "CardType": "Credit",
        "Month": 11,
        "Year": 2040,
        "UniqueCode": "PLUg7DMV88LRBnQ2SvssryFDUBmWM2G4wYlT+BEqm1AAPy6BKz+wBA==",
        "Details": {
            "CardBankId": 56,
            "CardBank": "T. VAKIFLAR BANKASI T.A.O.",
            "CardBrandId": 2,
            "CardBrand": "Visa",
            "CardFamilyId": 1,
            "CardFamily": "World",
            "CardKindId": 1,
            "CardKind": "Bireysel Kart",
            "CardTypeId": 1,
            "CardType": "Credit"
        }
    }
}
```

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