Apply Guided Setup
POST/api/product-account-rules/setup/apply
Create the rules the guided setup planned, in one transaction: new rules are placed above every existing rule (existing rules are never edited or deleted), the overrides named in use_rule_product_ids are cleared, and one re-apply run starts.
accounting:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token with the accounting:write scope and the manage-accounting-settings permission.
Request body fields:
dimension(string, required) — how revenue is split:category,brand,supplierortype.groups(array, required, may be empty, max 500) — one entry per group from Get Guided Setup Dimensions.groups.*.id(integer or string, required) — the group id (category / brand / supplier id, or a product type value such asmanufactured).groups.*.accounts(object, optional) — nominal code id per account type:sales,cogs,inventory,inventory_in_transit,accrued_purchases,discount(each integer ornull). Groups with no account are skipped; groups with identical accounts are merged into one rule.
suggestions(array of strings, optional) —keys of suggestions from the preview to accept (e.g.brand:8:3,manufactured).use_rule_product_ids(array of integers, optional) — products whose own account override disagrees with the new rules and should be cleared so they follow the rules (seeexceptionsin the preview).channel_accounts_take_priority(boolean, optional) — set on every generated rule.confirm_type_mismatch(boolean, optional) — accept accounts whose type does not fit their slot.map_account_type(string|null, optional, defaultsales) — the account type the preview's before/afteraccount_mapshows:sales,cogs,inventory,inventory_in_transit,accrued_purchasesordiscount. Ignored by apply.
Send the same body you previewed. Response (data): rules ({id, name, position, conditions_summary} for each created rule) and tracked_job_id (the re-apply run).
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.