---
title: "Create an autorouting rule"
method: POST
path: "/accounting/v1.0/folios/rules"
tags: ["Folio Configuration"]
---

# Create an autorouting rule

`POST /accounting/v1.0/folios/rules`

## Request

- Base URL: `https://api.cloudbeds.com`
- URL: `https://api.cloudbeds.com/accounting/v1.0/folios/rules`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Implicit: `https://hotels.cloudbeds.com/api/v1.2/oauth`

Create a new autorouting rule for a group profile. The rule defines which transaction types are automatically routed from reservations to a group profile folio.

## Headers

- `X-Property-ID` integer, required

## Request body

- CreateRoutingRuleRequest
  - `sourceId` integer, required: Group Profile ID
  - `sourceKind` 'GROUP_PROFILE': Deprecated. Defaults to GROUP_PROFILE if not provided.
  - `subSourceId` integer: Allotment Block ID. Null for group-level rules, required for block-level rules.
  - `rules` RoutingRuleEntryRequest[], required: Rule entries. For group-level rules provide exactly one entry (no folioId). For block-level rules provide one entry per target folio.
    - `enabled` boolean, required: Whether this rule entry is enabled
    - `folioId` integer: Target folio ID. Required for block-level rule entries (when the outer subSourceId is set). Must be omitted for group-level rule entries.
    - `routeChildrenTypes` RouteChildrenType[], required: Child transaction types that should follow their parent to the same folio
    - `transactionTypes` RoutingRuleTransactionTypeRequest[], required: Transaction types that this entry routes
      - `externalRelationKind` 'ROOM' | 'PAYMENT' | 'ITEM' | 'ITEM_POS' | 'ADDON' | 'RESERVATION' | 'ACCOUNTS_RECEIVABLE' | 'ROOM_REVENUE' | 'TAX' | 'FEE' | 'ADJUSTMENT' | 'PAYMENT_FEE' | 'BOOKABLE_RESOURCE' | 'CHANNEL_COMMISSION' | 'CITY_LEDGER' | 'GRATUITY' | 'CHECK_ITEM' | 'CHECK_SERVICE_CHARGE' | 'CHECK_DISCOUNT' | 'CHANNEL_COMMISSION_MANUAL': Kind of the external relation
      - `originId` string: Origin ID for the transaction type (e.g., fee ID, tax ID)

## Response `201`

Created

- RoutingRuleResponse
  - `propertyId` string: Property ID
  - `sourceId` string: Group Profile ID
  - `sourceKind` 'GROUP_PROFILE': Deprecated. Defaults to GROUP_PROFILE if not provided.
  - `subSourceId` string: Allotment Block ID. Null for group-level rules.
  - `rules` RoutingRuleEntryResponse[]: Rule entries. For group-level rules this contains exactly one entry (no folioId). For block-level rules each entry targets a different folio.
    - `id` string: Rule entry ID
    - `enabled` boolean: Whether this rule entry is enabled
    - `folioId` string: Target folio ID for this entry
    - `routeChildrenTypes` RouteChildrenType[]: Child transaction types that follow their parent to the same folio
    - `transactionTypes` RoutingRuleTransactionTypeResponse[]: Transaction types this entry routes
      - `externalRelationKind` 'ROOM' | 'PAYMENT' | 'ITEM' | 'ITEM_POS' | 'ADDON' | 'RESERVATION' | 'ACCOUNTS_RECEIVABLE' | 'ROOM_REVENUE' | 'TAX' | 'FEE' | 'ADJUSTMENT' | 'PAYMENT_FEE' | 'BOOKABLE_RESOURCE' | 'CHANNEL_COMMISSION' | 'CITY_LEDGER' | 'GRATUITY' | 'CHECK_ITEM' | 'CHECK_SERVICE_CHARGE' | 'CHECK_DISCOUNT' | 'CHANNEL_COMMISSION_MANUAL': Kind of the external relation
      - `originId` string: Origin ID for the transaction type (e.g., fee ID, tax ID)

## Other responses

- `400`: Bad Request

---

[API](https://skmtc.dev/cloudbeds/apis/accounting-api.md) - [All operations](https://skmtc.dev/cloudbeds/apis/accounting-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cloudbeds/apis/accounting-api/revisions/0b58c698deef?raw)
