PomeloEx (PomeloEx v0.1.0)

View Source

PomeloEx 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:

  1. Parent modules (e.g. PomeloEx.General.Company) — expose public functions via defdelegate
  2. Operation modules — implement HTTP calls via execute/1 (hidden from public docs)
  3. 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

KeyDescriptionDefault
:http_adapterHTTP client module"PomeloEx.Adapter.HTTPoison"
:urlAPI base URL
:client_idOAuth client ID
:client_secretOAuth client secret
:audienceOAuth audience
:grant_typeOAuth grant type
:idempotency_key_lengthLength of generated idempotency keys

Domains