UNPKG

e-invoice-api

Version:

The official TypeScript library for the e-invoice API

47 lines 2.04 kB
import { APIResource } from "../../core/resource.js"; import { APIPromise } from "../../core/api-promise.js"; import { type Uploadable } from "../../core/uploads.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Attachments extends APIResource { /** * Get attachment details with for an invoice or credit note with link to download * file (signed URL, valid for 1 hour) */ retrieve(attachmentID: string, params: AttachmentRetrieveParams, options?: RequestOptions): APIPromise<DocumentAttachment>; /** * Get all attachments for an invoice or credit note */ list(documentID: string, options?: RequestOptions): APIPromise<AttachmentListResponse>; /** * Delete an attachment from an invoice or credit note */ delete(attachmentID: string, params: AttachmentDeleteParams, options?: RequestOptions): APIPromise<AttachmentDeleteResponse>; /** * Add a new attachment to an invoice or credit note */ add(documentID: string, body: AttachmentAddParams, options?: RequestOptions): APIPromise<DocumentAttachment>; } export interface DocumentAttachment { id: string; file_name: string; file_size?: number; file_type?: string; file_url?: string | null; } export type AttachmentListResponse = Array<DocumentAttachment>; export interface AttachmentDeleteResponse { is_deleted: boolean; } export interface AttachmentRetrieveParams { document_id: string; } export interface AttachmentDeleteParams { document_id: string; } export interface AttachmentAddParams { file: Uploadable; } export declare namespace Attachments { export { type DocumentAttachment as DocumentAttachment, type AttachmentListResponse as AttachmentListResponse, type AttachmentDeleteResponse as AttachmentDeleteResponse, type AttachmentRetrieveParams as AttachmentRetrieveParams, type AttachmentDeleteParams as AttachmentDeleteParams, type AttachmentAddParams as AttachmentAddParams, }; } //# sourceMappingURL=attachments.d.ts.map