Outcome
Set accounting, invoice identity and invoice approval-automation settings. Automatic payment links require automatic customer pages and a workspace-authorised Topolo Pay merchant.
Before you start
- Verify the intended environment, authenticated identity and specifically approved organization context.
- The published application permission is settings:write. Discover the exact granted canonical Books workspace and bind it separately from action input.
- Approve the actual mutation, accounting inputs and any provider/recipient effects before CLI --confirm or MCP confirm:true. Fixture identifiers and simulated provider responses authorize no live operation.
Discover the target
topolo whoami --json
topolo actions get app_topolo_books.settings.update --detail --json
topolo resources topolo-books --json
topolo workspaces list topolo-books --json
- Set BOOKS_WORKSPACE_ID to the exact granted workspace returned by discovery.
- invoicePaymentMerchantId: Resolve this exact identifier through the related published reads for the same organization and workspace; never infer it from a name.
- invoicePaymentProviderAccountId: Resolve this exact identifier through the related published reads for the same organization and workspace; never infer it from a name.
Request
PUT /api/settings
Inspect and test this action. Save the reviewed input as payload.json; supply credential/resource context separately.
Input fields
| Field | Required | Meaning | Schema and constraints |
|---|---|---|---|
baseCurrency | Optional | Workspace accounting currency. A change is refused once ledger posting has occurred. | {"type":"string","pattern":"^[A-Z]{3}$"} |
fiscalYearStartMonth | Optional | fiscal Year Start Month | {"type":"integer","minimum":1,"maximum":12} |
lockDate | Optional | lock Date | {"anyOf":[{"type":"string","pattern":"^\d{4}-\d{2}-\d{2}$"},{"type":"null"}]} |
conversionDate | Optional | conversion Date | {"anyOf":[{"type":"string","pattern":"^\d{4}-\d{2}-\d{2}$"},{"type":"null"}]} |
invoiceBusinessName | Optional | invoice Business Name | {"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]} |
invoiceLegalName | Optional | invoice Legal Name | {"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]} |
invoiceEmail | Optional | invoice Email | {"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]} |
invoicePhone | Optional | invoice Phone | {"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]} |
invoiceWebsite | Optional | invoice Website | {"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]} |
invoiceRegistrationNumber | Optional | invoice Registration Number | {"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]} |
invoiceTaxNumber | Optional | invoice Tax Number | {"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]} |
invoiceAddressLine1 | Optional | invoice Address Line1 | {"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]} |
invoiceAddressLine2 | Optional | invoice Address Line2 | {"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]} |
invoiceCity | Optional | invoice City | {"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]} |
invoiceRegion | Optional | invoice Region | {"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]} |
invoicePostalCode | Optional | invoice Postal Code | {"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]} |
invoiceCountry | Optional | invoice Country | {"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]} |
invoicePaymentInstructions | Optional | invoice Payment Instructions | {"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]} |
invoiceBankAccountName | Optional | invoice Bank Account Name | {"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]} |
invoiceBankName | Optional | invoice Bank Name | {"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]} |
invoiceBankAccountNumber | Optional | invoice Bank Account Number | {"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]} |
invoiceBankRoutingNumber | Optional | invoice Bank Routing Number | {"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]} |
invoiceBankSortCode | Optional | invoice Bank Sort Code | {"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]} |
invoiceBankIban | Optional | invoice Bank Iban | {"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]} |
invoiceBankSwiftBic | Optional | invoice Bank Swift Bic | {"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]} |
invoiceBankCurrency | Optional | invoice Bank Currency | {"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]} |
invoiceFooter | Optional | invoice Footer | {"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]} |
invoiceTemplate | Optional | invoice Template | {"type":"string","enum":["modern","classic"]} |
invoiceAutoCreatePublicPage | Optional | invoice Auto Create Public Page | {"type":"boolean"} |
invoiceAutoCreatePaymentLink | Optional | invoice Auto Create Payment Link | {"type":"boolean"} |
invoicePaymentMerchantId | Optional | invoice Payment Merchant Id | {"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]} |
invoicePaymentProviderAccountId | Optional | invoice Payment Provider Account Id | {"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]} |
Inspect nested fields and the complete input schema.
Effects
- Sets accounting, invoice identity and approval-automation settings for the workspace. The base currency is refused once anything has posted. Enabling automatic payment links also requires automatic customer pages and a currently authorised Topolo Pay merchant.
Interpret the response
Read $.settings.workspace_id for the returned workspace identifier. Empty collections and nullable fields do not discover a target.
Call app_topolo_books.settings.get and confirm the values you sent.
Inspect the success schema. CLI/MCP add their own transport envelope; CLI --detail requests the full result.
Worked examples
Actual Books route handlers and the exported Worker were exercised against five local SQLite D1 concern databases with all committed migrations, the real posting Durable Object and local R2. Route captures use synthetic verified Auth; Worker captures use synthetic Auth transports. Nexus, Brand, Notify, Pay, Mercury and Xero responses are explicitly simulated at the provider transport boundary. Captures prove local request/response behavior and canonical SDK projection, not live bank access, payment movement, email delivery, provider eligibility, tax compliance, encrypted custody, scheduled execution, deployment or production completion. Fixture identities, credentials, addresses and records authorize no live operation.
Run a reviewed request
Save the input from the selected worked example as payload.json. Validate and inspect the plan before calling the action; refused examples demonstrate errors and are not instructions to execute.
CLI:
topolo actions validate app_topolo_books.settings.update --data @payload.json --json
topolo actions plan app_topolo_books.settings.update --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_books.settings.update --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --confirm --detail --json
MCP tool and arguments for the first successful example:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_books.settings.update",
"input": {
"conversionDate": "2026-02-01"
},
"resourceType": "workspace",
"resourceId": "<exact granted workspace id>",
"confirm": true,
"detail": true
}
}
Successful response · HTTP 200
Input · payload.json:
{
"conversionDate": "2026-02-01"
}
Captured response · HTTP 200
{
"settings": {
"workspace_id": "ws_cnv_muvnq0th2",
"organization_id": "org_cnv_muvnq0th2",
"base_currency": "GBP",
"fiscal_year_start_month": 1,
"lock_date": null,
"coa_template": null,
"created_at": "2026-10-05T19:42:56.935Z",
"updated_at": "2026-10-05T19:42:56.937Z",
"invoice_business_name": null,
"invoice_legal_name": null,
"invoice_email": null,
"invoice_phone": null,
"invoice_website": null,
"invoice_registration_number": null,
"invoice_tax_number": null,
"invoice_address_line1": null,
"invoice_address_line2": null,
"invoice_city": null,
"invoice_region": null,
"invoice_postal_code": null,
"invoice_country": null,
"invoice_payment_instructions": null,
"invoice_footer": null,
"invoice_template": "modern",
"conversion_date": "2026-02-01",
"invoice_bank_account_name": null,
"invoice_bank_name": null,
"invoice_bank_account_number": null,
"invoice_bank_routing_number": null,
"invoice_bank_sort_code": null,
"invoice_bank_iban": null,
"invoice_bank_swift_bic": null,
"invoice_bank_currency": null,
"invoice_auto_create_public_page": 0,
"invoice_auto_create_payment_link": 0,
"invoice_payment_merchant_id": null,
"invoice_payment_provider_account_id": null
}
}
HTTP 200. Call app_topolo_books.settings.get and confirm the values you sent.
Refused response · auth_error
Input · payload.json:
{
"baseCurrency": "GBP",
"fiscalYearStartMonth": 4,
"lockDate": "2026-03-31"
}
Captured response · HTTP 401
{
"error": "API key validation failed"
}
HTTP 401. SDK error code auth_error. Authenticate in the intended organization again. Verify whoami and the exact Books application/workspace binding before retrying; do not switch identity to work around a refusal.
Refused response · merchant_not_available
Input · payload.json:
{
"invoiceAutoCreatePublicPage": true,
"invoiceAutoCreatePaymentLink": true,
"invoicePaymentMerchantId": "mrc_missing",
"invoicePaymentProviderAccountId": "mpa_missing"
}
Captured response · HTTP 409
{
"error": "merchant_not_available",
"message": "Choose an exact Topolo Pay provider account enabled for this workspace"
}
HTTP 409. SDK error code merchant_not_available. Read settings.invoice_payment_options.list and select the exact available Pay merchant/provider-account pair for this workspace. Provider eligibility needs live verification.
Refused response · merchant_not_available
Input · payload.json:
{
"invoiceAutoCreatePublicPage": true,
"invoiceAutoCreatePaymentLink": true,
"invoicePaymentMerchantId": "mrc_books",
"invoicePaymentProviderAccountId": "mpa_missing"
}
Captured response · HTTP 409
{
"error": "merchant_not_available",
"message": "Choose an exact Topolo Pay provider account enabled for this workspace"
}
HTTP 409. SDK error code merchant_not_available. Read settings.invoice_payment_options.list and select the exact available Pay merchant/provider-account pair for this workspace. Provider eligibility needs live verification.
Successful response · HTTP 200
Input · payload.json:
{
"invoiceAutoCreatePublicPage": true,
"invoiceAutoCreatePaymentLink": true,
"invoicePaymentMerchantId": "mrc_books",
"invoicePaymentProviderAccountId": "mpa_checkout_books"
}
Captured response · HTTP 200
{
"settings": {
"workspace_id": "ws_invoice-approval-route_muvnpf2h15",
"organization_id": "org_invoice-approval-route_muvnpf2h15",
"base_currency": "GBP",
"fiscal_year_start_month": 4,
"lock_date": null,
"coa_template": "uk_ltd",
"created_at": "2026-10-05T19:42:28.746Z",
"updated_at": "2026-10-05T19:42:28.766Z",
"invoice_business_name": null,
"invoice_legal_name": null,
"invoice_email": null,
"invoice_phone": null,
"invoice_website": null,
"invoice_registration_number": null,
"invoice_tax_number": null,
"invoice_address_line1": null,
"invoice_address_line2": null,
"invoice_city": null,
"invoice_region": null,
"invoice_postal_code": null,
"invoice_country": null,
"invoice_payment_instructions": null,
"invoice_footer": null,
"invoice_template": "modern",
"conversion_date": null,
"invoice_bank_account_name": null,
"invoice_bank_name": null,
"invoice_bank_account_number": null,
"invoice_bank_routing_number": null,
"invoice_bank_sort_code": null,
"invoice_bank_iban": null,
"invoice_bank_swift_bic": null,
"invoice_bank_currency": null,
"invoice_auto_create_public_page": 1,
"invoice_auto_create_payment_link": 1,
"invoice_payment_merchant_id": "mrc_books",
"invoice_payment_provider_account_id": "mpa_checkout_books"
}
}
HTTP 200. Call app_topolo_books.settings.get and confirm the values you sent.
Successful response · HTTP 200
Input · payload.json:
{
"fiscalYearStartMonth": 1
}
Captured response · HTTP 200
{
"settings": {
"workspace_id": "ws_route_muvnp2sb19",
"organization_id": "org_route_muvnp2sb19",
"base_currency": "GBP",
"fiscal_year_start_month": 1,
"lock_date": null,
"coa_template": "uk_ltd",
"created_at": "2026-10-05T19:42:12.832Z",
"updated_at": "2026-10-05T19:42:12.846Z",
"invoice_business_name": null,
"invoice_legal_name": null,
"invoice_email": null,
"invoice_phone": null,
"invoice_website": null,
"invoice_registration_number": null,
"invoice_tax_number": null,
"invoice_address_line1": null,
"invoice_address_line2": null,
"invoice_city": null,
"invoice_region": null,
"invoice_postal_code": null,
"invoice_country": null,
"invoice_payment_instructions": null,
"invoice_footer": null,
"invoice_template": "modern",
"conversion_date": null,
"invoice_bank_account_name": null,
"invoice_bank_name": null,
"invoice_bank_account_number": null,
"invoice_bank_routing_number": null,
"invoice_bank_sort_code": null,
"invoice_bank_iban": null,
"invoice_bank_swift_bic": null,
"invoice_bank_currency": null,
"invoice_auto_create_public_page": 0,
"invoice_auto_create_payment_link": 0,
"invoice_payment_merchant_id": null,
"invoice_payment_provider_account_id": null
}
}
HTTP 200. Call app_topolo_books.settings.get and confirm the values you sent.
Successful response · HTTP 200
Input · payload.json:
{
"baseCurrency": "USD"
}
Captured response · HTTP 200
{
"settings": {
"workspace_id": "ws_e2e_muvnp7sp3",
"organization_id": "org_e2e_muvnp7sp3",
"base_currency": "USD",
"fiscal_year_start_month": 1,
"lock_date": null,
"coa_template": null,
"created_at": "2026-10-05T19:42:19.323Z",
"updated_at": "2026-10-05T19:42:19.323Z",
"invoice_business_name": null,
"invoice_legal_name": null,
"invoice_email": null,
"invoice_phone": null,
"invoice_website": null,
"invoice_registration_number": null,
"invoice_tax_number": null,
"invoice_address_line1": null,
"invoice_address_line2": null,
"invoice_city": null,
"invoice_region": null,
"invoice_postal_code": null,
"invoice_country": null,
"invoice_payment_instructions": null,
"invoice_footer": null,
"invoice_template": "modern",
"conversion_date": null,
"invoice_bank_account_name": null,
"invoice_bank_name": null,
"invoice_bank_account_number": null,
"invoice_bank_routing_number": null,
"invoice_bank_sort_code": null,
"invoice_bank_iban": null,
"invoice_bank_swift_bic": null,
"invoice_bank_currency": null,
"invoice_auto_create_public_page": 0,
"invoice_auto_create_payment_link": 0,
"invoice_payment_merchant_id": null,
"invoice_payment_provider_account_id": null
}
}
HTTP 200. Call app_topolo_books.settings.get and confirm the values you sent.
Verify the result
- Call app_topolo_books.settings.get and confirm the values you sent.
Errors and recovery
auth_error(HTTP 401): Authenticate in the intended organization again. Verify whoami and the exact Books application/workspace binding before retrying; do not switch identity to work around a refusal.merchant_not_available(HTTP 409): Read settings.invoice_payment_options.list and select the exact available Pay merchant/provider-account pair for this workspace. Provider eligibility needs live verification.
These are observed local refusals. Shared authentication, schema validation and resource authorization can also refuse before the route. Preserve the actual error, details and request id.
Recovery boundary
Read settings.get before changing anything, then call settings.update again with the previous values.
Related actions
- Apply a chart-of-accounts template: Seed a template's accounts and its jurisdiction tax-rate pack into the workspace. Existing account codes and effective-dated tax codes are skipped, so applying twice is safe; no transactions are created.
- List accounts: List the chart of accounts. Filter by type or archived state, search across code, name and description, and sort by code, name, type, subtype or status.
- Get workspace settings: Read the workspace accounting, invoice identity and invoice approval-automation settings.
Evidence
Actual Books route handlers and the exported Worker were exercised against five local SQLite D1 concern databases with all committed migrations, the real posting Durable Object and local R2. Route captures use synthetic verified Auth; Worker captures use synthetic Auth transports. Nexus, Brand, Notify, Pay, Mercury and Xero responses are explicitly simulated at the provider transport boundary. Captures prove local request/response behavior and canonical SDK projection, not live bank access, payment movement, email delivery, provider eligibility, tax compliance, encrypted custody, scheduled execution, deployment or production completion. Fixture identities, credentials, addresses and records authorize no live operation.