> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payreque.st/llms.txt
> Use this file to discover all available pages before exploring further.

# Tags System

> Organize your business data with color-coded labels for segmentation, filtering, and automation

## Overview

Tags are customizable labels that help you organize and segment your business data in PayRequest. Apply tags to customers, subscriptions, products, invoices, smart links, and expenses to create powerful workflows, filter data, and trigger automations.

<Tip>
  Tags are essential for organizing large datasets. Create tags for customer segments (VIP, trial users), product categories (services, physical), or campaigns (Summer 2025) to quickly filter and analyze your data.
</Tip>

## Key Features

* **Color-Coded Labels**: 18 color options for visual organization
* **Multi-Entity Support**: Tag customers, subscriptions, products, invoices, smart links, and expenses
* **Filtering & Segmentation**: Filter any entity list by tags with AND/OR logic
* **Automation Triggers**: Automatically add/remove tags based on email events
* **Usage Tracking**: See how many entities use each tag
* **CSV Export**: Export tagged entities for reporting
* **Per-Business Isolation**: Tags are private to your business account

## Accessing Tags

Navigate to **Tags** in your dashboard sidebar to access the tag management interface.

<Note>
  Tags are available for all PayRequest accounts. You can create unlimited tags per entity type.
</Note>

## Supported Entity Types

PayRequest supports tagging 7 different entity types:

| Type             | Description                       | Common Use Cases                  |
| ---------------- | --------------------------------- | --------------------------------- |
| **Customer**     | Customer profiles                 | VIP, Active, Churned, Lead Source |
| **Subscription** | PayRequest & Mollie subscriptions | Plan tier, Trial, Annual, Monthly |
| **Product**      | Digital products and services     | Category, Featured, On Sale       |
| **Invoice**      | Invoices and bills                | Urgent, Overdue, Paid, Disputed   |
| **Smart Link**   | Marketing payment links           | Campaign, Channel, Season         |
| **Expense**      | Recurring expenses                | Software, Marketing, Operations   |
| **Support**      | Support-related items             | Priority, Department, Status      |

## Creating Tags

### Step 1: Open Tag Creation

From the Tags page, click **Create Tag** in the top right corner.

### Step 2: Configure Tag Details

**Required Fields:**

* **Name**: Descriptive label (e.g., "VIP Customer", "Summer Campaign")
* **Type**: Select entity type (Customer, Subscription, Product, etc.)
* **Color**: Choose from 18 color options

<Info>
  Tag names must be unique within each type. You can have a "VIP" customer tag and a "VIP" product tag, but not two "VIP" customer tags.
</Info>

### Step 3: Save Tag

Click **Create Tag** to save. The tag is immediately available for use across your dashboard.

## Available Colors

Choose from 18 color options to visually distinguish your tags:

<CardGroup cols={3}>
  <Card title="Neutral">
    zinc
  </Card>

  <Card title="Warm">
    red, orange, amber, yellow
  </Card>

  <Card title="Cool">
    lime, green, emerald, teal, cyan, sky, blue, indigo
  </Card>

  <Card title="Accent">
    violet, purple, fuchsia, pink, rose
  </Card>
</CardGroup>

<Tip>
  Use consistent color schemes for similar tags. For example, all subscription tier tags could use shades of blue, while all campaign tags use warm colors.
</Tip>

## Applying Tags

### To Products

1. Go to **Products** in the sidebar
2. Click on a product to view details
3. Click **Manage Tags** button
4. Select tags from the dropdown or create new ones inline
5. Click **Save Tags**

### To Subscriptions

1. Go to **Subscriptions** in the sidebar
2. Click on a subscription to view details
3. Scroll to the **Tags** section
4. Click **Manage Tags**
5. Select or create tags
6. Click **Save Tags**

### To Customers

1. Go to **Customers** in the sidebar
2. Click on a customer profile
3. Locate the **Tags** section
4. Add or remove tags as needed

### To Invoices

1. Go to **Invoices** in the sidebar
2. Click on an invoice to view details
3. Use the tag management interface to add tags

### To Smart Links

When creating or editing a smart link:

1. Scroll to the **Tags** field
2. Select existing tags or create new ones
3. Tags help organize links by campaign, channel, or purpose

### To Expenses

In the Expense Tracker:

1. Open an expense record
2. Add tags to categorize by department, type, or project

## Filtering by Tags

### Basic Filtering

Most entity list pages support tag filtering:

1. Locate the **Tag Filter** dropdown
2. Select one or more tags
3. The list updates to show only matching items

### AND vs OR Logic

When selecting multiple tags:

**ANY (OR Logic)** - Default

* Shows items that have **at least one** of the selected tags
* Example: Select "VIP" and "Trial" → Shows VIP customers OR trial customers

**ALL (AND Logic)** - Toggle available

* Shows items that have **all** selected tags
* Example: Select "VIP" and "Annual" → Shows only customers who are BOTH VIP AND on annual plans

<Info>
  The filter logic toggle appears when you select multiple tags. Click to switch between ANY and ALL matching modes.
