# How to Install Axur Cardstream Integration

**Axur Cardstream** is an integration that helps you protect your e-commerce from fraud even on the first purchase and, consequently, avoid the chargeback.

It's a global list of cards leaked on the Internet, as well as the deep and dark web. With the API active, every time your client makes a purchase, you can check if the card has been exposed, request additional verification, or even cancel the transaction.

---

## Requirements

To start using this integration, you need to:

- Create an [Axur account](https://www.axur.com/en-us/).
- Get an Axur **API Token**.

---

## Getting the integration

To install this integration:

1. Access [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/) > **Marketplace**.
2. On the Marketplace homepage, select the **Cardstream** card.
3. On the integration page, click the **Install** button.

You'll see a message indicating that your integration was successfully installed.

:::tip
You can search any integration by browsing through the cards, using the filters, or typing a keyword in the search bar.
:::

---

## Configuring the integration

Once you've installed the **Axur Cardstream** integration, you'll need to complete the steps explained below to configure it.

### Setting up a firewall

Follow the steps:

1. On the upper-left corner, open the **Products menu** and select **Firewall** in the **Secure** section.
2. Click the **+ Firewall** button.
3. Give an easy-to-remember name to your firewall.
4. Enable the **Functions** switch in the **Modules** section.
  - This action gives access to functions on your firewall.
5. Click the **Save** button.

Done. Now you've instantiated the firewall for your function and have access to functions on your firewall.

:::caution[Warning]
If a product or module is activated, it could generate usage-related costs. Check the [pricing page](/en/documentation/products/pricing/) for more information.
:::

### Setting up the Firewall function

While still on the **Firewall** page:

1. Select the **Functions Instances** tab.
2. Click the **+ Function Instance** button.
3. Give an easy-to-remember name to your instance.
4. On the dropdown menu, select the **Axur Cardstream** function.
5. In the **Arguments** box, pass your variables:

```json
{
  "card_number_field": "cc_number",
  "api_key": "YourAxurAPIKey",
}
```

Where:

| Variable | Mandatory | Description |
| ---- | ---- | ---- |
| `card_number_field` | Yes | The number of the credit card used in the transaction |
| `api_key` | Yes | The API Key of your Axur account |

:::note
The `card_number_field` variable supports multi-level value retrieval in request bodies using **dot notation**. For example, specifying `user_data.card_info.number` allows extracting deeply nested values, enabling more flexible and precise configuration for accessing data within complex JSON structures.
:::

6. Click the **Save** button.

### Setting up the Rules Engine

To finish, you must set up a rule in **Rules Engine** to configure the **criteria** and the **behavior** to run the function.

Still in the **Firewall** page:

1. Select the **Rules Engine** tab.
2. Click the **+ Rule Engine** button.
3. Give an easy-to-remember name to the rule.
4. Select a *criteria* to run and catch the domains that you want to run the integration on.
  - Example: if `Host` *matches* `yourdomain.com`.
5. Below, select a *behavior* to the *criteria*. In this case, it'll be **Run Function**. 
    - Select the adequate function according to the name you gave it in the instantiate step.
6. Click the **Save** button.

On the Console, you must now configure your domain so it is protected by your Firewall.

7. On the **Products menu**, select **Worloads**.
8. Click on the domain you want to protect with your **Cardstream** function.
9. In the **Settings** section, click on the `Firewall` selector and choose the Firewall you've just created.
10. Click the **Save** button.

Done. Now the **Axur Cardstream** integration is running.

---