# ContractPlanCreateDto

A model the API reference uses in a request or a response. The operation pages link every field typed as this model here.

Payload for creating a plan, including the price it starts on.

## Fields
- `merchantId` (string(uuid)) required: The merchant that owns the plan. (nullable)
- `name` (string) required: The plan's operator-facing name. Must be unique within the owning merchant. (nullable, max length 128)
- `code` (string): The merchant's own short code for the plan. Optional, and not resolved by the platform. (nullable, max length 64)
- `description` (string): What the plan covers, in the operator's own words. (nullable, max length 1024)
- `currencyCode` (string) required: The ISO 4217 alphabetic currency code the plan's amounts are denominated in. (nullable, min length 3, max length 3, pattern ^[A-Za-z]{3}$)
- `isActive` (boolean): Whether the plan may be subscribed to. Turning it off hides it from the plan picker and  blocks new subscriptions; it does not stop billing the contracts already on it.
- `defaultSchedule` ([ContractSchedule](https://devportal.demo.winkpg.io/docs/api/models/ContractSchedule.md)): The recurrence a new contract on this plan starts from. Optional, and a suggestion only: the  contract owns its schedule once created.
  Fields:
  - `frequency` ([Frequency](https://devportal.demo.winkpg.io/docs/api/models/Frequency.md)): The type of the recurrence rule.
    Values:
    - `Secondly`
    - `Minutely`
    - `Hourly`
    - `Daily`
    - `Weekly`
    - `Monthly`
    - `Yearly`
  - `count` (integer(int32)): The number of occurrences in a particular recurrence. (nullable)
  - `until` (string(date-time)): The datetime that bounds the current recurrence. (nullable)
  - `interval` (integer(int32)): The recurrence interval.
  - `bySecond` (array<integer(int32)>): BySecond rule modifier. (nullable)
  - `byMinute` (array<integer(int32)>): BySecond rule modifier. (nullable)
  - `byHour` (array<integer(int32)>): BySecond rule modifier. (nullable)
  - `byDay` (array<[ContractScheduleByDayRule](https://devportal.demo.winkpg.io/docs/api/models/ContractScheduleByDayRule.md)>): Week day rule modifier. (nullable)
  - `byMonth` (array<integer(int32)>): Month day rule modifier. (nullable)
  - `byMonthDay` (array<integer(int32)>): Month days rule modifier. (nullable)
  - `byYearDay` (array<integer(int32)>): Year days rule modifier. (nullable)
  - `byWeekNumber` (array<integer(int32)>): Week number rule modifier. (nullable)
  - `bySetPosition` (array<integer(int32)>): BySetPosition rule modifier. (nullable)
  - `firstDayOfWeek` ([DayOfWeek](https://devportal.demo.winkpg.io/docs/api/models/DayOfWeek.md)): The first day of week, used in calculating weekday-based recurrences (nullable)
    Values:
    - `Sunday`
    - `Monday`
    - `Tuesday`
    - `Wednesday`
    - `Thursday`
    - `Friday`
    - `Saturday`
  - `nextScheduledRun` (string(date-time)): The next computed billing date, updated after each billing run. Null for contracts that  have never been scheduled or have ended. (nullable)
  - `startDate` (string(date-time)): The earliest date on which this contract is eligible to bill. Set by the user  when creating the contract (defaults to the creation date) and may be set to a  future date to delay first billing. The recurrence engine anchors expansion to  this date and the daily billing job will not fire a contract whose  `startDate` is in the future.                Null on contracts created before this field existed. When it is null, the server  anchors the schedule on the contract's creation time, or on the current time when  that is also absent; callers that compute a schedule themselves should apply the  same fallback. (nullable)
- `trialDays` (integer(int32)): The trial length a new contract on this plan inherits, in days. Optional; empty or zero  means no trial. A default for contract creation only: each contract owns its own trial end  date once created, and changing this never moves an existing subscriber. (nullable, min 0, max 365)
- `billSubtotalAmount` (number(double)): The base amount the plan charges each cycle, before tax. (min 0)
- `taxAmount` (number(double)): The tax added to the base amount each cycle. Leave empty when the plan carries no tax line. (nullable, min 0)
- `totalAmount` (number(double)): The total charged to a subscriber each cycle. This is the amount the billing engine charges;  the subtotal and tax are the operator's breakdown of it. (greater than 0)

## See also

- [All documentation](https://devportal.demo.winkpg.io/llms.txt): the machine-readable index of every public page on this site.
