Skip to main content
POST
/
statements
/
periods
/
notify
Publish closed-period statements to members
curl --request POST \
  --url https://api.royalti.io/statements/periods/notify \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "periodStart": "2023-12-25",
  "periodEnd": "2023-12-25",
  "force": false,
  "includeZero": false
}
'
import requests

url = "https://api.royalti.io/statements/periods/notify"

payload = {
"periodStart": "2023-12-25",
"periodEnd": "2023-12-25",
"force": False,
"includeZero": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
periodStart: '2023-12-25',
periodEnd: '2023-12-25',
force: false,
includeZero: false
})
};

fetch('https://api.royalti.io/statements/periods/notify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.royalti.io/statements/periods/notify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'periodStart' => '2023-12-25',
'periodEnd' => '2023-12-25',
'force' => false,
'includeZero' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.royalti.io/statements/periods/notify"

payload := strings.NewReader("{\n \"periodStart\": \"2023-12-25\",\n \"periodEnd\": \"2023-12-25\",\n \"force\": false,\n \"includeZero\": 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://api.royalti.io/statements/periods/notify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"periodStart\": \"2023-12-25\",\n \"periodEnd\": \"2023-12-25\",\n \"force\": false,\n \"includeZero\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.royalti.io/statements/periods/notify")

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 \"periodStart\": \"2023-12-25\",\n \"periodEnd\": \"2023-12-25\",\n \"force\": false,\n \"includeZero\": false\n}"

response = http.request(request)
puts response.read_body
{
  "message": "<string>",
  "data": {
    "queued": 123,
    "total": 123,
    "skipped": {
      "notClosed": 123,
      "zero": 123,
      "alreadyNotified": 123,
      "noEmail": 123
    }
  }
}
{
"status": "error",
"message": "Unauthorized"
}

Description

Notify period statements Deliberate, decoupled publish step: after an admin closes a period (POST /statements/periods/close) and reviews it, this call emails each eligible member their statement (portal link + PDF attachment) and raises an in-app notification. Per-member delivery is queued on statementNotificationQueue — the response reports how many were queued, not delivered. Only closed statements (persisted rows, not ledger-fallback) are eligible. A member is skipped and counted under:
  • notClosed — statement status is not closed
  • zero — net and due are both zero and includeZero is not set
  • alreadyNotifiedlastNotifiedAt is set and force is not set
  • noEmail — the member has no email on file
Authorization:
  • Required role: admin or higher

Code Examples

const response = await fetch('https://api.royalti.io/statements/periods/notify', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "periodStart": "2024-01-21",
    "periodEnd": "2024-01-21",
    "force": true,
    "includeZero": true
  })
});

const data = await response.json();
console.log(data);
import requests

response = requests.post(
  'https://api.royalti.io/statements/periods/notify',
  json={"periodStart":"2024-01-21","periodEnd":"2024-01-21","force":true,"includeZero":true}
)

data = response.json()
print(data)
curl -X POST https://api.royalti.io/statements/periods/notify \
  -H "Content-Type: application/json" \
  -d '{"periodStart":"2024-01-21","periodEnd":"2024-01-21","force":true,"includeZero":true}'

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Body

application/json
periodStart
string<date>
required
periodEnd
string<date>
required
force
boolean
default:false

Re-notify members already marked lastNotifiedAt.

includeZero
boolean
default:false

Notify members with zero net/due for the period.

Response

Notifications queued.

Every statements response wraps the payload in { status, message, data }. data carries the per-endpoint payload PLUS the per-tenant feature flag.

status
enum<string>
Available options:
success,
error
message
string
data
object