View Source Circlex.Api.Core.Payouts (Circlex v0.1.7)

API Client to the Core Payouts API.

Reference: https://developers.circle.com/reference/getbusinessaccountpayouts

Link to this section Summary

Link to this section Functions

Link to this function

create(destination, amount, opts \\ [])

View Source

Create a payout.

Reference: https://developers.circle.com/reference/createbusinessaccountpayout

examples

Examples

iex> host = Circlex.Test.start_server()
iex> destination = %{address: "0x871A9FF377eCf2632A0928950dCEb181557F2e17", chain: "ETH", type: "blockchain"}
iex> amount = %{amount: "12345.00", currency: "USD"}
iex> Circlex.Api.Core.Payouts.create(destination, amount, host: host)
{
  :ok,
  %Circlex.Struct.Payout{
    adjustments: nil,
    amount: %Circlex.Struct.Amount{amount: "12345.00", currency: "USD"},
    create_date: "2022-07-17T08:59:41.344582Z",
    destination: %Circlex.Struct.SourceDest{type: :blockchain, address: "0x871a9ff377ecf2632a0928950dceb181557f2e17", chain: "ETH"},
    fees: %Circlex.Struct.Amount{amount: "0.00", currency: "USD"},
    id: "a033a6d8-05ae-11ed-9e62-6a1733211c00",
    return: nil,
    risk_evaluation: nil,
    source_wallet_id: "1000216185",
    status: "pending",
    tracking_ref: "CIR3KXZZ00",
    update_date: "2022-07-17T08:59:41.344582Z"
  }
}
Link to this function

get_payout(id, opts \\ [])

View Source

Get a payout.

Reference: https://developers.circle.com/reference/getbusinessaccountpayout

examples

Examples

iex> host = Circlex.Test.start_server()
iex> Circlex.Api.Core.Payouts.get_payout("6e2e20bd-6ad6-4603-950b-64803647a4e6", host: host)
{
  :ok,
  %Circlex.Struct.Payout{
    adjustments: nil,
    amount: %Circlex.Struct.Amount{amount: "12111.00", currency: "USD"},
    create_date: "2022-07-15T20:03:32.718Z",
    destination: %Circlex.Struct.SourceDest{type: :wire, id: "4847be95-8b73-44cc-a329-549a25a776e2"},
    fees: %Circlex.Struct.Amount{amount: "25.00", currency: "USD"},
    id: "6e2e20bd-6ad6-4603-950b-64803647a4e6",
    return: nil,
    risk_evaluation: nil,
    source_wallet_id: "1000216185",
    status: "complete",
    tracking_ref: nil,
    update_date: "2022-07-15T20:20:32.255Z"
  }
}
Link to this function

list_payouts(opts \\ [])

View Source

Get a list of payouts.

Reference: https://developers.circle.com/reference/getbusinessaccountpayouts

TODO: Filters

examples

Examples

iex> host = Circlex.Test.start_server()
iex> Circlex.Api.Core.Payouts.list_payouts(host: host)
{
  :ok,
  [
    %Circlex.Struct.Payout{
      adjustments: nil,
      amount: %Circlex.Struct.Amount{amount: "12111.00", currency: "USD"},
      create_date: "2022-07-15T20:03:32.718Z",
      destination: %Circlex.Struct.SourceDest{type: :wire, id: "4847be95-8b73-44cc-a329-549a25a776e2"},
      fees: %Circlex.Struct.Amount{amount: "25.00", currency: "USD"},
      id: "6e2e20bd-6ad6-4603-950b-64803647a4e6",
      return: nil,
      risk_evaluation: nil,
      source_wallet_id: "1000216185",
      status: "complete",
      tracking_ref: nil,
      update_date: "2022-07-15T20:20:32.255Z"
    }
  ]
}