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));import requests
url = "https://sandbox.api.enfinitos.com/v1/settlement-rules"
payload = {
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.enfinitos.com/v1/settlement-rules"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"splits\": [\n {\n \"share\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"counterpartyId\": \"<string>\",\n \"minimumCents\": 123,\n \"maximumCents\": 123\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.api.enfinitos.com/v1/settlement-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"splits\": [\n {\n \"share\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"counterpartyId\": \"<string>\",\n \"minimumCents\": 123,\n \"maximumCents\": 123\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.enfinitos.com/v1/settlement-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"splits\": [\n {\n \"share\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"counterpartyId\": \"<string>\",\n \"minimumCents\": 123,\n \"maximumCents\": 123\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}"
response = http.request(request)
puts response.read_bodyfalsecurl --request POST \
--url https://sandbox.api.enfinitos.com/v1/settlement-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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
}
'{
"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>"
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}Create a settlement rule
Create a settlement rule governing how a meter’s gross is split between parties. Rules are created DRAFT by default; pass activateOnCreate: true to go straight to ACTIVE/SCHEDULED. Splits’ shares must sum to exactly 1. Requires scope settlement:write.
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));import requests
url = "https://sandbox.api.enfinitos.com/v1/settlement-rules"
payload = {
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.enfinitos.com/v1/settlement-rules"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"splits\": [\n {\n \"share\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"counterpartyId\": \"<string>\",\n \"minimumCents\": 123,\n \"maximumCents\": 123\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.api.enfinitos.com/v1/settlement-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"splits\": [\n {\n \"share\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"counterpartyId\": \"<string>\",\n \"minimumCents\": 123,\n \"maximumCents\": 123\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.enfinitos.com/v1/settlement-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"splits\": [\n {\n \"share\": \"<string>\",\n \"ledgerAccountCode\": \"<string>\",\n \"counterpartyId\": \"<string>\",\n \"minimumCents\": 123,\n \"maximumCents\": 123\n }\n ],\n \"description\": \"<string>\",\n \"substrate\": \"<string>\",\n \"appliesToScope\": \"<string>\",\n \"currency\": \"GBP\",\n \"activeFrom\": \"2023-11-07T05:31:56Z\",\n \"activeUntil\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"activateOnCreate\": false\n}"
response = http.request(request)
puts response.read_bodyfalsecurl --request POST \
--url https://sandbox.api.enfinitos.com/v1/settlement-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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
}
'{
"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>"
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": true,
"message": "<string>",
"contractVersion": "<string>",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}Authorizations
API key sent as Authorization: Bearer <api-key>.
Body
Operator-facing label (required, non-empty).
Party splits; shares must sum to exactly "1".
Show child attributes
Show child attributes
Optional targeting block. If omitted, a targeting block is synthesised from the top-level substrate, appliesToScope, and currency fields.
Show child attributes
Show child attributes
Convenience — seeds targeting.substrates when targeting is omitted.
Convenience — seeds targeting.appliesToScope when targeting is omitted.
ISO 4217 currency (upper-cased). Defaults to GBP.
Defaults to now. A future value yields SCHEDULED when activated on create.
Author attribution. Defaults to "developer".
When true, create the rule ACTIVE (or SCHEDULED if activeFrom is in the future).