Skip to main content
POST
/
v1
/
settlement-rules
Create a settlement rule
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    label: '<string>',
    splits: [
      {
        share: '<string>',
        ledgerAccountCode: '<string>',
        counterpartyId: '<string>',
        minimumCents: 123,
        maximumCents: 123
      }
    ],
    description: '<string>',
    substrate: '<string>',
    appliesToScope: '<string>',
    currency: 'GBP',
    activeFrom: '2023-11-07T05:31:56Z',
    activeUntil: '2023-11-07T05:31:56Z',
    createdBy: '<string>',
    activateOnCreate: false
  })
};

fetch('https://sandbox.api.enfinitos.com/v1/settlement-rules', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "ok": true,
  "data": {
    "rule": {
      "id": "<string>",
      "orgId": "<string>",
      "version": 123,
      "label": "<string>",
      "description": "<string>",
      "activeFrom": "2023-11-07T05:31:56Z",
      "activeUntil": "2023-11-07T05:31:56Z",
      "supersedesRuleId": "<string>",
      "supersededByRuleId": "<string>",
      "splits": [
        {
          "share": "<string>",
          "ledgerAccountCode": "<string>",
          "counterpartyId": "<string>",
          "minimumCents": 123,
          "maximumCents": 123
        }
      ],
      "targeting": {
        "currency": "<string>",
        "substrates": [
          "<string>"
        ],
        "counterpartyIds": [
          "<string>"
        ],
        "appliesToScope": "<string>",
        "minimumAmountCents": 123,
        "maximumAmountCents": 123
      },
      "taxConfig": {
        "withholdingApplies": true,
        "passThroughFeeLedgerCodes": [
          "<string>"
        ],
        "vatRate": "<string>"
      },
      "createdBy": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "approvedBy": "<string>",
      "approvedAt": "2023-11-07T05:31:56Z",
      "approvalNotes": "<string>"
    }
  },
  "contractVersion": "<string>"
}

Authorizations

Authorization
string
header
required

API key sent as Authorization: Bearer <api-key>.

Body

application/json
label
string
required

Operator-facing label (required, non-empty).

splits
object[]
required

Party splits; shares must sum to exactly "1".

description
string | null
targeting
object

Optional targeting block. If omitted, a targeting block is synthesised from the top-level substrate, appliesToScope, and currency fields.

substrate
string | null

Convenience — seeds targeting.substrates when targeting is omitted.

appliesToScope
string | null

Convenience — seeds targeting.appliesToScope when targeting is omitted.

currency
string
default:GBP

ISO 4217 currency (upper-cased). Defaults to GBP.

activeFrom
string<date-time>

Defaults to now. A future value yields SCHEDULED when activated on create.

activeUntil
string<date-time> | null
createdBy
string

Author attribution. Defaults to "developer".

activateOnCreate
boolean
default:false

When true, create the rule ACTIVE (or SCHEDULED if activeFrom is in the future).

Response

The created rule.

ok
boolean
required
data
object
required

Route-specific payload. Operation responses refine this.

contractVersion
string
required
Allowed value: "v1.0"