---
title: "Propose field checks for the payment rules"
method: POST
path: "/v1/ap/rules/compile"
tags: ["Accounts Payable"]
---

# Propose field checks for the payment rules

`POST /v1/ap/rules/compile`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/ap/rules/compile`
- Auth: HTTP bearer

For every payment rule still checked in `heavy` mode (or only those in `rule_ids`, up to 100 per call, so a long list can be sent in parts), proposes a field check: a test over the invoice, purchase order, delivery note and contract fields that can decide the rule without reading the documents. A proposal is kept unconfirmed until a person puts it in force; a rule that needs its documents read stays `heavy` and says why. A rule with a proposal already kept answers with it again.

## Request body

- ApRuleCompileInput
  - `locale` string: The language the checks' wording is written in (de, en, es, fr, it, pt; English otherwise).
  - `rule_ids` string[]: Only these rules; every `heavy` rule when absent.

## Response `201`

One proposal per rule.

- ComplianceRuleProposal[]
  - union: What proposing a field check for a rule returns.
    - object
      - `rule_id` string, uuid, required
      - `status` 'check', required
      - `check` ComplianceRuleCheckView, required: A field check as a person reads it.
        - `readback` object, nullable: The check restated in plain language.
          - `headline` string
          - `body` string
          - `outcomes` object: One sentence per outcome, for a reviewer.
            - `passed` string
            - `failed` string
            - `unclear` string
        - `fields` string[]: The fields the check reads; fields of linked documents as `alias.field`.
    - object
      - `rule_id` string, uuid, required
      - `status` 'heavy', required
      - `reason` string, required: Why the rule needs its documents read.

## Other responses

- `400`: The request is invalid.
- `401`: Missing or invalid API key.
- `403`: The API key does not have the required scope.
- `404`: The requested resource was not found.
- `409`: The app is switched off in this workspace, or a rule named is already checked by its fields.
- `502`: Checks cannot be proposed right now; try again.

## Changes

- **2026-11-26** `622d429de7ea`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/ap/rules/compile/post.md)

---

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