openapi: 3.2.0 info: title: Weel Open Custom Fields 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 Fields description: 'This group of endpoints allows you to create and manage custom fields (dimensions/cost centres) for your business. Custom fields can be of type `LIST` (with predefined options) or `FREE_TEXT`. Custom fields created via the Public API have a `created_by` value of `PUBLIC_API`. Custom fields created by accounting integrations (Xero, MYOB, QuickBooks, NetSuite, Business Central) have restrictions: their name and type cannot be modified via the Public API. ' paths: /v1/businesses/{client_id}/custom-fields: get: operationId: listCustomFields tags: - Custom Fields summary: List custom fields description: Returns a paginated list of custom fields for the given business. parameters: - $ref: '#/components/parameters/ClientId' - $ref: '#/components/parameters/PaginationOffset' - $ref: '#/components/parameters/PaginationLimit' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomFieldListResponse' '401': description: Unauthorized '403': description: Forbidden security: - BearerAuth: [] post: operationId: createCustomField tags: - Custom Fields summary: Create a custom field description: Creates a new custom field for the given business. The `created_by` value will be set to `PUBLIC_API`. parameters: - $ref: '#/components/parameters/ClientId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateCustomFieldRequest' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/CustomField' '400': description: Bad Request '401': description: Unauthorized '403': description: Forbidden security: - BearerAuth: [] /v1/businesses/{client_id}/custom-fields/{custom_field_id}: get: operationId: getCustomField tags: - Custom Fields summary: Get a custom field description: Returns a single custom field by ID. parameters: - $ref: '#/components/parameters/ClientId' - $ref: '#/components/parameters/CustomFieldId' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomField' '401': description: Unauthorized '403': description: Forbidden '404': description: Not Found security: - BearerAuth: [] patch: operationId: updateCustomField tags: - Custom Fields summary: Update a custom field description: 'Partially updates a custom field. **Restrictions for accounting integration fields** (created by Xero, MYOB, QuickBooks, NetSuite, or Business Central): the `name` field cannot be changed. Only `budget_setting` can be updated. ' parameters: - $ref: '#/components/parameters/ClientId' - $ref: '#/components/parameters/CustomFieldId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateCustomFieldRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomField' '400': description: Bad Request '401': description: Unauthorized '403': description: Forbidden '404': description: Not Found security: - BearerAuth: [] delete: operationId: deleteCustomField tags: - Custom Fields summary: Delete a custom field description: Deletes a custom field. This also removes all associated options and budget links. parameters: - $ref: '#/components/parameters/ClientId' - $ref: '#/components/parameters/CustomFieldId' responses: '204': description: No Content '401': description: Unauthorized '403': description: Forbidden '404': description: Not Found security: - BearerAuth: [] components: schemas: UpdateCustomFieldRequest: type: object properties: name: type: string description: The new display name. Not permitted for fields created by accounting integrations. Cannot set to a name already in use by another custom field in the business. example: Cost Centre field_type: type: string description: The type of the custom field. Not permitted for fields created by accounting integrations. enum: - LIST - FREE_TEXT example: LIST is_manager_only: type: boolean description: Cannot be changed after creation — always returns 400 if a different value is sent. example: false budget_setting: type: string description: Controls which budgets this custom field is assigned to. enum: - NONE - SOME - ALL_CURRENT_AND_NEW example: SOME CreateCustomFieldRequest: type: object required: - name - field_type properties: name: type: string description: The display name for the custom field. Must be unique within the business. example: Project Code field_type: type: string description: The type of the custom field. enum: - LIST - FREE_TEXT example: LIST budget_setting: type: string description: Controls which budgets this custom field is assigned to. enum: - NONE - SOME - ALL_CURRENT_AND_NEW default: ALL_CURRENT_AND_NEW example: NONE CustomFieldListResponse: type: object properties: count: type: integer description: Total number of custom fields. example: 10 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/CustomField' CustomField: type: object properties: id: type: string format: uuid description: The unique identifier for this custom field. example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 name: type: string description: The display name of the custom field. example: Project Code field_type: type: string description: The type of the custom field. enum: - LIST - FREE_TEXT example: LIST budget_setting: type: string description: Controls which budgets this custom field is assigned to. enum: - NONE - SOME - ALL_CURRENT_AND_NEW example: NONE is_manager_only: type: boolean description: Whether this custom field is visible only to managers. Cannot be changed after creation. example: false created_by: type: string description: The source that created this custom field. enum: - MANUAL - PUBLIC_API - XERO - MYOB - QUICKBOOKS - NETSUITE - BUSINESS_CENTRAL example: PUBLIC_API created: type: string format: date-time description: The date and time when this custom field was created. example: '2024-01-15T09:00:00Z' updated: type: string format: date-time description: The date and time when this custom field was last updated. example: '2024-01-15T09:00:00Z' parameters: 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