You can delete a customer using its ID. When a customer is deleted, all associated payment methods are also deleted, and all associated recurring billing subscriptions are canceled.

Ruby
Copy
Copied
result = gateway.customer.delete("the_customer_id")
if result.success?
  puts "customer successfully deleted"
end
This code snippet now uses gateway instance methods instead of class-level methods. Learn more.

If the customer can't be found, it will raise a Braintree::NotFoundError.

Arguments
customer_id required, String

A string value representing an existing customer in your Vault.

Still have questions?

If you can’t find an answer, contact our Support team