#Sanjeev Sundaravarathan
1 messages · Page 1 of 1 (latest)
Hi
that means you are passing a customerId that doesn't exist. Or there is no pending invoicesItems for the customer
try to follow this guide step by step for creating manual Invoice:
https://stripe.com/docs/invoicing/integration/quickstart
Hi Sorry, I am writing like this,
creating a subscription first, we have an use case where to create we need to create a manual invoice and customer can pay for that invoice
so when I try to call stripe.Invoice.create, getting this error
stripe.error.InvalidRequestError: Request req_oGlsMaItsDuh01: Nothing to invoice for customer
That mean's there is no pending invoice for the customer
If you want to create an empty invoice try passing collection_method: 'send_invoice',
sure, will try that
And then you need to add invoice items to that invoice:
https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-price
sorry should I create invoice first and then invoice items or create invoice with the items ?
Hi, I'm taking over my colleague. Please let me catch up
You should create invoice first, and then create items.
I am trying to create invoice like this
stripe.error.InvalidRequestError: Request req_wDWr6fhKqDVblz: Nothing to invoice for customer
Try creating items on the customer first then.
Hey, I tried like this and getting this error
stripe.error.InvalidRequestError: Request req_yx0dXuuwLfRRHz: You cannot update subscriptions with multiple plans using the deprecated /v1/customers/* endpoints. Instead, please use the /v1/customers/* endpoints to manage customers and use the /v1/subscriptions/* endpoints to manage subscriptions.
just to show what i do exactly
account_id = subscription.payment_instrument.payment_method.company_processor.data["account_id"]extra = {"stripe_account": account_id}stripe_subscription_id = subscription.processor_subscription_data["subscription_id"]stripe_subscription = stripe.Subscription.retrieve(stripe_subscription_id, **extra)
created subscription and retrieve it
stripe.Customer.modify( stripe_subscription.customer, email="test@splink.io", items=[ { "id": item.id, 'price_data': { "unit_amount": 19255, "currency": "eur", "product": item.plan.product, "recurring": { "interval": "day", } } } ], **extra)
creating customer
then trying to create manual invoice and pay from customer side
Why are you updating a Subscription with a Customer endpoint?
Please follow the suggestion of the error message and use stripe.Customer.update() method to update the email: https://stripe.com/docs/api/customers/update
And stripe.Subscription.update() to update items of a Subscription: https://stripe.com/docs/api/subscriptions/update
no sorry, i need use the manuall invoicing, so customer will have subscriptions going on and in between we need create a invoice to which they can pay as well
In any case, the way you do this step currently is not correct, so you'll need to fix it before moving on.
so I created a subscriptions. then for creating new invoice, is there way i can manually create one and make payment to it?
Yes, you can follow this guide that explains in detail how invoices work: https://stripe.com/docs/invoicing/integration
I followed that docs and created a new invoice but still getting stripe.error.InvalidRequestError: Request req_ibjJewuTdLCSXS: Nothing to invoice for customer
You are using this API version 2020-08-27, try creating an invoice item first to the customer and then create an Invoice