#lec1892
1 messages · Page 1 of 1 (latest)
Can you share the Invoice that you create in test mode so that I can compare?
sure
one sec please
https://dashboard.stripe.com/test/invoices/in_1NSjkoGTwF4XBiKH2qTxxkiP
This invoice was created with no items.
Then I added 1 item and paid the invoice.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
The invoices are in different accounts also.
The test mode invoice has been created in account A.
I tried to create the live mode invoice in account B.
Yeah you're seeing this difference in behavior because these two accounts are on different API version and have different defaults - in this case, your livemode request failed because it's on an older API version where the default value for pending_invoice_items_behavior still uses include_and_require and will fail if the customer has no line items (https://stripe.com/docs/api/invoices/create#create_invoice-pending_invoice_items_behavior)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You need to explicitly pass in pending_invoice_items_behavior: exclude on your live mode request to get the same behavior as your test mode request