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

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# Dolandırıcılığı yönetin

> Riskli ödemeleri engellemek veya incelemek için Whop'un dolandırıcılık kontrollerinin üzerine kendi ödeme kurallarınızı ekleyin.

Dolandırıcılık amaçlı bir ödeme size paranın kendisine, [15 \$'lık itiraz ücretine](https://docs.whop.com/tr/manage-your-business/manage-payments/manage-disputes.md) ve daha kötü bir [itiraz oranına](https://docs.whop.com/tr/trust-and-safety/account-health/managing-dispute-rates.md) mal olur. Whop, ödemeleri kendi dolandırıcılık kontrolleriyle tarar. Ödeme kuralları bunun üzerine kendi katmanınızı ekler: yazdığınız koşullar ve bir ödeme bunların tümüyle eşleştiğinde Whop'un uyguladığı bir eylem.

Kurallar Whop'un kontrollerinden sonra çalışır ve onları asla gevşetmez. Whop'un engellediği bir ödeme engelli kalır.

## Bir kuralın uygulayabileceği dört eylem

| Eylem | Ne olur | Birden fazla kural eşleştiğinde |
| - | - | - |
| `block` | Ödeme yetkilendirmeden önce reddedilir. Alıcı genel bir ret mesajı görür. | `review` ve `enforce_3ds` kurallarına üstün gelir |
| `review` | Uygun bir kart tahsil edilmeden yetkilendirilir. Otomatik tahsilat, yetkilendirmeden 48 saat sonrasına planlanır. Daha erken tahsil edebilir veya geçersiz kılabilirsiniz. Desteklenmeyen yöntemler incelemeyi atlar ve normal ödeme işlemesine devam eder. | `enforce_3ds` kuralına üstün gelir |
| `enforce_3ds` | Alıcı ödemeyi 3D Secure aracılığıyla bankasıyla onaylar. | En düşük öncelik |
| `allow` | Ödeme diğer kurallarınızı atlar. Whop'un kontrollerini asla atlamaz. | Diğer üçüne de üstün gelir |

Bir kural `risk_score`, `amount_in_usd`, `card_country`, `card_bin`, `customer_email` ve `ip_address` alanlarını okuyabilir. `card_bin`, ödemeyi yapmak için kullanılan kartın Banka Tanımlama Numarasıdır: kart numarasının ilk altı hanesi. [List fields](https://docs.whop.com/tr/api-reference/payment-rules/list-fields.md) her birinin kabul ettiği operatörleri ve değerleri döndürür.

Emin olmadığınız durumlarda engellemek yerine doğrulama isteyin. Engelleme, eşleşen gerçek alıcıları da geri çevirir; doğrulama ise kart sahibi olduklarını kanıtlamalarına olanak tanır.

> [!NOTE]
>
> Bu örnekleri `WHOP_API_KEY` ayarlanmış güvenilir bir sunucu ortamında çalıştırın.
> Diliniz için ilk örnekteki içe aktarmaları ve istemci kurulumunu yeniden kullanın.

## Açık dolandırıcılığı engelleyin

[İtirazlarınızda](https://docs.whop.com/tr/developer/guides/refunds-and-disputes.md) en sık gördüğünüz örüntüyle başlayın. Bu kural, ABD dışında düzenlenmiş bir kartla yapılan ve Whop'un 85 veya üzeri puan verdiği bir ödemeyi engeller.

```typescript TypeScript theme={null}
import { WhopClient } from "@whop/sdk";

const client = new WhopClient({ token: process.env.WHOP_API_KEY });

const rule = await client.paymentRules.create({
	account_id: "biz_xxxxxxxxxxxxx",
	name: "Block high-risk cards from outside the US",
	action: "block",
	conditions: {
		all: [
			{ field: "risk_score", operator: "gte", value: 85 },
			{ field: "card_country", operator: "neq", value: "US" },
		],
	},
});

console.log(rule.id); // prule_xxxxxxxxxxxxx
```

```python Python theme={null}
import os
from whop_sdk import Whop
from whop_sdk.payment_rules import (
    CreatePaymentRulesRequestConditions,
    CreatePaymentRulesRequestConditionsAllItem,
)

client = Whop(token=os.environ["WHOP_API_KEY"])

rule = client.payment_rules.create(
    account_id="biz_xxxxxxxxxxxxx",
    name="Block high-risk cards from outside the US",
    action="block",
    conditions=CreatePaymentRulesRequestConditions(
        all_=[
            CreatePaymentRulesRequestConditionsAllItem(field="risk_score", operator="gte", value=85),
            CreatePaymentRulesRequestConditionsAllItem(field="card_country", operator="neq", value="US"),
        ],
    ),
)

print(rule.id)  # prule_xxxxxxxxxxxxx
```

```ruby Ruby theme={null}
require "whop_sdk"

client = Whop_sdk::Client.new(token: ENV.fetch("WHOP_API_KEY"))

rule = client.payment_rules.create(
  account_id: "biz_xxxxxxxxxxxxx",
  name: "Block high-risk cards from outside the US",
  action: "block",
  conditions: {
    all: [
      { field: "risk_score", operator: "gte", value: 85 },
      { field: "card_country", operator: "neq", value: "US" }
    ]
  }
)

puts rule.id # prule_xxxxxxxxxxxxx
```

```rust Rust theme={null}
use whop_sdk::prelude::*;

let config = ClientConfig {
    token: Some(std::env::var("WHOP_API_KEY").unwrap()),
    ..Default::default()
};
let client = Whop::new(config).expect("Failed to build client");

let rule = client
    .payment_rules
    .create(
        &CreatePaymentRulesRequest {
            name: "Block high-risk cards from outside the US".to_string(),
            action: CreatePaymentRulesRequestAction::Block,
            conditions: CreatePaymentRulesRequestConditions {
                all: vec![
                    CreatePaymentRulesRequestConditionsAllItem {
                        field: CreatePaymentRulesRequestConditionsAllItemField::RiskScore,
                        operator: CreatePaymentRulesRequestConditionsAllItemOperator::Gte,
                        value: PaymentRuleConditionValue::Integer(85),
                    },
                    CreatePaymentRulesRequestConditionsAllItem {
                        field: CreatePaymentRulesRequestConditionsAllItemField::CardCountry,
                        operator: CreatePaymentRulesRequestConditionsAllItemOperator::Neq,
                        value: PaymentRuleConditionValue::String("US".to_string()),
                    },
                ],
                ..Default::default()
            },
            account_id: Some("biz_xxxxxxxxxxxxx".to_string()),
            metadata: None,
        },
        None,
    )
    .await?;

println!("{}", rule.id); // prule_xxxxxxxxxxxxx
```

```go Go theme={null}
import (
    "context"
    "fmt"
    "log"
    "os"

    whopsdk "github.com/whopio/whopsdk-go/v2"
    "github.com/whopio/whopsdk-go/v2/client"
    "github.com/whopio/whopsdk-go/v2/option"
)

client := client.NewWhop(option.WithToken(os.Getenv("WHOP_API_KEY")))

rule, err := client.PaymentRules.Create(context.TODO(), &whopsdk.CreatePaymentRulesRequest{
    AccountID: whopsdk.String("biz_xxxxxxxxxxxxx"),
    Name:      "Block high-risk cards from outside the US",
    Action:    whopsdk.CreatePaymentRulesRequestActionBlock,
    Conditions: &whopsdk.CreatePaymentRulesRequestConditions{
        All: []*whopsdk.CreatePaymentRulesRequestConditionsAllItem{
            {
                Field:    whopsdk.CreatePaymentRulesRequestConditionsAllItemFieldRiskScore,
                Operator: whopsdk.CreatePaymentRulesRequestConditionsAllItemOperatorGte,
                Value:    &whopsdk.PaymentRuleConditionValue{Integer: 85},
            },
            {
                Field:    whopsdk.CreatePaymentRulesRequestConditionsAllItemFieldCardCountry,
                Operator: whopsdk.CreatePaymentRulesRequestConditionsAllItemOperatorNeq,
                Value:    &whopsdk.PaymentRuleConditionValue{String: "US"},
            },
        },
    },
})
if err != nil {
    log.Fatal(err)
}
fmt.Println(rule.ID) // prule_xxxxxxxxxxxxx
```

```java Java theme={null}
import com.whop.api.WhopApiClient;
import com.whop.api.resources.paymentrules.requests.CreatePaymentRulesRequest;
import com.whop.api.resources.paymentrules.types.*;
import com.whop.api.types.PaymentRuleConditionValue;
import java.util.List;

var client = WhopApiClient.builder()
    .token(System.getenv("WHOP_API_KEY"))
    .build();

var rule = client.paymentRules().create(
    CreatePaymentRulesRequest.builder()
        .accountId("biz_xxxxxxxxxxxxx")
        .name("Block high-risk cards from outside the US")
        .action(CreatePaymentRulesRequestAction.BLOCK)
        .conditions(CreatePaymentRulesRequestConditions.builder()
            .all(List.of(
                CreatePaymentRulesRequestConditionsAllItem.builder()
                    .field(CreatePaymentRulesRequestConditionsAllItemField.RISK_SCORE)
                    .operator(CreatePaymentRulesRequestConditionsAllItemOperator.GTE)
                    .value(PaymentRuleConditionValue.of(85))
                    .build(),
                CreatePaymentRulesRequestConditionsAllItem.builder()
                    .field(CreatePaymentRulesRequestConditionsAllItemField.CARD_COUNTRY)
                    .operator(CreatePaymentRulesRequestConditionsAllItemOperator.NEQ)
                    .value(PaymentRuleConditionValue.of("US"))
                    .build()
            ))
            .build())
        .build()
);
System.out.println(rule.getId());
```

```swift Swift theme={null}
import Foundation
import WhopSDK

let client = Whop(token: ProcessInfo.processInfo.environment["WHOP_API_KEY"]!)

let rule = try await client.paymentRules.create(
    request: .init(
        accountId: "biz_xxxxxxxxxxxxx",
        action: .block,
        conditions: .init(all: [
            .init(
                field: .riskScore,
                operator: .gte,
                value: .int(85)
            ),
            .init(
                field: .cardCountry,
                operator: .neq,
                value: .string("US")
            )
        ]),
        name: "Block high-risk cards from outside the US"
    )
)
print(rule.id)
```

```bash cURL theme={null}
curl "https://api.whop.com/api/v1/payment_rules" \
  -H "Authorization: Bearer $WHOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "biz_xxxxxxxxxxxxx",
    "name": "Block high-risk cards from outside the US",
    "action": "block",
    "conditions": {
      "all": [
        { "field": "risk_score", "operator": "gte", "value": 85 },
        { "field": "card_country", "operator": "neq", "value": "US" }
      ]
    }
  }'
```

Her zaman `account_id` iletin. Bu olmadan kural, kimlik bilgilerinizin varsayılan olarak kullandığı hesaba düşer; birden fazla hesabı yöneten bir platform için bu kolayca yanlış gidebilir. Kurallar her dakika ödeme sayfasına yayınlanır, bu nedenle yeni veya değiştirilmiş bir kural birkaç dakika içinde uygulanmaya başlar.

> [!NOTE]
>
> Gereken izin: kural yazmak için `payment:manage`, okumak için
> `payment:basic:read`. İzinleri [İzinler
> kılavuzundan](https://docs.whop.com/tr/developer/guides/permissions.md) ekleyin.

## Büyük siparişlerde doğrulama isteyin

Çalıntı bir karttan gelen büyük bir sipariş, en son isteyeceğiniz ters ibrazdır. Gerçek bir müşteriden gelen büyük bir sipariş ise kaybetmeyi en son isteyeceğiniz satıştır. 3D Secure doğrulaması ikisini birbirinden ayırır ve alıcı doğrulamayı geçtiğinde ödeme `three_ds_verified: true` olarak kaydedilir.

Ödeme sayfası bir doğrulamayı taşıyamadığında `enforce_3ds` atlanır, ancak yine de ödemeye kaydedilir. Bu; yenilemeler gibi oturum dışı ödemeleri, kendi 3D Secure düzeyini belirleyen varyantları, kart dışı ödemeleri ve işlemcinin doğrulama isteyemediği kartları kapsar. American Express yalnızca USD ödemelerinde doğrulamaya tabi tutulur.

```typescript TypeScript theme={null}
await client.paymentRules.create({
	account_id: "biz_xxxxxxxxxxxxx",
	name: "Challenge orders over $500",
	action: "enforce_3ds",
	conditions: {
		all: [{ field: "amount_in_usd", operator: "gte", value: 500 }],
	},
});
```

```python Python theme={null}
client.payment_rules.create(
    account_id="biz_xxxxxxxxxxxxx",
    name="Challenge orders over $500",
    action="enforce_3ds",
    conditions=CreatePaymentRulesRequestConditions(
        all_=[CreatePaymentRulesRequestConditionsAllItem(field="amount_in_usd", operator="gte", value=500)],
    ),
)
```

```ruby Ruby theme={null}
client.payment_rules.create(
  account_id: "biz_xxxxxxxxxxxxx",
  name: "Challenge orders over $500",
  action: "enforce_3ds",
  conditions: {
    all: [{ field: "amount_in_usd", operator: "gte", value: 500 }]
  }
)
```

```rust Rust theme={null}
client
    .payment_rules
    .create(
        &CreatePaymentRulesRequest {
            name: "Challenge orders over $500".to_string(),
            action: CreatePaymentRulesRequestAction::Enforce3Ds,
            conditions: CreatePaymentRulesRequestConditions {
                all: vec![CreatePaymentRulesRequestConditionsAllItem {
                    field: CreatePaymentRulesRequestConditionsAllItemField::AmountInUsd,
                    operator: CreatePaymentRulesRequestConditionsAllItemOperator::Gte,
                    value: PaymentRuleConditionValue::Integer(500),
                }],
                ..Default::default()
            },
            account_id: Some("biz_xxxxxxxxxxxxx".to_string()),
            metadata: None,
        },
        None,
    )
    .await?;
```

```go Go theme={null}
_, err = client.PaymentRules.Create(context.TODO(), &whopsdk.CreatePaymentRulesRequest{
    AccountID: whopsdk.String("biz_xxxxxxxxxxxxx"),
    Name:      "Challenge orders over $500",
    Action:    whopsdk.CreatePaymentRulesRequestActionEnforce3Ds,
    Conditions: &whopsdk.CreatePaymentRulesRequestConditions{
        All: []*whopsdk.CreatePaymentRulesRequestConditionsAllItem{
            {
                Field:    whopsdk.CreatePaymentRulesRequestConditionsAllItemFieldAmountInUsd,
                Operator: whopsdk.CreatePaymentRulesRequestConditionsAllItemOperatorGte,
                Value:    &whopsdk.PaymentRuleConditionValue{Integer: 500},
            },
        },
    },
})
if err != nil {
    log.Fatal(err)
}
```

```java Java theme={null}
var rule = client.paymentRules().create(
    CreatePaymentRulesRequest.builder()
        .accountId("biz_xxxxxxxxxxxxx")
        .name("Challenge orders over $500")
        .action(CreatePaymentRulesRequestAction.valueOf("enforce_3ds"))
        .conditions(CreatePaymentRulesRequestConditions.builder()
            .all(List.of(
                CreatePaymentRulesRequestConditionsAllItem.builder()
                    .field(CreatePaymentRulesRequestConditionsAllItemField.AMOUNT_IN_USD)
                    .operator(CreatePaymentRulesRequestConditionsAllItemOperator.GTE)
                    .value(PaymentRuleConditionValue.of(500))
                    .build()
            ))
            .build())
        .build()
);
System.out.println(rule.getId());
```

```swift Swift theme={null}
let rule = try await client.paymentRules.create(
    request: .init(
        accountId: "biz_xxxxxxxxxxxxx",
        action: .enforce3ds,
        conditions: .init(all: [
            .init(
                field: .amountInUsd,
                operator: .gte,
                value: .int(500)
            )
        ]),
        name: "Challenge orders over $500"
    )
)
print(rule.id)
```

```bash cURL theme={null}
curl "https://api.whop.com/api/v1/payment_rules" \
  -H "Authorization: Bearer $WHOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "biz_xxxxxxxxxxxxx",
    "name": "Challenge orders over $500",
    "action": "enforce_3ds",
    "conditions": {
      "all": [
        { "field": "amount_in_usd", "operator": "gte", "value": 500 }
      ]
    }
  }'
```

## Bir ödemeyi tahsil etmeden önce inceleyin

Bir `review` kuralı, uygun bir kart ödemesini tahsil etmeden yetkilendirir. Alıcı ödemeyi tamamlar ve yetkilendirme anında üyelik erişimi alır. Bunu elle tamamladığınız siparişler veya riskli olan ancak kesin olarak dolandırıcılık olmayan bir örüntü için kullanın. Siz önce harekete geçmezseniz Whop 48 saat sonra otomatik olarak tahsil eder:

* Parayı tahsil etmek için [Capture](https://docs.whop.com/tr/api-reference/payments/capture-payment.md) kullanın. Ödeme `paid` olur ve Whop, siparişi tamamlamanız için sinyaliniz olan `payment.succeeded` olayını gönderir.
* Blokeyi kaldırmak için [Void](https://docs.whop.com/tr/api-reference/payments/void-payment.md) kullanın. Whop erişimi iptal eder, ayrılmış stoku iade eder ve `payment.canceled` gönderir.

Whop, bloke başladığında ve API ile istenen yetkilendirmelerde de `payment.authorized` gönderir. Bloke edilmiş bir ödeme `substatus: "requires_capture"` ile `status: "authorized"` olarak görünür. `auto_capture_at` için [ödeme durumunu getirin](https://docs.whop.com/tr/api-reference/payments/retrieve-payment-status.md).

Bu kural, kartı ABD dışında düzenlenmiş en az 250 \$'lık kart ödemelerini bloke eder.

```typescript TypeScript theme={null}
await client.paymentRules.create({
	account_id: "biz_xxxxxxxxxxxxx",
	name: "Review large orders from abroad",
	action: "review",
	conditions: {
		all: [
			{ field: "amount_in_usd", operator: "gte", value: 250 },
			{ field: "card_country", operator: "neq", value: "US" },
		],
	},
});
```

```python Python theme={null}
client.payment_rules.create(
    account_id="biz_xxxxxxxxxxxxx",
    name="Review large orders from abroad",
    action="review",
    conditions=CreatePaymentRulesRequestConditions(
        all_=[
            CreatePaymentRulesRequestConditionsAllItem(field="amount_in_usd", operator="gte", value=250),
            CreatePaymentRulesRequestConditionsAllItem(field="card_country", operator="neq", value="US"),
        ],
    ),
)
```

```ruby Ruby theme={null}
client.payment_rules.create(
  account_id: "biz_xxxxxxxxxxxxx",
  name: "Review large orders from abroad",
  action: "review",
  conditions: {
    all: [
      { field: "amount_in_usd", operator: "gte", value: 250 },
      { field: "card_country", operator: "neq", value: "US" }
    ]
  }
)
```

```rust Rust theme={null}
client
    .payment_rules
    .create(
        &CreatePaymentRulesRequest {
            name: "Review large orders from abroad".to_string(),
            action: CreatePaymentRulesRequestAction::Review,
            conditions: CreatePaymentRulesRequestConditions {
                all: vec![
                    CreatePaymentRulesRequestConditionsAllItem {
                        field: CreatePaymentRulesRequestConditionsAllItemField::AmountInUsd,
                        operator: CreatePaymentRulesRequestConditionsAllItemOperator::Gte,
                        value: PaymentRuleConditionValue::Integer(250),
                    },
                    CreatePaymentRulesRequestConditionsAllItem {
                        field: CreatePaymentRulesRequestConditionsAllItemField::CardCountry,
                        operator: CreatePaymentRulesRequestConditionsAllItemOperator::Neq,
                        value: PaymentRuleConditionValue::String("US".to_string()),
                    },
                ],
                ..Default::default()
            },
            account_id: Some("biz_xxxxxxxxxxxxx".to_string()),
            metadata: None,
        },
        None,
    )
    .await?;
```

```go Go theme={null}
_, err = client.PaymentRules.Create(context.TODO(), &whopsdk.CreatePaymentRulesRequest{
    AccountID: whopsdk.String("biz_xxxxxxxxxxxxx"),
    Name:      "Review large orders from abroad",
    Action:    whopsdk.CreatePaymentRulesRequestActionReview,
    Conditions: &whopsdk.CreatePaymentRulesRequestConditions{
        All: []*whopsdk.CreatePaymentRulesRequestConditionsAllItem{
            {
                Field:    whopsdk.CreatePaymentRulesRequestConditionsAllItemFieldAmountInUsd,
                Operator: whopsdk.CreatePaymentRulesRequestConditionsAllItemOperatorGte,
                Value:    &whopsdk.PaymentRuleConditionValue{Integer: 250},
            },
            {
                Field:    whopsdk.CreatePaymentRulesRequestConditionsAllItemFieldCardCountry,
                Operator: whopsdk.CreatePaymentRulesRequestConditionsAllItemOperatorNeq,
                Value:    &whopsdk.PaymentRuleConditionValue{String: "US"},
            },
        },
    },
})
if err != nil {
    log.Fatal(err)
}
```

```java Java theme={null}
var rule = client.paymentRules().create(
    CreatePaymentRulesRequest.builder()
        .accountId("biz_xxxxxxxxxxxxx")
        .name("Review large orders from abroad")
        .action(CreatePaymentRulesRequestAction.REVIEW)
        .conditions(CreatePaymentRulesRequestConditions.builder()
            .all(List.of(
                CreatePaymentRulesRequestConditionsAllItem.builder()
                    .field(CreatePaymentRulesRequestConditionsAllItemField.AMOUNT_IN_USD)
                    .operator(CreatePaymentRulesRequestConditionsAllItemOperator.GTE)
                    .value(PaymentRuleConditionValue.of(250))
                    .build(),
                CreatePaymentRulesRequestConditionsAllItem.builder()
                    .field(CreatePaymentRulesRequestConditionsAllItemField.CARD_COUNTRY)
                    .operator(CreatePaymentRulesRequestConditionsAllItemOperator.NEQ)
                    .value(PaymentRuleConditionValue.of("US"))
                    .build()
            ))
            .build())
        .build()
);
System.out.println(rule.getId());
```

```swift Swift theme={null}
let rule = try await client.paymentRules.create(
    request: .init(
        accountId: "biz_xxxxxxxxxxxxx",
        action: .review,
        conditions: .init(all: [
            .init(
                field: .amountInUsd,
                operator: .gte,
                value: .int(250)
            ),
            .init(
                field: .cardCountry,
                operator: .neq,
                value: .string("US")
            )
        ]),
        name: "Review large orders from abroad"
    )
)
print(rule.id)
```

```bash cURL theme={null}
curl "https://api.whop.com/api/v1/payment_rules" \
  -H "Authorization: Bearer $WHOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "biz_xxxxxxxxxxxxx",
    "name": "Review large orders from abroad",
    "action": "review",
    "conditions": {
      "all": [
        { "field": "amount_in_usd", "operator": "gte", "value": 250 },
        { "field": "card_country", "operator": "neq", "value": "US" }
      ]
    }
  }'
```

Siparişi inceledikten sonra ödeme kimliğiyle tahsil edin:

```typescript TypeScript theme={null}
await client.payments.capture({ id: "pay_xxxxxxxxxxxxx" });
```

```python Python theme={null}
client.payments.capture(id="pay_xxxxxxxxxxxxx")
```

```ruby Ruby theme={null}
client.payments.capture(id: "pay_xxxxxxxxxxxxx")
```

```rust Rust theme={null}
client.payments.capture("pay_xxxxxxxxxxxxx", None).await?;
```

```go Go theme={null}
_, err = client.Payments.Capture(context.TODO(), &whopsdk.CapturePaymentsRequest{
    ID: "pay_xxxxxxxxxxxxx",
})
if err != nil {
    log.Fatal(err)
}
```

```java Java theme={null}
client.payments().capture("pay_xxxxxxxxxxxxx");
```

```swift Swift theme={null}
_ = try await client.payments.capture(id: "pay_xxxxxxxxxxxxx")
```

```bash cURL theme={null}
curl -X POST "https://api.whop.com/api/v1/payments/pay_xxxxxxxxxxxxx/capture" \
  -H "Authorization: Bearer $WHOP_API_KEY"
```

Ya da geçersiz kılın:

```typescript TypeScript theme={null}
await client.payments.void({ id: "pay_xxxxxxxxxxxxx" });
```

```python Python theme={null}
client.payments.void(id="pay_xxxxxxxxxxxxx")
```

```ruby Ruby theme={null}
client.payments.void(id: "pay_xxxxxxxxxxxxx")
```

```rust Rust theme={null}
client.payments.void("pay_xxxxxxxxxxxxx", None).await?;
```

```go Go theme={null}
_, err = client.Payments.Void(context.TODO(), &whopsdk.VoidPaymentsRequest{
    ID: "pay_xxxxxxxxxxxxx",
})
if err != nil {
    log.Fatal(err)
}
```

```java Java theme={null}
client.payments().void_("pay_xxxxxxxxxxxxx");
```

```swift Swift theme={null}
_ = try await client.payments.void(id: "pay_xxxxxxxxxxxxx")
```

```bash cURL theme={null}
curl -X POST "https://api.whop.com/api/v1/payments/pay_xxxxxxxxxxxxx/void" \
  -H "Authorization: Bearer $WHOP_API_KEY"
```

### İnceleme sınırlamaları

* **Yalnızca oturum içi kartlar bloke edilebilir.** Apple Pay, Google Pay, banka, bakiye ve yenilemeler gibi oturum dışı ödemeler incelemeyi atlar. Eşleşme yine de `payment_rule_matches` içine kaydedilir.
* **`capture: false` ile oluşturulan ödemeler kendi takvimlerini korur.** Bir inceleme kuralı bunu asla geçersiz kılmaz.
* **Tahsilat ya hep ya hiçtir.** Bir kısmını iade etmek için sonrasında geri ödeme yapın.
* **Alıcılar siz karar vermeden önce ürüne sahip olur.** Geçersiz kılarsanız onları bilgilendirin.

## Güvenilir alıcıların önünü açık tutun

Bir `allow` kuralı, güvendiğiniz alıcıları engelleme, inceleme ve doğrulama kurallarınızdan muaf tutar.

```typescript TypeScript theme={null}
await client.paymentRules.create({
	account_id: "biz_xxxxxxxxxxxxx",
	name: "Trusted customers",
	action: "allow",
	conditions: {
		all: [
			{
				field: "customer_email",
				operator: "in",
				value: ["ava@example.com", "noah@example.com"],
			},
		],
	},
});
```

```python Python theme={null}
client.payment_rules.create(
    account_id="biz_xxxxxxxxxxxxx",
    name="Trusted customers",
    action="allow",
    conditions=CreatePaymentRulesRequestConditions(
        all_=[
            CreatePaymentRulesRequestConditionsAllItem(
                field="customer_email",
                operator="in",
                value=["ava@example.com", "noah@example.com"],
            )
        ],
    ),
)
```

```ruby Ruby theme={null}
client.payment_rules.create(
  account_id: "biz_xxxxxxxxxxxxx",
  name: "Trusted customers",
  action: "allow",
  conditions: {
    all: [
      { field: "customer_email", operator: "in", value: ["ava@example.com", "noah@example.com"] }
    ]
  }
)
```

```rust Rust theme={null}
client
    .payment_rules
    .create(
        &CreatePaymentRulesRequest {
            name: "Trusted customers".to_string(),
            action: CreatePaymentRulesRequestAction::Allow,
            conditions: CreatePaymentRulesRequestConditions {
                all: vec![CreatePaymentRulesRequestConditionsAllItem {
                    field: CreatePaymentRulesRequestConditionsAllItemField::CustomerEmail,
                    operator: CreatePaymentRulesRequestConditionsAllItemOperator::In,
                    value: PaymentRuleConditionValue::StringList(vec![
                        "ava@example.com".to_string(),
                        "noah@example.com".to_string(),
                    ]),
                }],
                ..Default::default()
            },
            account_id: Some("biz_xxxxxxxxxxxxx".to_string()),
            metadata: None,
        },
        None,
    )
    .await?;
```

```go Go theme={null}
_, err = client.PaymentRules.Create(context.TODO(), &whopsdk.CreatePaymentRulesRequest{
    AccountID: whopsdk.String("biz_xxxxxxxxxxxxx"),
    Name:      "Trusted customers",
    Action:    whopsdk.CreatePaymentRulesRequestActionAllow,
    Conditions: &whopsdk.CreatePaymentRulesRequestConditions{
        All: []*whopsdk.CreatePaymentRulesRequestConditionsAllItem{
            {
                Field:    whopsdk.CreatePaymentRulesRequestConditionsAllItemFieldCustomerEmail,
                Operator: whopsdk.CreatePaymentRulesRequestConditionsAllItemOperatorIn,
                Value: &whopsdk.PaymentRuleConditionValue{
                    StringList: []string{"ava@example.com", "noah@example.com"},
                },
            },
        },
    },
})
if err != nil {
    log.Fatal(err)
}
```

```java Java theme={null}
var rule = client.paymentRules().create(
    CreatePaymentRulesRequest.builder()
        .accountId("biz_xxxxxxxxxxxxx")
        .name("Trusted customers")
        .action(CreatePaymentRulesRequestAction.ALLOW)
        .conditions(CreatePaymentRulesRequestConditions.builder()
            .all(List.of(
                CreatePaymentRulesRequestConditionsAllItem.builder()
                    .field(CreatePaymentRulesRequestConditionsAllItemField.CUSTOMER_EMAIL)
                    .operator(CreatePaymentRulesRequestConditionsAllItemOperator.IN)
                    .value(PaymentRuleConditionValue.of(List.of("ava@example.com", "noah@example.com")))
                    .build()
            ))
            .build())
        .build()
);
System.out.println(rule.getId());
```

```swift Swift theme={null}
let rule = try await client.paymentRules.create(
    request: .init(
        accountId: "biz_xxxxxxxxxxxxx",
        action: .allow,
        conditions: .init(all: [
            .init(
                field: .customerEmail,
                operator: .`in`,
                value: .stringArray(["ava@example.com", "noah@example.com"])
            )
        ]),
        name: "Trusted customers"
    )
)
print(rule.id)
```

```bash cURL theme={null}
curl "https://api.whop.com/api/v1/payment_rules" \
  -H "Authorization: Bearer $WHOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "biz_xxxxxxxxxxxxx",
    "name": "Trusted customers",
    "action": "allow",
    "conditions": {
      "all": [
        { "field": "customer_email", "operator": "in", "value": ["ava@example.com", "noah@example.com"] }
      ]
    }
  }'
```

## Bir kuralı sıkılaştırın

Bir kuralın ne yaptığı oluşturulduktan sonra sabittir; böylece karar verdiği ödemeler, karar veren kuralı adlandırmaya devam eder. Eylemini veya koşullarını değiştirmek için kuralı [değiştirin](https://docs.whop.com/tr/api-reference/payment-rules/replace-a-payment-rule.md): eski kural silinir ve yeni bir kimliğe sahip ardılı adını, `metadata` değerini ve etkin durumunu devralır. Burada, çok fazla gerçek alıcıyı yakaladıktan sonra engelleme eşiği 85'ten 90'a yükseltilir.

```typescript TypeScript theme={null}
const successor = await client.paymentRules.replace({
	id: "prule_xxxxxxxxxxxxx",
	action: "block",
	conditions: {
		all: [
			{ field: "risk_score", operator: "gte", value: 90 },
			{ field: "card_country", operator: "neq", value: "US" },
		],
	},
});

console.log(successor.id); // a new prule_ ID
```

```python Python theme={null}
from whop_sdk.payment_rules import (
    ReplacePaymentRulesRequestConditions,
    ReplacePaymentRulesRequestConditionsAllItem,
)

successor = client.payment_rules.replace(
    id="prule_xxxxxxxxxxxxx",
    action="block",
    conditions=ReplacePaymentRulesRequestConditions(
        all_=[
            ReplacePaymentRulesRequestConditionsAllItem(field="risk_score", operator="gte", value=90),
            ReplacePaymentRulesRequestConditionsAllItem(field="card_country", operator="neq", value="US"),
        ],
    ),
)

print(successor.id)  # a new prule_ ID
```

```ruby Ruby theme={null}
successor = client.payment_rules.replace(
  id: "prule_xxxxxxxxxxxxx",
  action: "block",
  conditions: {
    all: [
      { field: "risk_score", operator: "gte", value: 90 },
      { field: "card_country", operator: "neq", value: "US" }
    ]
  }
)

puts successor.id # a new prule_ ID
```

```rust Rust theme={null}
let successor = client
    .payment_rules
    .replace(
        &"prule_xxxxxxxxxxxxx".to_string(),
        &ReplacePaymentRulesRequest {
            action: ReplacePaymentRulesRequestAction::Block,
            conditions: ReplacePaymentRulesRequestConditions {
                all: vec![
                    ReplacePaymentRulesRequestConditionsAllItem {
                        field: ReplacePaymentRulesRequestConditionsAllItemField::RiskScore,
                        operator: ReplacePaymentRulesRequestConditionsAllItemOperator::Gte,
                        value: PaymentRuleConditionValue::Integer(90),
                    },
                    ReplacePaymentRulesRequestConditionsAllItem {
                        field: ReplacePaymentRulesRequestConditionsAllItemField::CardCountry,
                        operator: ReplacePaymentRulesRequestConditionsAllItemOperator::Neq,
                        value: PaymentRuleConditionValue::String("US".to_string()),
                    },
                ],
                ..Default::default()
            },
        },
        None,
    )
    .await?;

println!("{}", successor.id); // a new prule_ ID
```

```go Go theme={null}
successor, err := client.PaymentRules.Replace(context.TODO(), &whopsdk.ReplacePaymentRulesRequest{
    ID:     "prule_xxxxxxxxxxxxx",
    Action: whopsdk.ReplacePaymentRulesRequestActionBlock,
    Conditions: &whopsdk.ReplacePaymentRulesRequestConditions{
        All: []*whopsdk.ReplacePaymentRulesRequestConditionsAllItem{
            {
                Field:    whopsdk.ReplacePaymentRulesRequestConditionsAllItemFieldRiskScore,
                Operator: whopsdk.ReplacePaymentRulesRequestConditionsAllItemOperatorGte,
                Value:    &whopsdk.PaymentRuleConditionValue{Integer: 90},
            },
            {
                Field:    whopsdk.ReplacePaymentRulesRequestConditionsAllItemFieldCardCountry,
                Operator: whopsdk.ReplacePaymentRulesRequestConditionsAllItemOperatorNeq,
                Value:    &whopsdk.PaymentRuleConditionValue{String: "US"},
            },
        },
    },
})
if err != nil {
    log.Fatal(err)
}
fmt.Println(successor.ID) // a new prule_ ID
```

```java Java theme={null}
import com.whop.api.resources.paymentrules.requests.ReplacePaymentRulesRequest;

var successor = client.paymentRules().replace(
    "prule_xxxxxxxxxxxxx",
    ReplacePaymentRulesRequest.builder()
        .action(ReplacePaymentRulesRequestAction.BLOCK)
        .conditions(ReplacePaymentRulesRequestConditions.builder()
            .all(List.of(
                ReplacePaymentRulesRequestConditionsAllItem.builder()
                    .field(ReplacePaymentRulesRequestConditionsAllItemField.RISK_SCORE)
                    .operator(ReplacePaymentRulesRequestConditionsAllItemOperator.GTE)
                    .value(PaymentRuleConditionValue.of(90))
                    .build(),
                ReplacePaymentRulesRequestConditionsAllItem.builder()
                    .field(ReplacePaymentRulesRequestConditionsAllItemField.CARD_COUNTRY)
                    .operator(ReplacePaymentRulesRequestConditionsAllItemOperator.NEQ)
                    .value(PaymentRuleConditionValue.of("US"))
                    .build()
            ))
            .build())
        .build()
);
System.out.println(successor.getId());
```

```swift Swift theme={null}
let successor = try await client.paymentRules.replace(
    id: "prule_xxxxxxxxxxxxx",
    request: .init(
        action: .block,
        conditions: .init(all: [
            .init(
                field: .riskScore,
                operator: .gte,
                value: .int(90)
            ),
            .init(
                field: .cardCountry,
                operator: .neq,
                value: .string("US")
            )
        ])
    )
)
print(successor.id)
```

```bash cURL theme={null}
curl "https://api.whop.com/api/v1/payment_rules/prule_xxxxxxxxxxxxx/replace" \
  -H "Authorization: Bearer $WHOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "block",
    "conditions": {
      "all": [
        { "field": "risk_score", "operator": "gte", "value": 90 },
        { "field": "card_country", "operator": "neq", "value": "US" }
      ]
    }
  }'
```

Bir kuralı duraklatmak için [devre dışı bırakın](https://docs.whop.com/tr/api-reference/payment-rules/deactivate-a-payment-rule.md), devam ettirmek için [etkinleştirin](https://docs.whop.com/tr/api-reference/payment-rules/activate-a-payment-rule.md). Kullanımdan kaldırmak için [silin](https://docs.whop.com/tr/api-reference/payment-rules/delete-a-payment-rule.md). Kural `status: "deleted"` ile okunabilir kalır.

## Etkiyi ölçün

Her ödeme, kendisiyle eşleşen kuralları o sırada kuralın sahip olduğu adla birlikte `payment_rule_matches` içinde listeler.

```json theme={null}
{
	"id": "pay_xxxxxxxxxxxxx",
	"substatus": "blocked",
	"risk_score": 91,
	"payment_rule_matches": [
		{
			"id": "prule_xxxxxxxxxxxxx",
			"name": "Block high-risk cards from outside the US",
			"action": "block"
		}
	]
}
```

Hiçbir eşleşmesi olmayan ödemelere gelen itirazlar, bir kuralın çok dar olduğu anlamına gelir. Kaybettiğinizden çok daha fazla ödemeyle eşleşen bir kural ise çok geniştir. Zaman içindeki toplamlar için [Stats API](https://docs.whop.com/tr/developer/guides/stats.md) metrikleri `payment_rule_matches` ve `payment_rule_matched_volume`, `payment_rule_ids` veya `action` bazında ayrıştırılır.

## Sonraki adımlar

> [card] [Payment Rules referansı](https://docs.whop.com/tr/api-reference/payment-rules/list-payment-rules.md)
>
> Her uç nokta, parametre ve yanıt alanı.

> [card] [İadeler ve itirazlar](https://docs.whop.com/tr/developer/guides/refunds-and-disputes.md)
>
> Yine de gerçekleşen ters ibrazlara yanıt verin.


## Related topics

- [Ödemelere Genel Bakış](https://docs.whop.com/tr/developer/payments/overview.md)
- [Faturalar](https://docs.whop.com/tr/developer/guides/invoices.md)
- [Whop CLI Komutları](https://docs.whop.com/tr/cli/commands.md)
