v1

latestOpenAPI 3.0.02026-07-24161215397.4 KB
Contracts

Add new contract

Option 1 - Create a contract of a type, that requires at least one resource. You can add secondary items such as recurring plans and one-off plans as well, if the contract type allows it.

Option 2 - Create a contract of a type, that requires at least one recurring plan. You can add secondary items such as resources and one-off plans as well, if the contract type allows it

Option 3 - Create a contract of a type, that requires at least one one-off plan. You can add secondary items such as recurring plans and resources as well, if the contract type allows it

Required scopes: flex.community.contracts.create

post/api/v2/organizations/{orgSlug}/contracts

Path parameters

orgSlugstring required

organization slug

Request body

propertiesobject

An object that contains all custom properties that can be applied to the item.

documentTypestring required

The type of the contract. Check "Settings"->"Platform"->"Contracts" to see what types are available.

companystring required

The _id of the company associated with the contract.

memberstring required

The _id of the member associated with the contract.

locationstring

The _id of the location associated with the contract.

startDatestring required

The start date of the contract.

endDatestring

The end date of the contract.

legalDocumentsstring[]

An array with the ids of the legal documents attached to the contract.

addendumstring

An addendum to the contract.

numberstring

The number/name of the contract. If not written it will be automatically generated using organization's settings

isRollingboolean

A true/false value that decides if the contract is rolling or not

percentagePriceIncreasenumber

Percentage price increase of the contract.

type'renewal' | 'expansion' | 'new'

The type of the contract.

Example request

{
  "notice": {
    "months": 3
  },
  "properties": {
    "customProperty1": "value1",
    "customProperty2": "value2"
  },
  "documentType": "membershipagreement",
  "company": "6080186f490fcf6e0547ec50",
  "member": "6080186f490fcf6e0547ec51",
  "location": "6080186f490fcf6e0547ec58",
  "deal": {
    "dealId": "deal-123",
    "dealName": "Membership deal",
    "crmLink": "https://crm.example.com/deals/deal-123"
  },
  "startDate": "2024-08-21T00:00:00.000Z",
  "endDate": "2025-08-20T00:00:00.000Z",
  "plans": [],
  "oneOffPlans": [],
  "resources": [],
  "legalDocuments": [
    "6080186f490fcf6e0547ec85",
    "6080186f490fcf6e0547ec59"
  ],
  "addendum": "<p> This is an example addendum to the contract. </p>",
  "number": "CON-3",
  "isRolling": true,
  "percentagePriceIncrease": 10
}

Response

propertiesobject

An object that contains all custom properties that can be applied to the item.

_idstring

The _id of the contract.

numberstring

The number/name of the contract.

companystring

The _id of the company associated with the contract.

memberstring

The _id of the member associated with the contract

locationstring

The _id of the location associated with the contract.

documentTypestring

The type of the contract. Check "Settings"->"Platform"->"Contracts" to see what types are available.

startDatestring

The start date of the contract

endDatestring

The end date of the contract

legalDocumentsstring[]

An array with the ids of the legal documents attached to the contract.

addendumstring

An addendum to the contract.

isRollingboolean

A true/false value that decides if the contract is rolling or not

stage'terminated' | 'served_notice' | 'active' | 'up_for_renewal' | 'not_renewed' | 'expired' | 'rolling'

The stage of the contract.

status'signed' | 'draft' | 'terminated' | 'not_signed' | 'canceled'

The status of the contract.

signatureStatus'e_signed' | 'manually_signed' | 'out_for_signature' | 'declined' | 'requires_attention' | 'canceled' | 'signed_by_member'

The status of the signature of the contract.

signDatestring

The date and time when the contract was signed.

activationErrorsobject[]

An array of activation errors

totalnumber

The total price of the contract (after taxes).

baseTotalnumber

The total price of the contract (before taxes).

plansTotalnumber

The total price of all the plans in the contract.

oneOffsTotalnumber

The total price of all the one-offs in the contract.

resourcesTotalnumber

The total price of all the resources in the contract.

percentagePriceIncreasenumber

Percentage price increase of the contract.

previousDepositHeldnumber

The previous deposit of the contract.

type'renewal' | 'expansion' | 'new'

The type of the contract.

renewedContractstring

The _id of the renewed contract that this renewal contract continues.

renewalContractstring

The _id of the renewal contract that continues this renewed contract.

createdAtstring date-time

The date and time when the contract was created.

createdBystring

The user that created the contract.

modifiedAtstring date-time

The date and time when the contract was last modified.

modifiedBystring

The user that last updated the contract.

Example response

{
  "notice": {
    "months": 3
  },
  "properties": {
    "customProperty1": "value1",
    "customProperty2": "value2"
  },
  "_id": "6080186f490fcf6e0547ec57",
  "number": "CON-3",
  "company": "6080186f490fcf6e0547ec59",
  "member": "6080186f490fcf6e0547ec57",
  "location": "6080186f490fcf6e0547ec58",
  "deal": {
    "dealId": "deal-123",
    "dealName": "Membership deal",
    "crmLink": "https://crm.example.com/deals/deal-123"
  },
  "documentType": "membershipagreement",
  "startDate": "2024-08-21T00:00:00.000Z",
  "endDate": "2025-08-20T00:00:00.000Z",
  "plans": [],
  "oneOffPlans": [],
  "resources": [],
  "legalDocuments": [
    "6080186f490fcf6e0547ec85",
    "6080186f490fcf6e0547ec59"
  ],
  "addendum": "<p> This is an example addendum to the contract. </p>",
  "isRolling": true,
  "signDate": "2024-08-21T16:00:00.000Z",
  "signedBy": {
    "_id": "6080186f490fcf6e0547ec50",
    "displayName": "John Doe"
  },
  "activationErrors": [],
  "termination": {
    "date": "2024-08-21T00:00:00.000Z",
    "reasonKey": "Example Reason Key",
    "comments": "Example Comment"
  },
  "total": 150.5,
  "baseTotal": 145.62,
  "plansTotal": 120.81,
  "oneOffsTotal": 15.522,
  "resourcesTotal": 15.99,
  "percentagePriceIncrease": 10,
  "previousDepositHeld": 100,
  "renewedContract": "6080186f490fcf6e0547ec57",
  "renewalContract": "6080186f490fcf6e0547ec58",
  "createdAt": "2024-08-21T16:00:00.000Z",
  "createdBy": "6080186f490fcf6e0547ec50",
  "modifiedAt": "2024-08-21T16:00:00.000Z",
  "modifiedBy": "6080186f490fcf6e0547ec50"
}