Confirm accounting/sale periods for a session
curl --request PUT \
--url https://api.royalti.io/source-creator/sessions/{id}/periods \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountingPeriod": "202501",
"salePeriod": "202501",
"hasSalePeriod": false,
"decimalSeparator": "<string>"
}
'import requests
url = "https://api.royalti.io/source-creator/sessions/{id}/periods"
payload = {
"accountingPeriod": "202501",
"salePeriod": "202501",
"hasSalePeriod": False,
"decimalSeparator": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountingPeriod: '202501',
salePeriod: '202501',
hasSalePeriod: false,
decimalSeparator: '<string>'
})
};
fetch('https://api.royalti.io/source-creator/sessions/{id}/periods', 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/source-creator/sessions/{id}/periods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'accountingPeriod' => '202501',
'salePeriod' => '202501',
'hasSalePeriod' => false,
'decimalSeparator' => '<string>'
]),
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/source-creator/sessions/{id}/periods"
payload := strings.NewReader("{\n \"accountingPeriod\": \"202501\",\n \"salePeriod\": \"202501\",\n \"hasSalePeriod\": false,\n \"decimalSeparator\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.royalti.io/source-creator/sessions/{id}/periods")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountingPeriod\": \"202501\",\n \"salePeriod\": \"202501\",\n \"hasSalePeriod\": false,\n \"decimalSeparator\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/source-creator/sessions/{id}/periods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountingPeriod\": \"202501\",\n \"salePeriod\": \"202501\",\n \"hasSalePeriod\": false,\n \"decimalSeparator\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Periods confirmed successfully",
"data": {
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountingPeriod": "202501",
"salePeriod": "<string>",
"hasSalePeriod": true
}
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "This feature requires a plan upgrade",
"data": {
"feature": "royaltyAccess",
"currentPlan": "FREE",
"availablePlans": [
{}
]
}
}{
"status": "error",
"message": "<string>"
}Source Creator
Confirm accounting/sale periods for a session
PUT /source-creator/sessions//periods
PUT
/
source-creator
/
sessions
/
{id}
/
periods
Confirm accounting/sale periods for a session
curl --request PUT \
--url https://api.royalti.io/source-creator/sessions/{id}/periods \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountingPeriod": "202501",
"salePeriod": "202501",
"hasSalePeriod": false,
"decimalSeparator": "<string>"
}
'import requests
url = "https://api.royalti.io/source-creator/sessions/{id}/periods"
payload = {
"accountingPeriod": "202501",
"salePeriod": "202501",
"hasSalePeriod": False,
"decimalSeparator": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountingPeriod: '202501',
salePeriod: '202501',
hasSalePeriod: false,
decimalSeparator: '<string>'
})
};
fetch('https://api.royalti.io/source-creator/sessions/{id}/periods', 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/source-creator/sessions/{id}/periods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'accountingPeriod' => '202501',
'salePeriod' => '202501',
'hasSalePeriod' => false,
'decimalSeparator' => '<string>'
]),
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/source-creator/sessions/{id}/periods"
payload := strings.NewReader("{\n \"accountingPeriod\": \"202501\",\n \"salePeriod\": \"202501\",\n \"hasSalePeriod\": false,\n \"decimalSeparator\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.royalti.io/source-creator/sessions/{id}/periods")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountingPeriod\": \"202501\",\n \"salePeriod\": \"202501\",\n \"hasSalePeriod\": false,\n \"decimalSeparator\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/source-creator/sessions/{id}/periods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountingPeriod\": \"202501\",\n \"salePeriod\": \"202501\",\n \"hasSalePeriod\": false,\n \"decimalSeparator\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Periods confirmed successfully",
"data": {
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountingPeriod": "202501",
"salePeriod": "<string>",
"hasSalePeriod": true
}
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "This feature requires a plan upgrade",
"data": {
"feature": "royaltyAccess",
"currentPlan": "FREE",
"availablePlans": [
{}
]
}
}{
"status": "error",
"message": "<string>"
}This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
PUT /source-creator/sessions//periods Description: Confirms the accounting period (required, YYYYMM) and optional sale period for the session’s file, and optionally overrides the detected decimal separator. Persisted on the session’sfileAnalysis JSONB
and used later by generate-queries and save when deriving the
BigQuery table-name format and versioning start date.
Authorization:
- Required role:
adminor higher
Code Examples
const response = await fetch('https://api.royalti.io/source-creator/sessions/example-id/periods', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"ref": "#/components/schemas/ConfirmPeriodsRequest"
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.put(
'https://api.royalti.io/source-creator/sessions/example-id/periods',
headers={
'Authorization': f'Bearer {token}'
},
json={"ref":"#/components/schemas/ConfirmPeriodsRequest"}
)
data = response.json()
print(data)
curl -X PUT https://api.royalti.io/source-creator/sessions/example-id/periods \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"ref":"#/components/schemas/ConfirmPeriodsRequest"}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Path Parameters
Session ID
Body
application/json
YYYYMM
Pattern:
^\d{4}(0[1-9]|1[0-2])$Example:
"202501"
Pattern:
^\d{4}(0[1-9]|1[0-2])$Example:
"202501"
Whether this source uses a separate sale period in table names.
Optional override of the auto-detected decimal separator ("," or ".").