View Source ExOAPI.Stripe.SDK.CreditNotes (exoapi_stripe v0.1.4)

Link to this section Summary

Functions

description: <p>Returns a list of credit notes.</p>

description: <p>When retrieving a credit note, you’ll get a <strong>lines</strong> property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p>

description: <p>Retrieves the credit note object with the given identifier.</p>

description: <p>Get a preview of a credit note without creating it.</p>

description: <p>When retrieving a credit note preview, you’ll get a <strong>lines</strong> property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.</p>

description: <p>Issue a credit note to adjust the amount of a finalized invoice. For a <code>status=open</code> invoice, a credit note reduces its <code>amount_due</code>. For a <code>status=paid</code> invoice, a credit note does not affect its <code>amount_due</code>. Instead, it can result in any combination of the following:</p>

description: <p>Updates an existing credit note.</p>

description: <p>Marks a credit note as void. Learn more about <a href="/docs/billing/invoices/credit-notes#voiding">voiding credit notes</a>.</p>

Link to this section Types

Link to this type

get_credit_notes_credit_note_lines_opts()

View Source
@type get_credit_notes_credit_note_lines_opts() ::
  {:starting_after, String.t()}
  | {:limit, String.t()}
  | {:expand, String.t()}
  | {:ending_before, String.t()}
Link to this type

get_credit_notes_id_opts()

View Source
@type get_credit_notes_id_opts() :: {:expand, String.t()}
Link to this type

get_credit_notes_opts()

View Source
@type get_credit_notes_opts() ::
  {:starting_after, String.t()}
  | {:limit, String.t()}
  | {:invoice, String.t()}
  | {:expand, String.t()}
  | {:ending_before, String.t()}
  | {:customer, String.t()}
Link to this type

get_credit_notes_preview_lines_opts()

View Source
@type get_credit_notes_preview_lines_opts() ::
  {:starting_after, String.t()}
  | {:refund_amount, String.t()}
  | {:refund, String.t()}
  | {:reason, String.t()}
  | {:out_of_band_amount, String.t()}
  | {:metadata, String.t()}
  | {:memo, String.t()}
  | {:lines, String.t()}
  | {:limit, String.t()}
  | {:expand, String.t()}
  | {:ending_before, String.t()}
  | {:credit_amount, String.t()}
  | {:amount, String.t()}
Link to this type

get_credit_notes_preview_opts()

View Source
@type get_credit_notes_preview_opts() ::
  {:refund_amount, String.t()}
  | {:refund, String.t()}
  | {:reason, String.t()}
  | {:out_of_band_amount, String.t()}
  | {:metadata, String.t()}
  | {:memo, String.t()}
  | {:lines, String.t()}
  | {:expand, String.t()}
  | {:credit_amount, String.t()}
  | {:amount, String.t()}

Link to this section Functions

Link to this function

get_credit_notes(client, opts \\ [])

View Source
@spec get_credit_notes(client :: ExOAPI.Client.t(), [get_credit_notes_opts()]) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | %{
       url: String.t(),
       object: String.t() | :list,
       has_more: boolean(),
       data: [ExOAPI.Stripe.Schemas.CreditNote.t()]
     }
   | map()}
  | {:error, any()}

description: <p>Returns a list of credit notes.</p>

Link to this function

get_credit_notes_credit_note_lines(client, credit_note, opts \\ [])

View Source
@spec get_credit_notes_credit_note_lines(
  client :: ExOAPI.Client.t(),
  credit_note :: String.t(),
  [get_credit_notes_credit_note_lines_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | %{
       url: String.t(),
       object: String.t() | :list,
       has_more: boolean(),
       data: [ExOAPI.Stripe.Schemas.CreditNoteLineItem.t()]
     }
   | map()}
  | {:error, any()}

description: <p>When retrieving a credit note, you’ll get a <strong>lines</strong> property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p>

Link to this function

get_credit_notes_id(client, id, opts \\ [])

View Source
@spec get_credit_notes_id(
  client :: ExOAPI.Client.t(),
  id :: String.t(),
  [get_credit_notes_id_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.CreditNote.t()
   | map()}
  | {:error, any()}

description: <p>Retrieves the credit note object with the given identifier.</p>

Link to this function

get_credit_notes_preview(client, invoice, opts \\ [])

View Source
@spec get_credit_notes_preview(
  client :: ExOAPI.Client.t(),
  invoice :: String.t(),
  [get_credit_notes_preview_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.CreditNote.t()
   | map()}
  | {:error, any()}

description: <p>Get a preview of a credit note without creating it.</p>

Link to this function

get_credit_notes_preview_lines(client, invoice, opts \\ [])

View Source
@spec get_credit_notes_preview_lines(
  client :: ExOAPI.Client.t(),
  invoice :: String.t(),
  [get_credit_notes_preview_lines_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | %{
       url: String.t(),
       object: String.t() | :list,
       has_more: boolean(),
       data: [ExOAPI.Stripe.Schemas.CreditNoteLineItem.t()]
     }
   | map()}
  | {:error, any()}

description: <p>When retrieving a credit note preview, you’ll get a <strong>lines</strong> property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.</p>

Link to this function

post_credit_notes(client, body)

View Source
@spec post_credit_notes(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      refund_amount: integer(),
      refund: String.t(),
      reason:
        String.t()
        | :duplicate
        | :fraudulent
        | :order_change
        | :product_unsatisfactory,
      out_of_band_amount: integer(),
      metadata: map(),
      memo: String.t(),
      lines: [
        %{
          unit_amount_decimal: String.t(),
          unit_amount: integer(),
          type: String.t() | :custom_line_item | :invoice_line_item,
          tax_rates: String.t() | [String.t()],
          quantity: integer(),
          invoice_line_item: String.t(),
          description: String.t(),
          amount: integer()
        }
      ],
      invoice: String.t(),
      expand: [String.t()],
      credit_amount: integer(),
      amount: integer()
    }
    | map()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.CreditNote.t()
   | map()}
  | {:error, any()}

description: <p>Issue a credit note to adjust the amount of a finalized invoice. For a <code>status=open</code> invoice, a credit note reduces its <code>amount_due</code>. For a <code>status=paid</code> invoice, a credit note does not affect its <code>amount_due</code>. Instead, it can result in any combination of the following:</p>

  • 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_amountor post_payment_credit_notes_amount depending on its status at the time of credit note creation.

Link to this function

post_credit_notes_id(client, body, id)

View Source
@spec post_credit_notes_id(
  client :: ExOAPI.Client.t(),
  body :: %{metadata: map(), memo: String.t(), expand: [String.t()]} | map(),
  id :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.CreditNote.t()
   | map()}
  | {:error, any()}

description: <p>Updates an existing credit note.</p>

Link to this function

post_credit_notes_id_void(client, body, id)

View Source
@spec post_credit_notes_id_void(
  client :: ExOAPI.Client.t(),
  body :: %{expand: [String.t()]} | map(),
  id :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.CreditNote.t()
   | map()}
  | {:error, any()}

description: <p>Marks a credit note as void. Learn more about <a href="/docs/billing/invoices/credit-notes#voiding">voiding credit notes</a>.</p>