#mfujitapirika
1 messages · Page 1 of 1 (latest)
How did you attach and what error did it return?
First call was failed. Payment source is going to be inputed after creating invoice.
subscription = stripe.Subscription.create(
customer=customer_id,
items=[{
'price': price_id,
"tax_rates": tax_rates
}],
payment_behavior='allow_incomplete',
backdate_start_date=int(backdate_start_date.timestamp()),
billing_cycle_anchor=int(billing_cycle_anchor.timestamp()),
)
invoice = stripe.Invoice.create(
customer=customer_id,
auto_advance=False,
description="testest",
subscription=subscription.id
)
stripe.error.InvalidRequestError: Request req_nmTjjIee4E4yTo: This customer has no attached payment source or default payment method. Please consider adding a default payment method. For more information, visit https://stripe.com/docs/billing/subscriptions/payment-methods-setting#payment-method-priority.
Yes I think the error is pretty clear that you can't create an Invoice without a payment method to attempt
You can try the add_invoice_items parameter (https://stripe.com/docs/billing/invoices/subscription#first-invoice-extra) but that wouldn't let you edit the description
Is your ultimate purpose is to edit the description?
I'll show my customers a receipt. Invoiceitem's description is printed out in that. That's why I'd like to rename description as I like.
And your Subscription's collection_method is charge_automatically correct?
There are 2 workarounds:
- Create subscription with trial_end set a couple of seconds into the future. The subscription will first generate a $0 invoice, and once the trial is over a non-zero invoice will be created with a one hour draft period.
- Create the subscription through a subscription schedule (see our docs for how). When the schedule starts, the subscription’s initial status will be active with an initial draft invoice that is scheduled to finalize in an hour.
With 1 hour in draft you maybe able to edit the Invoice Item description!