openapi: 3.0.3 info: title: Tropic Contracts API description: The Tropic public API enables organizations to connect Tropic with other software in their stack, creating a connected spend and procurement ecosystem. The API supports building custom integrations for tools that do not have pre-built connectors, including contract management, supplier management, procurement requests, and webhook configuration. version: 1.0.0 contact: name: Tropic Support url: https://help.tropicapp.io termsOfService: https://www.tropicapp.io/terms servers: - url: https://api.tropicapp.io/v1 description: Tropic Production API security: - BearerAuth: [] tags: - name: Contracts description: Manage vendor contracts and contract lifecycle paths: /contracts: get: summary: List Contracts description: Returns a paginated list of all contracts in the organization. operationId: listContracts tags: - Contracts parameters: - name: page in: query description: Page number for pagination schema: type: integer default: 1 - name: per_page in: query description: Number of results per page schema: type: integer default: 25 maximum: 100 - name: status in: query description: Filter by contract status schema: type: string enum: - active - expired - pending - cancelled - name: supplier_id in: query description: Filter by supplier ID schema: type: string responses: '200': description: Successful response content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/Contract' meta: $ref: '#/components/schemas/PaginationMeta' '401': $ref: '#/components/responses/Unauthorized' post: summary: Create Contract description: Creates a new contract record. operationId: createContract tags: - Contracts requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ContractCreate' responses: '201': description: Contract created content: application/json: schema: $ref: '#/components/schemas/Contract' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' /contracts/{id}: get: summary: Get Contract description: Returns a single contract by ID. operationId: getContract tags: - Contracts parameters: - name: id in: path required: true schema: type: string description: Contract ID responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Contract' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' put: summary: Update Contract description: Updates an existing contract. operationId: updateContract tags: - Contracts parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ContractUpdate' responses: '200': description: Contract updated content: application/json: schema: $ref: '#/components/schemas/Contract' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' delete: summary: Delete Contract description: Deletes a contract record. operationId: deleteContract tags: - Contracts parameters: - name: id in: path required: true schema: type: string responses: '204': description: Contract deleted '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' components: schemas: Contract: type: object properties: id: type: string description: Unique contract identifier name: type: string description: Contract name supplier_id: type: string description: Associated supplier ID supplier_name: type: string description: Supplier name status: type: string enum: - active - expired - pending - cancelled start_date: type: string format: date description: Contract start date end_date: type: string format: date description: Contract end date renewal_date: type: string format: date description: Contract renewal date total_value: type: number description: Total contract value in USD currency: type: string default: USD owner_id: type: string description: User ID of contract owner documents: type: array items: type: object properties: id: type: string name: type: string url: type: string created_at: type: string format: date-time updated_at: type: string format: date-time ContractUpdate: type: object properties: name: type: string status: type: string enum: - active - expired - pending - cancelled end_date: type: string format: date renewal_date: type: string format: date total_value: type: number PaginationMeta: type: object properties: total: type: integer page: type: integer per_page: type: integer total_pages: type: integer ContractCreate: type: object required: - name - supplier_id - start_date properties: name: type: string supplier_id: type: string start_date: type: string format: date end_date: type: string format: date renewal_date: type: string format: date total_value: type: number currency: type: string default: USD responses: Unauthorized: description: Unauthorized - invalid or missing API key content: application/json: schema: type: object properties: error: type: string BadRequest: description: Bad request - invalid parameters content: application/json: schema: type: object properties: error: type: string details: type: object NotFound: description: Resource not found content: application/json: schema: type: object properties: error: type: string securitySchemes: BearerAuth: type: http scheme: bearer description: API key issued from the Tropic settings panel