</Info>

## Tag View & Analytics

### Accessing Tag Details

Click on any tag name to view its detail page, which shows:

**Tag Information**

* Name, color, and type
* Total usage count
* Creation date

**Tagged Entities**

* List of all entities using this tag
* Searchable and paginated
* Organized by entity type

### Usage Breakdown

For Subscription tags, you'll see separate counts:

* PayRequest subscriptions (native)
* Mollie subscriptions (legacy)

### CSV Export

Export tagged entities for reporting:

1. Open a tag detail page
2. Navigate to the entity type section
3. Click **Export CSV**
4. Download includes entity details with tag information

## Tag Automations

Tags integrate with PayRequest's automation system for powerful workflow automation.

### Automatic Tagging via Email Events

Set up automations to automatically tag customers based on email delivery status:

**Available Triggers:**

* `email_bounced` - Email couldn't be delivered
* `email_complained` - Recipient marked as spam
* `email_failed` - Email delivery failed

**Common Automation Example:**

```
Trigger: email_bounced
Action: add_tag
Tag: "Invalid Email"
```

<Warning>
  Email automations help maintain clean customer data. Tag bounced emails to prevent sending to invalid addresses and protect your sender reputation.
</Warning>

### Setting Up Tag Automations

1. Go to **Automations** in the sidebar
2. Click **Create Automation**
3. Select trigger type (e.g., Email Bounced)
4. Choose action: **Add Tag** or **Remove Tag**
5. Select or create the target tag
6. Save and activate

<Tip>
  Create a "Verified Email" tag and remove it when emails bounce. Use this tag for filtering customers with confirmed email addresses.
</Tip>

### Automatic Tagging via Smart Links

Smart Links support automatic customer tagging after successful payments. This is powerful for tracking campaign conversions and customer lifecycle.

**Available Actions:**

| Action         | Description                         |
| -------------- | ----------------------------------- |
| **Apply Tag**  | Add a Customer tag after payment    |
| **Remove Tag** | Remove a Customer tag after payment |

**Common Use Cases:**

```
Smart Link: "Summer Campaign 2025"
Customer: John Doe
After Payment: Apply tag "Summer 2025 Customer"
```

```
Smart Link: "Upgrade to Premium"
Customer: Jane Smith
After Payment:
  - Remove tag "Free Tier"
  - Apply tag "Premium Customer"
```

**Setting Up Smart Link Tag Automation:**

1. Go to **Smart Links** and create or edit a link
2. Select a customer in **Send smart payment link to customer**
3. Scroll to **After Payment Actions**
4. Configure **Apply Tag to Customer** to add a tag
5. Configure **Remove Tag from Customer** to remove a tag
6. Save the smart link

<Info>
  The Remove Tag dropdown only shows tags that the selected customer currently has, plus any tag you've selected to apply (since it will be added upon payment).
</Info>

**Combining with Redirect:**

You can combine tag automation with redirect actions:

1. Apply a tag (e.g., "Paid Customer")
2. Remove a tag (e.g., "Lead")
3. Redirect to a thank-you page

All three actions execute after successful payment.

<Tip>
  Use Smart Link tag automation to move customers through your sales funnel automatically. Remove "Prospect" tags and add "Customer" tags upon payment completion.
</Tip>

## Managing Tags

### Editing Tags

1. From the Tags list, click **Edit** on any tag
2. Modify name, color, or type
3. Changes apply immediately to all tagged entities

### Deleting Tags

1. Click **Delete** on a tag
2. If the tag is in use, you'll see a warning with usage count
3. Confirm deletion

<Warning>
  Deleting a tag removes it from ALL entities that use it. This action cannot be undone. Consider renaming or deactivating tags instead.
</Warning>

### Tag Type Restrictions

Once a tag is created with a specific type, it can only be applied to that entity type:

* Customer tags → Customers only
* Product tags → Products only
* Subscription tags → Both PayRequest and Mollie subscriptions

## Best Practices

### Naming Conventions

**Do:**

* Use descriptive names: "Q4 2025 Campaign" instead of "Campaign1"
* Be consistent: "VIP Customer" and "VIP Product" are clear
* Use categories: "Lead Source: Website", "Lead Source: Referral"

**Don't:**

* Use vague names: "Tag1", "Test", "New"
* Create duplicates: "VIP" and "V.I.P." and "vip"
* Use overly long names (max 255 characters)

### Color Strategy

Assign colors with meaning:

| Color             | Suggested Use                                  |
| ----------------- | ---------------------------------------------- |
| **Green**         | Positive status (Active, Paid, Verified)       |
| **Red**           | Negative/Urgent (Overdue, Churned, Invalid)    |
| **Blue**          | Information (Plan tier, Category)              |
| **Yellow/Orange** | Warning/Attention (Trial ending, Needs review) |
| **Purple**        | Special (VIP, Featured, Premium)               |

### Organization Tips

