Skip to main content
POST
/
contracts
/
{contractId}
/
plans
Add plan to contract
curl --request POST \
  --url https://api.getenso.ai/contracts/{contractId}/plans \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "PlanId": "100",
  "startDate": "2026-04-01",
  "planId": "100",
  "name": "Annual Enterprise Subscription 2026",
  "endDate": "2027-03-31",
  "type": "standard",
  "orderIndex": 0,
  "ParentContractPlanId": "42",
  "parentContractPlanId": "42",
  "items": [
    {
      "SkuId": "sku_123",
      "CurrencyId": "2",
      "PlanTypeId": "3",
      "config": {
        "dayOfPeriod": 1,
        "amount": 999,
        "revenueRule": "immediate"
      },
      "id": "456",
      "orderIndex": 0,
      "description": "Per-user annual license",
      "milestones": [
        {
          "type": "invoice_trigger",
          "ContractMilestoneId": "123",
          "config": {
            "percentage_of_revenue": 25
          }
        }
      ]
    }
  ]
}
'
{
  "status": "success",
  "message": "Success",
  "data": {}
}
Not accessible by SystemUser role. Requires Admin.

Authorizations

Authorization
string
header
required

JWT bearer token obtained from POST /auth/system-login using your client credentials.

Path Parameters

contractId
string
required

Contract ID

Body

application/json

Use PlanId or planId to reuse an existing billing plan. If neither is sent, the route creates a new plan and expects name, and typically items.

PlanId
string
required
Example:

"100"

startDate
string<date>
required
Example:

"2026-04-01"

planId
string
Example:

"100"

name
string
Example:

"Annual Enterprise Subscription 2026"

endDate
string<date>
Example:

"2027-03-31"

type
enum<string>
Available options:
standard,
extension,
renewal
Example:

"standard"

orderIndex
integer
Example:

0

renewalTerms
object
ParentContractPlanId
string
Example:

"42"

parentContractPlanId
string
Example:

"42"

items
object[]

When creating a new plan item, provide CurrencyId, PlanTypeId, config, and either SkuId or Sku. The route persists meter references from config.meter and config.quantityMeter.

Response

Success

status
string
Example:

"success"

message
string
Example:

"Success"

data
object

Endpoint-specific payload (object, array, or null)