starkbank v2.6.1 StarkBank.DictKey View Source

Groups DictKey related functions

Link to this section Summary

Functions

DictKey represents a PIX key registered in Bacen's DICT system.

Receive a single DictKey struct by passing its id

Same as get(), but it will unwrap the error tuple and raise in case of errors.

Receive a list of up to 100 DictKey objects previously created in the Stark Bank API and the cursor to the next page. Use this function instead of query if you want to manually page your requests.

Same as page(), but it will unwrap the error tuple and raise in case of errors.

Receive a stream of DictKey structs associated with your Stark Bank Workspace

Same as query(), but it will unwrap the error tuple and raise in case of errors.

Link to this section Types

Link to this type

t()

View Source
t() :: %StarkBank.DictKey{
  account_created: term(),
  account_number: term(),
  account_type: term(),
  bank_name: term(),
  branch_code: term(),
  created: term(),
  id: term(),
  ispb: term(),
  name: term(),
  owned: term(),
  owner_type: term(),
  status: term(),
  tax_id: term(),
  type: term()
}

Link to this section Functions

Link to this function

%StarkBank.DictKey{}

View Source (struct)

DictKey represents a PIX key registered in Bacen's DICT system.

Parameters (optional):

  • :id [string]: DictKey object unique id and PIX key itself. ex: "tony@starkbank.com", "722.461.430-04", "20.018.183/0001-80", "+5511988887777", "b6295ee1-f054-47d1-9e90-ee57b74f60d9"

    Attributes (return-only):

  • :type [string, default nil]: DICT key type. ex: "email", "cpf", "cnpj", "phone" or "evp"

  • :name [string, default nil]: key owner full name. ex: "Tony Stark"

  • :tax_id [string, default nil]: key owner tax ID (CNPJ or masked CPF). ex: "*.345.678-" or "20.018.183/0001-80"

  • :owner_type [string, default nil]: DICT key owner type. ex "naturalPerson" or "legalPerson"

  • :bank_name [string, default nil]: bank name associated with the DICT key. ex: "Stark Bank"

  • :ispb [string, default nil]: bank ISPB associated with the DICT key. ex: "20018183"

  • :branch_code [string, default nil]: bank account branch code associated with the DICT key. ex: "9585"

  • :account_number [string, default nil]: bank account number associated with the DICT key. ex: "9828282578010513"

  • :account_type [string, default nil]: bank account type associated with the DICT key. ex: "checking", "saving", "salary" or "payment"

  • :status [string, default nil]: current DICT key status. ex: "created", "registered", "canceled" or "failed"

  • :account_created [datetime.datetime, default nil]: creation datetime of the bank account associated with the DICT key. ex: datetime.date(2020, 1, 12, 11, 14, 8)

  • :owned [DateTime, default nil]: datetime since when the current owner hold this DICT key. ex: ~U[2020-11-26 17:31:45.482618Z]

  • :created [DateTime, default nil]: creation datetime for the DICT key. ex: ~U[2020-11-26 17:31:45.482618Z]

Link to this function

get(id, options \\ [])

View Source
get(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) :: {:ok, t()} | {:error, [%StarkBank.Error{code: term(), message: term()}]}

Receive a single DictKey struct by passing its id

Parameters (required):

  • :id [string]: DictKey object unique id and PIX key itself. ex: "tony@starkbank.com", "722.461.430-04", "20.018.183/0001-80", "+5511988887777", "b6295ee1-f054-47d1-9e90-ee57b74f60d9"

Options:

  • :user [Organization/Project, default nil]: Organization or Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.

Return:

  • DictKey struct with updated attributes
Link to this function

get!(id, options \\ [])

View Source
get!(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) :: t()

Same as get(), but it will unwrap the error tuple and raise in case of errors.

Link to this function

page(options \\ [])

View Source
page(
  cursor: binary(),
  limit: integer(),
  type: binary(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  ids: [binary()],
  status: binary(),
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) ::
  {:ok, {binary(), [t()]}}
  | {:error, [%StarkBank.Error{code: term(), message: term()}]}

Receive a list of up to 100 DictKey objects previously created in the Stark Bank API and the cursor to the next page. Use this function instead of query if you want to manually page your requests.

Options:

  • :cursor [string, default nil]: cursor returned on the previous page function call
  • :limit [integer, default nil]: maximum number of structs to be retrieved. Unlimited if nil. ex: 35
  • :type [string, default nil]: DictKey type. ex: "cpf", "cnpj", "phone", "email" or "evp"
  • :after [Date or string, default nil]: date filter for structs created only after specified date. ex: ~D[2020-03-25]
  • :before [Date or string, default nil]: date filter for structs created only before specified date. ex: ~D[2020-03-25]
  • :ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"]
  • :status [string, default nil]: filter for status of retrieved structs. ex: "registered"
  • :user [Organization/Project, default nil]: Organization or Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.

Return:

  • list of DictKey structs with updated attributes and cursor to retrieve the next page of DictKey objects
Link to this function

page!(options \\ [])

View Source
page!(
  cursor: binary(),
  limit: integer(),
  type: binary(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  ids: [binary()],
  status: binary(),
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) :: [t()]

Same as page(), but it will unwrap the error tuple and raise in case of errors.

Link to this function

query(options \\ [])

View Source
query(
  limit: integer(),
  type: binary(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  ids: [binary()],
  status: binary(),
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) ::
  ({:cont, {:ok, [t()]}}
   | {:error, [StarkBank.Error.t()]}
   | {:halt, any()}
   | {:suspend, any()},
   any() ->
     any())

Receive a stream of DictKey structs associated with your Stark Bank Workspace

Options:

  • :limit [integer, default nil]: maximum number of structs to be retrieved. Unlimited if nil. ex: 35
  • :type [string, default nil]: DictKey type. ex: "cpf", "cnpj", "phone", "email" or "evp"
  • :after [Date or string, default nil]: date filter for structs created only after specified date. ex: ~D[2020-03-25]
  • :before [Date or string, default nil]: date filter for structs created only before specified date. ex: ~D[2020-03-25]
  • :ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"]
  • :status [string, default nil]: filter for status of retrieved structs. ex: "registered"
  • :user [Organization/Project, default nil]: Organization or Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.

Return:

  • stream of DictKey structs with updated attributes
Link to this function

query!(options \\ [])

View Source
query!(
  limit: integer(),
  type: binary(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  ids: [binary()],
  status: binary(),
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) :: ({:cont, [t()]} | {:halt, any()} | {:suspend, any()}, any() -> any())

Same as query(), but it will unwrap the error tuple and raise in case of errors.