DocumentsApi

interface DocumentsApi

Functions

Link copied to clipboard
@HTTP(method = "DELETE", path = "documents", hasBody = true)
abstract suspend fun deleteDocuments(@Body documentDeleteDto: DocumentDeleteDto): Response<DocumentDeleteResponseDto>

Delete documents This endpoint will allow you to batch delete documents. To delete one or more documents pass their ids as an array in the request body Important: If any of the documents fail to delete the whole request will fail Responses:

Link copied to clipboard
@GET(value = "documents/{id}/image")
abstract suspend fun documentImage(@Path(value = "id") id: String): Response<ResponseBody>

Get an image version of the document. This endpoint allows you to get an image (jpeg) for any type of document(image, pdf, html_email, etc..).
This will be the url that was returned in the imagePreview field in the GET documents details data format endpoint.

Important: This may take up to 20 seconds to return for pdf or email documents when calling for the first time Responses:

Link copied to clipboard
@GET(value = "documents/{id}/pdf")
abstract suspend fun documentPdf(@Path(value = "id") id: String): Response<ResponseBody>

Get the orginal pdf of a pdf/pdf_email source format document. This endpoint allows you to get the original pdf for any pdf source format document (pdf or pdf_email).
This will be the url that was returned in the url field in the GET document details data format endpoint for pdf documents.

Important: This endpoint can only be called for pdf or pdf_email source format documents and will not work with other document source format types Responses:

Link copied to clipboard
@PATCH(value = "documents/{id}")
abstract suspend fun editDocument(@Path(value = "id") id: String, @Body editDocumentRequestDto: EditDocumentRequestDto): Response<EditDocumentResponseDto>

Update a document This endpoint allows you to update a specific subset of data for a single document given its ID. \\ The schema defined below outlines the fields which can be updated. To unset a specific field you can pass empty string or null. Numeric or Enum fileds must be null to unset. Responses:

Link copied to clipboard
@GET(value = "documents/{id}")
abstract suspend fun getDocumentById(@Path(value = "id") id: String): Response<GetDocumentResponseDto>

Get a document This endpoint will retrieve the details of a single document with the given ID. Responses:

