Skip to content

iamkanishka/currencycloud_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CurrencycloudClient

Hex.pm Docs License: MIT

Production-grade Elixir / Hex client for the Currencycloud v2 API.

Features

  • Complete API coverage — all 14 API groups: Accounts, Balances, Beneficiaries, Contacts, Conversions, Funding, Payments, Payers, Rates, Reference, Reporting, Transactions, Transfers, Withdrawal Accounts.
  • Token lifecycle managementSession GenServer proactively refreshes tokens before expiry; auto-retries on 401.
  • Exponential backoff with full jitterRetryStrategy retries on 429 and 5xx.
  • Typed error structsAuthenticationError, BadRequestError, TooManyRequestsError, NetworkError, etc.
  • Sub-account scoping — first-class on_behalf_of support as a per-call param or client-level scope.
  • Webhook verification — HMAC-SHA256 signature verification with replay-attack protection.
  • Telemetry integration:telemetry events for every request, token refresh, and retry.
  • NimbleOptions config validation — clear errors at startup, not at runtime.
  • OTP-native — supervised Session GenServer.

Installation

def deps do
  [{:currencycloud_client, "~> 0.1"}]
end

Quick start

config = CurrencycloudClient.Config.new!(
  environment: :demo,
  login_id: System.fetch_env!("CC_LOGIN_ID"),
  api_key: System.fetch_env!("CC_API_KEY")
)

{:ok, session} = CurrencycloudClient.Session.start_link(config: config)
client = CurrencycloudClient.Client.new(config, session)

{:ok, balance} = CurrencycloudClient.API.Balances.get(client, "EUR")
IO.puts("EUR: #{balance["amount"]}")

See the full documentation at hexdocs.pm/currencycloud_client.

About

Production-grade Elixir client for the Currencycloud v2 API

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages