Skip to content
Tiago Guedes edited this page Mar 21, 2018 · 4 revisions

Customers

List

Iugu.Customer.list()
#=> {:ok, [%Iugu.Customer{cc_emails: nil, city: "Campo Mourão", complement: "Cobertura", ...}], 128}

Show

Iugu.Customer.show("6DB324B6859D4D46A3B8689AC745A943")
#=> {:ok, %Iugu.Customer{cc_emails: nil, city: "Campo Mourão", complement: "Cobertura", ...}}

Create

%Iugu.Customer{name: "Foobar", email: "foo@bar.com"} |> Iugu.Customer.create()
#=> {:ok, %Iugu.Customer{cc_emails: nil, city: "Campo Mourão", complement: "Cobertura", ...}}

Subscriptions

List

Iugu.Subscription.list(%{limit: 10})

Show

Iugu.Subscription.show("AF34BD75EED443A1A0BA85E23EB1B2F0")

Create

%Iugu.Subscription{customer_id: "097E474852F64ED3BEDB1D35BF84E2BB", plan_identifier: "Is12"}
|> Iugu.Subscription.create()

Invoices

List

Iugu.Invoice.list(%{limit: 10})

Show

Iugu.Invoice.show("31B41190411C4DF8BAEA3C86AB47D30F")

Create

%{
  due_date: "2018-10-04",
  total_cents: 1000,
  items: [%{description: "Item Um", price_cents: 1000, quantity: 1, "price": "R$ 10,00" }],
  email: "foobar4@beautydate.com.
  payer: %{name: "Foobar", cpf_cnpj: "99384620220", address: %{number: "370", zip_code: "80320070"}}
}
|> Iugu.Invoice.create()
Clone this wiki locally