Pennylane API Client
    Preparing search index...

    Variable SuppliersApiConst

    SuppliersApi: {
        categorizeSupplier: (
            supplierId: number,
            body: CategorizeSupplierBody,
        ) => Effect<
            readonly {
                analytical_code: string
                | null;
                category_group: { id: number };
                created_at: string;
                id: number;
                label: string;
                ledger_account: { id: number; url: string } | null;
                updated_at: string;
                weight: string;
            }[],
            CategorizeSupplierError,
            PennylaneClient,
        >;
        createSupplier: (
            body: CreateSupplierBody,
        ) => Effect<
            {
                created_at: string;
                emails: readonly string[];
                establishment_no: string
                | null;
                external_reference: string;
                iban: string;
                id: number;
                ledger_account: { id: number } | null;
                name: string;
                postal_address: {
                    address: string;
                    city: string;
                    country_alpha2: string;
                    postal_code: string;
                };
                reg_no: string
                | null;
                supplier_due_date_delay: number | null;
                supplier_due_date_rule: "days" | "days_or_end_of_month" | null;
                supplier_payment_method:
                    | "card"
                    | "other"
                    | "automatic_transfer"
                    | "manual_transfer"
                    | "automatic_debiting"
                    | "bill_of_exchange"
                    | "check"
                    | "cash"
                    | null;
                updated_at: string;
                vat_number: string;
            },
            CreateSupplierError,
            PennylaneClient,
        >;
        getSupplier: (
            id: number,
        ) => Effect<
            {
                created_at: string;
                emails: readonly string[];
                establishment_no: string
                | null;
                external_reference: string;
                iban: string;
                id: number;
                ledger_account: { id: number } | null;
                name: string;
                postal_address: {
                    address: string;
                    city: string;
                    country_alpha2: string;
                    postal_code: string;
                };
                reg_no: string
                | null;
                supplier_due_date_delay: number | null;
                supplier_due_date_rule: "days" | "days_or_end_of_month" | null;
                supplier_payment_method:
                    | "card"
                    | "other"
                    | "automatic_transfer"
                    | "manual_transfer"
                    | "automatic_debiting"
                    | "bill_of_exchange"
                    | "check"
                    | "cash"
                    | null;
                updated_at: string;
                vat_number: string;
            },
            GetSupplierError,
            PennylaneClient,
        >;
        getSupplierCategories: (
            supplierId: number,
            params?: GetSupplierCategoriesQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    analytical_code: string
                    | null;
                    category_group: { id: number };
                    created_at: string;
                    id: number;
                    label: string;
                    ledger_account: { id: number; url: string } | null;
                    updated_at: string;
                    weight: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetSupplierCategoriesError,
            PennylaneClient,
        >;
        getSupplierChanges: (
            params?: GetSupplierChangesQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    created_at: string;
                    id: number;
                    operation: "insert"
                    | "update"
                    | "delete";
                    processed_at: string;
                    updated_at: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetSupplierChangesError,
            PennylaneClient,
        >;
        getSuppliers: (
            params?: GetSuppliersQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    created_at: string;
                    emails: readonly string[];
                    establishment_no: string
                    | null;
                    external_reference: string;
                    iban: string;
                    id: number;
                    ledger_account: { id: number } | null;
                    name: string;
                    postal_address: {
                        address: string;
                        city: string;
                        country_alpha2: string;
                        postal_code: string;
                    };
                    reg_no: string
                    | null;
                    supplier_due_date_delay: number | null;
                    supplier_due_date_rule: "days" | "days_or_end_of_month" | null;
                    supplier_payment_method:
                        | "card"
                        | "other"
                        | "automatic_transfer"
                        | "manual_transfer"
                        | "automatic_debiting"
                        | "bill_of_exchange"
                        | "check"
                        | "cash"
                        | null;
                    updated_at: string;
                    vat_number: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetSuppliersError,
            PennylaneClient,
        >;
        updateSupplier: (
            id: number,
            body: UpdateSupplierBody,
        ) => Effect<
            {
                created_at: string;
                emails: readonly string[];
                establishment_no: string
                | null;
                external_reference: string;
                iban: string;
                id: number;
                ledger_account: { id: number } | null;
                name: string;
                postal_address: {
                    address: string;
                    city: string;
                    country_alpha2: string;
                    postal_code: string;
                };
                reg_no: string
                | null;
                supplier_due_date_delay: number | null;
                supplier_due_date_rule: "days" | "days_or_end_of_month" | null;
                supplier_payment_method:
                    | "card"
                    | "other"
                    | "automatic_transfer"
                    | "manual_transfer"
                    | "automatic_debiting"
                    | "bill_of_exchange"
                    | "check"
                    | "cash"
                    | null;
                updated_at: string;
                vat_number: string;
            },
            UpdateSupplierError,
            PennylaneClient,
        >;
    } = ...

    Service containing methods for the "suppliers" endpoints.

    Type Declaration

    • categorizeSupplier: (
          supplierId: number,
          body: CategorizeSupplierBody,
      ) => Effect<
          readonly {
              analytical_code: string
              | null;
              category_group: { id: number };
              created_at: string;
              id: number;
              label: string;
              ledger_account: { id: number; url: string } | null;
              updated_at: string;
              weight: string;
          }[],
          CategorizeSupplierError,
          PennylaneClient,
      >

      Replaces the categories of a supplier.

      Categories can belong to different category groups; the sum of weights within a same group must equal 1.

      Possible errors:

      • CategorizeSupplierBadRequest (400): Missing or invalid request body
      • CategorizeSupplierUnauthorized (401): Invalid or missing API key
      • CategorizeSupplierForbidden (403): Insufficient permissions (suppliers:all scope required)
      • CategorizeSupplierNotFound (404): Supplier or category not found
      • CategorizeSupplierUnprocessableEntity (422): Request rejected by business validation
    • createSupplier: (
          body: CreateSupplierBody,
      ) => Effect<
          {
              created_at: string;
              emails: readonly string[];
              establishment_no: string
              | null;
              external_reference: string;
              iban: string;
              id: number;
              ledger_account: { id: number } | null;
              name: string;
              postal_address: {
                  address: string;
                  city: string;
                  country_alpha2: string;
                  postal_code: string;
              };
              reg_no: string
              | null;
              supplier_due_date_delay: number | null;
              supplier_due_date_rule: "days" | "days_or_end_of_month" | null;
              supplier_payment_method:
                  | "card"
                  | "other"
                  | "automatic_transfer"
                  | "manual_transfer"
                  | "automatic_debiting"
                  | "bill_of_exchange"
                  | "check"
                  | "cash"
                  | null;
              updated_at: string;
              vat_number: string;
          },
          CreateSupplierError,
          PennylaneClient,
      >

      Creates a supplier.

      Possible errors:

      • CreateSupplierBadRequest (400): Missing or invalid request body
      • CreateSupplierUnauthorized (401): Invalid or missing API key
      • CreateSupplierForbidden (403): Insufficient permissions (suppliers:all scope required)
      • CreateSupplierNotFound (404): Resource not found
      • CreateSupplierConflict (409): Conflict with an existing supplier
      • CreateSupplierUnprocessableEntity (422): Request rejected by business validation
    • getSupplier: (
          id: number,
      ) => Effect<
          {
              created_at: string;
              emails: readonly string[];
              establishment_no: string
              | null;
              external_reference: string;
              iban: string;
              id: number;
              ledger_account: { id: number } | null;
              name: string;
              postal_address: {
                  address: string;
                  city: string;
                  country_alpha2: string;
                  postal_code: string;
              };
              reg_no: string
              | null;
              supplier_due_date_delay: number | null;
              supplier_due_date_rule: "days" | "days_or_end_of_month" | null;
              supplier_payment_method:
                  | "card"
                  | "other"
                  | "automatic_transfer"
                  | "manual_transfer"
                  | "automatic_debiting"
                  | "bill_of_exchange"
                  | "check"
                  | "cash"
                  | null;
              updated_at: string;
              vat_number: string;
          },
          GetSupplierError,
          PennylaneClient,
      >

      Retrieves a single supplier by its identifier.

      Possible errors:

      • GetSupplierBadRequest (400): Invalid request
      • GetSupplierUnauthorized (401): Invalid or missing API key
      • GetSupplierForbidden (403): Insufficient permissions for this operation
      • GetSupplierNotFound (404): Supplier not found
    • getSupplierCategories: (
          supplierId: number,
          params?: GetSupplierCategoriesQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  analytical_code: string
                  | null;
                  category_group: { id: number };
                  created_at: string;
                  id: number;
                  label: string;
                  ledger_account: { id: number; url: string } | null;
                  updated_at: string;
                  weight: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetSupplierCategoriesError,
          PennylaneClient,
      >

      Retrieves the categories of a supplier.

      Uses cursor-based pagination.

      Possible errors:

      • GetSupplierCategoriesBadRequest (400): Missing or invalid query parameters
      • GetSupplierCategoriesUnauthorized (401): Invalid or missing API key
      • GetSupplierCategoriesForbidden (403): Insufficient permissions (suppliers:readonly scope required)
      • GetSupplierCategoriesNotFound (404): Supplier not found
    • getSupplierChanges: (
          params?: GetSupplierChangesQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  created_at: string;
                  id: number;
                  operation: "insert"
                  | "update"
                  | "delete";
                  processed_at: string;
                  updated_at: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetSupplierChangesError,
          PennylaneClient,
      >

      Retrieves supplier change events (insert / update / delete).

      Changes are retained for 4 weeks. Uses cursor-based pagination.

      Possible errors:

      • GetSupplierChangesBadRequest (400): Missing or invalid query parameters
      • GetSupplierChangesUnauthorized (401): Invalid or missing API key
      • GetSupplierChangesForbidden (403): Insufficient permissions (suppliers:readonly scope required)
      • GetSupplierChangesNotFound (404): Resource not found
      • GetSupplierChangesUnprocessableEntity (422): start_date older than 4 weeks or combined with cursor
    • getSuppliers: (
          params?: GetSuppliersQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  created_at: string;
                  emails: readonly string[];
                  establishment_no: string
                  | null;
                  external_reference: string;
                  iban: string;
                  id: number;
                  ledger_account: { id: number } | null;
                  name: string;
                  postal_address: {
                      address: string;
                      city: string;
                      country_alpha2: string;
                      postal_code: string;
                  };
                  reg_no: string
                  | null;
                  supplier_due_date_delay: number | null;
                  supplier_due_date_rule: "days" | "days_or_end_of_month" | null;
                  supplier_payment_method:
                      | "card"
                      | "other"
                      | "automatic_transfer"
                      | "manual_transfer"
                      | "automatic_debiting"
                      | "bill_of_exchange"
                      | "check"
                      | "cash"
                      | null;
                  updated_at: string;
                  vat_number: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetSuppliersError,
          PennylaneClient,
      >

      Retrieves a list of suppliers.

      Uses cursor-based pagination.

      Possible errors:

      • GetSuppliersBadRequest (400): Missing or invalid query parameters
      • GetSuppliersUnauthorized (401): Invalid or missing API key
      • GetSuppliersForbidden (403): Insufficient permissions (suppliers:readonly scope required)
      • GetSuppliersNotFound (404): Resource not found
    • updateSupplier: (
          id: number,
          body: UpdateSupplierBody,
      ) => Effect<
          {
              created_at: string;
              emails: readonly string[];
              establishment_no: string
              | null;
              external_reference: string;
              iban: string;
              id: number;
              ledger_account: { id: number } | null;
              name: string;
              postal_address: {
                  address: string;
                  city: string;
                  country_alpha2: string;
                  postal_code: string;
              };
              reg_no: string
              | null;
              supplier_due_date_delay: number | null;
              supplier_due_date_rule: "days" | "days_or_end_of_month" | null;
              supplier_payment_method:
                  | "card"
                  | "other"
                  | "automatic_transfer"
                  | "manual_transfer"
                  | "automatic_debiting"
                  | "bill_of_exchange"
                  | "check"
                  | "cash"
                  | null;
              updated_at: string;
              vat_number: string;
          },
          UpdateSupplierError,
          PennylaneClient,
      >

      Updates an existing supplier.

      Possible errors:

      • UpdateSupplierBadRequest (400): Missing or invalid request body
      • UpdateSupplierUnauthorized (401): Invalid or missing API key
      • UpdateSupplierForbidden (403): Insufficient permissions (suppliers:all scope required)
      • UpdateSupplierNotFound (404): Supplier not found
      • UpdateSupplierUnprocessableEntity (422): Request rejected by business validation