Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Close invoices for a specific Stripe customer
# Description: close open invoices on a Stripe customer
# Link:
require 'stripe'
Stripe.api_key = ENV['STRIPE_KEY']
customer = Stripe::Customer.retrieve('cus_123') do |invoice|
if !invoice.closed
# NOTE you can also mark as invoice as forgiven: `invoice.forgiven = true`
# this has the same effect in NetSuite of creating a credit memo
invoice.closed = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.