---
title: "Replace a payment rule"
method: POST
path: "/payment_rules/{id}/replace"
tags: ["Payment Rules"]
---

# Replace a payment rule

`POST /payment_rules/{id}/replace`

Deletes this rule and creates its successor in one step. The successor carries a new ID and the metadata of the rule it replaced,.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `action` 'allow' | 'block' | 'enforce_3ds', required — What happens to a payment when every condition matches. An `allow` overrides this account's other rules only, never Whop's own fraud controls. An `enforce_3ds` is skipped where the payment cannot carry a challenge.
  - `conditions` object, required — The conditions a payment is matched against. Up to 10 conditions, and 8 KiB once serialized.
    - `all` object[], required
      - `field` 'risk_score' | 'card_country' | 'customer_email', required — The payment attribute this condition reads.
      - `operator` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'starts_with' | 'ends_with', required — How the payment attribute is compared to the value.
      - `value` union, required — The value to compare against. A number for `risk_score`, a string for the other fields, and an array of strings for the `in` and `not_in` operators.
        - integer
        - string
        - string[]

## Response `201`

The rule that replaced this one

- PaymentRule
  - `account_id` string, required — Account ID, prefixed `biz_`.
  - `action` 'allow' | 'block' | 'enforce_3ds', required — What happens to a payment when every condition matches. An `allow` overrides this account's other rules only, never Whop's own fraud controls. An `enforce_3ds` is skipped where the payment cannot carry a challenge.
  - `conditions` PaymentRuleConditions, required
    - `all` PaymentRuleCondition[], required
      - `field` 'risk_score' | 'card_country' | 'customer_email', required — The payment attribute this condition reads.
      - `operator` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'starts_with' | 'ends_with', required — How the payment attribute is compared to the value.
      - `value` union, required — The value to compare against. A number for `risk_score`, a string for the other fields, and an array of strings for the `in` and `not_in` operators.
        - integer
        - string
        - string[]
  - `created_at` string, required — When the rule was created, as an ISO 8601 timestamp.
  - `deleted_at` string, nullable, required — When the rule was deleted, as an ISO 8601 timestamp. `null` unless `status` is `deleted`.
  - `id` string, required — Payment rule ID, prefixed `prule_`.
  - `metadata` object, required — Custom string-to-string values for your integration. Maximum 50 keys, 40 characters per key, 500 characters per value.
  - `name` string, required — A name for this rule. Up to 255 characters.
  - `status` 'active' | 'inactive' | 'deleted', required — Whether the rule is applied to payments. A `deleted` rule is kept so the payments it already decided still name it.
  - `updated_at` string, required — When the rule was last changed, as an ISO 8601 timestamp.

## Other responses

- `409` — Conflict

## Changes

> 60 revisions in range; 1 not diffed.

- **2026-09-16** `ff3a76573563` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/whop/apis/whop-api/changes/payment_rules/:id/replace/post.md)

---

[API](https://skmtc.dev/whop/apis/whop-api.md) · [All operations](https://skmtc.dev/whop/apis/whop-api/llms.txt) · [OpenAPI document](https://skmtc.dev/whop/apis/whop-api/revisions/ff3a76573563?raw)
