Unit.API.CheckDeposits (Unit v1.0.0)

Copy Markdown View Source

API module for Unit Check Deposits (Remote Deposit Capture).

Flow

  1. Create a check deposit — status: AwaitingImages
  2. Upload front image → status: AwaitingBackImage
  3. Upload back image → status: PendingClearingSent

Images must be submitted as JPEG (preferred) or TIFF files.

Summary

Functions

Create a check deposit.

Get a check deposit by ID.

List check deposits.

Update a check deposit's tags.

Upload the front image of a check (JPEG or TIFF binary).

Functions

create(params, opts \\ [])

@spec create(
  map(),
  keyword()
) :: {:ok, Unit.Resource.CheckDeposit.t()} | {:error, term()}

Create a check deposit.

Required params

  • :account_id
  • :amount — in cents
  • :description

get(id, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, Unit.Resource.CheckDeposit.t()} | {:error, term()}

Get a check deposit by ID.

list(opts \\ [])

@spec list(keyword()) ::
  {:ok, [Unit.Resource.CheckDeposit.t()], map()} | {:error, term()}

List check deposits.

Filter options

  • :account_id, :customer_id, :status
  • :since, :until

update(id, params, opts \\ [])

@spec update(String.t(), map(), keyword()) ::
  {:ok, Unit.Resource.CheckDeposit.t()} | {:error, term()}

Update a check deposit's tags.

upload_back(id, image_binary, mime_type \\ "image/jpeg", opts \\ [])

@spec upload_back(String.t(), binary(), String.t(), keyword()) ::
  {:ok, Unit.Resource.CheckDeposit.t()} | {:error, term()}

Upload the back image of a check.

upload_front(id, image_binary, mime_type \\ "image/jpeg", opts \\ [])

@spec upload_front(String.t(), binary(), String.t(), keyword()) ::
  {:ok, Unit.Resource.CheckDeposit.t()} | {:error, term()}

Upload the front image of a check (JPEG or TIFF binary).