View Source StarkInfra.PixClaim (starkinfra v0.1.0)

Groups PixClaim related functions

Link to this section Summary

Functions

PixClaims intend to transfer a PixKey from one account to another. When you initialize a PixClaim, the entity will not be automatically created in the Stark Infra API. The 'create' function sends the structs to the Stark Infra API and returns the created struct.

Same as create, but it will unwrap the error tuple and raise in case of error.

Create a PixClaim to request the transfer of a PixKey to an account hosted at other Pix participants in the Stark Infra API.

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

Retrieve a PixClaim struct linked to your Workspace in the Stark Infra API by its id.

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

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

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

Receive a stream of PixClaims structs previously created in the Stark Infra API

Same as update, but it will unwrap the error tuple and raise in case of error.

Update a PixClaim parameters by passing id.

Link to this section Types

@type t() :: %StarkInfra.PixClaim{
  account_created: term(),
  account_number: term(),
  account_type: term(),
  agent: term(),
  bank_code: term(),
  branch_code: term(),
  claimed_bank_code: term(),
  created: term(),
  id: term(),
  key_id: term(),
  key_type: term(),
  name: term(),
  status: term(),
  tax_id: term(),
  type: term(),
  updated: term()
}

Link to this section Functions

Link to this function

%StarkInfra.PixClaim{}

View Source (struct)

PixClaims intend to transfer a PixKey from one account to another. When you initialize a PixClaim, the entity will not be automatically created in the Stark Infra API. The 'create' function sends the structs to the Stark Infra API and returns the created struct.

parameters-required

Parameters (required):

  • :account_created [Date, DateTime or string]: opening Date or DateTime for the account claiming the PixKey. ex: "2022-01-01".
  • :account_number [string]: number of the account claiming the PixKey. ex: "76543".
  • :account_type [string]: type of the account claiming the PixKey. Options: "checking", "savings", "salary" or "payment".
  • :branch_code [string]: branch code of the account claiming the PixKey. ex: 1234".
  • :name [string]: holder's name of the account claiming the PixKey. ex: "Jamie Lannister".
  • :tax_id [string]: holder's taxId of the account claiming the PixKey (CPF/CNPJ). ex: "012.345.678-90".
  • :key_id [string]: id of the registered Pix Key to be claimed. Allowed keyTypes are CPF, CNPJ, phone number or email. ex: "+5511989898989".

attributes-return-only

Attributes (return-only):

  • :id [string]: unique id returned when the PixClaim is created. ex: "5656565656565656"
  • :status [string]: current PixClaim status. Options: "created", "failed", "delivered", "confirmed", "success", "canceled"
  • :type [string]: type of Pix Claim. Options: "ownership", "portability".
  • :key_type [string]: keyType of the claimed PixKey. Options: "CPF", "CNPJ", "phone" or "email"
  • :agent [string]: Options: "claimer" if you requested the PixClaim or "claimed" if you received a PixClaim request.
  • :bank_code [string]: bank_code of the account linked to the PixKey being claimed. ex: "20018183".
  • :claimed_bank_code [string]: bank_code of the account donating the PixKey. ex: "20018183".
  • :created [DateTime]: creation DateTime for the PixClaim. ex: ~U[2020-3-10 10:30:0:0]
  • :updated [DateTime]: update DateTime for the PixClaim. ex: ~U[2020-3-10 10:30:0:0]
Link to this function

create!(keys, options \\ [])

View Source
@spec create!(t() | map(), [
  {:user, StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil}
]) :: any()

Same as create, but it will unwrap the error tuple and raise in case of error.

Link to this function

create(keys, options \\ [])

View Source
@spec create(t() | map(), [
  {:user, StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil}
]) :: {:ok, t()} | {:error, [{:error, StarkInfra.Error.t()}]}

Create a PixClaim to request the transfer of a PixKey to an account hosted at other Pix participants in the Stark Infra API.

parameters-required

Parameters (required):

  • :claim [PixClaim struct]: PixClaim struct to be created in the API.

options

Options:

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

return

Return:

  • PixClaim struct with updated attributes.

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

Retrieve a PixClaim struct linked to your Workspace in the Stark Infra API by its id.

parameters-required

Parameters (required):

  • :id [string]: struct unique id. ex: "5656565656565656"

options

Options:

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

return

Return:

  • PixClaim struct that corresponds to the given id.
