Skip to content
Taylorz CRM Developers
Esc
↑↓navigate↵open⌘Jpreview

Save the commercial policy

Carries the revision the policy was read at; a stale one is refused.

PUT/api/v1/settings/commercial
Authorization
AuthorizationOAuth2 access token · headerrequired

Authorization-code grant with PKCE. Clients are public and hold no secret. Discovery is published at /.well-known/oauth-authorization-server/api/auth.

Scopes:api.access
Header parameters
Idempotency-Keystringrequired

Replays the first answer for a repeated request

min length 8 · max length 128
Request body
requiredapplication/json
policyobjectrequired
Show properties
accountingMappingsobject
default: {}
baseCurrencystring
matches ^[A-Z]{3}$ · default: "JPY"
calculationOrderstring
default: "discount_before_tax"
Allowed:discount_before_taxdiscount_after_tax
currenciesobject
default: {}
currencyScaleinteger
min 0 · max 4 · default: 0
fiscalYearStartMonthinteger
min 1 · max 12 · default: 4
pricesIncludeTaxboolean
default: false
roundingstring
default: "half_up"
Allowed:half_uphalf_eventoward_zerofloorceil
taxCalculationstring
default: "per_rate_total"
Allowed:per_lineper_rate_total
taxRoundingstring
default: "floor"
Allowed:half_uphalf_eventoward_zerofloorceil
timezonestring
default: "Asia/Tokyo"
revisionintegerrequired
min 1 · max 2147483647
Responses
200

The policy as it now stands

idstringrequired
min length 1 · max length 255
policyCommercialPolicyrequired
Show properties
accountingMappingsobjectrequired
default: {}
baseCurrencystringrequired
matches ^[A-Z]{3}$ · default: "JPY"
calculationOrderstringrequired
default: "discount_before_tax"
Allowed:discount_before_taxdiscount_after_tax
currenciesobjectrequired
default: {}
currencyScaleintegerrequired
min 0 · max 4 · default: 0
fiscalYearStartMonthintegerrequired
min 1 · max 12 · default: 4
pricesIncludeTaxbooleanrequired
default: false
roundingstringrequired
default: "half_up"
Allowed:half_uphalf_eventoward_zerofloorceil
taxCalculationstringrequired
default: "per_rate_total"
Allowed:per_lineper_rate_total
taxRoundingstringrequired
default: "floor"
Allowed:half_uphalf_eventoward_zerofloorceil
timezonestringrequired
default: "Asia/Tokyo"
revisionintegerrequired
min 1 · max 2147483647
400

The request body, query or parameters were refused

codestringrequired
Allowed:invalid_inputnot_foundconflictforbidden
detailany
errorstringrequired
reasonstring
401

The access token is missing, invalid or revoked

errorstringrequired
403

The tenant's module is off, or the token's scope or the member's role does not permit the action

codestringrequired
Allowed:invalid_inputnot_foundconflictforbidden
detailany
errorstringrequired
reasonstring
404

No such record, or none the caller may read

codestringrequired
Allowed:invalid_inputnot_foundconflictforbidden
detailany
errorstringrequired
reasonstring
409

The operation conflicts with the current state

codestringrequired
Allowed:invalid_inputnot_foundconflictforbidden
detailany
errorstringrequired
reasonstring
413

The request exceeds the route's body limit

errorstringrequired
500

An unexpected failure

errorstringrequired
Request
curl -X PUT '/api/v1/api/v1/settings/commercial' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Idempotency-Key: stringst' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "policy": {
    "accountingMappings": {},
    "baseCurrency": "JPY",
    "calculationOrder": "discount_before_tax",
    "currencies": {},
    "currencyScale": 0,
    "fiscalYearStartMonth": 4,
    "pricesIncludeTax": false,
    "rounding": "half_up",
    "taxCalculation": "per_line",
    "taxRounding": "half_up",
    "timezone": "Asia/Tokyo"
  },
  "revision": 1
}'
Response
{
  "id": "string",
  "policy": {
    "accountingMappings": {},
    "baseCurrency": "JPY",
    "calculationOrder": "discount_before_tax",
    "currencies": {},
    "currencyScale": 0,
    "fiscalYearStartMonth": 4,
    "pricesIncludeTax": false,
    "rounding": "half_up",
    "taxCalculation": "per_line",
    "taxRounding": "half_up",
    "timezone": "Asia/Tokyo"
  },
  "revision": 1
}

Was this page helpful?