Skip to main content
PUT
Update term
installment_definitions replaces the stored rows. Omitted discount fields keep their stored values. Records that already use the term keep their schedule until they are next updated; a PUT without installments, or a PATCH that changes the total, term, or dates, then rebuilds the schedule from the new rows, or keeps paid rows and spreads the rest over the unpaid ones. To archive a term, send record_status set to archived. Side effects
  • Setting is_default to true makes this term the organization default and clears the previous default. Setting it to false, archiving the term, or deactivating it clears the default when this term holds it.
Additional validations
  • A write that changes the organization default term also needs the organization settings edit permission. Without it, the request returns 403.
  • Installment terms need at least two installment_definitions with unique positions. Percent rows must add up to 100. Amount rows need exactly one remainder row in the highest position.
  • discount_percent and discount_days are accepted only when early-payment discounts are enabled for the organization.
  • sales_discount_account_id and purchase_discount_account_id must be accounts of your organization.
  • The term name must be unique in the organization.

Authorizations

X-API-KEY
string
header
required

Headers

Idempotency-Key
string

Optional. A unique value (a UUID works well) identifying this operation. If the request is repeated with the same key, the original response is replayed instead of the operation running again, so a retry cannot create a duplicate record. Results are replayable for 48 hours. Reusing a key with a different request body returns 422.

Maximum string length: 255

Path Parameters

term_id
integer
required

Body

application/json
term_type
enum<string>
required

Standard means that the due date is calculated based on the days until net due.

Available options:
standard,
date_driven,
early_discount,
installment
name
string | null
Required string length: 2 - 128
is_active
boolean
default:true
days_until_net_due
integer | null
Required range: 0 <= x <= 99999
day_of_month_net_due
integer | null
Required range: 0 <= x <= 31
number_of_days_next_month
integer | null
Required range: 0 <= x <= 31
discount_percent
Required range: 0.01 <= x <= 100
discount_days
integer | null
Required range: x >= 0
sales_discount_account_id
integer | null
purchase_discount_account_id
integer | null
installment_definitions
TermInstallmentDefinitionSchemaIn · object[]
record_status
enum<string>
default:posted
Available options:
draft,
posted,
archived
is_default
boolean
default:false

Response

OK

id
integer
required
name
string
required
is_active
boolean
required
term_type
enum<string>
required

Standard means that the due date is calculated based on the days until net due.

Available options:
standard,
date_driven,
early_discount,
installment
record_status
enum<string>
required
Available options:
draft,
posted,
archived
days_until_net_due
integer | null
required
day_of_month_net_due
integer | null
required
number_of_days_next_month
integer | null
required
discount_percent
string | null
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
discount_days
integer | null
sales_discount_account_id
integer | null
purchase_discount_account_id
integer | null
installment_definitions
TermInstallmentDefinitionSchemaOut · object[]
is_default
boolean
default:false