# Tokenisation Profile

A Tokenisation Profile is a setting to represent how to exclude information from a 3rd party service message.&#x20;

{% hint style="danger" %}
Please ask us to create profiles for you (No Charge), we have working profiles and can make new profiles easily.
{% endhint %}

### Tokenisation Profile structure

```javascript
{
  "id": "441928a5-6cf6-4735-ae95-8b1a27178d1c",
  "type": "tokenization_profile",
  "attributes": {
    "id": "441928a5-6cf6-4735-ae95-8b1a27178d1c",
    "name": "sample",
    "profile": {
      "type": "json",
      "schema": {
        "message_node": {
          "selector": "$.data"
        },
        "card_node": {
          "selector": "attributes.guarantee"
        }
      },
      "card_token_placement": {
        "type": "card_node",
        "card_token_node": "token",
        "error_node": "error",
      },
      "card_node": {
        "card_number": {
          "selector": "card_number"
        },
        "cardholder_name": {
          "selector": "cardholder_name"
        },
        "expiration_month": {
          "selector": "expiration_date",
          "transformation": "substring:0,2"
        },
        "expiration_year": {
          "selector": "expiration_date",
          "transformation": "substring:3,6"
        },
        "service_code": {
          "selector": "cvv"
        }
      }
    },
    "created_at": "2020-06-08T05:49:10.979Z",
    "updated_at": "2020-06-08T05:49:10.979Z"
  }
}
```

| Field        | Description                                |
| ------------ | ------------------------------------------ |
| `id`         | Unique identifier based at UUID v4         |
| `name`       | Tokenisation profile name, URL-safe string |
| `profile`    | Tokenisation profile structure             |
| `created_at` | timestamp when profile was created         |
| `updated_at` | timestamp when profile was updated         |

#### **Profile**

| **Field**              | Description                                              |
| ---------------------- | -------------------------------------------------------- |
| `type`                 | type of incoming content (JSON or XML)                   |
| `schema`               | information about message\_node and card\_node placement |
| `card_token_placement` | information about card\_token destination                |
| `card_node`            | information about card information nodes                 |

#### **Schema**

| Field          | Description                                                                                                 |
| -------------- | ----------------------------------------------------------------------------------------------------------- |
| `message_node` | JSON object with selector field with JSONPath or XPath to booking message node at 3rd party service message |
| `card_node`    | JSON object with selector field with relative JSONPath or XPath to credit card node                         |

#### **Card Token Placement**

| Field  | Description                                                                                           |
| ------ | ----------------------------------------------------------------------------------------------------- |
| `type` | One of possible values: card\_node, headers                                                           |
| `node` | required field if type is card\_node, XPath or JSONPath to node, where card\_token should be inserted |

If you choose `card_node`, `card_token` will be inserted into message structure. If `headers` chosen, card\_token will be return at `X-PCI-VAULTERA-TOKENS` Header. If message contain several bookings, we will return several card\_tokens. If one of messages does not have credit card info, it will be represent as an empty string at Headers.

#### Card Node

| Field              | Description                                                      |
| ------------------ | ---------------------------------------------------------------- |
| `card_number`      | JSON object with selector for Card Number                        |
| `cardholder_name`  | JSON object with selector for Cardholder name                    |
| `expiration_month` | JSON object with selector for Expiration Month                   |
| `expiration_year`  | JSON object with selector for Expiration Year                    |
| `service_code`     | <p>JSON object with selector for Service Code (CVV, CVC)<br></p> |

Each selector can contain field selector with JSONPath or XPath, and field transformation to modify the excluded value.

Please, keep in mind, our Tokenisation Profiles are based at XPath or JSONPath functionality.
