Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Invoice Items

bradrydzewski edited this page Jun 5, 2012 · 4 revisions

Create a new invoice item

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

params := stripe.InvoiceItemParams {
	Customer : "cus_Lt6VFhU30fptWh",
	Amount   : 2000,
	Currency : "usd",
	Desc     : "One-time setup fee",
}

item, err := stripe.InvoiceItems.Create(&params)

Full list of parameters for creating an Invoice Item:
http://go.pkgdoc.org/github.com/bradrydzewski/go.stripe#InvoiceItemParams

Official Stripe Documentation:
https://stripe.com/docs/api#create_invoiceitem

Retrieve an existing invoice item

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

item, err := stripe.InvoiceItems.Retrieve("ii_LL5ruCWcwjqQIQ")

Update an invoice item

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

params := stripe.InvoiceItemParams {
	Amount   : 1500,
	Desc     : "Customer for [email protected]"
}

item, err := stripe.InvoiceItems.Update("ii_LL5ruCWcwjqQIQ", &params)

Delete an invoice item

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

_, err := stripe.InvoiceItems.Delete("ii_LL5ruCWcwjqQIQ")

List all invoice items

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

items, err := stripe.InvoiceItems.List()

List for the specified range:

// get a list of 10 invoice items, starting at position 40 in the list of invoice items
items, err := stripe.InvoiceItems.ListN(10, 40)

List for the specified Customer:

items, err := stripe.InvoiceItems.CustomerList("cus_Lt6VFhU30fptWh")

List for the specified Customer and range:

items, err := stripe.InvoiceItems.CustomerList("cus_Lt6VFhU30fptWh", 10, 40)
Clone this wiki locally