postDocument

@POST(value = documents)
@Multipart()
abstract suspend fun postDocument(@Part() sourceFile: MultipartBody.Part, @Part(value = documentTypedocumentType: RequestBody, @Part(value = foreignIdforeignId: RequestBody?, @Part(value = accountIdaccountId: RequestBody?, @Part(value = descriptiondescription: RequestBody?, @Part(value = transactionIdtransactionId: 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 &#x3D; &#39;invoice&#39;. Contact Sensibill support for more information about the enableInvoice feature flag. * Responses:

  • 200: Success. The new document was successfully submitted and its ID returned.

  • 400: Bad Request. This will occur if you provide an invalid value for a request parameter, an invalid parameter or invalid body.

  • 401: Unauthorized. This will occur if you do not supply an access-token to this endpoint, or if you provide an expired or invalid access token.

  • 403: Forbidden. This will occur if you try to use this endpoint without being setup for documents.

  • 500: Internal Server Error.

Return

DocumentCreationResponseDto

Parameters

sourceFile
  • The binary data to be attached within a multi-part form. The file type can be either JPG, GIF, PNG or PDF and the maximum file size for the file is 5 MB.

documentType
  • The type of the document being submitted. Supported typed include: invoice

foreignId
  • An integrator supplied identifier that must be unique. In case of upload failure or loss of document Id this Id can be used on a new request with the source file to receive the original document id without our system reprocessing the source file.

accountId
description
transactionId