Raw file storage, used as the building block for check deposit images
(TreasuryPrime.CheckDeposit) and supporting KYC/KYB documentation
(TreasuryPrime.Document).
Unlike every other resource, file upload doesn't take a JSON body — you
POST the raw bytes with the appropriate Content-Type header.
Uploading
{:ok, file} = TreasuryPrime.File.upload(client, image_binary, "image/jpeg")
file.id #=> "file_..."Downloading
{:ok, binary} = TreasuryPrime.File.download(client, file.id)
Elixir.File.write!("check_front.jpg", binary)
Summary
Functions
Downloads a file's raw binary content.
Fetches file metadata by id.
Uploads raw binary content (e.g. JPEG/PNG for check images, PDF for
documents). Returns file metadata including the new id.
Types
Functions
@spec download(TreasuryPrime.Client.t(), String.t()) :: {:ok, binary()} | {:error, TreasuryPrime.Error.t()}
Downloads a file's raw binary content.
@spec download!(TreasuryPrime.Client.t(), String.t()) :: binary()
@spec get(TreasuryPrime.Client.t(), String.t()) :: {:ok, t()} | {:error, TreasuryPrime.Error.t()}
Fetches file metadata by id.
@spec get!(TreasuryPrime.Client.t(), String.t()) :: t()
@spec upload(TreasuryPrime.Client.t(), binary(), String.t()) :: {:ok, t()} | {:error, TreasuryPrime.Error.t()}
Uploads raw binary content (e.g. JPEG/PNG for check images, PDF for
documents). Returns file metadata including the new id.
@spec upload!(TreasuryPrime.Client.t(), binary(), String.t()) :: t()