Create a new billing cycle

post/billing-cycles
SecuritybearerAuth
Request
header Parameters
defaultBillRunStartsOn
string

Start date override for the generated open bill run when the billing cycle is created

Request Body schema: application/json

New billing cycle

name
required
string [ 1 .. 255 ] characters [\w\p{L}\s%£@&#=':;`’,|!_—–\(\)\\/\-\+\.\?\*\...

Billing cycle name

startDayOfPeriod
integer <int32> [ 2 .. 28 ]

Start day of period

wholePeriod
required
boolean
Default: false

If this is set to true, it means the billing period if for whole month/week periods, meaning the starting day is 1st and the last day is the last day of the month e.g. 31st for Jan, 28/29 for Feb, 30th for April and so on.

lengthOfPeriod
integer <int32> [ 1 .. 12 ]
Default: 1

This is the length of the billing period and should be set to one by default which is the monthly billing cycle. A value of three would indicate that it is a quarterly billing cycle.

periodUnit
required
string (RentalProductUnit)

Rental product unit

Enum: "DAILY" "WEEKLY" "MONTHLY"
maxDaysBeforeCloseable
integer <int32> >= 1
Default: 15

The number of days before the periodEndDate that the billing period can be closed. e.g it should be defaulted to a sensible value like 5 days and prevent the closure the billing run too early (for example trying to close the 31st March 2014 bill run on 13th March 2014).

maxDaysAfterCloseable
integer <int32> >= 1
Default: 15

The number of days after the periodEndDate that the billing period can be closed. e.g it should be defaulted to a sensible value like 20 days and prevent the closure the billing run too late (for example trying to close the 31st March 2014 bill run on 30th April 2014).

maxBackDateableUsageInDays
integer <int32> >= 0

Any usage records in this bill cycle will not be billed out if older than this setting

currencyCode
required
string (CurrencyCode) = 3 characters [A-Z]{3}

ISO 4217 3-character currency code

defaultInvoiceDate
string (BillRunDefaultInvoiceDates)

Default invoice dates

Enum: "TODAY" "END_OF_BILL_RUN" "END_OF_BILL_RUN_PLUS_ONE" "BLANK"
completionType
required
string (CompletionType)

How to auto-complete a bill run

Enum: "DISABLED" "CLOSE_ONLY" "CLOSE_AND_FINALIZE"
autoCloseHour
integer <int32> [ 0 .. 23 ]

Hour to automatically close the bill run at

autoCloseMinute
integer <int32> [ 0 .. 59 ]

Minute to automatically close the bill run at

autoCloseOffsetDays
integer <int32> [ -15 .. 15 ]

Number of days after bill run period end date to automatically close the bill run

autoCloseUserId
integer <int64>

Identifier of user who will automatically close the bill run

Array of objects (BillingCycleRule)
Array of objects (BillingCycleStat)
Responses
200

OK

201

Created

400

Bad Request

401

Unauthorized

403

Forbidden

Request samples
application/json
{
  • "name": "string",
  • "startDayOfPeriod": 2,
  • "wholePeriod": false,
  • "lengthOfPeriod": 1,
  • "periodUnit": "DAILY",
  • "maxDaysBeforeCloseable": 15,
  • "maxDaysAfterCloseable": 15,
  • "maxBackDateableUsageInDays": 0,
  • "currencyCode": "GBP",
  • "defaultInvoiceDate": "TODAY",
  • "completionType": "DISABLED",
  • "autoCloseHour": 23,
  • "autoCloseMinute": 59,
  • "autoCloseOffsetDays": -15,
  • "autoCloseUserId": 1,
  • "billingCycleRules": [
    • {
      • "type": "REVENUE",
      • "thresholdPercentage": 1,
      • "thresholdMinValue": 50000,
      • "thresholdMaxValue": 50000,
      • "active": true,
      • "comparisonPeriod": "THREE_PERIODS",
      • "comparisonBasedOn": "VALUE"
      }
    ],
  • "billingCycleStats": [
    • {
      • "type": "REVENUE",
      • "value": 0,
      • "comparisonPeriod": "THREE_PERIODS"
      }
    ]
}
Response samples
application/json
{
  • "id": 1,
  • "name": "string",
  • "startDayOfPeriod": 2,
  • "wholePeriod": false,
  • "lengthOfPeriod": 1,
  • "periodUnit": "DAILY",
  • "maxDaysBeforeCloseable": 15,
  • "maxDaysAfterCloseable": 15,
  • "maxBackDateableUsageInDays": 0,
  • "currencyCode": "GBP",
  • "defaultInvoiceDate": "TODAY",
  • "completionType": "DISABLED",
  • "autoCloseHour": 23,
  • "autoCloseMinute": 59,
  • "autoCloseOffsetDays": -15,
  • "autoCloseUserId": 1,
  • "billingCycleRules": [
    • {
      • "id": 1,
      • "type": "REVENUE",
      • "thresholdPercentage": 1,
      • "thresholdMinValue": 50000,
      • "thresholdMaxValue": 50000,
      • "active": true,
      • "comparisonPeriod": "THREE_PERIODS",
      • "comparisonBasedOn": "VALUE"
      }
    ],
  • "billingCycleStats": [
    • {
      • "type": "REVENUE",
      • "value": 0,
      • "comparisonPeriod": "THREE_PERIODS"
      }
    ]
}