Pennylane API Client
    Preparing search index...

    Variable JournalsApiConst

    JournalsApi: {
        createJournal: (
            body: CreateJournalBody,
        ) => Effect<
            { code: string; id: number; label: string; type: string },
            CreateJournalError,
            PennylaneClient,
        >;
        getJournal: (
            id: number,
        ) => Effect<
            { code: string; id: number; label: string; type: string },
            GetJournalError,
            PennylaneClient,
        >;
        getJournals: (
            params?: GetJournalsQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly { code: string; id: number; label: string; type: string }[];
                next_cursor?: string | null;
            },
            GetJournalsError,
            PennylaneClient,
        >;
    } = ...

    Service containing methods for the "journals" endpoints.

    Type Declaration

    • createJournal: (
          body: CreateJournalBody,
      ) => Effect<
          { code: string; id: number; label: string; type: string },
          CreateJournalError,
          PennylaneClient,
      >

      Creates a new journal.

      Possible errors:

      • CreateJournalBadRequest (400): Missing or invalid request parameters
      • CreateJournalUnauthorized (401): Invalid or missing API key
      • CreateJournalForbidden (403): Insufficient permissions for this operation
      • CreateJournalUnprocessableEntity (422): Request data is invalid (e.g., code already exists)
      yield* JournalsApi.createJournal({ code: "VT", label: "Sales" })
      
    • getJournal: (
          id: number,
      ) => Effect<
          { code: string; id: number; label: string; type: string },
          GetJournalError,
          PennylaneClient,
      >

      Retrieves a single journal by its unique identifier.

      Uses v2026 behavior only.

    • getJournals: (
          params?: GetJournalsQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly { code: string; id: number; label: string; type: string }[];
              next_cursor?: string | null;
          },
          GetJournalsError,
          PennylaneClient,
      >

      Retrieves a list of journals.

      Uses only v2026 pagination and query options.

      // Get first page with new pagination
      yield* JournalsApi.getJournals({ limit: 10 })

      // Get next page using cursor
      yield* JournalsApi.getJournals({ cursor: "MjAyNS0wMS0wOVQwODoyNDozOC44MTI0NTha" })

      // Filter journals of type "sale"
      yield* JournalsApi.getJournals({
      filter: [{ field: "type", operator: "eq", value: "sale" }],
      })