openapi: 3.2.0 info: title: Weel Open Accounting Codes 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: Accounting Codes description: 'This group of endpoints allows you to manage GL codes (accounting codes) for your business. GL codes are used to classify expenses for bookkeeping export. Businesses with a connected accounting integration (Xero, MYOB, NetSuite, QuickBooks, Business Central) cannot create or delete GL codes via the API — those are managed by the integration sync. Businesses with a manual integration or no integration can freely create, update, and delete GL codes. A manual integration is automatically created on the first POST if none exists. ' paths: /v1/businesses/{client_id}/accounting-codes: get: operationId: listAccountingCodes tags: - Accounting Codes summary: List accounting codes description: Returns a paginated list of GL codes 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/AccountingCodeListResponse' '401': description: Unauthorized '403': description: Forbidden security: - BearerAuth: [] post: operationId: upsertAccountingCode tags: - Accounting Codes summary: Create or update an accounting code description: 'Creates or updates a GL code for the business (upsert by `code`). - If a GL code with the given `code` already exists, its `name` is updated. - If a previously soft-deleted GL code with that `code` exists, it is restored. - Otherwise a new record is created. Only available for businesses with a manual integration or no integration. If no integration exists, a manual integration is automatically created. Returns `400` if the business has a connected accounting provider (Xero, MYOB, NetSuite, QuickBooks, Business Central). ' parameters: - $ref: '#/components/parameters/ClientId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateAccountingCodeRequest' responses: '200': description: OK (existing code updated or restored) content: application/json: schema: $ref: '#/components/schemas/AccountingCode' '201': description: Created content: application/json: schema: $ref: '#/components/schemas/AccountingCode' '400': description: Bad Request '401': description: Unauthorized '403': description: Forbidden security: - BearerAuth: [] /v1/businesses/{client_id}/accounting-codes/{accounting_code_id}: delete: operationId: deleteAccountingCode tags: - Accounting Codes summary: Delete an accounting code description: 'Soft-deletes a GL code. Only available for businesses with a manual integration. Any category mapped to this GL code will have its mapping cleared. Business admins and accountants will receive an `ACCOUNTING_CODE_DELETED` notification. ' parameters: - $ref: '#/components/parameters/ClientId' - $ref: '#/components/parameters/AccountingCodeId' responses: '204': description: No Content '400': description: Bad Request (e.g. business has a non-manual accounting integration) '401': description: Unauthorized '403': description: Forbidden '404': description: Not Found security: - BearerAuth: [] components: schemas: AccountingCodeListResponse: type: object properties: count: type: integer description: Total number of GL codes. example: 100 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/AccountingCode' AccountingCode: type: object properties: id: type: string format: uuid description: The unique identifier for this GL code. example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 code: type: string description: The GL code string used for bookkeeping export. example: '4000' name: type: string description: The display name of the GL code. example: Office Expenses created: type: string format: date-time description: When this GL code was created in UTC. example: '2026-01-15T10:30:00Z' updated: type: string format: date-time description: When this GL code was last updated in UTC. example: '2026-01-15T10:30:00Z' CreateAccountingCodeRequest: type: object required: - code - name properties: code: type: string maxLength: 128 description: The GL code string. Used as the upsert key — if a code with this value already exists it will be updated. example: '4000' name: type: string maxLength: 150 description: The display name of the GL code. example: Office Expenses 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 AccountingCodeId: name: accounting_code_id in: path description: The ID of the accounting code (GL code). required: true schema: type: string format: uuid example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 PaginationLimit: name: limit in: query description: Number of items per page. schema: type: integer default: 50 maximum: 500 example: 50 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