---
updatedAt: 2026-07-06T22:28:57.000Z
---

Fetch the complete documentation index at: https://developers.pismo.io/pismo-docs/llms.txt. Use this file to discover all available pages before exploring further.

# Replace rule model

Replace the rule model identified in the path.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Core platform - Rule models",
    "description": "Manage rule models",
    "contact": {
      "name": "API Support",
      "url": "https://developers.pismo.io/support/"
    },
    "license": {
      "name": "Copyright Pismo"
    },
    "version": "1.37.0"
  },
  "servers": [
    {
      "url": "https://sandbox.pismolabs.io/processing-code",
      "description": "Sandbox API server for testing"
    }
  ],
  "tags": [
    {
      "name": "Model",
      "description": "Endpoints for rule model management."
    }
  ],
  "components": {
    "parameters": {
      "ModelIdPath": {
        "name": "modelId",
        "description": "Model ID",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "example": "b3f53d8f-6812-4869-b17a-874d78750cc6"
      }
    },
    "schemas": {
      "BadRequestError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "example": "PC0001",
            "description": "Error code"
          },
          "message": {
            "type": "string",
            "example": "Invalid request payload",
            "description": "Error message"
          }
        }
      },
      "Condition": {
        "type": "object",
        "required": [
          "type",
          "operator",
          "data"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ModelListType"
          },
          "operator": {
            "type": "string",
            "example": "eq",
            "description": "Operator that will be used on this rule evaluation\n- `eq`: Equals operator, allowed with rules that evaluate data containing strings, numbers, and booleans.\n- `neq`: Not equals operator, allowed with rules that evaluate data containing strings, numbers, and booleans.\n- `gt`: Greater than operator, allowed with rules that evaluate data containing numbers.\n- `gte`: Greater than or equal operator, allowed with rules that evaluate data containing numbers.\n- `lt`: Less than operator, allowed with rules that evaluate data containing numbers.\n- `lte`: Less than or equal operator, allowed with rules that evaluate data containing numbers.\n- `in`: In operator, allowed with rules that use model list as data. Compares if the data is in the configured list.\n- `contains`: Contains operator, allowed with rules that use model list as data. Compares if the data is part of any string in the configured list.\n- `starts_with`: Starts with operator, allowed with rules that use model list as data. Verifies whether any string in the list starts with the data value.\n- `ends_with`: Ends with operator, allowed with rules that use model list as data. Verifies whether any string in the list ends with the data value.\n",
            "enum": [
              "eq",
              "neq",
              "gt",
              "gte",
              "lt",
              "lte",
              "in",
              "contains",
              "starts_with",
              "ends_with"
            ]
          },
          "data": {
            "type": "string",
            "example": "10",
            "description": "Data used to evaluate this rule against the operator and the information received in the request.\n\nThis field must be in the format as indicated in `type` and `operator`.\n\n**Note:** This field's value can be a model list ID returned from [Create model list](https://developers.pismo.io/pismo-docs/reference/post-org-model-list). A model list contains a list of values for evaluation. \n"
          }
        }
      },
      "InternalServerError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "example": "PC0002",
            "description": "Error code"
          },
          "message": {
            "type": "string",
            "example": "An unexpected error happened.",
            "description": "Error message"
          }
        }
      },
      "ModelListType": {
        "type": "string",
        "example": "MERCHANT_NAME_LIST",
        "description": "List types and data formats allowed:<br />\n    - `INSTALLMENT_NUMBER` - Integer values<br />\n    - `PROCESSING_CODE` - Alphanumeric strings<br />\n    - `ACCOUNT_TYPE` - Alphanumeric strings<br />\n    - `ORIGIN`- Alphanumeric strings<br />\n    - `DCC`-  Boolean values<br />\n    - `DOMESTIC`-  Boolean values<br />\n    - `MERCHANT_NAME_LIST` - Alphanumeric strings<br />\n    - `INSTALLMENT_PLAN` - Alphanumeric strings<br />\n    - `AMOUNT` - Numbers with or without decimal places<br />\n    - `MERCHANT_CATEGORY_CODE` - Alphanumeric strings<br />\n    - `REVERSAL_INDICATOR` - Boolean values<br />\n    - `AUTHORIZATION_FLOW` - Either `PAYMENTS` or `NETWORK`<br />\n    - `ORIGINAL_PROCESSING_CODE`- Original processing code or persisted authorization processing code<br />\n    - `MTI` - Message Type Indicator (MTI) - a four-digit numeric field - ISO 8583 standard<br />\n",
        "enum": [
          "INSTALLMENT_NUMBER",
          "PROCESSING_CODE",
          "ACCOUNT_TYPE",
          "ORIGIN",
          "DCC",
          "DOMESTIC",
          "MERCHANT_NAME_LIST",
          "INSTALLMENT_PLAN",
          "AMOUNT",
          "MERCHANT_CATEGORY_CODE",
          "REVERSAL_INDICATOR",
          "AUTHORIZATION_FLOW",
          "ORIGINAL_PROCESSING_CODE",
          "MTI"
        ]
      },
      "ModelPayload": {
        "type": "object",
        "required": [
          "rules"
        ],
        "properties": {
          "rules": {
            "type": "array",
            "description": "Processing code rules configuration array.",
            "items": {
              "$ref": "#/components/schemas/Rule"
            }
          },
          "name": {
            "type": "string",
            "description": "Model name",
            "example": "Model name"
          }
        }
      },
      "NotFoundError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "example": "PC0004",
            "description": "Error code"
          },
          "message": {
            "type": "string",
            "example": "Validation error: Item not found.",
            "description": "Error message"
          }
        }
      },
      "Rule": {
        "type": "object",
        "required": [
          "processing_code",
          "order",
          "conditions"
        ],
        "properties": {
          "processing_code": {
            "type": "string",
            "example": "00",
            "description": "Processing code to use when the rule condition is met and it is a domestic transaction.\n"
          },
          "order": {
            "$ref": "#/components/schemas/RuleOrder"
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Condition"
            },
            "description": "Conditions that need to be `true` to assign the processing code."
          },
          "name": {
            "$ref": "#/components/schemas/RuleName"
          },
          "international_processing_code": {
            "type": "string",
            "example": "003100",
            "description": "Processing code to use when the rule condition is met and it is an international transaction. If this is an international transaction and this field is not passed, the `processing_code` field is used instead.\n"
          }
        }
      },
      "RuleName": {
        "type": "string",
        "description": "Rule name",
        "example": "Rule name example"
      },
      "RuleOrder": {
        "type": "integer",
        "description": "Rule evaluation order, `1` being the highest.",
        "example": 1
      }
    },
    "responses": {
      "400BadRequest": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BadRequestError"
            }
          }
        }
      },
      "404NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/NotFoundError"
            }
          }
        }
      },
      "500InternalServerError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/InternalServerError"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/models/{modelId}": {
      "put": {
        "tags": [
          "Model"
        ],
        "summary": "Replace rule model",
        "description": "Replace the rule model identified in the path.",
        "operationId": "put-rule-model",
        "parameters": [
          {
            "$ref": "#/components/parameters/ModelIdPath"
          }
        ],
        "requestBody": {
          "description": "Parameters to replace a given rule model",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelPayload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "No content"
          },
          "400": {
            "$ref": "#/components/responses/400BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/404NotFound"
          },
          "500": {
            "$ref": "#/components/responses/500InternalServerError"
          }
        }
      }
    }
  }
}
```