View Source StarkInfra.PixKey (starkinfra v0.0.1)
Groups PixKey related functions
Link to this section Summary
Functions
PixKeys link bank account information to key ids. Key ids are a convenient way to search and pass bank account information. When you initialize a Pix Key, 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 cancel(), but it will unwrap the error tuple and raise in case of errors.
Delete a pixKey entity previously created in the Stark Infra API
Same as create(), but it will unwrap the error tuple and raise in case of errors.
Create a PixKey linked to a specific account in the Stark Infra API
Same as get(), but it will unwrap the error tuple and raise in case of errors.
Retrieve the PixKey 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 errors.
Receive a stream of PixKeys structs previously created in the Stark Infra API
Same as query(), but it will unwrap the error tuple and raise in case of errors.
Receive a stream of PixKeys structs previously created in the Stark Infra API
Same as update(), but it will unwrap the error tuple and raise in case of errors.
Update a PixKey parameters by passing id.
Link to this section Types
@type t() :: %StarkInfra.PixKey{ account_created: term(), account_number: term(), account_type: term(), bank_code: term(), bank_name: term(), branch_code: term(), created: term(), id: term(), name: term(), owned: term(), owner_type: term(), status: term(), tags: term(), tax_id: term(), type: term() }
Link to this section Functions
PixKeys link bank account information to key ids. Key ids are a convenient way to search and pass bank account information. When you initialize a Pix Key, 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 linked account. ex: "2022-01-01".
- `:account_number` [string]: number of the linked account. ex: "76543".
- `:account_type` [string]: type of the linked account. Options: "checking", "savings", "salary" or "payment".
- `:branch_code` [string]: branch code of the linked account. ex: 1234.
- `:name` [string]: holder's name of the linked account. ex: "Jamie Lannister".
- `:tax_id` [string]: holder's taxId (CPF/CNPJ) of the linked account. ex: "012.345.678-90".
parameters-optional
Parameters (optional):
- `:id` [string, default nil]: id of the registered PixKey. Allowed types are: CPF, CNPJ, phone number or email. If this parameter is not passed, an EVP will be created. ex: "+5511989898989";
- `:tags` [list of strings, default nil]: list of strings for reference when searching for PixKeys. ex: ["employees", "monthly"]
attributes-return-only
Attributes (return-only):
- `:owned` [DateTime]: datetime when the key was owned by the holder. ex: ~U[2020-3-10 10:30:0:0]
- `:owner_type` [string]: type of the owner of the PixKey. Options: "business" or "individual".
- `:status` [string]: current PixKey status. Options: "created", "registered", "canceled", "failed"
- `:bank_code` [string]: bank_code of the account linked to the Pix Key. ex: "20018183".
- `:bank_name` [string]: name of the bank that holds the account linked to the PixKey. ex: "StarkBank"
- `:type` [string]: type of the PixKey. Options: "cpf", "cnpj", "phone", "email" and "evp",
- `:created` [DateTime]: creation datetime for the PixKey. ex: ~U[2020-03-10 10:30:0:0]
Same as cancel(), but it will unwrap the error tuple and raise in case of errors.
Delete a pixKey entity previously created in the Stark Infra API
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:
- canceled pixKey struct
@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 errors.
@spec create(t() | map(), [ {:user, StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil} ]) :: {:ok, t()} | {:error, [{:error, StarkInfra.Error.t()}]}
Create a PixKey linked to a specific account in the Stark Infra API
options
Options:
- `:key` [PixKey struct]: PixKey struct to be created in the API.
options-1
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:
- PixKey struct with updated attributes.
Same as get(), but it will unwrap the error tuple and raise in case of errors.
Retrieve the PixKey struct linked to your Workspace in the Stark Infra API by its id.
parameters-required
Parameters (required):
- `:id` [string]: struct unique id. ex: "5656565656565656".
- `:payer_id` [string]: tax id (CPF/CNPJ) of the individual or business requesting the PixKey information. This id is used by the Central Bank to limit request rates. ex: "20.018.183/0001-80".
options
Options:
- `:end_to_end_id` [string, default nil]: central bank's unique transaction id. If the request results in the creation of a PixRequest, the same endToEndId should be used. If this parameter is not passed, one endToEndId will be automatically created. Example: "E00002649202201172211u34srod19le"
- `: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:
- PixKey struct that corresponds to the given id.
@spec page!( cursor: binary(), limit: integer(), after: Date.t() | binary(), before: Date.t() | binary(), status: binary(), tags: [binary()], ids: [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 errors.
@spec page( cursor: binary(), limit: integer(), after: Date.t() | binary(), before: Date.t() | binary(), status: binary(), tags: [binary()], ids: [binary()], user: StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil ) :: {:ok, {:binary, [t()]}} | {:error, [{:error, StarkInfra.Error.t()}]}
Receive a stream of PixKeys structs previously created in the Stark Infra API
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"
- `:tags` [list of strings, default nil]: tags to filter retrieved structs. ex: ["tony", "stark"]
- `:ids` [list of strings, default nil]: list of ids to filter retrieved structs. ex: ["5656565656565656", "4545454545454545"]
- `:type` [list of strings, default nil]: filter for the type of retrieved PixKeys. Options: "cpf", "cnpj", "phone", "email", "evp".
- `: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 PixKey structs
- stream of PixKey structs with updated attributes
@spec query!( limit: integer(), after: Date.t(), before: Date.t(), status: binary(), tags: [binary()], ids: [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 errors.
@spec query( limit: integer(), after: Date.t(), before: Date.t(), status: binary(), tags: [binary()], ids: [binary()], user: StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil ) :: ({:cont, [t()]} | {:error, [StarkInfra.Error.t()]}, any() -> any())
Receive a stream of PixKeys structs previously created in the Stark Infra API
options
Options:
- `: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", "registered", "canceled", "failed".
- `:tags` [list of strings, default nil]: tags to filter retrieved structs. ex: ["tony", "stark"]
- `:ids` [list of strings, default nil]: list of ids to filter retrieved structs. ex: ["5656565656565656", "4545454545454545"]
- `:type` [list of strings, default nil]: filter for the type of retrieved PixKeys. Options: "cpf", "cnpj", "phone", "email", "evp".
- `: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 PixKey structs with updated attributes
Same as update(), but it will unwrap the error tuple and raise in case of errors.
Update a PixKey parameters by passing id.
parameters-required
Parameters (required):
- `:id` [string]: PixKey id. ex: '5656565656565656'
- `:reason` [string]: reason why the PixKey is being patched. Options: "branchTransfer", "reconciliation" or "userRequested".
parameters-optional
Parameters (optional):
- `:account_created` [Date, DateTime or string, default nil]: opening Date or DateTime for the account to be linked. ex: "2022-01-01.
- `:account_number` [string, default nil]: number of the account to be linked. ex: "76543".
- `:account_type` [string, default nil]: type of the account to be linked. Options: "checking", "savings", "salary" or "payment".
- `:branch_code` [string, default nil]: branch code of the account to be linked. ex: 1234".
- `:name` [string, default nil]: holder's name of the account to be linked. ex: "Jamie Lannister".
return
Return:
- PixKey with updated attributes