{
  "openapi": "3.1.0",
  "info": {
    "title": "Memberships",
    "description": "Customer memberships, invoice templates, membership types, recurring services, recurring service events, recurring service types",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.servicetitan.io/memberships/v2",
      "description": "Production"
    },
    {
      "url": "https://api-integration.servicetitan.io/memberships/v2",
      "description": "Integration"
    }
  ],
  "paths": {
    "/tenant/{tenant}/memberships": {
      "get": {
        "tags": [
          "CustomerMemberships"
        ],
        "summary": "Gets a list of customer memberships",
        "operationId": "CustomerMemberships_GetList",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Perform lookup by multiple IDs (maximum 50)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerIds",
            "in": "query",
            "description": "Filters by customer IDs",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filters by membership status\\\nValues: [Active, Suspended, Expired, Canceled, Deleted]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Memberships.V2.MembershipStatus"
                }
              ]
            }
          },
          {
            "name": "duration",
            "in": "query",
            "description": "Filters by membership duration (in months); use null for ongoing memberships",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "billingFrequency",
            "in": "query",
            "description": "Filters by membership billing frequency\\\nValues: [OneTime, Monthly, EveryOtherMonth, Quarterly, BiAnnual, Annual]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Memberships.V2.MembershipRecurrenceType"
                }
              ]
            }
          },
          {
            "name": "active",
            "in": "query",
            "description": "What kind of items should be returned (only active items will be returned by default)\\\nValues: [True, Any, False]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ActiveRequestArg"
                }
              ]
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "description": "Return items created before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdOnOrAfter",
            "in": "query",
            "description": "Return items created on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedBefore",
            "in": "query",
            "description": "Return items modified before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedOnOrAfter",
            "in": "query",
            "description": "Return items modified on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "The logical number of page to return, starting from 1",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "How many records to return (50 by default)",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeTotal",
            "in": "query",
            "description": "Whether total count should be returned",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Applies sorting by specified fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_Of_Memberships.V2.CustomerMembershipResponse"
                },
                "example": {
                  "page": 0,
                  "pageSize": 0,
                  "hasMore": true,
                  "totalCount": 0,
                  "data": [
                    {
                      "id": 0,
                      "createdOn": "string",
                      "createdById": 0,
                      "modifiedOn": "string",
                      "followUpOn": "string",
                      "cancellationDate": "string",
                      "from": "string",
                      "nextScheduledBillDate": "string",
                      "to": "string",
                      "billingFrequency": {},
                      "renewalBillingFrequency": {},
                      "status": {},
                      "followUpStatus": {},
                      "active": true,
                      "initialDeferredRevenue": 0,
                      "duration": 0,
                      "renewalDuration": 0,
                      "businessUnitId": 0,
                      "customerId": 0,
                      "membershipTypeId": 0,
                      "activatedById": 0,
                      "activatedFromId": 0,
                      "billingTemplateId": 0,
                      "cancellationBalanceInvoiceId": 0,
                      "cancellationInvoiceId": 0,
                      "followUpCustomStatusId": 0,
                      "locationId": 0,
                      "paymentMethodId": 0,
                      "paymentTypeId": 0,
                      "recurringLocationId": 0,
                      "renewalMembershipTaskId": 0,
                      "renewedById": 0,
                      "soldById": 0,
                      "customerPo": "string",
                      "importId": "string",
                      "memo": "string",
                      "customFields": [
                        {
                          "typeId": 0,
                          "name": "string",
                          "value": "string"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.memberships:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/memberships/custom-fields": {
      "get": {
        "tags": [
          "CustomerMemberships"
        ],
        "summary": "Gets a list of custom field types that apply to customer memberships",
        "operationId": "CustomerMemberships_GetCustomFields",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "The logical number of page to return, starting from 1",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "How many records to return (50 by default)",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeTotal",
            "in": "query",
            "description": "Whether total count should be returned",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Filters records by name (case-insensitive \"contains\" operation)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "description": "Return items created before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdOnOrAfter",
            "in": "query",
            "description": "Return items created on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedBefore",
            "in": "query",
            "description": "Return items modified before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedOnOrAfter",
            "in": "query",
            "description": "Return items modified on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Applies sorting by specified fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_Of_Memberships.V2.CustomFieldTypeResponse"
                },
                "example": {
                  "page": 0,
                  "pageSize": 0,
                  "hasMore": true,
                  "totalCount": 0,
                  "data": [
                    {
                      "id": 0,
                      "name": "string",
                      "dataType": {},
                      "dataTypeOptions": [
                        "string"
                      ],
                      "createdOn": "string",
                      "modifiedOn": "string"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.memberships:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/memberships/{id}": {
      "get": {
        "tags": [
          "CustomerMemberships"
        ],
        "summary": "Gets customer membership specified by ID",
        "operationId": "CustomerMemberships_Get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Customer membership ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memberships.V2.CustomerMembershipResponse"
                },
                "example": {
                  "id": 0,
                  "createdOn": "string",
                  "createdById": 0,
                  "modifiedOn": "string",
                  "followUpOn": "string",
                  "cancellationDate": "string",
                  "from": "string",
                  "nextScheduledBillDate": "string",
                  "to": "string",
                  "billingFrequency": {},
                  "renewalBillingFrequency": {},
                  "status": {},
                  "followUpStatus": {},
                  "active": true,
                  "initialDeferredRevenue": 0,
                  "duration": 0,
                  "renewalDuration": 0,
                  "businessUnitId": 0,
                  "customerId": 0,
                  "membershipTypeId": 0,
                  "activatedById": 0,
                  "activatedFromId": 0,
                  "billingTemplateId": 0,
                  "cancellationBalanceInvoiceId": 0,
                  "cancellationInvoiceId": 0,
                  "followUpCustomStatusId": 0,
                  "locationId": 0,
                  "paymentMethodId": 0,
                  "paymentTypeId": 0,
                  "recurringLocationId": 0,
                  "renewalMembershipTaskId": 0,
                  "renewedById": 0,
                  "soldById": 0,
                  "customerPo": "string",
                  "importId": "string",
                  "memo": "string",
                  "customFields": [
                    {
                      "typeId": 0,
                      "name": "string",
                      "value": "string"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Customer membership not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.memberships:r"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "CustomerMemberships"
        ],
        "summary": "Updates specified customer membership in \"patch\" mode",
        "operationId": "CustomerMemberships_Update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Customer membership ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "description": "Customer membership update request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Memberships.V2.CustomerMembershipUpdateRequest"
              },
              "example": {
                "businessUnitId": 0,
                "nextScheduledBillDate": "string",
                "status": {},
                "memo": "string",
                "from": "string",
                "to": "string",
                "soldById": 0,
                "billingTemplateId": 0,
                "locationId": 0,
                "recurringServiceAction": {},
                "recurringLocationId": 0,
                "paymentMethodId": 0,
                "paymentTypeId": 0,
                "renewalMembershipTaskId": 0,
                "initialDeferredRevenue": 0,
                "cancellationBalanceInvoiceId": 0,
                "cancellationInvoiceId": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModificationResponse"
                },
                "example": {
                  "id": 0
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Customer membership not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.memberships:w"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/memberships/{id}/status-changes": {
      "get": {
        "tags": [
          "CustomerMemberships"
        ],
        "summary": "Gets status changes for the given customer membership",
        "operationId": "CustomerMemberships_GetStatusChanges",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Customer membership ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Memberships.V2.CustomerMembershipStatusChangeItemResponse"
                  }
                },
                "example": [
                  {
                    "id": 0,
                    "oldStatus": {},
                    "newStatus": {},
                    "note": "string",
                    "createdOn": "string",
                    "createdById": 0
                  }
                ]
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Customer membership not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.memberships:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/memberships/sale": {
      "post": {
        "tags": [
          "CustomerMemberships"
        ],
        "summary": "Creates membership sale invoice",
        "operationId": "CustomerMemberships_Create",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Memberships.V2.MembershipSaleInvoiceCreateRequest"
              },
              "example": {
                "customerId": 0,
                "businessUnitId": 0,
                "saleTaskId": 0,
                "durationBillingId": 0,
                "locationId": 0,
                "recurringServiceAction": {},
                "recurringLocationId": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memberships.V2.MembershipSaleInvoiceCreateResponse"
                },
                "example": {
                  "invoiceId": 0,
                  "customerMembershipId": 0
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.memberships:w"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/export/membership-types": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Provides export feed for membership types",
        "operationId": "Export_MembershipTypes",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Continuation token received from previous export request in \"continueFrom\" field.\nWhen not specified, the export process starts from the beginning.\\\nUse custom date strings, e.g. \"2020-01-01\" to start the export process from the certain point in time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeRecentChanges",
            "in": "query",
            "description": "Use \"true\" to start receiving the most recent changes quicker.\nNote this may cause the same results appearing multiple times on consecutive requests.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportResponse_Of_Memberships.V2.ExportMembershipTypeResponse"
                },
                "example": {
                  "hasMore": true,
                  "continueFrom": "string",
                  "data": [
                    {
                      "id": 0,
                      "createdOn": "string",
                      "createdById": 0,
                      "modifiedOn": "string",
                      "importId": "string",
                      "billingTemplateId": 0,
                      "discount": 0,
                      "durationBilling": [
                        {
                          "id": 0,
                          "duration": 0,
                          "billingFrequency": {},
                          "salePrice": 0,
                          "billingPrice": 0,
                          "renewalPrice": 0
                        }
                      ],
                      "discounts": [
                        {
                          "id": 0,
                          "targetId": 0,
                          "discount": 0
                        }
                      ],
                      "recurringServices": [
                        {
                          "id": 0,
                          "membershipTypeId": 0,
                          "recurringServiceTypeId": 0,
                          "offset": 0,
                          "offsetType": {},
                          "allocation": 0
                        }
                      ],
                      "tagTypeIds": [
                        0
                      ],
                      "name": "string",
                      "displayName": "string",
                      "active": true,
                      "discountMode": {},
                      "locationTarget": {},
                      "revenueRecognitionMode": {},
                      "autoCalculateInvoiceTemplates": true,
                      "useMembershipPricingTable": true,
                      "showMembershipSavings": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.membershiptypes:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/export/recurring-service-types": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Provides export feed for recurring service types",
        "operationId": "Export_RecurringServiceTypes",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Continuation token received from previous export request in \"continueFrom\" field.\nWhen not specified, the export process starts from the beginning.\\\nUse custom date strings, e.g. \"2020-01-01\" to start the export process from the certain point in time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeRecentChanges",
            "in": "query",
            "description": "Use \"true\" to start receiving the most recent changes quicker.\nNote this may cause the same results appearing multiple times on consecutive requests.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportResponse_Of_Memberships.V2.ExportRecurringServiceTypeResponse"
                },
                "example": {
                  "hasMore": true,
                  "continueFrom": "string",
                  "data": [
                    {
                      "id": 0,
                      "createdOn": "string",
                      "createdById": 0,
                      "modifiedOn": "string",
                      "active": true,
                      "recurrenceType": {},
                      "recurrenceInterval": 0,
                      "recurrenceMonths": [
                        "January"
                      ],
                      "durationType": {},
                      "durationLength": 0,
                      "invoiceTemplateId": 0,
                      "businessUnitId": 0,
                      "jobTypeId": 0,
                      "priority": {},
                      "campaignId": 0,
                      "jobSummary": "string",
                      "name": "string",
                      "importId": "string"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringservicetypes:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/export/memberships": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Provides export feed for customer memberships",
        "operationId": "Export_Memberships",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Continuation token received from previous export request in \"continueFrom\" field.\nWhen not specified, the export process starts from the beginning.\\\nUse custom date strings, e.g. \"2020-01-01\" to start the export process from the certain point in time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeRecentChanges",
            "in": "query",
            "description": "Use \"true\" to start receiving the most recent changes quicker.\nNote this may cause the same results appearing multiple times on consecutive requests.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportResponse_Of_Memberships.V2.ExportCustomerMembershipResponse"
                },
                "example": {
                  "hasMore": true,
                  "continueFrom": "string",
                  "data": [
                    {
                      "id": 0,
                      "createdOn": "string",
                      "createdById": 0,
                      "modifiedOn": "string",
                      "followUpOn": "string",
                      "cancellationDate": "string",
                      "from": "string",
                      "nextScheduledBillDate": "string",
                      "to": "string",
                      "billingFrequency": {},
                      "renewalBillingFrequency": {},
                      "status": {},
                      "followUpStatus": {},
                      "active": true,
                      "initialDeferredRevenue": 0,
                      "duration": 0,
                      "renewalDuration": 0,
                      "businessUnitId": 0,
                      "customerId": 0,
                      "membershipTypeId": 0,
                      "activatedById": 0,
                      "activatedFromId": 0,
                      "billingTemplateId": 0,
                      "cancellationBalanceInvoiceId": 0,
                      "cancellationInvoiceId": 0,
                      "followUpCustomStatusId": 0,
                      "locationId": 0,
                      "paymentMethodId": 0,
                      "paymentTypeId": 0,
                      "recurringLocationId": 0,
                      "renewalMembershipTaskId": 0,
                      "renewedById": 0,
                      "soldById": 0,
                      "customerPo": "string",
                      "importId": "string",
                      "memo": "string",
                      "customFields": [
                        {
                          "typeId": 0,
                          "name": "string",
                          "value": "string"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.memberships:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/export/invoice-templates": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Provides export feed for invoice templates",
        "operationId": "Export_InvoiceTemplates",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Continuation token received from previous export request in \"continueFrom\" field.\nWhen not specified, the export process starts from the beginning.\\\nUse custom date strings, e.g. \"2020-01-01\" to start the export process from the certain point in time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeRecentChanges",
            "in": "query",
            "description": "Use \"true\" to start receiving the most recent changes quicker.\nNote this may cause the same results appearing multiple times on consecutive requests.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportResponse_Of_Memberships.V2.ExportInvoiceTemplateResponse"
                },
                "example": {
                  "hasMore": true,
                  "continueFrom": "string",
                  "data": [
                    {
                      "id": 0,
                      "name": "string",
                      "createdOn": "string",
                      "createdById": 0,
                      "modifiedOn": "string",
                      "active": true,
                      "total": 0,
                      "isSettingsTemplate": true,
                      "importId": "string",
                      "items": [
                        {
                          "id": 0,
                          "skuId": 0,
                          "skuType": {},
                          "quantity": 0,
                          "unitPrice": 0,
                          "isAddOn": true,
                          "importId": "string",
                          "workflowActionItemId": 0,
                          "description": "string",
                          "cost": 0,
                          "hours": 0
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.invoicetemplates:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/export/recurring-services": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Provides export feed for recurring services",
        "operationId": "Export_LocationRecurringServices",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Continuation token received from previous export request in \"continueFrom\" field.\nWhen not specified, the export process starts from the beginning.\\\nUse custom date strings, e.g. \"2020-01-01\" to start the export process from the certain point in time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeRecentChanges",
            "in": "query",
            "description": "Use \"true\" to start receiving the most recent changes quicker.\nNote this may cause the same results appearing multiple times on consecutive requests.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportResponse_Of_Memberships.V2.ExportLocationRecurringServiceResponse"
                },
                "example": {
                  "hasMore": true,
                  "continueFrom": "string",
                  "data": [
                    {
                      "id": 0,
                      "name": "string",
                      "active": true,
                      "createdOn": "string",
                      "createdById": 0,
                      "modifiedOn": "string",
                      "importId": "string",
                      "membershipId": 0,
                      "locationId": 0,
                      "recurringServiceTypeId": 0,
                      "durationType": {},
                      "durationLength": 0,
                      "from": "string",
                      "to": "string",
                      "memo": "string",
                      "invoiceTemplateId": 0,
                      "invoiceTemplateForFollowingYearsId": 0,
                      "firstVisitComplete": true,
                      "activatedFromId": 0,
                      "allocation": 0,
                      "businessUnitId": 0,
                      "jobTypeId": 0,
                      "campaignId": 0,
                      "priority": {},
                      "jobSummary": "string",
                      "recurrenceType": {},
                      "recurrenceInterval": 0,
                      "recurrenceMonths": [
                        "January"
                      ],
                      "recurrenceDaysOfWeek": [
                        "Sunday"
                      ],
                      "recurrenceWeek": {},
                      "recurrenceDayOfNthWeek": {},
                      "recurrenceDaysOfMonth": [
                        0
                      ],
                      "jobStartTime": "string",
                      "estimatedPayrollCost": 0,
                      "preferredTechnicianIds": [
                        0
                      ],
                      "tagTypeIds": [
                        0
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringservices:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/export/recurring-service-events": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Provides export feed for recurring service events",
        "operationId": "Export_LocationRecurringServiceEvents",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Continuation token received from previous export request in \"continueFrom\" field.\nWhen not specified, the export process starts from the beginning.\\\nUse custom date strings, e.g. \"2020-01-01\" to start the export process from the certain point in time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeRecentChanges",
            "in": "query",
            "description": "Use \"true\" to start receiving the most recent changes quicker.\nNote this may cause the same results appearing multiple times on consecutive requests.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportResponse_Of_Memberships.V2.ExportLocationRecurringServiceEventResponse"
                },
                "example": {
                  "hasMore": true,
                  "continueFrom": "string",
                  "data": [
                    {
                      "id": 0,
                      "locationRecurringServiceId": 0,
                      "locationRecurringServiceName": "string",
                      "membershipId": 0,
                      "membershipName": "string",
                      "status": {},
                      "date": "string",
                      "createdOn": "string",
                      "jobId": 0,
                      "createdById": 0,
                      "modifiedOn": "string",
                      "active": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringserviceevents:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/export/membership-status-changes": {
      "get": {
        "tags": [
          "Export"
        ],
        "summary": "Provides export feed for customer membership status changes",
        "operationId": "Export_MembershipStatusChanges",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Continuation token received from previous export request in \"continueFrom\" field.\nWhen not specified, the export process starts from the beginning.\\\nUse custom date strings, e.g. \"2020-01-01\" to start the export process from the certain point in time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeRecentChanges",
            "in": "query",
            "description": "Use \"true\" to start receiving the most recent changes quicker.\nNote this may cause the same results appearing multiple times on consecutive requests.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportResponse_Of_Memberships.V2.ExportCustomerMembershipStatusChangesResponse"
                },
                "example": {
                  "hasMore": true,
                  "continueFrom": "string",
                  "data": [
                    {
                      "id": 0,
                      "oldStatus": {},
                      "newStatus": {},
                      "note": "string",
                      "createdOn": "string",
                      "createdById": 0,
                      "membershipId": 0
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.memberships:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/invoice-templates": {
      "get": {
        "tags": [
          "InvoiceTemplates"
        ],
        "summary": "Gets a list of invoice templates by given IDs",
        "description": "Please note this endpoint does not allow to enumerate all invoice templates.\nUse the Customer Membership endpoint (for billing template) or\nRecurring Service endpoint (for invoice template) to get invoice template IDs.",
        "operationId": "InvoiceTemplates_GetList",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Perform lookup by multiple IDs (maximum 50)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_Of_Memberships.V2.InvoiceTemplateResponse"
                },
                "example": {
                  "page": 0,
                  "pageSize": 0,
                  "hasMore": true,
                  "totalCount": 0,
                  "data": [
                    {
                      "id": 0,
                      "name": "string",
                      "createdOn": "string",
                      "createdById": 0,
                      "modifiedOn": "string",
                      "active": true,
                      "total": 0,
                      "isSettingsTemplate": true,
                      "importId": "string",
                      "items": [
                        {
                          "id": 0,
                          "skuId": 0,
                          "skuType": {},
                          "quantity": 0,
                          "unitPrice": 0,
                          "isAddOn": true,
                          "importId": "string",
                          "workflowActionItemId": 0,
                          "description": "string",
                          "cost": 0,
                          "hours": 0
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.invoicetemplates:r"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "InvoiceTemplates"
        ],
        "summary": "Creates new invoice template",
        "operationId": "InvoiceTemplates_Create",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Memberships.V2.InvoiceTemplateCreateRequest"
              },
              "example": {
                "items": [
                  {
                    "skuId": 0,
                    "quantity": 0,
                    "unitPrice": 0,
                    "isAddOn": true,
                    "workflowActionItemId": 0,
                    "description": "string",
                    "cost": 0,
                    "hours": 0
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModificationResponse"
                },
                "example": {
                  "id": 0
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.invoicetemplates:w"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/invoice-templates/{id}": {
      "get": {
        "tags": [
          "InvoiceTemplates"
        ],
        "summary": "Gets invoice template specified by ID",
        "operationId": "InvoiceTemplates_Get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice template ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memberships.V2.InvoiceTemplateResponse"
                },
                "example": {
                  "id": 0,
                  "name": "string",
                  "createdOn": "string",
                  "createdById": 0,
                  "modifiedOn": "string",
                  "active": true,
                  "total": 0,
                  "isSettingsTemplate": true,
                  "importId": "string",
                  "items": [
                    {
                      "id": 0,
                      "skuId": 0,
                      "skuType": {},
                      "quantity": 0,
                      "unitPrice": 0,
                      "isAddOn": true,
                      "importId": "string",
                      "workflowActionItemId": 0,
                      "description": "string",
                      "cost": 0,
                      "hours": 0
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Invoice template not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.invoicetemplates:r"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "InvoiceTemplates"
        ],
        "summary": "Updates specified invoice template in \"patch\" mode",
        "operationId": "InvoiceTemplates_Update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice template ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "description": "Invoice template update request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Memberships.V2.InvoiceTemplateUpdateRequest"
              },
              "example": {
                "name": "string",
                "createdOn": "string",
                "createdById": 0,
                "active": true,
                "items": [
                  {
                    "id": 0,
                    "skuId": 0,
                    "quantity": 0,
                    "unitPrice": 0,
                    "isAddOn": true,
                    "description": "string",
                    "cost": 0,
                    "hours": 0
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModificationResponse"
                },
                "example": {
                  "id": 0
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Invoice template not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.invoicetemplates:w"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/recurring-service-events": {
      "get": {
        "tags": [
          "LocationRecurringServiceEvents"
        ],
        "summary": "Gets a list of recurring service events",
        "operationId": "LocationRecurringServiceEvents_GetList",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Perform lookup by multiple IDs (maximum 50)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "description": "Location ID ",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "jobId",
            "in": "query",
            "description": "Job ID ",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Follow up status \\\nValues: [NotAttempted, Unreachable, Contacted, Won, Dismissed]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Memberships.V2.OpportunityStatus"
                }
              ]
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "description": "Return items created before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdOnOrAfter",
            "in": "query",
            "description": "Return items created on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedBefore",
            "in": "query",
            "description": "Return items modified before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedOnOrAfter",
            "in": "query",
            "description": "Return items modified on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "The logical number of page to return, starting from 1",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "How many records to return (50 by default)",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeTotal",
            "in": "query",
            "description": "Whether total count should be returned",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Applies sorting by specified fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_Of_Memberships.V2.LocationRecurringServiceEventResponse"
                },
                "example": {
                  "page": 0,
                  "pageSize": 0,
                  "hasMore": true,
                  "totalCount": 0,
                  "data": [
                    {
                      "id": 0,
                      "locationRecurringServiceId": 0,
                      "locationRecurringServiceName": "string",
                      "membershipId": 0,
                      "membershipName": "string",
                      "status": {},
                      "date": "string",
                      "createdOn": "string",
                      "jobId": 0,
                      "createdById": 0,
                      "modifiedOn": "string"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringserviceevents:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/recurring-service-events/{id}/mark-complete": {
      "post": {
        "tags": [
          "LocationRecurringServiceEvents"
        ],
        "summary": "Marks the specified recurring service event as complete",
        "description": "Marking an event as complete links the job with provided JobID to the given Location Recurring Service Event.\nIt will also copy over invoice items to the Job Invoice corresponding to the Invoice Template of the\nLocation Recurring Service the Event was generated from.",
        "operationId": "LocationRecurringServiceEvents_MarkComplete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Recurring service event ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "description": "Recurring service event status update request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Memberships.V2.MarkEventCompletedStatusUpdateRequest"
              },
              "example": {
                "jobId": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModificationResponse"
                },
                "example": {
                  "id": 0
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Recurring service event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringserviceevents:w"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/recurring-service-events/{id}/mark-incomplete": {
      "post": {
        "tags": [
          "LocationRecurringServiceEvents"
        ],
        "summary": "Marks the specified recurring service event as incomplete",
        "description": "Marking an event as incomplete unlinks the job with provided JobID to the given Location Recurring Service\nEvent. It will also delete the invoice items that were copied over when the Location Recurring Service Event\nwas marked as completed on the Job.",
        "operationId": "LocationRecurringServiceEvents_MarkIncomplete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Recurring service event ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "description": "Recurring service event status update request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Memberships.V2.MarkEventCompletedStatusUpdateRequest"
              },
              "example": {
                "jobId": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModificationResponse"
                },
                "example": {
                  "id": 0
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Recurring service event not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringserviceevents:w"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/recurring-services": {
      "get": {
        "tags": [
          "LocationRecurringServices"
        ],
        "summary": "Gets a list of recurring services",
        "operationId": "LocationRecurringServices_GetList",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Perform lookup by multiple IDs (maximum 50)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipIds",
            "in": "query",
            "description": "Filters by customer membership IDs",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationIds",
            "in": "query",
            "description": "Filters by location IDs",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "description": "What kind of items should be returned (only active items will be returned by default)\\\nValues: [True, Any, False]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ActiveRequestArg"
                }
              ]
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "description": "Return items created before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdOnOrAfter",
            "in": "query",
            "description": "Return items created on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedBefore",
            "in": "query",
            "description": "Return items modified before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedOnOrAfter",
            "in": "query",
            "description": "Return items modified on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "includeTechnicians",
            "in": "query",
            "description": "Whether technician IDs should be included in the result.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "The logical number of page to return, starting from 1",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "How many records to return (50 by default)",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeTotal",
            "in": "query",
            "description": "Whether total count should be returned",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Applies sorting by specified fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_Of_Memberships.V2.LocationRecurringServiceResponse"
                },
                "example": {
                  "page": 0,
                  "pageSize": 0,
                  "hasMore": true,
                  "totalCount": 0,
                  "data": [
                    {
                      "id": 0,
                      "name": "string",
                      "active": true,
                      "createdOn": "string",
                      "createdById": 0,
                      "modifiedOn": "string",
                      "importId": "string",
                      "membershipId": 0,
                      "locationId": 0,
                      "recurringServiceTypeId": 0,
                      "durationType": {},
                      "durationLength": 0,
                      "from": "string",
                      "to": "string",
                      "memo": "string",
                      "invoiceTemplateId": 0,
                      "invoiceTemplateForFollowingYearsId": 0,
                      "firstVisitComplete": true,
                      "activatedFromId": 0,
                      "allocation": 0,
                      "businessUnitId": 0,
                      "jobTypeId": 0,
                      "campaignId": 0,
                      "priority": {},
                      "jobSummary": "string",
                      "recurrenceType": {},
                      "recurrenceInterval": 0,
                      "recurrenceMonths": [
                        "January"
                      ],
                      "recurrenceDaysOfWeek": [
                        "Sunday"
                      ],
                      "recurrenceWeek": {},
                      "recurrenceDayOfNthWeek": {},
                      "recurrenceDaysOfMonth": [
                        0
                      ],
                      "jobStartTime": "string",
                      "estimatedPayrollCost": 0,
                      "preferredTechnicianIds": [
                        0
                      ],
                      "tagTypeIds": [
                        0
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringservices:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/recurring-services/{id}": {
      "get": {
        "tags": [
          "LocationRecurringServices"
        ],
        "summary": "Gets recurring service specified by ID",
        "operationId": "LocationRecurringServices_Get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Recurring service ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memberships.V2.LocationRecurringServiceResponse"
                },
                "example": {
                  "id": 0,
                  "name": "string",
                  "active": true,
                  "createdOn": "string",
                  "createdById": 0,
                  "modifiedOn": "string",
                  "importId": "string",
                  "membershipId": 0,
                  "locationId": 0,
                  "recurringServiceTypeId": 0,
                  "durationType": {},
                  "durationLength": 0,
                  "from": "string",
                  "to": "string",
                  "memo": "string",
                  "invoiceTemplateId": 0,
                  "invoiceTemplateForFollowingYearsId": 0,
                  "firstVisitComplete": true,
                  "activatedFromId": 0,
                  "allocation": 0,
                  "businessUnitId": 0,
                  "jobTypeId": 0,
                  "campaignId": 0,
                  "priority": {},
                  "jobSummary": "string",
                  "recurrenceType": {},
                  "recurrenceInterval": 0,
                  "recurrenceMonths": [
                    "January"
                  ],
                  "recurrenceDaysOfWeek": [
                    "Sunday"
                  ],
                  "recurrenceWeek": {},
                  "recurrenceDayOfNthWeek": {},
                  "recurrenceDaysOfMonth": [
                    0
                  ],
                  "jobStartTime": "string",
                  "estimatedPayrollCost": 0,
                  "preferredTechnicianIds": [
                    0
                  ],
                  "tagTypeIds": [
                    0
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Recurring service not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringservices:r"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "LocationRecurringServices"
        ],
        "summary": "Updates specified recurring service in \"patch\" mode",
        "operationId": "LocationRecurringServices_Update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Recurring service ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "description": "Recurring service update request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Memberships.V2.LocationRecurringServiceUpdateRequest"
              },
              "example": {
                "name": "string",
                "active": true,
                "recurringServiceTypeId": 0,
                "durationType": {},
                "durationLength": 0,
                "from": "string",
                "memo": "string",
                "invoiceTemplateId": 0,
                "invoiceTemplateForFollowingYearsId": 0,
                "businessUnitId": 0,
                "jobTypeId": 0,
                "campaignId": 0,
                "priority": {},
                "jobSummary": "string",
                "recurrenceType": {},
                "recurrenceInterval": 0,
                "recurrenceMonths": [
                  "January"
                ],
                "recurrenceDaysOfWeek": [
                  "Sunday"
                ],
                "recurrenceWeek": {},
                "recurrenceDayOfNthWeek": {},
                "jobStartTime": "string",
                "estimatedPayrollCost": 0,
                "tagTypeIds": [
                  0
                ],
                "preferredTechnicianIds": [
                  0
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModificationResponse"
                },
                "example": {
                  "id": 0
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Recurring service not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringservices:w"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/membership-types": {
      "get": {
        "tags": [
          "MembershipTypes"
        ],
        "summary": "Gets a list of membership types",
        "operationId": "MembershipTypes_GetList",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Perform lookup by multiple IDs (maximum 50)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "description": "What kind of items should be returned (only active items will be returned by default)\\\nValues: [True, Any, False]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ActiveRequestArg"
                }
              ]
            }
          },
          {
            "name": "duration",
            "in": "query",
            "description": "Filters by membership duration (in months); use null for ongoing memberships",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "billingFrequency",
            "in": "query",
            "description": "Filters by membership billing frequency\\\nValues: [OneTime, Monthly, EveryOtherMonth, Quarterly, BiAnnual, Annual]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Memberships.V2.MembershipRecurrenceType"
                }
              ]
            }
          },
          {
            "name": "includeDurationBilling",
            "in": "query",
            "description": "Whether duration/billing should be included in the result",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeDiscounts",
            "in": "query",
            "description": "Whether discounts should be included in the result",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeRecurringServices",
            "in": "query",
            "description": "Whether recurring service types associated with the membership type should be included in the result",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeTags",
            "in": "query",
            "description": "Whether tag type IDs associated with the membership type should be included in the result",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "description": "Return items created before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdOnOrAfter",
            "in": "query",
            "description": "Return items created on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedBefore",
            "in": "query",
            "description": "Return items modified before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedOnOrAfter",
            "in": "query",
            "description": "Return items modified on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "The logical number of page to return, starting from 1",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "How many records to return (50 by default)",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeTotal",
            "in": "query",
            "description": "Whether total count should be returned",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Applies sorting by specified fields",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_Of_Memberships.V2.MembershipTypeResponse"
                },
                "example": {
                  "page": 0,
                  "pageSize": 0,
                  "hasMore": true,
                  "totalCount": 0,
                  "data": [
                    {
                      "name": "string",
                      "displayName": "string",
                      "active": true,
                      "discountMode": {},
                      "locationTarget": {},
                      "revenueRecognitionMode": {},
                      "autoCalculateInvoiceTemplates": true,
                      "useMembershipPricingTable": true,
                      "showMembershipSavings": true,
                      "id": 0,
                      "createdOn": "string",
                      "createdById": 0,
                      "modifiedOn": "string",
                      "importId": "string",
                      "billingTemplateId": 0,
                      "discount": 0,
                      "durationBilling": [
                        {
                          "id": 0,
                          "duration": 0,
                          "billingFrequency": {},
                          "salePrice": 0,
                          "billingPrice": 0,
                          "renewalPrice": 0
                        }
                      ],
                      "discounts": [
                        {
                          "id": 0,
                          "targetId": 0,
                          "discount": 0
                        }
                      ],
                      "recurringServices": [
                        {
                          "id": 0,
                          "membershipTypeId": 0,
                          "recurringServiceTypeId": 0,
                          "offset": 0,
                          "offsetType": {},
                          "allocation": 0
                        }
                      ],
                      "tagTypeIds": [
                        0
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.membershiptypes:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/membership-types/{id}": {
      "get": {
        "tags": [
          "MembershipTypes"
        ],
        "summary": "Gets membership type specified by ID",
        "operationId": "MembershipTypes_Get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Membership type ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memberships.V2.MembershipTypeResponse"
                },
                "example": {
                  "name": "string",
                  "displayName": "string",
                  "active": true,
                  "discountMode": {},
                  "locationTarget": {},
                  "revenueRecognitionMode": {},
                  "autoCalculateInvoiceTemplates": true,
                  "useMembershipPricingTable": true,
                  "showMembershipSavings": true,
                  "id": 0,
                  "createdOn": "string",
                  "createdById": 0,
                  "modifiedOn": "string",
                  "importId": "string",
                  "billingTemplateId": 0,
                  "discount": 0,
                  "durationBilling": [
                    {
                      "id": 0,
                      "duration": 0,
                      "billingFrequency": {},
                      "salePrice": 0,
                      "billingPrice": 0,
                      "renewalPrice": 0
                    }
                  ],
                  "discounts": [
                    {
                      "id": 0,
                      "targetId": 0,
                      "discount": 0
                    }
                  ],
                  "recurringServices": [
                    {
                      "id": 0,
                      "membershipTypeId": 0,
                      "recurringServiceTypeId": 0,
                      "offset": 0,
                      "offsetType": {},
                      "allocation": 0
                    }
                  ],
                  "tagTypeIds": [
                    0
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Membership type not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.membershiptypes:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/membership-types/{id}/recurring-service-items": {
      "get": {
        "tags": [
          "MembershipTypes"
        ],
        "summary": "Gets recurring services for the given membership type",
        "operationId": "MembershipTypes_GetRecurringServiceItems",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Membership type ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Memberships.V2.MembershipTypeRecurringServiceItemResponse"
                  }
                },
                "example": [
                  {
                    "id": 0,
                    "membershipTypeId": 0,
                    "recurringServiceTypeId": 0,
                    "offset": 0,
                    "offsetType": {},
                    "allocation": 0,
                    "importId": "string",
                    "createdOn": "string",
                    "createdById": 0
                  }
                ]
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Membership type not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.membershiptypes:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/membership-types/{id}/discounts": {
      "get": {
        "tags": [
          "MembershipTypes"
        ],
        "summary": "Gets discounts for the given membership type",
        "operationId": "MembershipTypes_GetDiscountsList",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Membership type ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Memberships.V2.MembershipTypeDiscountItemResponse"
                  }
                },
                "example": [
                  {
                    "id": 0,
                    "targetId": 0,
                    "discount": 0,
                    "createdOn": "string",
                    "createdById": 0
                  }
                ]
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Membership type not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.membershiptypes:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/membership-types/{id}/duration-billing-items": {
      "get": {
        "tags": [
          "MembershipTypes"
        ],
        "summary": "Gets duration/billing options for the given membership type",
        "operationId": "MembershipTypes_GetDurationBillingList",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Membership type ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "active",
            "in": "query",
            "description": "What kind of items should be returned (only active items will be returned by default)\\\nValues: [True, Any, False]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ActiveRequestArg"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Memberships.V2.MembershipTypeDurationBillingItemResponse"
                  }
                },
                "example": [
                  {
                    "id": 0,
                    "duration": 0,
                    "billingFrequency": {},
                    "salePrice": 0,
                    "billingPrice": 0,
                    "renewalPrice": 0,
                    "importId": "string",
                    "active": true,
                    "createdOn": "string",
                    "createdById": 0
                  }
                ]
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Membership type not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.membershiptypes:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/recurring-service-types": {
      "get": {
        "tags": [
          "RecurringServiceTypes"
        ],
        "summary": "Gets a list of recurring service types",
        "operationId": "RecurringServiceTypes_GetList",
        "parameters": [
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Perform lookup by multiple IDs (maximum 50)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipTypeId",
            "in": "query",
            "description": "Filters by membership type ID",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "recurrenceType",
            "in": "query",
            "description": "Filters by recurrence type\\\nValues: [Weekly, Monthly, Seasonal, Daily, NthWeekdayOfMonth]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceType"
                }
              ]
            }
          },
          {
            "name": "durationType",
            "in": "query",
            "description": "Filters by duration type\\\nValues: [Continuous, NumberOfVisits]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceDuration"
                }
              ]
            }
          },
          {
            "name": "active",
            "in": "query",
            "description": "What kind of items should be returned (only active items will be returned by default)\\\nValues: [True, Any, False]",
            "schema": {
              "type": "string",
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ActiveRequestArg"
                }
              ]
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "description": "Return items created before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdOnOrAfter",
            "in": "query",
            "description": "Return items created on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedBefore",
            "in": "query",
            "description": "Return items modified before certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "modifiedOnOrAfter",
            "in": "query",
            "description": "Return items modified on or after certain date/time (in UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "The logical number of page to return, starting from 1",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "How many records to return (50 by default)",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeTotal",
            "in": "query",
            "description": "Whether total count should be returned",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Applies sorting by the specified field:\\\n\"?sort=+FieldName\" for ascending order,\\\n\"?sort=-FieldName\" for descending order.\\\n\\\nAvailable fields are: Id, Name, CreatedOn, ModifiedOn.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_Of_Memberships.V2.RecurringServiceTypeResponse"
                },
                "example": {
                  "page": 0,
                  "pageSize": 0,
                  "hasMore": true,
                  "totalCount": 0,
                  "data": [
                    {
                      "id": 0,
                      "createdOn": "string",
                      "createdById": 0,
                      "modifiedOn": "string",
                      "active": true,
                      "recurrenceType": {},
                      "recurrenceInterval": 0,
                      "recurrenceMonths": [
                        "January"
                      ],
                      "durationType": {},
                      "durationLength": 0,
                      "invoiceTemplateId": 0,
                      "businessUnitId": 0,
                      "jobTypeId": 0,
                      "priority": {},
                      "campaignId": 0,
                      "jobSummary": "string",
                      "name": "string",
                      "importId": "string"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringservicetypes:r"
            ]
          }
        ]
      }
    },
    "/tenant/{tenant}/recurring-service-types/{id}": {
      "get": {
        "tags": [
          "RecurringServiceTypes"
        ],
        "summary": "Gets recurring service type specified by ID",
        "operationId": "RecurringServiceTypes_Get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Recurring service type ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tenant",
            "in": "path",
            "description": "Tenant ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request has succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memberships.V2.RecurringServiceTypeResponse"
                },
                "example": {
                  "id": 0,
                  "createdOn": "string",
                  "createdById": 0,
                  "modifiedOn": "string",
                  "active": true,
                  "recurrenceType": {},
                  "recurrenceInterval": 0,
                  "recurrenceMonths": [
                    "January"
                  ],
                  "durationType": {},
                  "durationLength": 0,
                  "invoiceTemplateId": 0,
                  "businessUnitId": 0,
                  "jobTypeId": 0,
                  "priority": {},
                  "campaignId": 0,
                  "jobSummary": "string",
                  "name": "string",
                  "importId": "string"
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be processed, check validation errors or request format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "Recurring service type not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "type": "string",
                  "title": "string",
                  "status": 0,
                  "traceId": "string",
                  "errors": {},
                  "data": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyHeader": [],
            "oauth": [
              "tn.mem.recurringservicetypes:r"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "PaginatedResponse_Of_Memberships.V2.CustomerMembershipResponse": {
        "required": [
          "page",
          "pageSize",
          "hasMore",
          "data"
        ],
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "description": "From which page this output has started",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Page size for this query (i.e. how many records were requested to return)",
            "format": "int32"
          },
          "hasMore": {
            "type": "boolean",
            "description": "True if there are more records in the query than returned in this result"
          },
          "totalCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total count of records for this query (can optionally be populated)",
            "format": "int32"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.CustomerMembershipResponse"
            },
            "description": "The collection of result items, will never have more than PageSize items"
          }
        },
        "additionalProperties": false,
        "description": "Represents paginated API response."
      },
      "Memberships.V2.CustomerMembershipResponse": {
        "required": [
          "id",
          "createdOn",
          "modifiedOn",
          "followUpOn",
          "billingFrequency",
          "status",
          "followUpStatus",
          "active",
          "initialDeferredRevenue",
          "businessUnitId",
          "customerId",
          "membershipTypeId",
          "customFields"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Customer membership ID",
            "format": "int64"
          },
          "createdOn": {
            "type": "string",
            "description": "When customer membership was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this membership",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "When customer membership was last modified",
            "format": "date-time"
          },
          "followUpOn": {
            "type": "string",
            "description": "Follow up on date",
            "format": "date-time"
          },
          "cancellationDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "When customer membership was or will be cancelled",
            "format": "date-time"
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "description": "Beginning date of customer membership",
            "format": "date-time"
          },
          "nextScheduledBillDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Next scheduled billing date",
            "format": "date-time"
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "description": "End date of customer membership",
            "format": "date-time"
          },
          "billingFrequency": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipRecurrenceType"
              }
            ],
            "description": "How often the customer membership is billed"
          },
          "renewalBillingFrequency": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipRecurrenceType"
              },
              {
                "type": "null"
              }
            ],
            "description": "Renewal billing frequency"
          },
          "status": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipStatus"
              }
            ],
            "description": "Current status of the customer membership"
          },
          "followUpStatus": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.OpportunityStatus"
              }
            ],
            "description": "Follow-up status of the customer membership"
          },
          "active": {
            "type": "boolean",
            "description": "Whether customer membership is active"
          },
          "initialDeferredRevenue": {
            "type": "number",
            "description": "Initial deferred revenue",
            "format": "decimal"
          },
          "duration": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Duration of customer membership in months",
            "format": "int32"
          },
          "renewalDuration": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Renewal duration",
            "format": "int32"
          },
          "businessUnitId": {
            "type": "integer",
            "description": "Business unit ID",
            "format": "int64"
          },
          "customerId": {
            "type": "integer",
            "description": "Customer ID of membership",
            "format": "int64"
          },
          "membershipTypeId": {
            "type": "integer",
            "description": "The membership type ID of the customer membership",
            "format": "int64"
          },
          "activatedById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that activated this membership",
            "format": "int64"
          },
          "activatedFromId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the invoice item that is the sale task of this membership",
            "format": "int64"
          },
          "billingTemplateId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the invoice template used for membership billing",
            "format": "int64"
          },
          "cancellationBalanceInvoiceId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Cancellation balance invoice ID",
            "format": "int64"
          },
          "cancellationInvoiceId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the invoice that either charged or refunded the deferred revenue balance of the customer membership",
            "format": "int64"
          },
          "followUpCustomStatusId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of custom followup status",
            "format": "int64"
          },
          "locationId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of location for this customer membership",
            "format": "int64"
          },
          "paymentMethodId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Preferred payment method ID",
            "format": "int64"
          },
          "paymentTypeId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of payment type",
            "format": "int64"
          },
          "recurringLocationId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Recurring Location ID",
            "format": "int64"
          },
          "renewalMembershipTaskId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Task ID that renews this membership",
            "format": "int64"
          },
          "renewedById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the renewal membership",
            "format": "int64"
          },
          "soldById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that was credited for the sale of this membership",
            "format": "int64"
          },
          "customerPo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer Purchase Order"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal import ID label"
          },
          "memo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Memo for customer membership"
          },
          "customFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.CustomFieldResponse"
            },
            "description": "List of custom fields"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.MembershipRecurrenceType": {
        "enum": [
          "OneTime",
          "Monthly",
          "EveryOtherMonth",
          "Quarterly",
          "BiAnnual",
          "Annual"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "OneTime",
          "Monthly",
          "EveryOtherMonth",
          "Quarterly",
          "BiAnnual",
          "Annual"
        ]
      },
      "Memberships.V2.MembershipStatus": {
        "enum": [
          "Active",
          "Suspended",
          "Expired",
          "Canceled",
          "Deleted"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Active",
          "Suspended",
          "Expired",
          "Canceled",
          "Deleted"
        ]
      },
      "Memberships.V2.OpportunityStatus": {
        "enum": [
          "NotAttempted",
          "Unreachable",
          "Contacted",
          "Won",
          "Dismissed"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "NotAttempted",
          "Unreachable",
          "Contacted",
          "Won",
          "Dismissed"
        ]
      },
      "Memberships.V2.CustomFieldResponse": {
        "required": [
          "typeId",
          "name"
        ],
        "type": "object",
        "properties": {
          "typeId": {
            "type": "integer",
            "description": "Custom field type id",
            "format": "int64"
          },
          "name": {
            "type": "string",
            "description": "Custom field name"
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom field value"
          }
        },
        "additionalProperties": false
      },
      "ApiErrorResponse": {
        "required": [
          "type",
          "title",
          "status",
          "traceId",
          "errors",
          "data"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "A URI reference that identifies the problem type"
          },
          "title": {
            "type": "string",
            "description": "A short, human-readable summary of the problem type"
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status code generated by server",
            "format": "int32"
          },
          "traceId": {
            "type": "string",
            "description": "Internal trace ID for advanced diagnostics"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Provides more details about errors occurred, which can potentially be used for visual display"
          },
          "data": {
            "type": "object",
            "additionalProperties": {},
            "description": "Provides additional data, intended for programmatical usage"
          }
        },
        "additionalProperties": false,
        "description": "Detailed error response, following RFC 7807 recommendations (https://tools.ietf.org/html/rfc7807)."
      },
      "ActiveRequestArg": {
        "enum": [
          "True",
          "Any",
          "False"
        ],
        "type": "string",
        "description": "Represents possible HTTP query argument values, when applying filters based on active status.",
        "x-enumNames": [
          "True",
          "Any",
          "False"
        ]
      },
      "PaginatedResponse_Of_Memberships.V2.CustomFieldTypeResponse": {
        "required": [
          "page",
          "pageSize",
          "hasMore",
          "data"
        ],
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "description": "From which page this output has started",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Page size for this query (i.e. how many records were requested to return)",
            "format": "int32"
          },
          "hasMore": {
            "type": "boolean",
            "description": "True if there are more records in the query than returned in this result"
          },
          "totalCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total count of records for this query (can optionally be populated)",
            "format": "int32"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.CustomFieldTypeResponse"
            },
            "description": "The collection of result items, will never have more than PageSize items"
          }
        },
        "additionalProperties": false,
        "description": "Represents paginated API response."
      },
      "Memberships.V2.CustomFieldTypeResponse": {
        "required": [
          "id",
          "name",
          "dataType",
          "createdOn",
          "modifiedOn"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The ID of the custom field.",
            "format": "int64"
          },
          "name": {
            "type": "string",
            "description": "The name of the custom field."
          },
          "dataType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.CustomFieldDataType"
              }
            ],
            "description": "Indicates the data type of the custom field."
          },
          "dataTypeOptions": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Indicates the dropdown options if the custom field is a dropdown data type."
          },
          "createdOn": {
            "type": "string",
            "description": "The date the custom field was created in UTC date / time.",
            "format": "date-time"
          },
          "modifiedOn": {
            "type": "string",
            "description": "The last date the custom field was modified in UTC date / time.",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.CustomFieldDataType": {
        "enum": [
          "Text",
          "Dropdown",
          "Numeric"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Text",
          "Dropdown",
          "Numeric"
        ]
      },
      "Memberships.V2.CustomerMembershipStatusChangeItemResponse": {
        "required": [
          "id",
          "oldStatus",
          "newStatus",
          "createdOn"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the status change record",
            "format": "int64"
          },
          "oldStatus": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipStatus"
              }
            ],
            "description": "Previous status value"
          },
          "newStatus": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipStatus"
              }
            ],
            "description": "New status value"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional note attached to this status change"
          },
          "createdOn": {
            "type": "string",
            "description": "When this status change record was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this status change record",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "ModificationResponse": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The ID of created/updated object",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Default response when creating object with a new ID, or updating object by specified ID."
      },
      "Memberships.V2.CustomerMembershipUpdateRequest": {
        "type": "object",
        "properties": {
          "businessUnitId": {
            "type": "integer",
            "description": "ID of the Business Unit associated with this membership",
            "format": "int64"
          },
          "nextScheduledBillDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Next date that this membership will be billed on",
            "format": "date-time"
          },
          "status": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipStatus"
              }
            ],
            "description": "Status of the membership"
          },
          "memo": {
            "type": "string",
            "description": "Memo text field"
          },
          "from": {
            "type": "string",
            "description": "The starting date of this membership",
            "format": "date-time"
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "description": "The end date of this membership (null if ongoing)",
            "format": "date-time"
          },
          "soldById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that was credited for the sale of this membership",
            "format": "int64"
          },
          "billingTemplateId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The ID of the invoice template used to bill this membership.\nCan either be a \"settings template\" (when invoice template is shared – in this case new invoice template will be created),\nor be a new invoice template created specifically for this customer membership.",
            "format": "int64"
          },
          "locationId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Discount location ID of this membership (null if all locations)",
            "format": "int64"
          },
          "recurringServiceAction": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.RecurringServiceAction"
              }
            ],
            "description": "Required if RecurringLocationId is set.\nDetermines how many of the customer's locations that recurring services should be added to: all, single, or none (which deletes existing recurring services)."
          },
          "recurringLocationId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The location at which recurring services are scheduled (null if all locations)",
            "format": "int64"
          },
          "paymentMethodId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The ID of the payment method (credit card or bank account) that should be used for this membership. This\nfield is mutually exclusive with payment type. Only one or the other can be set at a time.",
            "format": "int64"
          },
          "paymentTypeId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The payment type (cash, check, etc) that should be used for this membership. This field is mutually\nexclusive with payment type. Only one or the other can be set at a time. Setting payment type means we will\nnot automatically use a payment method to bill the membership and payment will have to be collected manually.",
            "format": "int64"
          },
          "renewalMembershipTaskId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The ID of the service that will be used as the default to renew this membership.",
            "format": "int64"
          },
          "initialDeferredRevenue": {
            "type": "number",
            "description": "The amount of deferred revenue that this membership should start with that is not accounted for\nin the sale task.",
            "format": "decimal"
          },
          "cancellationBalanceInvoiceId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The ID of the invoice created upon membership cancellation in order to zero out the deferred revenue balance.",
            "format": "int64"
          },
          "cancellationInvoiceId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The ID of the invoice optionally created upon membership cancellation in order to charge (or refund) the\ncustomer if deferred revenue balance is not 0.",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.RecurringServiceAction": {
        "enum": [
          "None",
          "Single",
          "All"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "None",
          "Single",
          "All"
        ]
      },
      "Memberships.V2.MembershipSaleInvoiceCreateResponse": {
        "required": [
          "invoiceId",
          "customerMembershipId"
        ],
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "integer",
            "description": "ID of sale invoice created",
            "format": "int64"
          },
          "customerMembershipId": {
            "type": "integer",
            "description": "ID of customer membership that was created",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.MembershipSaleInvoiceCreateRequest": {
        "required": [
          "customerId",
          "businessUnitId",
          "saleTaskId",
          "durationBillingId",
          "recurringServiceAction"
        ],
        "type": "object",
        "properties": {
          "customerId": {
            "type": "integer",
            "description": "ID of the customer you are creating the Membership Sale Invoice for",
            "format": "int64"
          },
          "businessUnitId": {
            "type": "integer",
            "description": "Business unit ID",
            "format": "int64"
          },
          "saleTaskId": {
            "type": "integer",
            "description": "ID of the sale task that is creating the membership",
            "format": "int64"
          },
          "durationBillingId": {
            "type": "integer",
            "description": "ID of the duration/billing option to be used",
            "format": "int64"
          },
          "locationId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Discount location ID of this membership (null if all locations)",
            "format": "int64"
          },
          "recurringServiceAction": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.RecurringServiceAction"
              }
            ],
            "description": "Required if RecurringLocationId is set.\nDetermines how many of the customer's locations that recurring services should be added to: all, single, or none (which deletes existing recurring services)."
          },
          "recurringLocationId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The location at which recurring services are scheduled (null if all locations)",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "ExportResponse_Of_Memberships.V2.ExportMembershipTypeResponse": {
        "required": [
          "hasMore",
          "continueFrom",
          "data"
        ],
        "type": "object",
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "Indicates whether the export feed has reached its logical \"end\", or if there is more to export.\nTrue means the consumer can invoke another request right away using new continuation token value.\nFalse means there is now new data for the export, and the consumer should wait for some time (5-10 minutes)\nbefore making another request."
          },
          "continueFrom": {
            "type": "string",
            "description": "Continuation token used to resume the export operation. The value should be used in \"from\" query parameter of the following request."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.ExportMembershipTypeResponse"
            },
            "description": "The collection of exported items, usually sorted chronologically based on modification date"
          }
        },
        "additionalProperties": false,
        "description": "Represents export API response."
      },
      "Memberships.V2.ExportMembershipTypeResponse": {
        "required": [
          "id",
          "createdOn",
          "modifiedOn",
          "discount",
          "name",
          "active",
          "discountMode",
          "locationTarget",
          "revenueRecognitionMode",
          "autoCalculateInvoiceTemplates",
          "useMembershipPricingTable",
          "showMembershipSavings"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Membership type ID",
            "format": "int64"
          },
          "createdOn": {
            "type": "string",
            "description": "When membership type was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this membership type",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "When membership type was modified",
            "format": "date-time"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal import ID label"
          },
          "billingTemplateId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Billing template ID",
            "format": "int64"
          },
          "discount": {
            "type": "number",
            "description": "Membership type discount percentage (0 to 100). This is relevant only when the DiscountMode is `Basic`.",
            "format": "decimal"
          },
          "durationBilling": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.MembershipTypeDurationBillingEntry"
            },
            "description": "Membership type duration billing options.\nIf this field is null, it means it was not requested to be loaded via the `IncludeDurationBilling` flag."
          },
          "discounts": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.MembershipTypeDiscountEntry"
            },
            "description": "Membership type discounts. This includes a list containing the target of a discount (either a business unit ID or a pricebook\ncategory ID) as well as the percentage discount (0 to 100). Note that this list is relevant only when the\nDiscountMode is set to `Categories` or `BusinessUnits`.\nIf this field is null, it means it was not requested to be loaded via the `IncludeDiscounts` flag."
          },
          "recurringServices": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.MembershipTypeRecurringServiceEntry"
            },
            "description": "Membership type recurring service items associated with this membership type. Each item includes the recurring service type ID,\noffset, offset type, and allocation percentage.\nIf this field is null, it means it was not requested to be loaded via the `IncludeRecurringServices` flag."
          },
          "tagTypeIds": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Tag type IDs associated with this membership type.\nIf this field is null, it means it was not requested to be loaded via the `IncludeTagTypeIds` flag."
          },
          "name": {
            "type": "string",
            "description": "Membership type name"
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Membership type display name. This is used in the Customer Portal and will be null if not set through the Membership Wizard."
          },
          "active": {
            "type": "boolean",
            "description": "Whether membership type is active"
          },
          "discountMode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.DiscountMode"
              }
            ],
            "description": "Membership discount mode"
          },
          "locationTarget": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipLocationTarget"
              }
            ],
            "description": "Membership location target"
          },
          "revenueRecognitionMode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.RevenueRecognitionMode"
              }
            ],
            "description": "Membership revenue recognition mode"
          },
          "autoCalculateInvoiceTemplates": {
            "type": "boolean",
            "description": "Whether invoice templates should be auto-calculated"
          },
          "useMembershipPricingTable": {
            "type": "boolean",
            "description": "Whether membership pricing table should be used"
          },
          "showMembershipSavings": {
            "type": "boolean",
            "description": "Whether membership savings should be displayed"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.MembershipTypeDurationBillingEntry": {
        "required": [
          "id",
          "billingFrequency",
          "salePrice",
          "billingPrice",
          "renewalPrice"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the duration/billing option",
            "format": "int64"
          },
          "duration": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Duration of the entry ",
            "format": "int32"
          },
          "billingFrequency": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipRecurrenceType"
              }
            ],
            "description": "Billing frequency of the entry"
          },
          "salePrice": {
            "type": "number",
            "description": "Sale price of the entry",
            "format": "decimal"
          },
          "billingPrice": {
            "type": "number",
            "description": "Billing price of the entry",
            "format": "decimal"
          },
          "renewalPrice": {
            "type": "number",
            "description": "Renewal price of the entry",
            "format": "decimal"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.MembershipTypeDiscountEntry": {
        "required": [
          "id",
          "targetId",
          "discount"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the discount item",
            "format": "int64"
          },
          "targetId": {
            "type": "integer",
            "description": "ID of the discount's target, which can be either a business unit or pricebook category",
            "format": "int64"
          },
          "discount": {
            "type": "number",
            "description": "Percentage discount (0 to 100)",
            "format": "decimal"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.MembershipTypeRecurringServiceEntry": {
        "required": [
          "id",
          "membershipTypeId",
          "recurringServiceTypeId",
          "offset",
          "offsetType",
          "allocation"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the recurring service item",
            "format": "int64"
          },
          "membershipTypeId": {
            "type": "integer",
            "description": "Membership type ID associated with the item",
            "format": "int64"
          },
          "recurringServiceTypeId": {
            "type": "integer",
            "description": "Recurring service type ID associated with the item",
            "format": "int64"
          },
          "offset": {
            "type": "integer",
            "description": "Number of weeks or months (depending on offset type) between membership start and recurring service start",
            "format": "int32"
          },
          "offsetType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.OffsetType"
              }
            ],
            "description": "Offset type of the recurring service type associated with this item, can be weeks (0) or months (1)"
          },
          "allocation": {
            "type": "number",
            "description": "The percentage of deferred revenue allocated to the recurring service item",
            "format": "decimal"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.OffsetType": {
        "enum": [
          "Weeks",
          "Months"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Weeks",
          "Months"
        ]
      },
      "Memberships.V2.DiscountMode": {
        "enum": [
          "Basic",
          "Units",
          "Categories"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Basic",
          "Units",
          "Categories"
        ]
      },
      "Memberships.V2.MembershipLocationTarget": {
        "enum": [
          "AllLocations",
          "SingleLocation"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "AllLocations",
          "SingleLocation"
        ]
      },
      "Memberships.V2.RevenueRecognitionMode": {
        "enum": [
          "PointOfSale",
          "Deferred"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "PointOfSale",
          "Deferred"
        ]
      },
      "ExportResponse_Of_Memberships.V2.ExportRecurringServiceTypeResponse": {
        "required": [
          "hasMore",
          "continueFrom",
          "data"
        ],
        "type": "object",
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "Indicates whether the export feed has reached its logical \"end\", or if there is more to export.\nTrue means the consumer can invoke another request right away using new continuation token value.\nFalse means there is now new data for the export, and the consumer should wait for some time (5-10 minutes)\nbefore making another request."
          },
          "continueFrom": {
            "type": "string",
            "description": "Continuation token used to resume the export operation. The value should be used in \"from\" query parameter of the following request."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.ExportRecurringServiceTypeResponse"
            },
            "description": "The collection of exported items, usually sorted chronologically based on modification date"
          }
        },
        "additionalProperties": false,
        "description": "Represents export API response."
      },
      "Memberships.V2.ExportRecurringServiceTypeResponse": {
        "required": [
          "id",
          "createdOn",
          "modifiedOn",
          "active",
          "recurrenceType",
          "recurrenceInterval",
          "recurrenceMonths",
          "durationType",
          "durationLength",
          "priority"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Recurring service type ID",
            "format": "int64"
          },
          "createdOn": {
            "type": "string",
            "description": "When recurring service type was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this recurring service type",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "When recurring service type was modified",
            "format": "date-time"
          },
          "active": {
            "type": "boolean",
            "description": "Whether recurring service type is active"
          },
          "recurrenceType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceType"
              }
            ],
            "description": "The recurrence type (e.g. Daily, Weekly, Monthly)"
          },
          "recurrenceInterval": {
            "type": "integer",
            "description": "The recurrence interval for the given recurrence type",
            "format": "int32"
          },
          "recurrenceMonths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.Month"
            },
            "description": "A list of months when the recurring service occurs, if it is a seasonal recurrence type"
          },
          "durationType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceDuration"
              }
            ],
            "description": "The recurrence duration type"
          },
          "durationLength": {
            "type": "integer",
            "description": "The recurrence duration length (number of events)",
            "format": "int32"
          },
          "invoiceTemplateId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice template ID",
            "format": "int64"
          },
          "businessUnitId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Business unit ID",
            "format": "int64"
          },
          "jobTypeId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Job type ID",
            "format": "int64"
          },
          "priority": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.Priority"
              }
            ],
            "description": "Priority"
          },
          "campaignId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Campaign ID",
            "format": "int64"
          },
          "jobSummary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job summary"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recurring service type name"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Import ID"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.ServiceRecurrenceType": {
        "enum": [
          "Weekly",
          "Monthly",
          "Seasonal",
          "Daily",
          "NthWeekdayOfMonth"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Weekly",
          "Monthly",
          "Seasonal",
          "Daily",
          "NthWeekdayOfMonth"
        ]
      },
      "Memberships.V2.Month": {
        "enum": [
          "January",
          "February",
          "March",
          "April",
          "May",
          "June",
          "July",
          "August",
          "September",
          "October",
          "November",
          "December"
        ],
        "type": "string",
        "description": "Month name as a string, e.g. \"January\" or \"May\"",
        "x-enumNames": [
          "January",
          "February",
          "March",
          "April",
          "May",
          "June",
          "July",
          "August",
          "September",
          "October",
          "November",
          "December"
        ]
      },
      "Memberships.V2.ServiceRecurrenceDuration": {
        "enum": [
          "Continuous",
          "NumberOfVisits"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Continuous",
          "NumberOfVisits"
        ]
      },
      "Memberships.V2.Priority": {
        "enum": [
          "Low",
          "Normal",
          "High",
          "Urgent"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Low",
          "Normal",
          "High",
          "Urgent"
        ]
      },
      "ExportResponse_Of_Memberships.V2.ExportCustomerMembershipResponse": {
        "required": [
          "hasMore",
          "continueFrom",
          "data"
        ],
        "type": "object",
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "Indicates whether the export feed has reached its logical \"end\", or if there is more to export.\nTrue means the consumer can invoke another request right away using new continuation token value.\nFalse means there is now new data for the export, and the consumer should wait for some time (5-10 minutes)\nbefore making another request."
          },
          "continueFrom": {
            "type": "string",
            "description": "Continuation token used to resume the export operation. The value should be used in \"from\" query parameter of the following request."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.ExportCustomerMembershipResponse"
            },
            "description": "The collection of exported items, usually sorted chronologically based on modification date"
          }
        },
        "additionalProperties": false,
        "description": "Represents export API response."
      },
      "Memberships.V2.ExportCustomerMembershipResponse": {
        "required": [
          "id",
          "createdOn",
          "modifiedOn",
          "followUpOn",
          "billingFrequency",
          "status",
          "followUpStatus",
          "active",
          "initialDeferredRevenue",
          "businessUnitId",
          "customerId",
          "membershipTypeId",
          "customFields"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Customer membership ID",
            "format": "int64"
          },
          "createdOn": {
            "type": "string",
            "description": "When customer membership was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this membership",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "When customer membership was last modified",
            "format": "date-time"
          },
          "followUpOn": {
            "type": "string",
            "description": "Follow up on date",
            "format": "date-time"
          },
          "cancellationDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "When customer membership was or will be cancelled",
            "format": "date-time"
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "description": "Beginning date of customer membership",
            "format": "date-time"
          },
          "nextScheduledBillDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Next scheduled billing date",
            "format": "date-time"
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "description": "End date of customer membership",
            "format": "date-time"
          },
          "billingFrequency": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipRecurrenceType"
              }
            ],
            "description": "How often the customer membership is billed"
          },
          "renewalBillingFrequency": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipRecurrenceType"
              },
              {
                "type": "null"
              }
            ],
            "description": "Renewal billing frequency"
          },
          "status": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipStatus"
              }
            ],
            "description": "Current status of the customer membership"
          },
          "followUpStatus": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.OpportunityStatus"
              }
            ],
            "description": "Follow-up status of the customer membership"
          },
          "active": {
            "type": "boolean",
            "description": "Whether customer membership is active"
          },
          "initialDeferredRevenue": {
            "type": "number",
            "description": "Initial deferred revenue",
            "format": "decimal"
          },
          "duration": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Duration of customer membership in months",
            "format": "int32"
          },
          "renewalDuration": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Renewal duration",
            "format": "int32"
          },
          "businessUnitId": {
            "type": "integer",
            "description": "Business unit ID",
            "format": "int64"
          },
          "customerId": {
            "type": "integer",
            "description": "Customer ID of membership",
            "format": "int64"
          },
          "membershipTypeId": {
            "type": "integer",
            "description": "The membership type ID of the customer membership",
            "format": "int64"
          },
          "activatedById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that activated this membership",
            "format": "int64"
          },
          "activatedFromId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the invoice item that is the sale task of this membership",
            "format": "int64"
          },
          "billingTemplateId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the invoice template used for membership billing",
            "format": "int64"
          },
          "cancellationBalanceInvoiceId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Cancellation balance invoice ID",
            "format": "int64"
          },
          "cancellationInvoiceId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the invoice that either charged or refunded the deferred revenue balance of the customer membership",
            "format": "int64"
          },
          "followUpCustomStatusId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of custom followup status",
            "format": "int64"
          },
          "locationId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of location for this customer membership",
            "format": "int64"
          },
          "paymentMethodId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Preferred payment method ID",
            "format": "int64"
          },
          "paymentTypeId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of payment type",
            "format": "int64"
          },
          "recurringLocationId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Recurring Location ID",
            "format": "int64"
          },
          "renewalMembershipTaskId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Task ID that renews this membership",
            "format": "int64"
          },
          "renewedById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the renewal membership",
            "format": "int64"
          },
          "soldById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that was credited for the sale of this membership",
            "format": "int64"
          },
          "customerPo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer Purchase Order"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal import ID label"
          },
          "memo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Memo for customer membership"
          },
          "customFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.CustomFieldResponse"
            },
            "description": "List of custom fields"
          }
        },
        "additionalProperties": false
      },
      "ExportResponse_Of_Memberships.V2.ExportInvoiceTemplateResponse": {
        "required": [
          "hasMore",
          "continueFrom",
          "data"
        ],
        "type": "object",
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "Indicates whether the export feed has reached its logical \"end\", or if there is more to export.\nTrue means the consumer can invoke another request right away using new continuation token value.\nFalse means there is now new data for the export, and the consumer should wait for some time (5-10 minutes)\nbefore making another request."
          },
          "continueFrom": {
            "type": "string",
            "description": "Continuation token used to resume the export operation. The value should be used in \"from\" query parameter of the following request."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.ExportInvoiceTemplateResponse"
            },
            "description": "The collection of exported items, usually sorted chronologically based on modification date"
          }
        },
        "additionalProperties": false,
        "description": "Represents export API response."
      },
      "Memberships.V2.ExportInvoiceTemplateResponse": {
        "required": [
          "id",
          "createdOn",
          "modifiedOn",
          "active",
          "total",
          "isSettingsTemplate",
          "items"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Invoice template ID",
            "format": "int64"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Invoice template name (used only for shared invoice templates)"
          },
          "createdOn": {
            "type": "string",
            "description": "Invoice template creation date",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created invoice template",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "Invoice template modification date",
            "format": "date-time"
          },
          "active": {
            "type": "boolean",
            "description": "Whether invoice template is active"
          },
          "total": {
            "type": "number",
            "description": "Invoice template total",
            "format": "decimal"
          },
          "isSettingsTemplate": {
            "type": "boolean",
            "description": "Whether invoice template is shared (i.e. visible on the Settings page)"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Import ID"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.InvoiceTemplateItemResponse"
            },
            "description": "A list of invoice template items"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.InvoiceTemplateItemResponse": {
        "required": [
          "id",
          "skuId",
          "skuType",
          "quantity",
          "unitPrice",
          "isAddOn"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Invoice template item ID",
            "format": "int64"
          },
          "skuId": {
            "type": "integer",
            "description": "Linked SKU ID",
            "format": "int64"
          },
          "skuType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.SkuType"
              }
            ],
            "description": "The type of linked SKU"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity",
            "format": "decimal"
          },
          "unitPrice": {
            "type": "number",
            "description": "Unit price",
            "format": "decimal"
          },
          "isAddOn": {
            "type": "boolean",
            "description": "Whether invoice item is add-on"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Import ID"
          },
          "workflowActionItemId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The invoice item ID that created this invoice template item via ModifyMembershipWorkflowAction",
            "format": "int64"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Item description",
            "format": "html"
          },
          "cost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Materials cost",
            "format": "decimal"
          },
          "hours": {
            "type": [
              "number",
              "null"
            ],
            "description": "Sold/billable hours",
            "format": "decimal"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.SkuType": {
        "enum": [
          "Service",
          "Material",
          "Equipment",
          "PriceModifier"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Service",
          "Material",
          "Equipment",
          "PriceModifier"
        ]
      },
      "ExportResponse_Of_Memberships.V2.ExportLocationRecurringServiceResponse": {
        "required": [
          "hasMore",
          "continueFrom",
          "data"
        ],
        "type": "object",
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "Indicates whether the export feed has reached its logical \"end\", or if there is more to export.\nTrue means the consumer can invoke another request right away using new continuation token value.\nFalse means there is now new data for the export, and the consumer should wait for some time (5-10 minutes)\nbefore making another request."
          },
          "continueFrom": {
            "type": "string",
            "description": "Continuation token used to resume the export operation. The value should be used in \"from\" query parameter of the following request."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.ExportLocationRecurringServiceResponse"
            },
            "description": "The collection of exported items, usually sorted chronologically based on modification date"
          }
        },
        "additionalProperties": false,
        "description": "Represents export API response."
      },
      "Memberships.V2.ExportLocationRecurringServiceResponse": {
        "required": [
          "id",
          "name",
          "active",
          "createdOn",
          "modifiedOn",
          "locationId",
          "recurringServiceTypeId",
          "durationType",
          "durationLength",
          "firstVisitComplete",
          "allocation",
          "priority",
          "recurrenceType",
          "recurrenceInterval",
          "recurrenceMonths",
          "recurrenceDaysOfWeek",
          "recurrenceWeek",
          "recurrenceDaysOfMonth",
          "tagTypeIds"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Recurring service ID",
            "format": "int64"
          },
          "name": {
            "type": "string",
            "description": "Recurring service name"
          },
          "active": {
            "type": "boolean",
            "description": "Whether recurring service is active"
          },
          "createdOn": {
            "type": "string",
            "description": "When recurring service was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this recurring service",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "When recurring service was modified",
            "format": "date-time"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal import ID label"
          },
          "membershipId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Customer membership ID",
            "format": "int64"
          },
          "locationId": {
            "type": "integer",
            "description": "Location ID",
            "format": "int64"
          },
          "recurringServiceTypeId": {
            "type": "integer",
            "description": "Recurring Service Type ID",
            "format": "int64"
          },
          "durationType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceDuration"
              }
            ],
            "description": "The recurrence duration type"
          },
          "durationLength": {
            "type": "integer",
            "description": "The duration length for the given duration type",
            "format": "int32"
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "description": "Beginning date of recurring service",
            "format": "date-time"
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "description": "End date of recurring service",
            "format": "date-time"
          },
          "memo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Memo"
          },
          "invoiceTemplateId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice template ID",
            "format": "int64"
          },
          "invoiceTemplateForFollowingYearsId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice template ID for the 2nd year and following (for ongoing memberships)",
            "format": "int64"
          },
          "firstVisitComplete": {
            "type": "boolean",
            "description": "Whether first visit is complete"
          },
          "activatedFromId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the invoice item that is the sale task of this membership",
            "format": "int64"
          },
          "allocation": {
            "type": "number",
            "description": "Recurring service allocation",
            "format": "decimal"
          },
          "businessUnitId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Business unit ID",
            "format": "int64"
          },
          "jobTypeId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Job type ID",
            "format": "int64"
          },
          "campaignId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Campaign ID",
            "format": "int64"
          },
          "priority": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.Priority"
              }
            ],
            "description": "Recurring service priority"
          },
          "jobSummary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job summary"
          },
          "recurrenceType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceType"
              }
            ],
            "description": "The recurrence type (e.g. Daily, Weekly, Monthly, etc.)"
          },
          "recurrenceInterval": {
            "type": "integer",
            "description": "The recurrence interval for the given recurrence type.\nCan be 0 when RecurrenceType is Seasonal.",
            "format": "int32"
          },
          "recurrenceMonths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.Month"
            },
            "description": "A list of months when the recurring service occurs, if it is a seasonal recurrence type"
          },
          "recurrenceDaysOfWeek": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.WeekDay"
            },
            "description": "A list specifying which days of the week this recurring service recurs when\nRecurrenceType is Weekly"
          },
          "recurrenceWeek": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.WeekOfMonth"
              }
            ],
            "description": "Enum value corresponding to which week of the month this recurring service recurs when\nRecurrenceType is NthWeekdayOfMonth. Used with RecurrenceDayOfNthWeek."
          },
          "recurrenceDayOfNthWeek": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.WeekDay"
              },
              {
                "type": "null"
              }
            ],
            "description": "Enum value corresponding to which day of the week this recurring service recurs when\nRecurrenceType is NthWeekdayOfMonth. Used with RecurrenceWeek."
          },
          "recurrenceDaysOfMonth": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "description": "A list of days of the month on which this recurring service recurs when\nRecurrenceType is Monthly."
          },
          "jobStartTime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job start time",
            "format": "duration"
          },
          "estimatedPayrollCost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Estimated payroll cost",
            "format": "decimal"
          },
          "preferredTechnicianIds": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "A list of technician IDs assigned to this recurring service.\nWill be null if was not requested via IncludeTechnicians field."
          },
          "tagTypeIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "A list of tag IDs associated to this recurring service. "
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.WeekDay": {
        "enum": [
          "Sunday",
          "Monday",
          "Tuesday",
          "Wednesday",
          "Thursday",
          "Friday",
          "Saturday"
        ],
        "type": "string",
        "description": "Day of week as a string, e.g. \"Monday\" or \"Thursday\"",
        "x-enumNames": [
          "Sunday",
          "Monday",
          "Tuesday",
          "Wednesday",
          "Thursday",
          "Friday",
          "Saturday"
        ]
      },
      "Memberships.V2.WeekOfMonth": {
        "enum": [
          "None",
          "First",
          "Second",
          "Third",
          "Fourth",
          "Last"
        ],
        "type": "string",
        "description": "",
        "x-enumNames": [
          "None",
          "First",
          "Second",
          "Third",
          "Fourth",
          "Last"
        ]
      },
      "ExportResponse_Of_Memberships.V2.ExportLocationRecurringServiceEventResponse": {
        "required": [
          "hasMore",
          "continueFrom",
          "data"
        ],
        "type": "object",
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "Indicates whether the export feed has reached its logical \"end\", or if there is more to export.\nTrue means the consumer can invoke another request right away using new continuation token value.\nFalse means there is now new data for the export, and the consumer should wait for some time (5-10 minutes)\nbefore making another request."
          },
          "continueFrom": {
            "type": "string",
            "description": "Continuation token used to resume the export operation. The value should be used in \"from\" query parameter of the following request."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.ExportLocationRecurringServiceEventResponse"
            },
            "description": "The collection of exported items, usually sorted chronologically based on modification date"
          }
        },
        "additionalProperties": false,
        "description": "Represents export API response."
      },
      "Memberships.V2.ExportLocationRecurringServiceEventResponse": {
        "required": [
          "id",
          "locationRecurringServiceId",
          "status",
          "date",
          "createdOn",
          "modifiedOn",
          "active"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Recurring service event ID ",
            "format": "int64"
          },
          "locationRecurringServiceId": {
            "type": "integer",
            "description": "Recurring service ID ",
            "format": "int64"
          },
          "locationRecurringServiceName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recurring service name "
          },
          "membershipId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Membership ID ",
            "format": "int64"
          },
          "membershipName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Membership name "
          },
          "status": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.OpportunityStatus"
              }
            ],
            "description": "Opportunity status "
          },
          "date": {
            "type": "string",
            "description": "Event date ",
            "format": "date-time"
          },
          "createdOn": {
            "type": "string",
            "description": "Event creation date ",
            "format": "date-time"
          },
          "jobId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the job associated with this event ",
            "format": "int64"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this event (could happen as a result of\nediting recurring service, selling a new membership, etc.)",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "Event modification date ",
            "format": "date-time"
          },
          "active": {
            "type": "boolean",
            "description": "Whether this event still exists, or was deleted already."
          }
        },
        "additionalProperties": false
      },
      "ExportResponse_Of_Memberships.V2.ExportCustomerMembershipStatusChangesResponse": {
        "required": [
          "hasMore",
          "continueFrom",
          "data"
        ],
        "type": "object",
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "Indicates whether the export feed has reached its logical \"end\", or if there is more to export.\nTrue means the consumer can invoke another request right away using new continuation token value.\nFalse means there is now new data for the export, and the consumer should wait for some time (5-10 minutes)\nbefore making another request."
          },
          "continueFrom": {
            "type": "string",
            "description": "Continuation token used to resume the export operation. The value should be used in \"from\" query parameter of the following request."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.ExportCustomerMembershipStatusChangesResponse"
            },
            "description": "The collection of exported items, usually sorted chronologically based on modification date"
          }
        },
        "additionalProperties": false,
        "description": "Represents export API response."
      },
      "Memberships.V2.ExportCustomerMembershipStatusChangesResponse": {
        "required": [
          "id",
          "oldStatus",
          "newStatus",
          "createdOn",
          "membershipId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the status change record",
            "format": "int64"
          },
          "oldStatus": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipStatus"
              }
            ],
            "description": "Previous status value"
          },
          "newStatus": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipStatus"
              }
            ],
            "description": "New status value"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional note attached to this status change"
          },
          "createdOn": {
            "type": "string",
            "description": "When this status change record was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this status change record",
            "format": "int64"
          },
          "membershipId": {
            "type": "integer",
            "description": "ID of the membership that this status change record is associated with",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "PaginatedResponse_Of_Memberships.V2.InvoiceTemplateResponse": {
        "required": [
          "page",
          "pageSize",
          "hasMore",
          "data"
        ],
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "description": "From which page this output has started",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Page size for this query (i.e. how many records were requested to return)",
            "format": "int32"
          },
          "hasMore": {
            "type": "boolean",
            "description": "True if there are more records in the query than returned in this result"
          },
          "totalCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total count of records for this query (can optionally be populated)",
            "format": "int32"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.InvoiceTemplateResponse"
            },
            "description": "The collection of result items, will never have more than PageSize items"
          }
        },
        "additionalProperties": false,
        "description": "Represents paginated API response."
      },
      "Memberships.V2.InvoiceTemplateResponse": {
        "required": [
          "id",
          "createdOn",
          "modifiedOn",
          "active",
          "total",
          "isSettingsTemplate",
          "items"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Invoice template ID",
            "format": "int64"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Invoice template name (used only for shared invoice templates)"
          },
          "createdOn": {
            "type": "string",
            "description": "Invoice template creation date",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created invoice template",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "Invoice template modification date",
            "format": "date-time"
          },
          "active": {
            "type": "boolean",
            "description": "Whether invoice template is active"
          },
          "total": {
            "type": "number",
            "description": "Invoice template total",
            "format": "decimal"
          },
          "isSettingsTemplate": {
            "type": "boolean",
            "description": "Whether invoice template is shared (i.e. visible on the Settings page)"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Import ID"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.InvoiceTemplateItemResponse"
            },
            "description": "A list of invoice template items"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.InvoiceTemplateCreateRequest": {
        "type": "object",
        "properties": {
          "items": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.InvoiceTemplateItemCreateRequest"
            },
            "description": "Invoice template items"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.InvoiceTemplateItemCreateRequest": {
        "required": [
          "skuId",
          "quantity",
          "unitPrice",
          "isAddOn"
        ],
        "type": "object",
        "properties": {
          "skuId": {
            "type": "integer",
            "description": "Linked SKU ID",
            "format": "int64"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity",
            "format": "decimal"
          },
          "unitPrice": {
            "type": "number",
            "description": "Unit price",
            "format": "decimal"
          },
          "isAddOn": {
            "type": "boolean",
            "description": "Whether invoice item is add-on"
          },
          "workflowActionItemId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The invoice item ID that created this invoice template item via ModifyMembershipWorkflowAction",
            "format": "int64"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Item description",
            "format": "html"
          },
          "cost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Materials cost",
            "format": "decimal"
          },
          "hours": {
            "type": [
              "number",
              "null"
            ],
            "description": "Sold/billable hours",
            "format": "decimal"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.InvoiceTemplateUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Invoice template name (used only for shared invoice templates)"
          },
          "createdOn": {
            "type": "string",
            "description": "Invoice template creation date",
            "format": "date-time"
          },
          "createdById": {
            "type": "integer",
            "description": "ID of the user that created invoice template",
            "format": "int64"
          },
          "active": {
            "type": "boolean",
            "description": "Whether invoice template is active"
          },
          "items": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Memberships.V2.InvoiceTemplateItemUpdateRequest"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Invoice template items"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.InvoiceTemplateItemUpdateRequest": {
        "required": [
          "skuId",
          "quantity",
          "unitPrice",
          "isAddOn"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice template item ID",
            "format": "int64"
          },
          "skuId": {
            "type": "integer",
            "description": "Linked SKU ID",
            "format": "int64"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity",
            "format": "decimal"
          },
          "unitPrice": {
            "type": "number",
            "description": "Unit price",
            "format": "decimal"
          },
          "isAddOn": {
            "type": "boolean",
            "description": "Whether invoice item is add-on"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Item description",
            "format": "html"
          },
          "cost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Materials cost",
            "format": "decimal"
          },
          "hours": {
            "type": [
              "number",
              "null"
            ],
            "description": "Sold/billable hours",
            "format": "decimal"
          }
        },
        "additionalProperties": false
      },
      "PaginatedResponse_Of_Memberships.V2.LocationRecurringServiceEventResponse": {
        "required": [
          "page",
          "pageSize",
          "hasMore",
          "data"
        ],
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "description": "From which page this output has started",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Page size for this query (i.e. how many records were requested to return)",
            "format": "int32"
          },
          "hasMore": {
            "type": "boolean",
            "description": "True if there are more records in the query than returned in this result"
          },
          "totalCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total count of records for this query (can optionally be populated)",
            "format": "int32"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.LocationRecurringServiceEventResponse"
            },
            "description": "The collection of result items, will never have more than PageSize items"
          }
        },
        "additionalProperties": false,
        "description": "Represents paginated API response."
      },
      "Memberships.V2.LocationRecurringServiceEventResponse": {
        "required": [
          "id",
          "locationRecurringServiceId",
          "status",
          "date",
          "createdOn",
          "modifiedOn"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Recurring service event ID ",
            "format": "int64"
          },
          "locationRecurringServiceId": {
            "type": "integer",
            "description": "Recurring service ID ",
            "format": "int64"
          },
          "locationRecurringServiceName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recurring service name "
          },
          "membershipId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Membership ID ",
            "format": "int64"
          },
          "membershipName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Membership name "
          },
          "status": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.OpportunityStatus"
              }
            ],
            "description": "Opportunity status "
          },
          "date": {
            "type": "string",
            "description": "Event date ",
            "format": "date-time"
          },
          "createdOn": {
            "type": "string",
            "description": "Event creation date ",
            "format": "date-time"
          },
          "jobId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the job associated with this event ",
            "format": "int64"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this event (could happen as a result of\nediting recurring service, selling a new membership, etc.)",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "Event modification date ",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.MarkEventCompletedStatusUpdateRequest": {
        "required": [
          "jobId"
        ],
        "type": "object",
        "properties": {
          "jobId": {
            "type": "integer",
            "description": "The job ID that the event is marked as completed/incompleted on ",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "PaginatedResponse_Of_Memberships.V2.LocationRecurringServiceResponse": {
        "required": [
          "page",
          "pageSize",
          "hasMore",
          "data"
        ],
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "description": "From which page this output has started",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Page size for this query (i.e. how many records were requested to return)",
            "format": "int32"
          },
          "hasMore": {
            "type": "boolean",
            "description": "True if there are more records in the query than returned in this result"
          },
          "totalCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total count of records for this query (can optionally be populated)",
            "format": "int32"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.LocationRecurringServiceResponse"
            },
            "description": "The collection of result items, will never have more than PageSize items"
          }
        },
        "additionalProperties": false,
        "description": "Represents paginated API response."
      },
      "Memberships.V2.LocationRecurringServiceResponse": {
        "required": [
          "id",
          "name",
          "active",
          "createdOn",
          "modifiedOn",
          "locationId",
          "recurringServiceTypeId",
          "durationType",
          "durationLength",
          "firstVisitComplete",
          "allocation",
          "priority",
          "recurrenceType",
          "recurrenceInterval",
          "recurrenceMonths",
          "recurrenceDaysOfWeek",
          "recurrenceWeek",
          "recurrenceDaysOfMonth",
          "tagTypeIds"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Recurring service ID",
            "format": "int64"
          },
          "name": {
            "type": "string",
            "description": "Recurring service name"
          },
          "active": {
            "type": "boolean",
            "description": "Whether recurring service is active"
          },
          "createdOn": {
            "type": "string",
            "description": "When recurring service was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this recurring service",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "When recurring service was modified",
            "format": "date-time"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal import ID label"
          },
          "membershipId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Customer membership ID",
            "format": "int64"
          },
          "locationId": {
            "type": "integer",
            "description": "Location ID",
            "format": "int64"
          },
          "recurringServiceTypeId": {
            "type": "integer",
            "description": "Recurring Service Type ID",
            "format": "int64"
          },
          "durationType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceDuration"
              }
            ],
            "description": "The recurrence duration type"
          },
          "durationLength": {
            "type": "integer",
            "description": "The duration length for the given duration type",
            "format": "int32"
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "description": "Beginning date of recurring service",
            "format": "date-time"
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "description": "End date of recurring service",
            "format": "date-time"
          },
          "memo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Memo"
          },
          "invoiceTemplateId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice template ID",
            "format": "int64"
          },
          "invoiceTemplateForFollowingYearsId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice template ID for the 2nd year and following (for ongoing memberships)",
            "format": "int64"
          },
          "firstVisitComplete": {
            "type": "boolean",
            "description": "Whether first visit is complete"
          },
          "activatedFromId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the invoice item that is the sale task of this membership",
            "format": "int64"
          },
          "allocation": {
            "type": "number",
            "description": "Recurring service allocation",
            "format": "decimal"
          },
          "businessUnitId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Business unit ID",
            "format": "int64"
          },
          "jobTypeId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Job type ID",
            "format": "int64"
          },
          "campaignId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Campaign ID",
            "format": "int64"
          },
          "priority": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.Priority"
              }
            ],
            "description": "Recurring service priority"
          },
          "jobSummary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job summary"
          },
          "recurrenceType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceType"
              }
            ],
            "description": "The recurrence type (e.g. Daily, Weekly, Monthly, etc.)"
          },
          "recurrenceInterval": {
            "type": "integer",
            "description": "The recurrence interval for the given recurrence type.\nCan be 0 when RecurrenceType is Seasonal.",
            "format": "int32"
          },
          "recurrenceMonths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.Month"
            },
            "description": "A list of months when the recurring service occurs, if it is a seasonal recurrence type"
          },
          "recurrenceDaysOfWeek": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.WeekDay"
            },
            "description": "A list specifying which days of the week this recurring service recurs when\nRecurrenceType is Weekly"
          },
          "recurrenceWeek": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.WeekOfMonth"
              }
            ],
            "description": "Enum value corresponding to which week of the month this recurring service recurs when\nRecurrenceType is NthWeekdayOfMonth. Used with RecurrenceDayOfNthWeek."
          },
          "recurrenceDayOfNthWeek": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.WeekDay"
              },
              {
                "type": "null"
              }
            ],
            "description": "Enum value corresponding to which day of the week this recurring service recurs when\nRecurrenceType is NthWeekdayOfMonth. Used with RecurrenceWeek."
          },
          "recurrenceDaysOfMonth": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "description": "A list of days of the month on which this recurring service recurs when\nRecurrenceType is Monthly."
          },
          "jobStartTime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job start time",
            "format": "duration"
          },
          "estimatedPayrollCost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Estimated payroll cost",
            "format": "decimal"
          },
          "preferredTechnicianIds": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "A list of technician IDs assigned to this recurring service.\nWill be null if was not requested via IncludeTechnicians field."
          },
          "tagTypeIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "A list of tag IDs associated to this recurring service. "
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.LocationRecurringServiceUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Recurring service name"
          },
          "active": {
            "type": "boolean",
            "description": "Whether recurring service is active"
          },
          "recurringServiceTypeId": {
            "type": "integer",
            "description": "Recurring Service Type ID",
            "format": "int64"
          },
          "durationType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceDuration"
              }
            ],
            "description": "The recurrence duration type"
          },
          "durationLength": {
            "type": "integer",
            "description": "The duration length for the given duration type",
            "format": "int32"
          },
          "from": {
            "type": "string",
            "description": "Beginning date of recurring service",
            "format": "date-time"
          },
          "memo": {
            "type": "string",
            "description": "Memo"
          },
          "invoiceTemplateId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice template ID",
            "format": "int64"
          },
          "invoiceTemplateForFollowingYearsId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice template ID for the 2nd year and following (for ongoing memberships)",
            "format": "int64"
          },
          "businessUnitId": {
            "type": "integer",
            "description": "Business unit ID",
            "format": "int64"
          },
          "jobTypeId": {
            "type": "integer",
            "description": "Job type ID",
            "format": "int64"
          },
          "campaignId": {
            "type": "integer",
            "description": "Campaign ID",
            "format": "int64"
          },
          "priority": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.Priority"
              }
            ],
            "description": "Recurring service priority"
          },
          "jobSummary": {
            "type": "string",
            "description": "Job summary"
          },
          "recurrenceType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceType"
              }
            ],
            "description": "The recurrence type (e.g. Daily, Weekly, Monthly, etc.)"
          },
          "recurrenceInterval": {
            "type": "integer",
            "description": "The recurrence interval for the given recurrence type.\nCan be 0 when RecurrenceType is Seasonal.",
            "format": "int32"
          },
          "recurrenceMonths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.Month"
            },
            "description": "A list of months when the recurring service occurs, if it is a seasonal recurrence type"
          },
          "recurrenceDaysOfWeek": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.WeekDay"
            },
            "description": "A list specifying which days of the week this recurring service recurs when\nRecurrenceType is Weekly"
          },
          "recurrenceWeek": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.WeekOfMonth"
              }
            ],
            "description": "Enum value corresponding to which week of the month this recurring service recurs when\nRecurrenceType is NthWeekdayOfMonth. Used with RecurrenceDayOfNthWeek."
          },
          "recurrenceDayOfNthWeek": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.WeekDay"
              },
              {
                "type": "null"
              }
            ],
            "description": "Enum value corresponding to which day of the week this recurring service recurs when\nRecurrenceType is NthWeekdayOfMonth. Used with RecurrenceWeek."
          },
          "jobStartTime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job start time",
            "format": "duration"
          },
          "estimatedPayrollCost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Estimated payroll cost",
            "format": "decimal"
          },
          "tagTypeIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "List specifying IDs of Tag Types associated with this location recurring service"
          },
          "preferredTechnicianIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "List specifying IDs of preferred technicians for this location recurring service"
          }
        },
        "additionalProperties": false
      },
      "PaginatedResponse_Of_Memberships.V2.MembershipTypeResponse": {
        "required": [
          "page",
          "pageSize",
          "hasMore",
          "data"
        ],
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "description": "From which page this output has started",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Page size for this query (i.e. how many records were requested to return)",
            "format": "int32"
          },
          "hasMore": {
            "type": "boolean",
            "description": "True if there are more records in the query than returned in this result"
          },
          "totalCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total count of records for this query (can optionally be populated)",
            "format": "int32"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.MembershipTypeResponse"
            },
            "description": "The collection of result items, will never have more than PageSize items"
          }
        },
        "additionalProperties": false,
        "description": "Represents paginated API response."
      },
      "Memberships.V2.MembershipTypeResponse": {
        "required": [
          "name",
          "active",
          "discountMode",
          "locationTarget",
          "revenueRecognitionMode",
          "autoCalculateInvoiceTemplates",
          "useMembershipPricingTable",
          "showMembershipSavings",
          "id",
          "createdOn",
          "modifiedOn",
          "discount"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Membership type name"
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Membership type display name. This is used in the Customer Portal and will be null if not set through the Membership Wizard."
          },
          "active": {
            "type": "boolean",
            "description": "Whether membership type is active"
          },
          "discountMode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.DiscountMode"
              }
            ],
            "description": "Membership discount mode"
          },
          "locationTarget": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipLocationTarget"
              }
            ],
            "description": "Membership location target"
          },
          "revenueRecognitionMode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.RevenueRecognitionMode"
              }
            ],
            "description": "Membership revenue recognition mode"
          },
          "autoCalculateInvoiceTemplates": {
            "type": "boolean",
            "description": "Whether invoice templates should be auto-calculated"
          },
          "useMembershipPricingTable": {
            "type": "boolean",
            "description": "Whether membership pricing table should be used"
          },
          "showMembershipSavings": {
            "type": "boolean",
            "description": "Whether membership savings should be displayed"
          },
          "id": {
            "type": "integer",
            "description": "Membership type ID",
            "format": "int64"
          },
          "createdOn": {
            "type": "string",
            "description": "When membership type was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this membership type",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "When membership type was modified",
            "format": "date-time"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal import ID label"
          },
          "billingTemplateId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Billing template ID",
            "format": "int64"
          },
          "discount": {
            "type": "number",
            "description": "Membership type discount percentage (0 to 100). This is relevant only when the DiscountMode is `Basic`.",
            "format": "decimal"
          },
          "durationBilling": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.MembershipTypeDurationBillingEntry"
            },
            "description": "Membership type duration billing options.\nIf this field is null, it means it was not requested to be loaded via the `IncludeDurationBilling` flag."
          },
          "discounts": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.MembershipTypeDiscountEntry"
            },
            "description": "Membership type discounts. This includes a list containing the target of a discount (either a business unit ID or a pricebook\ncategory ID) as well as the percentage discount (0 to 100). Note that this list is relevant only when the\nDiscountMode is set to `Categories` or `BusinessUnits`.\nIf this field is null, it means it was not requested to be loaded via the `IncludeDiscounts` flag."
          },
          "recurringServices": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.MembershipTypeRecurringServiceEntry"
            },
            "description": "Membership type recurring service items associated with this membership type. Each item includes the recurring service type ID,\noffset, offset type, and allocation percentage.\nIf this field is null, it means it was not requested to be loaded via the `IncludeRecurringServices` flag."
          },
          "tagTypeIds": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Tag type IDs associated with this membership type.\nIf this field is null, it means it was not requested to be loaded via the `IncludeTagTypeIds` flag."
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.MembershipTypeRecurringServiceItemResponse": {
        "required": [
          "id",
          "membershipTypeId",
          "recurringServiceTypeId",
          "offset",
          "offsetType",
          "allocation",
          "createdOn"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the recurring service item",
            "format": "int64"
          },
          "membershipTypeId": {
            "type": "integer",
            "description": "Membership type ID associated with the item",
            "format": "int64"
          },
          "recurringServiceTypeId": {
            "type": "integer",
            "description": "Recurring service type ID associated with the item",
            "format": "int64"
          },
          "offset": {
            "type": "integer",
            "description": "Number of weeks or months (depending on offset type) between membership start and recurring service start",
            "format": "int32"
          },
          "offsetType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.OffsetType"
              }
            ],
            "description": "Offset type of the recurring service type associated with this item, can be weeks (0) or months (1)"
          },
          "allocation": {
            "type": "number",
            "description": "The percentage of deferred revenue allocated to the recurring service item",
            "format": "decimal"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Import ID"
          },
          "createdOn": {
            "type": "string",
            "description": "When recurring service item was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this recurring service item",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.MembershipTypeDiscountItemResponse": {
        "required": [
          "id",
          "targetId",
          "discount",
          "createdOn"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the discount item",
            "format": "int64"
          },
          "targetId": {
            "type": "integer",
            "description": "ID of the discount's target, which can be either a business unit or pricebook category",
            "format": "int64"
          },
          "discount": {
            "type": "number",
            "description": "Percentage discount (0 to 100)",
            "format": "decimal"
          },
          "createdOn": {
            "type": "string",
            "description": "When discount item was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this discount item",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "Memberships.V2.MembershipTypeDurationBillingItemResponse": {
        "required": [
          "id",
          "billingFrequency",
          "salePrice",
          "billingPrice",
          "renewalPrice",
          "active",
          "createdOn"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the duration/billing option",
            "format": "int64"
          },
          "duration": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Duration of the entry ",
            "format": "int32"
          },
          "billingFrequency": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.MembershipRecurrenceType"
              }
            ],
            "description": "Billing frequency of the entry"
          },
          "salePrice": {
            "type": "number",
            "description": "Sale price of the entry",
            "format": "decimal"
          },
          "billingPrice": {
            "type": "number",
            "description": "Billing price of the entry",
            "format": "decimal"
          },
          "renewalPrice": {
            "type": "number",
            "description": "Renewal price of the entry",
            "format": "decimal"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Import ID of the entry"
          },
          "active": {
            "type": "boolean",
            "description": "Whether the duration/billing option is active"
          },
          "createdOn": {
            "type": "string",
            "description": "When duration/billing option was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this duration/billing option",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "PaginatedResponse_Of_Memberships.V2.RecurringServiceTypeResponse": {
        "required": [
          "page",
          "pageSize",
          "hasMore",
          "data"
        ],
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "description": "From which page this output has started",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Page size for this query (i.e. how many records were requested to return)",
            "format": "int32"
          },
          "hasMore": {
            "type": "boolean",
            "description": "True if there are more records in the query than returned in this result"
          },
          "totalCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total count of records for this query (can optionally be populated)",
            "format": "int32"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.RecurringServiceTypeResponse"
            },
            "description": "The collection of result items, will never have more than PageSize items"
          }
        },
        "additionalProperties": false,
        "description": "Represents paginated API response."
      },
      "Memberships.V2.RecurringServiceTypeResponse": {
        "required": [
          "id",
          "createdOn",
          "modifiedOn",
          "active",
          "recurrenceType",
          "recurrenceInterval",
          "recurrenceMonths",
          "durationType",
          "durationLength",
          "priority"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Recurring service type ID",
            "format": "int64"
          },
          "createdOn": {
            "type": "string",
            "description": "When recurring service type was created",
            "format": "date-time"
          },
          "createdById": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the user that created this recurring service type",
            "format": "int64"
          },
          "modifiedOn": {
            "type": "string",
            "description": "When recurring service type was modified",
            "format": "date-time"
          },
          "active": {
            "type": "boolean",
            "description": "Whether recurring service type is active"
          },
          "recurrenceType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceType"
              }
            ],
            "description": "The recurrence type (e.g. Daily, Weekly, Monthly)"
          },
          "recurrenceInterval": {
            "type": "integer",
            "description": "The recurrence interval for the given recurrence type",
            "format": "int32"
          },
          "recurrenceMonths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Memberships.V2.Month"
            },
            "description": "A list of months when the recurring service occurs, if it is a seasonal recurrence type"
          },
          "durationType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.ServiceRecurrenceDuration"
              }
            ],
            "description": "The recurrence duration type"
          },
          "durationLength": {
            "type": "integer",
            "description": "The recurrence duration length (number of events)",
            "format": "int32"
          },
          "invoiceTemplateId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice template ID",
            "format": "int64"
          },
          "businessUnitId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Business unit ID",
            "format": "int64"
          },
          "jobTypeId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Job type ID",
            "format": "int64"
          },
          "priority": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Memberships.V2.Priority"
              }
            ],
            "description": "Priority"
          },
          "campaignId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Campaign ID",
            "format": "int64"
          },
          "jobSummary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job summary"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recurring service type name"
          },
          "importId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Import ID"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "apiKeyHeader": {
        "type": "apiKey",
        "name": "ST-App-Key",
        "in": "header",
        "description": "ServiceTitan App Key Header"
      },
      "oauth": {
        "type": "oauth2",
        "description": "OAuth 2.0 Client Credentials Flow",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://auth.servicetitan.io/connect/token",
            "scopes": {
              "tn.mem.memberships:r": "Memberships → Customer Memberships (Read)",
              "tn.mem.memberships:w": "Memberships → Customer Memberships (Write)",
              "tn.mem.membershiptypes:r": "Memberships → Membership Types (Read)",
              "tn.mem.recurringservicetypes:r": "Memberships → Recurring Service Types (Read)",
              "tn.mem.invoicetemplates:r": "Memberships → Invoice Templates (Read)",
              "tn.mem.recurringservices:r": "Memberships → Recurring Services (Read)",
              "tn.mem.recurringserviceevents:r": "Memberships → Recurring Service Events (Read)",
              "tn.mem.invoicetemplates:w": "Memberships → Invoice Templates (Write)",
              "tn.mem.recurringserviceevents:w": "Memberships → Recurring Service Events (Write)",
              "tn.mem.recurringservices:w": "Memberships → Recurring Services (Write)"
            }
          }
        }
      }
    }
  }
}