#luffysenchou9488

1 messages · Page 1 of 1 (latest)

brittle burrowBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

small jackal
#

Hi Vanya

kindred solstice
small jackal
#

Can i do this from the dashboard directly?

#

and will this replace existing invoice items or just add to the existing invoice items?

kindred solstice
#

It will add extra ones. Not sure how it works on the Dashboard though.

small jackal
#

But adding others is not my requirement, i need to replace the exisitng ones. Because if it just adds to the current items, he will still get charged for them

kindred solstice
#

Then I recommend adding a trial period until the start of next month, and using add_invoice_items to charge for the full first month.

small jackal
#

got it

#

thanks

kindred solstice
#

Happy to help.

small jackal
#

Are the params to be added not accepted as json? I need to add add_invoice_items to this payload but very confused as to how I add it these are accepted as request params and not a Json payload

  -u "sk_test_k8Y8rztC8oYOEox2xceyxI3O00YaQB6rXQ:" \
  -d "add_invoice_items.price_data.currency"="USD" \
  -d "add_invoice_items.price_data.unit_amount"="45"```
kindred solstice
#

-d "add_invoice_items[price_data][unit_amount]"="45"

brittle burrowBOT
small jackal
#

Hi Karllekko

#

I'm updating the subscription via API for adding additional invoice items. The below API is giving 200 response code but i dont see any additional items in the invoice for this subscription:

  -u "sk_test_k8Y8rztC8oYOEox2xceyxI3O00YaQB6rXQ:" \
  -d '{
        "add_invoice_items": [
          "price_data": {
              "unit_amount": "4500",
              "currency": "USD"
          }
        ]
      }'```
tardy field
#

you can't pass JSON to the API, that doesn't work

#

I suggest not using curl and writing real code in your real app and the programming language you're comfortable with; or using Stripe CLI.

If you're using curl you need to pass it the way that was explained above

small jackal
#

when i tried the way vanya said, it was throwing invalid array error

tardy field
#

yeah because there was a mistake, it should be -d "add_invoice_items[0][price_data][unit_amount]"="45"

small jackal
#

ok, but this is very inconvienient without a json

tardy field
#

makes sense but no, the API does not accept JSOn

small jackal
tardy field
#

just use a real library in real code in your application and you don't have to think about it

small jackal
#

yes, will be using an sdk, but till then i have to explore the functionalities of stripe for adding invoice items. Unfortunately vanya said this is not supported in dashboard, hence, using the api

#

is there a way i can add invoice items from dashboard directly till i do this in a programmatical way?

tardy field
#

not sure

#

anyway, any other questions? have you solved your issue?