e-invoice-api
Version:
The official TypeScript library for the e-invoice API
34 lines • 1.45 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
import { path } from "../../internal/utils/path.mjs";
export 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, params, options) {
const { document_id } = params;
return this._client.get(path `/api/documents/${document_id}/attachments/${attachmentID}`, options);
}
/**
* Get all attachments for an invoice or credit note
*/
list(documentID, options) {
return this._client.get(path `/api/documents/${documentID}/attachments`, options);
}
/**
* Delete an attachment from an invoice or credit note
*/
delete(attachmentID, params, options) {
const { document_id } = params;
return this._client.delete(path `/api/documents/${document_id}/attachments/${attachmentID}`, options);
}
/**
* Add a new attachment to an invoice or credit note
*/
add(documentID, body, options) {
return this._client.post(path `/api/documents/${documentID}/attachments`, multipartFormRequestOptions({ body, ...options }, this._client));
}
}
//# sourceMappingURL=attachments.mjs.map