The billing export script generates a compressed archive of billing data from your Synqly instance. This archive is sent to Synqly for monthly, quarterly, or yearly billing reconciliation.
Export the previous month's billing data:
./scripts/billing-export.sh \
--url https://synqly.example.com \
--user admin \
--token-file ~/.synqly-token \
--password-file ~/.synqly-passExport a specific month:
./scripts/billing-export.sh \
--url https://synqly.example.com \
--user admin \
--month 2026-01The script requires curl, jq, tar, and gzip to be available on your system. If any of these are missing, the script will report which dependencies need to be installed before proceeding.
You will need administrative credentials for your Synqly instance, including the root token and a username and password with administrative permissions.
These credentials are configured in your helm chart's values.yaml file.
Root Token is configured at global.root.credentials.rootToken, or referenced from a Kubernetes Secret via global.root.secretRef. Generate one with openssl rand -base64 32.
Admin Username and Password are configured at global.organizationAdmin.default.credentials, or referenced from Kubernetes Secrets via global.organizationAdmin.default.secretRef.
The script supports several methods for providing credentials.
The root token can be provided through these methods (in order of precedence):
--tokenpasses the token directly, but it will appear in shell history.SYNQLY_TOKENenvironment variable.--token-filereads the token from the first line of a file. Recommended for automation.- Interactive prompt when running in a terminal with no token provided.
The password follows a similar precedence, with an additional option for piped input:
--passwordpasses the password directly (appears in shell history).SYNQLY_PASSWORDenvironment variable.--password-filereads the password from the first line of a file.- Piped input for integration with secret managers:
vault read -field=password secret/synqly | ./billing-export.sh ... - Interactive prompt when running in a terminal with no password provided.
By default, the script exports billing data for the previous calendar month. You can override this behavior to export a specific month or a range of months.
Use --month to export a single month. The value can be either a YYYY-MM format or a month name:
--month 2026-01
--month januaryMonth names are case-insensitive. When using a month name without a year, the script assumes the most recent occurrence of that month. For example, running the script in January 2026 with --month march will export March 2025, since March 2026 has not yet occurred.
Use --from and --to together to export multiple months:
--from 2025-10 --to 2026-01
--from october --to januaryBoth flags must be specified when exporting a range. The range is inclusive of both endpoints.
If your time period includes the current month, the script will display a warning that the data may be incomplete since the month is still in progress.
The script produces a compressed tar archive named synqly-billing-export-YYYY-MM-DD-HHMMSS.tar.gz containing:
- A CSV file for each exported month, named like
2026-january.csv - A
metadata.jsonfile with export details including the Synqly version, source URL, and list of included months - An
export.logfile with timestamps of each operation performed during the export
The CSV files contain one row per integration, with a Deleted column indicating whether the integration was deleted during the billing period.
Use --output to specify the destination directory for the archive. The default is the current working directory.
Email the export archive to monthlyusagereport@synqly.com. The subject line should include your company name and the reporting period. The script outputs the date range at the end of execution for easy reference.
Example subject line:
Acme Corp: 2026-januaryOr for multi-month reports:
Acme Corp: 2025-october to 2026-januaryNo message body is required. You can just attach the archive file.
Install the missing tools listed in the error message. On most systems, these are available through the standard package manager.
Both the instance URL and admin username must be provided.
The script could not obtain credentials through any of the supported methods. Ensure you are providing credentials through one of the methods described above.
The path specified with --token-file or --password-file does not exist or is not readable.
The credentials were rejected by the Synqly instance. Verify that the root token is valid and the username and password are correct.
Use either --month for a single month or --from/--to for a range, but not both.
When specifying a range, both endpoints must be provided.
No billing records were found for the specified month. This may be expected for new deployments or months with no activity.
Credential files should have restrictive permissions (readable only by the user running the script). Avoid using the --password or --token command-line flags in scripts or automation, as these values may be captured in shell history or process listings.
The --insecure flag disables SSL certificate verification. Use this only when connecting to instances with self-signed certificates in controlled environments, and never in production.
The generated archive contains billing metadata including organization identifiers and usage counts. It does not contain customer data, credentials, or API keys.