curl --request POST \
--url https://api.valyx.com/billing/contract \
--header 'Content-Type: application/json' \
--header 'X-Valyx-Signature: <x-valyx-signature>' \
--data '
{
"customerId": "cust_45678",
"contractNumber": "CONTRACT-2025-001",
"contractTitle": "Premium Subscription Plan",
"contractPeriod": {
"unit": "MONTH",
"value": 12
},
"billingFrequency": {
"unit": "MONTH",
"value": 1
},
"isPreusage": false,
"startDate": "2025-01-01",
"virtualStartDate": "2025-01-01",
"creditTermId": "CT-30-DAYS",
"poNumber": "PO-98765",
"noteInvoice": "Please pay within 30 days",
"terms": "Net 30 payment terms apply",
"noteContract": "This contract is for the premium subscription plan",
"billingDiscounts": [
{
"amount": 100,
"percentage": 10,
"isPostTax": false,
"isUsageBased": false,
"priority": 1,
"isStackable": false,
"tiers": [
{
"amount": 50,
"percentage": 10,
"isPostTax": false,
"upTo": 1000
}
],
"duration": {
"startIndex": 1,
"endIndex": 3
}
}
],
"billingTime": "BEGINNING_OF_PERIOD",
"billingReportLimit": {
"isUsageBased": false,
"tiers": [
{
"upTo": "Infinity",
"minValue": 123,
"maxValue": 123
}
],
"minValue": 123,
"maxValue": 123
},
"contractLimit": {
"isUsageBased": false,
"tiers": [
{
"upTo": "Infinity",
"minValue": 123,
"maxValue": 123
}
],
"minValue": 123,
"maxValue": 123
},
"advanceConfig": {
"trueUpEnabled": false,
"trueDownEnabled": false,
"actualUsageOverride": false,
"fileName": "<string>",
"attachmentId": "<string>"
},
"autoRenew": false,
"renewalPeriod": {
"value": 123,
"unit": "MONTH"
}
}
'{
"error": "<string>",
"message": "<string>",
"data": {
"totalDocs": 123,
"docs": [
{
"id": {},
"customerId": {},
"contractNumber": {},
"contractTitle": {},
"contractPeriod": {},
"renewalPeriod": {},
"noteContract": {},
"billingFrequency": {},
"usageBillingCycle": {},
"estimateCycle": {},
"billingTime": {},
"startDate": {},
"virtualStartDate": {},
"endDate": {},
"nextBillingDate": {},
"billingDiscounts": {},
"isPreusage": {},
"billingReportLimit": {},
"contractLimit": {},
"creditTermId": {},
"poNumber": {},
"placeOfSupply": {},
"billingAddress": {},
"shippingAddress": {},
"totalInvoicedAmount": {},
"noteInvoice": {},
"terms": {},
"advanceConfig": {},
"invoiceSplitConfig": {},
"gstin": {},
"companyGstin": {},
"currency": {},
"currencyId": {},
"companyId": {},
"createdBy": {},
"updatedBy": {},
"status": {},
"autoRenew": {}
}
],
"hasNext": true,
"hasPrev": true,
"pageNumber": 123,
"pageSize": 123,
"totalPages": 123,
"prevPageNumber": 123,
"nextPageNumber": 123
}
}curl --request POST \
--url https://api.valyx.com/billing/contract \
--header 'Content-Type: application/json' \
--header 'X-Valyx-Signature: <x-valyx-signature>' \
--data '
{
"customerId": "cust_45678",
"contractNumber": "CONTRACT-2025-001",
"contractTitle": "Premium Subscription Plan",
"contractPeriod": {
"unit": "MONTH",
"value": 12
},
"billingFrequency": {
"unit": "MONTH",
"value": 1
},
"isPreusage": false,
"startDate": "2025-01-01",
"virtualStartDate": "2025-01-01",
"creditTermId": "CT-30-DAYS",
"poNumber": "PO-98765",
"noteInvoice": "Please pay within 30 days",
"terms": "Net 30 payment terms apply",
"noteContract": "This contract is for the premium subscription plan",
"billingDiscounts": [
{
"amount": 100,
"percentage": 10,
"isPostTax": false,
"isUsageBased": false,
"priority": 1,
"isStackable": false,
"tiers": [
{
"amount": 50,
"percentage": 10,
"isPostTax": false,
"upTo": 1000
}
],
"duration": {
"startIndex": 1,
"endIndex": 3
}
}
],
"billingTime": "BEGINNING_OF_PERIOD",
"billingReportLimit": {
"isUsageBased": false,
"tiers": [
{
"upTo": "Infinity",
"minValue": 123,
"maxValue": 123
}
],
"minValue": 123,
"maxValue": 123
},
"contractLimit": {
"isUsageBased": false,
"tiers": [
{
"upTo": "Infinity",
"minValue": 123,
"maxValue": 123
}
],
"minValue": 123,
"maxValue": 123
},
"advanceConfig": {
"trueUpEnabled": false,
"trueDownEnabled": false,
"actualUsageOverride": false,
"fileName": "<string>",
"attachmentId": "<string>"
},
"autoRenew": false,
"renewalPeriod": {
"value": 123,
"unit": "MONTH"
}
}
'{
"error": "<string>",
"message": "<string>",
"data": {
"totalDocs": 123,
"docs": [
{
"id": {},
"customerId": {},
"contractNumber": {},
"contractTitle": {},
"contractPeriod": {},
"renewalPeriod": {},
"noteContract": {},
"billingFrequency": {},
"usageBillingCycle": {},
"estimateCycle": {},
"billingTime": {},
"startDate": {},
"virtualStartDate": {},
"endDate": {},
"nextBillingDate": {},
"billingDiscounts": {},
"isPreusage": {},
"billingReportLimit": {},
"contractLimit": {},
"creditTermId": {},
"poNumber": {},
"placeOfSupply": {},
"billingAddress": {},
"shippingAddress": {},
"totalInvoicedAmount": {},
"noteInvoice": {},
"terms": {},
"advanceConfig": {},
"invoiceSplitConfig": {},
"gstin": {},
"companyGstin": {},
"currency": {},
"currencyId": {},
"companyId": {},
"createdBy": {},
"updatedBy": {},
"status": {},
"autoRenew": {}
}
],
"hasNext": true,
"hasPrev": true,
"pageNumber": 123,
"pageSize": 123,
"totalPages": 123,
"prevPageNumber": 123,
"nextPageNumber": 123
}
}Auth key to authenticate the request
The unique identifier of the customer associated with this contract
"cust_45678"
A unique reference number for this contract
"CONTRACT-2025-001"
The title or name of the contract
"Premium Subscription Plan"
The total duration of the contract, specifying the time unit and value
How often billing should occur for this contract
Indicates if billing should happen at the start of the period (pre-usage)
The date when the contract becomes effective
"2025-01-01"
A calculated start date for billing purposes, used if billing time is set to beginning of period
"2025-01-01"
Identifier for the credit term associated with this contract
"CT-30-DAYS"
Purchase order number, if applicable
"PO-98765"
Optional note to be included in the invoice
"Please pay within 30 days"
Terms and conditions associated with this contract
"Net 30 payment terms apply"
Optional note to be displayed on the contract
"This contract is for the premium subscription plan"
List of discounts applicable during billing
Show child attributes
Fixed discount amount to be applied (in the contract currency). Either amount or percentage should be set.
100
Discount percentage to be applied. Either amount or percentage should be set.
10
If true, discount is applied after tax calculation; otherwise, before tax.
Indicates whether this discount is applicable only to usage-based charges.
Determines the order in which discounts are applied; lower numbers are applied first.
1
If true, this discount can be combined with other discounts; otherwise, it is exclusive.
Optional tiered discount levels based on usage.
Show child attributes
Fixed discount amount for this tier. Either amount or percentage should be set.
50
Discount percentage for this tier. Either amount or percentage should be set.
10
Indicates if this tiered discount is applied after tax calculation. If false, it is applied before tax.
Maximum usage or amount this tier applies to. Use a very large number for no limit.
1000
Optional duration specifying the billing periods when this discount is active.
Show child attributes
Determines when billing is calculated: either at the beginning of the period or based on subscription start date
BEGINNING_OF_PERIOD, SUBSCRIPTION_DATE "BEGINNING_OF_PERIOD"
Limits applied to the billing report for this contract
Show child attributes
Indicates if the report limit is based on usage. If true, the tiers and min/max values are interpreted per usage unit.
Optional list of tiered limits that apply based on usage thresholds.
Show child attributes
The upper limit of this tier. Usage or billing beyond this value will fall into the next tier. Can be set to a very large number to indicate no limit.
The minimum value for this tier. Billing will start counting from this value. Optional if no lower bound is needed.
The maximum value for this tier. Optional if no upper bound is required.
Minimum allowed value for the billing report. Can be omitted if no minimum is required.
Maximum allowed value for the billing report. Can be omitted if no maximum is required.
Optional limit on total contract value or usage
Show child attributes
Indicates whether the contract limit is usage-based. If true, the system will enforce usage thresholds; otherwise, limits apply to other metrics.
A list of tiers defining usage limits for this contract. Each tier can have a min and max value. Optional if the contract has no tiered limits.
Show child attributes
Defines the upper bound for this tier. All usage up to this value will fall under this tier. Use Infinity for no upper limit.
The minimum value for this contract tier. Usage or billing calculations start from this threshold.
The maximum value for this contract tier. Usage beyond this value will be restricted or handled according to contract rules.
The minimum contract limit value. Billing or usage will start counting from this threshold.
The maximum contract limit value. Usage beyond this value will be restricted or handled as per contract rules.
Configuration for advance billing or usage adjustments
Show child attributes
Indicates whether true-up adjustments are enabled. True-up allows increasing charges based on actual usage at the end of a billing period.
Indicates whether true-down adjustments are enabled. True-down allows reducing charges based on lower actual usage at the end of a billing period.
If true, allows manually overriding the actual usage for this contract.
The name of the file uploaded for advance usage configuration, if any.
The ID of the uploaded file stored in the system for reference or download.
If true, the contract will automatically renew at the end of its period
The duration for which the contract should be renewed automatically
Show child attributes
The number of units after which the contract will auto-renew. For example, value=3 and unit=MONTH means the contract renews every 3 months.
The time unit for the renewal period. Specifies whether the contract should auto-renew after a number of days, weeks, months, or years.
DAY, WEEK, MONTH, YEAR "MONTH"
Success
Show child attributes
Show child attributes