1. Invoices
Documentation
  • Back to home
  • StripeKit
  • Installation
  • Getting Started
  • Choosing a Mode
  • Type Reference
  • Setup
    • Configuration
    • Timezones
    • Storage Adapter
    • Money and Currency
    • Error Handling
  • Stripe
    • Elements
  • Modules
    • Overview
    • Customers
      • Overview
      • List
      • Retrieve
      • Find or Create by Email
      • Create
      • Update
      • Sync
      • Delete
    • Payment Methods
      • Overview
      • Create Setup Intent
      • List
      • Attach
      • Detach
      • Set Default
      • Sync
    • Payments
      • Overview
      • Pay With Saved Method
      • Create
      • Retrieve
      • Confirm
      • Cancel
      • Sync
    • Checkout
      • Overview
      • Get
      • Create
      • Submit Fields
      • Apply Coupon
      • Mark Complete
    • Subscriptions
      • Overview
      • Create
      • Retrieve
      • Cancel
      • Resume
      • Toggle Collection Method
      • Update Fields
      • Apply Promotion Code
      • List By Customer
      • Find By Metadata
      • Sync
    • Invoices
      • Overview
      • Retrieve
      • List By Customer
      • List By Subscription
      • Pay With Saved Method
      • Void
      • Finalize
      • Sync
    • Coupons
      • Overview
      • Create
      • Validate
      • Apply To Subscription
      • List
      • Deactivate
    • Webhooks
      • Overview
      • Process
      • Events Reference
    • Sync
      • Overview
  1. Invoices

Pay With Saved Method

$kit->invoices->payWithSavedMethod()#

Pays an open invoice using a saved payment method, for example one that was left unpaid because a subscription uses send_invoice collection, or because an automatic charge failed.

Signature#

Parameters#

FieldTypeRequiredDescription
invoiceIdstringYesThe invoice to pay.
customerIdstringYesMust match the invoice's own customer.
paymentMethodIdstringYesA payment method already attached to that customer.

Example request#

Example response#

Same shape as retrieve(), with status set to 'paid' on success.

Errors#

ExceptionWhen
StripeOperationErrorThe invoice is not in a payable state (already paid or void), the card is declined, or the invoice does not belong to the given customer.

Notes#

If a storage adapter is configured, the result is persisted via saveInvoice().
This pays the invoice directly, it does not go through the checkout/PaymentIntent flow used elsewhere in StripeKit, so mode (api/elements) is irrelevant here, there is nothing for the customer to confirm on the frontend.
Previous
List By Subscription
Next
Void
Built with