Skip to main content
PATCH
Update contract recurring discount

Authorizations

X-API-KEY
string
header
required

API Key Authentication.

Path Parameters

id
string<uuid>
required

Unique identifier for the contract.

contractRecurringDiscountId
string<uuid>
required

The unique identifier of the recurring discount in our system.

Body

application/json

The custom fields that replace those of the recurring discount.

customFields
object
required

Custom fields that can be associated with the entity. The fields must be previously created in the system before they can be used.

Example:

Response

A discount that a contract applies from a chosen billing cycle, for a number of billings or with no end. It is a fixed amount or a percentage on the invoice, a plan, one plan charge or the contract minimum.

id
string<uuid>
required

The unique identifier of the recurring discount in our system.

planId
string<uuid> | null
required

The unique identifier of the plan that the discount applies to, for the plan and plan_charge target scopes. Null for the invoice and contract_minimum_amount target scopes.

planChargeId
string<uuid> | null
required

The unique identifier of the plan charge that the discount applies to, for the plan_charge target scope. Null for the other target scopes.

targetScope
enum<string>
required

What the discount applies to on each invoice: invoice (the whole invoice), plan (the line items of the plan), plan_charge (the line item of one plan charge of the plan), or contract_minimum_amount (the line item that the contract minimum adds).

Available options:
invoice,
plan,
plan_charge,
contract_minimum_amount
method
enum<string>
required

How amount reads: fixed takes an amount of money off the target, and percentage takes a percentage of the target off it.

Available options:
fixed,
percentage
amount
number
required

The value of the discount, as a positive integer: cents when method is fixed, and basis points when method is percentage, where 1 basis point is 0.01% and 10000 is 100%.

Required range: x >= 1Must be a multiple of 1
description
string
required

The text of the discount as it appears on invoices.

Minimum string length: 1
Example:

"Desconto de fidelidade"

startDate
string<date>
required

The start date of the billing cycle from which the discount applies.

invoiceCount
number | null
required

How many billing acts that bill the target the discount applies to, counted from startDate over the open invoices, because an issued invoice keeps its discounts and spends no count. The invoices that one billing act splits among payment accounts spend one count together, so 12 counts on a quarterly fee last 12 quarters. Null means that the discount applies until it is deactivated.

Required range: x >= 1Must be a multiple of 1
distributionMode
enum<string>
required

How a fixed discount reaches the invoices that one billing act splits among payment accounts: full takes the whole amount off each invoice, and proportional splits the amount among them in proportion to their totals. A percentage discount always applies to each invoice.

Available options:
proportional,
full
isActive
boolean
required

Whether the discount applies to new billing cycles. A deactivated discount stays on the contract for history.

customFields
object
required

Custom fields that can be associated with the entity. The fields must be previously created in the system before they can be used.

Example: