Documentation ¶
Overview ¶
Package creditnote provides the /credit_notes APIs
Index ¶
- func Get(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
- func New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
- func Preview(params *stripe.CreditNotePreviewParams) (*stripe.CreditNote, error)
- func Update(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
- func VoidCreditNote(id string, params *stripe.CreditNoteVoidCreditNoteParams) (*stripe.CreditNote, error)
- type Client
- func (c Client) Get(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
- func (c Client) List(listParams *stripe.CreditNoteListParams) *Iter
- func (c Client) ListLines(listParams *stripe.CreditNoteListLinesParams) *LineItemIter
- func (c Client) New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
- func (c Client) Preview(params *stripe.CreditNotePreviewParams) (*stripe.CreditNote, error)
- func (c Client) PreviewLines(listParams *stripe.CreditNotePreviewLinesParams) *LineItemIter
- func (c Client) Update(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
- func (c Client) VoidCreditNote(id string, params *stripe.CreditNoteVoidCreditNoteParams) (*stripe.CreditNote, error)
- type Iter
- type LineItemIter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
Retrieves the credit note object with the given identifier.
func New ¶
func New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following:
Refund: create a new refund (using refund_amount) or link an existing refund (using refund). Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
func Preview ¶
func Preview(params *stripe.CreditNotePreviewParams) (*stripe.CreditNote, error)
Get a preview of a credit note without creating it.
func Update ¶
func Update(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
Updates an existing credit note.
func VoidCreditNote ¶
func VoidCreditNote(id string, params *stripe.CreditNoteVoidCreditNoteParams) (*stripe.CreditNote, error)
Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
Types ¶
type Client ¶
Client is used to invoke /credit_notes APIs.
func (Client) Get ¶
func (c Client) Get(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
Retrieves the credit note object with the given identifier.
func (Client) List ¶
func (c Client) List(listParams *stripe.CreditNoteListParams) *Iter
Returns a list of credit notes.
func (Client) ListLines ¶
func (c Client) ListLines(listParams *stripe.CreditNoteListLinesParams) *LineItemIter
When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
func (Client) New ¶
func (c Client) New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following:
Refund: create a new refund (using refund_amount) or link an existing refund (using refund). Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
func (Client) Preview ¶
func (c Client) Preview(params *stripe.CreditNotePreviewParams) (*stripe.CreditNote, error)
Get a preview of a credit note without creating it.
func (Client) PreviewLines ¶
func (c Client) PreviewLines(listParams *stripe.CreditNotePreviewLinesParams) *LineItemIter
When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
func (Client) Update ¶
func (c Client) Update(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error)
Updates an existing credit note.
func (Client) VoidCreditNote ¶
func (c Client) VoidCreditNote(id string, params *stripe.CreditNoteVoidCreditNoteParams) (*stripe.CreditNote, error)
Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
type Iter ¶
Iter is an iterator for credit notes.
func (*Iter) CreditNote ¶
func (i *Iter) CreditNote() *stripe.CreditNote
CreditNote returns the credit note which the iterator is currently pointing to.
func (*Iter) CreditNoteList ¶
func (i *Iter) CreditNoteList() *stripe.CreditNoteList
CreditNoteList returns the current list object which the iterator is currently using. List objects will change as new API calls are made to continue pagination.
type LineItemIter ¶
LineItemIter is an iterator for credit note line items.
func ListLines ¶
func ListLines(params *stripe.CreditNoteListLinesParams) *LineItemIter
When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
func PreviewLines ¶
func PreviewLines(params *stripe.CreditNotePreviewLinesParams) *LineItemIter
When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
func (*LineItemIter) CreditNoteLineItem ¶
func (i *LineItemIter) CreditNoteLineItem() *stripe.CreditNoteLineItem
CreditNoteLineItem returns the credit note line item which the iterator is currently pointing to.
func (*LineItemIter) CreditNoteLineItemList ¶
func (i *LineItemIter) CreditNoteLineItemList() *stripe.CreditNoteLineItemList
CreditNoteLineItemList returns the current list object which the iterator is currently using. List objects will change as new API calls are made to continue pagination.