#newton_code
1 messages ¡ Page 1 of 1 (latest)
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.
- newton_checkout-discounts-subscriptions, 2 days ago, 16 messages
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1235284419347091628
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Taking a look now
My version of CLI doesn't allow for tiers to be passed in. Does yours? What does the below command show?
stripe prices create --help
I also don't have tiers showing under "Request Parameters:" from the output of stripe prices create --help
However I thought I could use the -d "nested[param]=value" style of param
Using stripe prices create --currency=usd --unit-amount=1000 -d "product_data[name]"="Tiered stuff" --billing-scheme=tiered --tiers-mode=volume -d "tiers=[{up_to: 'inf', flat_amount: 10}]" appears to attempt to use an array per out log https://dashboard.stripe.com/test/logs/req_ZCPkqBwooLwoX8?t=1714582718
invalid_request_error - tiers
Invalid array
I figure I need to adjust the formatting.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
To answer your question, here's the full output of stripe prices create --help:
% stripe prices create --help
Usage:
stripe prices create [--param=value] [-d "nested[param]=value"]Request Parameters:
--active
--billing-scheme
--currency
--custom-unit-amount.enabled
--custom-unit-amount.maximum
--custom-unit-amount.minimum
--custom-unit-amount.preset
--lookup-key
--nickname
--product
--product-data.active
--product-data.id
--product-data.name
--product-data.statement-descriptor
--product-data.tax-code
--product-data.unit-label
--recurring.aggregate-usage
--recurring.interval
--recurring.interval-count
--recurring.trial-period-days
--recurring.usage-type
--tax-behavior
--tiers-mode
--transfer-lookup-key
--transform-quantity.divide-by
--transform-quantity.round
--unit-amount
--unit-amount-decimalNote: all types are specifically for the Stripe CLI itself, not the Stripe API. The CLI handles
transforming types to what the API expects.
Flags:
-c, --confirm Skip the warning prompt and automatically confirm the command being entered
--dark-style Use a darker color scheme better suited for lighter command-lines
-d, --data stringArray Data for the API request
-e, --expand stringArray Response attributes to expand inline
-h, --help help for create
-i, --idempotency string Set the idempotency key for the request, prevents replaying the same requests within 24 hours
--live Make a live request (default: test)
-s, --show-headers Show response headers
--stripe-account string Set a header identifying the connected account
-v, --stripe-version string Set the Stripe API version to use for your requestGlobal Flags:
--api-key string Your API key to use for the command
--color string turn on/off color output (on, off, auto)
--config string config file (default is $HOME/.config/stripe/config.toml)
--device-name string device name
--log-level string log level (debug, info, trace, warn, error) (default "info")
-p, --project-name string the project name to read from for config (default "default")
I'm thinking that it's possible Stripe CLI just doesn't support the tiers parameter, which is confusing, given that it's required. Let me double check with someone
It's going to be a few minutes, as my team is in a meeting. I should be able to get answers within the next ~25 minutes. Just wanted to make sure I was setting expectations
OK, thanks for the expectation setting!
I have a meeting of my own starting in ~35 minutes so may have to jump before we get an answer.
Okay, it was a formatting issue. As an example, this works fine:
stripe prices create --currency=usd -d "product_data[name]"="Tiered stuff" -d "recurring[interval]"=month --billing-scheme=tiered --tiers-mode=volume -d "tiers[0][unit_amount]"=33 -d "tiers[0][up_to]"=10 -d "tiers[1][unit_amount]"=22 -d "tiers[1][up_to]"=inf
Awesome! Thanks so much!
No further questions. We can close this thread now. Thanks again!
Sure thing!