openapi: 3.2.0 info: title: Weel Open Custom Field Options API version: v1 termsOfService: https://letsweel.com/terms/ contact: name: Contact our support email: help@letsweel.com url: https://help.letsweel.com description: 'The Weel OpenAPI empowers businesses with seamless expense management and real-time insights. Our platform makes it easy to integrate and automate expense workflows, manage receipts, and keep track of spending across your organization. ' servers: - url: https://public.letsweel.com security: - BearerAuth: [] tags: - name: Custom Field Options description: This group of endpoints allows you to manage the list options for a `LIST` type custom field. Options created via the Public API can be disabled or deleted. paths: /v1/businesses/{client_id}/custom-fields/{custom_field_id}/options: get: operationId: listCustomFieldOptions tags: - Custom Field Options summary: List custom field options description: Returns a paginated list of all options for the given custom field, including disabled ones. parameters: - $ref: '#/components/parameters/ClientId' - $ref: '#/components/parameters/CustomFieldId' - $ref: '#/components/parameters/PaginationOffset' - $ref: '#/components/parameters/PaginationLimit' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomFieldOptionListResponse' '401': description: Unauthorized '403': description: Forbidden '404': description: Not Found security: - BearerAuth: [] post: operationId: createCustomFieldOption tags: - Custom Field Options summary: Create a custom field option description: 'Adds a new option to a `LIST` type custom field. Not permitted for `FREE_TEXT` custom fields or custom fields created by accounting integrations. ' parameters: - $ref: '#/components/parameters/ClientId' - $ref: '#/components/parameters/CustomFieldId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateCustomFieldOptionRequest' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/CustomFieldOption' '400': description: Bad Request '401': description: Unauthorized '403': description: Forbidden '404': description: Not Found security: - BearerAuth: [] /v1/businesses/{client_id}/custom-fields/{custom_field_id}/options/{option_id}: patch: operationId: updateCustomFieldOption tags: - Custom Field Options summary: Update a custom field option description: 'Partially updates a custom field option. **Accounting integration fields** (Xero, MYOB, QuickBooks, NetSuite, Business Central): only `enabled` can be changed. The `text` field cannot be modified. **Non-accounting-integration fields** (MANUAL, PUBLIC_API): only `text` can be changed. The `enabled` field cannot be modified — delete and recreate options instead. ' parameters: - $ref: '#/components/parameters/ClientId' - $ref: '#/components/parameters/CustomFieldId' - $ref: '#/components/parameters/CustomFieldOptionId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateCustomFieldOptionRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomFieldOption' '400': description: Bad Request '401': description: Unauthorized '403': description: Forbidden '404': description: Not Found security: - BearerAuth: [] delete: operationId: deleteCustomFieldOption tags: - Custom Field Options summary: Delete a custom field option description: 'Permanently deletes a custom field option. Not permitted for options belonging to custom fields created by accounting integrations. ' parameters: - $ref: '#/components/parameters/ClientId' - $ref: '#/components/parameters/CustomFieldId' - $ref: '#/components/parameters/CustomFieldOptionId' responses: '204': description: No Content '400': description: Bad Request '401': description: Unauthorized '403': description: Forbidden '404': description: Not Found security: - BearerAuth: [] components: schemas: CustomFieldOption: type: object properties: id: type: string format: uuid description: The unique identifier for this option. example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 text: type: string description: The display text of this option. example: Project Alpha enabled: type: boolean description: Whether this option is available for selection. example: true created: type: string format: date-time description: The date and time when this option was created. example: '2024-01-15T09:00:00Z' updated: type: string format: date-time description: The date and time when this option was last updated. example: '2024-01-15T09:00:00Z' UpdateCustomFieldOptionRequest: type: object properties: text: type: string description: The new display text. Only permitted for options belonging to non-accounting-integration custom fields. example: Project Beta enabled: type: boolean description: Enable or disable this option. Only permitted for options belonging to accounting integration custom fields (Xero, MYOB, QuickBooks, NetSuite, Business Central). example: false CustomFieldOptionListResponse: type: object properties: count: type: integer description: Total number of options for this custom field (including disabled). example: 5 next: type: - string - 'null' description: Pagination cursor for the next page. example: limit=50&offset=50 previous: type: - string - 'null' description: Pagination cursor for the previous page. example: null results: type: array items: $ref: '#/components/schemas/CustomFieldOption' CreateCustomFieldOptionRequest: type: object required: - text properties: text: type: string description: The display text for this option. example: Project Alpha parameters: CustomFieldOptionId: name: option_id in: path description: The ID of the custom field option. required: true schema: type: string format: uuid example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 PaginationOffset: name: offset in: query description: Offset to retrieve items from. schema: type: integer default: 0 example: 50 ClientId: name: client_id in: path description: The ID of the business. required: true schema: type: integer example: 123 PaginationLimit: name: limit in: query description: Number of items per page. schema: type: integer default: 50 maximum: 500 example: 50 CustomFieldId: name: custom_field_id in: path description: The ID of the custom field. required: true schema: type: string format: uuid example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 securitySchemes: BearerAuth: type: http scheme: bearer x-tagGroups: - name: Users tags: - Invites - Users - Roles - name: Transactions tags: - Transactions - name: Budgets tags: - Budgets - Budget Members - Budget Owners - Budget Topups - name: Statements tags: - Statements - name: Custom Fields tags: - Custom Fields - Custom Field Options - Custom Field Budgets - name: Chart of Accounts tags: - Accounting Codes - Categories