1. **Start Simple**: Begin with 3-5 essential tags per type
2. **Review Regularly**: Remove unused tags quarterly
3. **Document Purpose**: Use consistent naming so team members understand tag meanings
4. **Combine with Automations**: Let automations handle routine tagging

## Use Cases

### Customer Segmentation

**Lifecycle Tags:**

* Trial User
* Active Customer
* At Risk
* Churned

**Value Tags:**

* VIP
* High Value
* New Customer
* Referral Partner

### Subscription Management

**Plan Tags:**

* Freelancer Plan
* Business Plan
* Enterprise
* Legacy Plan

**Status Tags:**

* Annual Billing
* Monthly Billing
* Trial Period
* Pending Cancellation

### Marketing Campaigns

**Smart Link Tags:**

* Black Friday 2025
* Email Campaign
* Social Media
* Partner Referral

### Invoice Organization

**Status Tags:**

* Urgent
* Disputed
* Partial Payment
* Sent Reminder

## Troubleshooting

### Tags Not Appearing

**Check:**

1. Tag type matches entity type (Customer tag won't appear on Products)
2. You're filtering by the correct type
3. Clear browser cache and refresh

### Can't Delete Tag

**Cause:** Tag is currently in use

**Solution:**

1. View tag details to see which entities use it
2. Remove tag from all entities first
3. Then delete the tag

### Duplicate Tags

**Cause:** Tags were created with similar names or different capitalizations

**Solution:**

1. Identify the duplicate tags
2. Update entities to use one tag consistently
3. Delete the unused duplicate

### Automations Not Adding Tags

**Check:**

1. Automation is set to **Active**
2. Trigger conditions are met
3. Tag exists and matches entity type
4. No errors in automation logs

## API Integration

For developers integrating with PayRequest:

### Tag Structure

```json theme={null}
{
  "id": 1,
  "name": "VIP Customer",
  "color": "purple",
  "type": "Customer",
  "user_id": 1,
  "created_at": "2025-01-15T10:30:00Z"
}
```

### Polymorphic Relationship

Tags use Laravel's polymorphic many-to-many relationships:

* **tags** table: Tag definitions
* **taggables** table: Pivot table linking tags to entities
  * `tag_id`: Reference to tag
  * `taggable_id`: Entity ID
  * `taggable_type`: Entity class (Customer, Product, etc.)

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="Can I use the same tag across different entity types?">
    No. Each tag is specific to one entity type. However, you can create tags with the same name for different types (e.g., "VIP" for both Customers and Products). They will be separate tags with independent usage tracking.
  </Accordion>

  <Accordion title="Is there a limit to how many tags I can create?">
    No, there's no limit. However, for practical organization, we recommend keeping your tag count manageable - typically under 50 tags per type.
  </Accordion>

  <Accordion title="Can my customers see tags?">
    No. Tags are internal organizational tools only. They're visible only in your dashboard and never shown in the customer portal, shop, or invoices.
  </Accordion>

  <Accordion title="What happens to tags when I delete an entity?">
    When you delete a customer, subscription, or other entity, the tag associations are automatically removed. The tags themselves remain available for other entities.
  </Accordion>

  <Accordion title="Can I bulk-apply tags to multiple entities?">
    Currently, tags are applied individually. For bulk operations, consider using the CSV import feature with tag assignments or setting up automations for automatic tagging.
  </Accordion>

  <Accordion title="Do tags work with both PayRequest and Mollie subscriptions?">
    Yes! The Subscription tag type works with both PayRequest native subscriptions and legacy Mollie subscriptions. You can tag and filter both types using the same tags.
  </Accordion>

  <Accordion title="Can I search for entities by tag?">
    Yes. Most entity list pages include a tag filter dropdown. Select one or more tags to filter the displayed items. You can also search within tagged entities on tag detail pages.
  </Accordion>

  <Accordion title="How do tag automations work with new customers?">
    Automations run when specific events occur (like email bounces). For new customer tagging, you'll need to manually apply tags or use future automation triggers like "customer\_created" when available.
  </Accordion>

  <Accordion title="Can Smart Links automatically tag customers after payment?">
    Yes! When creating or editing a Smart Link, you can configure automatic tag actions in the After Payment Actions section. You can apply a Customer tag, remove a Customer tag, or do both. These actions execute automatically when the customer completes payment. This is useful for tracking campaign conversions and moving customers through your sales funnel.
  </Accordion>
</AccordionGroup>

## Related Features

<CardGroup cols={2}>
  <Card title="Email Automations" icon="envelope" href="/organization-and-automation/email-automations">
    Set up automatic tagging based on email events
  </Card>

  <Card title="Customer Management" icon="users" href="/customer-management/customer-profiles">
    Organize and segment your customers
  </Card>

  <Card title="Smart Links" icon="link" href="/payment-processing/smart-links">
    Tag marketing links by campaign
  </Card>

  <Card title="Activity Tracking" icon="clock-rotate-left" href="/organization-and-automation/activity-tracking">
    Monitor tag changes in activity log
  </Card>
</CardGroup>
