# Custom Conditions

{% stepper %}
{% step %}
**Condition Types**

{% tabs %}
{% tab title="String Conditions" %}
• **Contains:** Check if field contains text

• **Equals:** Exact string match

• **Regex:** Pattern matching

• **Exists:** Check if field exists
{% endtab %}

{% tab title="Logic Operators" %}
• **AND:** All conditions must be true

• **OR:** Any condition can be true

• **Nested Groups:** Complex logic combinations

• **Case Sensitivity:** Optional case matching
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}
**Field Paths**

Use dot notation to access nested fields in the webhook payload:

```
Examples:
item.quantity - Access quantity field
customer.email - Access customer email
payment.status - Access payment status
metadata.product_id - Access nested metadata
```

{% endstep %}

{% step %}
**Example Conditions**

<pre><code>Simple Condition:
Generate keys only for premium products:

<strong>Field:
</strong>item.type
Condition:
equals "premium"
</code></pre>

```
Complex Condition:
Generate keys for successful payments with specific quantity:

Group 1 (AND):
payment.status equals "completed"
item.quantity greater_than 0
Group 2 (OR):
item.type equals "premium"
item.type equals "standard"
```

{% endstep %}
{% endstepper %}

{% hint style="info" %}
**Pro Tip:** Start with simple conditions and gradually add complexity. Use the test webhook feature to verify your conditions work as expected.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jnkie.com/shop-webhooks/custom-conditions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
