Skip to main content
POST
/
v1
/
contracts
/
{id}
/
recurring-discounts
Create contract recurring discount
curl --request POST \
  --url https://api.useaira.com/v1/contracts/{id}/recurring-discounts \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "amount": 123,
  "description": "<string>",
  "startDate": "2023-12-25",
  "planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "endDate": "2023-12-25",
  "distributionMode": "proportional"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amount": 123,
  "description": "<string>",
  "startDate": "2023-12-25",
  "endDate": "2023-12-25",
  "isActive": true
}

Authorizations

X-API-KEY
string
header
required

API Key Authentication.

Path Parameters

id
string<uuid>
required

Unique identifier for the contract.

Body

application/json
method
enum<string>
required

Discount method: "fixed" (amount in cents) or "percentage" (basis points).

Available options:
fixed,
percentage
amount
number
required

Amount in cents when method is "fixed", or basis points (0-10000, where 10000 = 100%) when method is "percentage".

description
string
required
Minimum string length: 1
startDate
string<date>
required

First billing-cycle start date the discount applies to. Must match a valid cycle date of the contract.

targetScope
enum<string>
required

Where the discount applies: "invoice", "plan", or "contract_minimum_amount".

Available options:
invoice,
plan,
contract_minimum_amount
planId
string<uuid> | null

Optional plan to scope the discount to. Required when targetScope is "plan".

endDate
string<date> | null

Optional last cycle date the discount applies to. Null means the discount has no end.

distributionMode
enum<string>
default:proportional

For split invoices: "proportional" divides a fixed discount across invoices; "full" applies it in full to each.

Available options:
proportional,
full

Response

Default Response

id
string<uuid>
required
planId
string<uuid> | null
required
targetScope
enum<string>
required
Available options:
invoice,
plan,
metric,
contract_minimum_amount
method
enum<string>
required
Available options:
fixed,
percentage
amount
number
required
description
string
required
Minimum string length: 1
startDate
string<date>
required
endDate
string<date> | null
required
distributionMode
enum<string>
required
Available options:
proportional,
full
isActive
boolean
required