PomeloEx (PomeloEx v0.1.0)
View SourcePomeloEx is an Elixir client library for the Pomelo API.
Pomelo is a Latin American fintech platform that provides card issuing, digital accounts, identity verification (KYC/KYB), fraud prevention, loyalty programs, credit products, and more.
Architecture
This library follows a three-layer design pattern:
- Parent modules (e.g.
PomeloEx.General.Company) — expose public functions viadefdelegate - Operation modules — implement HTTP calls via
execute/1(hidden from public docs) - Type modules — define typed request schemas using
TypedEctoSchema(hidden from public docs)
Usage
Before making API calls, you must configure the library with your Pomelo credentials:
config :pomelo_ex,
client_id: "your_client_id",
client_secret: "your_client_secret",
url: "https://api.pomelo.la",
audience: "https://api.pomelo.la",
grant_type: "client_credentials"Authentication
Obtain an access token via PomeloEx.General.Authorization.request_token/0:
{:ok, %PomeloEx.Adapter.Response{body: body}} = PomeloEx.General.Authorization.request_token()
token = body["access_token"]Making API calls
Pass the token within each request struct:
payload = %PomeloEx.Types.General.Companies.CreateCompanyType{
token: token,
legal_name: "My Company",
email: "contact@company.com",
operation_country: "ARG"
}
{:ok, response} = PomeloEx.General.Company.create_company(payload)Sandbox environment
For development, use the sandbox environment:
config :pomelo_ex,
url: "https://sandbox.api.pomelo.la",
...Configuration
| Key | Description | Default |
|---|---|---|
:http_adapter | HTTP client module | "PomeloEx.Adapter.HTTPoison" |
:url | API base URL | — |
:client_id | OAuth client ID | — |
:client_secret | OAuth client secret | — |
:audience | OAuth audience | — |
:grant_type | OAuth grant type | — |
:idempotency_key_length | Length of generated idempotency keys | — |
Domains
PomeloEx.General.Authorization— OAuth 2.0 token managementPomeloEx.General.Company— Company managementPomeloEx.General.Users— User managementPomeloEx.Identity.KYC— Know Your Customer sessionsPomeloEx.Identity.KYB— Know Your Business sessionsPomeloEx.Cards.Issuing— Card issuance lifecyclePomeloEx.Cards.Processing— Transaction authorization and presentmentPomeloEx.Cards.Tokenization— Digital wallet tokenizationPomeloEx.Cards.SensitiveInformation— Sensitive data handlingPomeloEx.Cards.Credits— Credit products and linesPomeloEx.Cards.Associations— Card-credit line associationsPomeloEx.DigitalAccounts— Digital account managementPomeloEx.Finance.Settlements— Settlement operationsPomeloEx.Fraud— Fraud prevention operationsPomeloEx.Loyalty— Loyalty points and cashback