@spec page!(
  cursor: binary(),
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  status: binary(),
  ids: [binary()],
  type: binary(),
  agent: binary(),
  key_type: binary(),
  key_id: binary(),
  user: StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil
) :: any()

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

@spec page(
  cursor: binary(),
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  status: binary(),
  ids: [binary()],
  type: binary(),
  agent: binary(),
  key_type: binary(),
  key_id: binary(),
  user: StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil
) :: {:ok, {binary(), [t()]}} | {:error, [{:error, StarkInfra.Error.t()}]}

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

options

Options:

  • :cursor [string, default nil]: cursor returned on the previous page function call.
  • :limit [integer, default 100]: maximum number of structs to be retrieved. Max = 100. ex: 35
  • :after [Date or string, default nil]: date filter for structs created after a specified date. ex: ~D[2020, 3, 10]
  • :before [Date or string, default nil]: date filter for structs created before a specified date. ex: ~D[2020, 3, 10]
  • :status [list of strings, default nil]: filter for status of retrieved structs. Options: "created", "failed", "delivered", "confirmed", "success", "canceled"
  • :ids [list of strings, default nil]: list of ids to filter retrieved structs. ex: ["5656565656565656", "4545454545454545"]
  • :type [strings, default nil]: filter for the type of retrieved PixClaims. Options: "ownership" or "portability".
  • :agent [string, default nil]: filter for the agent of retrieved PixClaims. Options: "claimer" or "claimed".
  • :key_type [string, default nil]: filter for the PixKey type of retrieved PixClaims. Options: "cpf", "cnpj", "phone", "email", "evp".
  • :key_id [string, default nil]: filter PixClaims linked to a specific PixKey id. Example: "+5511989898989".
  • :user [Organization/Project, default nil]: Organization or Project struct returned from StarkInfra.project(). Only necessary if default project or organization has not been set in configs.

return

Return:

  • cursor to retrieve the next page of PixClaim structs
  • stream of PixClaim structs with updated attributes
@spec query!(
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  status: binary(),
  ids: [binary()],
  type: binary(),
  agent: binary(),
  key_type: binary(),
  key_id: binary(),
  user: StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil
) :: any()

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

@spec query(
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  status: binary(),
  ids: [binary()],
  type: binary(),
  agent: binary(),
  key_type: binary(),
  key_id: binary(),
  user: StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil
) :: {:ok, [t()]} | {:error, [{:error, StarkInfra.Error.t()}]}

Receive a stream of PixClaims structs previously created in the Stark Infra API

options

Options:

  • :limit [integer, default nil]: maximum number of structs to be retrieved. Unlimited if nil. ex: 35
  • :after [Date or string, default nil]: date filter for structs created after a specified date. ex: ~D[2020-03-10]
  • :before [Date or string, default nil]: date filter for structs created before a specified date. ex: ~D[2020-03-10]
  • :status [list of strings, default nil]: filter for status of retrieved structs. Options: "created", "failed", "delivered", "confirmed", "success", "canceled".
  • :ids [list of strings, default nil]: list of ids to filter retrieved structs. ex: ["5656565656565656", "4545454545454545"]
  • :type [strings, default nil]: filter for the type of retrieved PixClaims. Options: "ownership" or "portability".
  • :agent [string, default nil]: filter for the agent of retrieved PixClaims. Options: "claimer" or "claimed".
  • :key_type [string, default nil]: filter for the PixKey type of retrieved PixClaims. Options: "cpf", "cnpj", "phone", "email", "evp".
  • :key_id [string, default nil]: filter PixClaims linked to a specific PixKey id. Example: "+5511989898989".
  • :user [Organization/Project, default nil]: Organization or Project struct returned from StarkInfra.project(). Only necessary if default project or organization has not been set in configs.

return

Return:

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

update!(id, status, parameters \\ [])

View Source

Same as update, but it will unwrap the error tuple and raise in case of error.

Link to this function

update(id, status, parameters \\ [])

View Source

Update a PixClaim parameters by passing id.

parameters-required

Parameters (required):

  • :id [string]: PixClaim id. ex: '5656565656565656'
  • :status [string]: patched status for Pix Claim. Options: "confirmed" and "canceled"

parameters-optional

Parameters (optional):

  • :reason [string, default: "userRequested"]: reason why the PixClaim is being patched. Options: "fraud", "userRequested".
  • :user [Organization/Project, default nil]: Organization or Project struct returned from StarkInfra.project(). Only necessary if default project or organization has not been set in configs.

return

Return:

  • PixClaim with updated attributes