Link copied to clipboard
@GET(value = "documents")
abstract suspend fun getDocuments(@Query(value = "limit") limit: Int? = 20, @Query(value = "offset") offset: Int? = 0, @Query(value = "sortBy") sortBy: DocumentSortByEnum? = DocumentSortByEnum.ARRIVAL_DATE_TIME, @Query(value = "orderBy") orderBy: DocumentOrderByEnum? = DocumentOrderByEnum.DESC, @Query(value = "filter.accountMetadata.account") filterAccountMetadataAccount: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.accountMetadata.account.exists") filterAccountMetadataAccountExists: Boolean? = null, @Query(value = "filter.accountMetadata.transactionId") filterAccountMetadataTransactionId: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.accountMetadata.transactionId.exists") filterAccountMetadataTransactionIdExists: Boolean? = null, @Query(value = "filter.amountDue") filterAmountDue: @JvmSuppressWildcards List<BigDecimal>? = null, @Query(value = "filter.amountDue.gte") filterAmountDueGte: BigDecimal? = null, @Query(value = "filter.amountDue.lte") filterAmountDueLte: BigDecimal? = null, @Query(value = "filter.arrivalDateTime.gte") filterArrivalDateTimeGte: OffsetDateTime? = null, @Query(value = "filter.arrivalDateTime.lte") filterArrivalDateTimeLte: OffsetDateTime? = null, @Query(value = "filter.categoryCode") filterCategoryCode: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.currencyCode") filterCurrencyCode: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.description") filterDescription: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.documentDate") filterDocumentDate: @JvmSuppressWildcards List<LocalDate>? = null, @Query(value = "filter.documentDate.gte") filterDocumentDateGte: LocalDate? = null, @Query(value = "filter.documentDate.lte") filterDocumentDateLte: LocalDate? = null, @Query(value = "filter.documentNumber") filterDocumentNumber: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.documentTime") filterDocumentTime: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.documentTime.gte") filterDocumentTimeGte: String? = null, @Query(value = "filter.documentTime.lte") filterDocumentTimeLte: String? = null, @Query(value = "filter.documentType") filterDocumentType: @JvmSuppressWildcards List<DocumentTypeEnum>? = null, @Query(value = "filter.expenseType") filterExpenseType: @JvmSuppressWildcards List<ExpenseTypeEnum>? = null, @Query(value = "filter.folder") filterFolder: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.foreignId") filterForeignId: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.fulltext") filterFulltext: String? = null, @Query(value = "filter.id") filterId: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.lastUpdateDateTime.gte") filterLastUpdateDateTimeGte: OffsetDateTime? = null, @Query(value = "filter.lastUpdateDateTime.lte") filterLastUpdateDateTimeLte: OffsetDateTime? = null, @Query(value = "filter.merchantName") filterMerchantName: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.merchantTaxIdNumber") filterMerchantTaxIdNumber: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.notes") filterNotes: @JvmSuppressWildcards List<String>? = null, @Query(value = "filter.paymentTender") filterPaymentTender: @JvmSuppressWildcards List<TenderTypesEnum>? = null, @Query(value = "filter.returnPeriodDuration") filterReturnPeriodDuration: @JvmSuppressWildcards List<BigDecimal>? = null, @Query(value = "filter.returnPeriodDuration.gte") filterReturnPeriodDurationGte: BigDecimal? = null, @Query(value = "filter.returnPeriodDuration.lte") filterReturnPeriodDurationLte: BigDecimal? = null, @Query(value = "filter.returnPeriodUnit") filterReturnPeriodUnit: @JvmSuppressWildcards List<PeriodUnitEnum>? = null, @Query(value = "filter.total") filterTotal: @JvmSuppressWildcards List<BigDecimal>? = null, @Query(value = "filter.total.gte") filterTotalGte: BigDecimal? = null, @Query(value = "filter.total.lte") filterTotalLte: BigDecimal? = null, @Query(value = "filter.status") filterStatus: @JvmSuppressWildcards List<DocumentStatusTypeEnum>? = null, @Query(value = "filter.sourceFormat") filterSourceFormat: @JvmSuppressWildcards List<DocumentSourceFormatsEnum>? = null, @Query(value = "filter.warrantyPeriodDuration") filterWarrantyPeriodDuration: @JvmSuppressWildcards List<BigDecimal>? = null, @Query(value = "filter.warrantyPeriodDuration.gte") filterWarrantyPeriodDurationGte: BigDecimal? = null, @Query(value = "filter.warrantyPeriodDuration.lte") filterWarrantyPeriodDurationLte: BigDecimal? = null, @Query(value = "filter.warrantyPeriodUnit") filterWarrantyPeriodUnit: @JvmSuppressWildcards List<PeriodUnitEnum>? = null): Response<GetDocumentListResponseDto>

Returns a paginated list of documents from a user. This will retrieve a paginated list of documents for the current user. Responses:

Link copied to clipboard
@GET(value = "documents/status")
abstract suspend fun getDocumentsStatus(@Query(value = "id") id: @JvmSuppressWildcards List<String>, @Query(value = "timeout") timeout: Int? = null): Response<DocumentsStatusResponseDto>

Query documents for processing status updates Query a list of documents (using their id) for their processing status Responses:

Link copied to clipboard
@POST(value = "documents")
@Multipart
abstract suspend fun postDocument(@Part sourceFile: MultipartBody.Part, @Part(value = "documentType") documentType: RequestBody, @Part(value = "foreignId") foreignId: RequestBody?, @Part(value = "accountId") accountId: RequestBody?, @Part(value = "description") description: RequestBody?, @Part(value = "transactionId") transactionId: RequestBody?): Response<DocumentCreationResponseDto>

Create a new document This allows clients to submit new documents to be processed by the system. Only clients with the feature flag enableInvoice enabled are allowed to submit documentType = 'invoice'. Contact Sensibill support for more information about the enableInvoice feature flag. Responses: