Skip to main content
PUT
Update invoice discount

Authorizations

X-API-KEY
string
header
required

API Key Authentication.

Path Parameters

invoiceId
string<uuid>
required

The unique identifier of the invoice the discount belongs to.

discountId
string<uuid>
required

The unique identifier of the discount in our system.

Body

application/json

Schema representing a discount on an invoice, on one of its line item groups, or on one of its line items. Only active discounts (see isActive) affect the invoice totals.

target
enum<string>
required

What the discount applies to: the whole invoice, one line item group, or one line item.

Available options:
invoice,
line_item_group,
line_item
targetIdempotencyKey
string
required

The idempotency key of the targeted invoice, line item group, or line item, matching the target field.

method
enum<string>
required

How amount is interpreted: fixed subtracts a monetary amount; percentage subtracts a percentage of the targeted amount.

Available options:
fixed,
percentage
description
string
required

Display text of the discount as it appears on the invoice.

Minimum string length: 1
amount
number
required

Value of the discount, as a positive integer: whole cents when method is fixed; basis points when method is percentage (1 basis point = 0.01%; maximum 10000 = 100%).

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

Response

Schema representing a discount on an invoice, on one of its line item groups, or on one of its line items. Only active discounts (see isActive) affect the invoice totals.

id
string<uuid>
required

The unique identifier of the discount in our system.

target
enum<string>
required

What the discount applies to: the whole invoice, one line item group, or one line item.

Available options:
invoice,
line_item_group,
line_item
targetIdempotencyKey
string
required

The idempotency key of the targeted invoice, line item group, or line item, matching the target field.

method
enum<string>
required

How amount is interpreted: fixed subtracts a monetary amount; percentage subtracts a percentage of the targeted amount.

Available options:
fixed,
percentage
reason
enum<string>
required

Why the discount exists: manual_discount (created by a user or through the API), contract_proration or plan_instance_proration (generated to prorate a partial period), or contract_recurring (generated from a recurring discount configured on the contract).

Available options:
manual_discount,
contract_proration,
contract_recurring,
plan_instance_proration
description
string
required

Display text of the discount as it appears on the invoice.

Minimum string length: 1
amount
number
required

Value of the discount, as a positive integer: whole cents when method is fixed; basis points when method is percentage (1 basis point = 0.01%; maximum 10000 = 100%).

Required range: x >= 1Must be a multiple of 1
isActive
boolean
required

Whether the discount is currently applied to the invoice totals. Inactive discounts are kept for history but have no effect.