#ian-goldberg_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1227651176070250538
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! If you look at the request in your Dashboard you can see that you're not passing any parameters in: https://dashboard.stripe.com/logs/req_CsgnI4Skydu7ja
No Customer, no line items, no details at all.
Our API does not accept incoming JSON.
See here for details: https://docs.stripe.com/api
We only accept form-encoded request bodies.
roger that -- interesting
i was taking a previous request body from the workbench and putting it into postman and editing the data
seems like a lot to encode this:
I'm not sure what to say. Our API only accepts form-encoded requests.
yeah makes sense. how do i encode nested data
such as phases
"0": {
"automatic_tax": {
"enabled": "true"
},
"collection_method": "send_invoice",
"currency": "usd",
"invoice_settings": {
"days_until_due": "10",
"send_hosted_payment_email": "false",
"supported_payment_methods": {
"ach_credit_transfer": "true",
"acss_debit": "true",
"afterpay_clearpay": "false",
"alipay": "false",
"amazon_pay": "false",
"au_becs_debit": "false",
"bacs_debit": "false",
"bancontact": "true",
"boleto": "false",
"card": "true",
"cashapp": "true",
"customer_balance": "false",
"demo_pay": "false",
"eps": "true",
"fpx": "false",
"giropay": "true",
"grabpay": "false",
"id_bank_transfer": "false",
"id_credit_transfer": "false",
"ideal": "true",
"jp_credit_transfer": "false",
"konbini": "false",
"kr_market": "false",
"link": "false",
"netbanking": "false",
"ng_market": "false",
"p24": "true",
"paper_check": "false",
"paynow": "false",
"paypal": "false",
"promptpay": "false",
"revolut_pay": "false",
"sepa_credit_transfer": "false",
"sepa_debit": "true",
"sofort": "true",
"upi": "false",
"us_bank_account": "true",
"wechat_pay": "false"
}
}```
It depends on what you're trying to nest. Have a look at the curl examples in the API reference.
That would be like phases[0]automatic_tax...
yeah so like
customer={$.steps.loop-6.value.attributes.stripeCustomerId}
&end_behavior=release
&initial_billing_cycle_anchor={$.steps.date-time-helpers-8.result}
&phases[0][automatic_tax][enabled]=true
&phases[0][collection_method]=send_invoice
&phases[0][currency]=usd
&phases[0][invoice_settings][days_until_due]=10
&phases[0][invoice_settings][send_hosted_payment_email]=false
&phases[0][invoice_settings][supported_payment_methods][ach_credit_transfer]=true
&phases[0][invoice_settings][supported_payment_methods]
ok thx
Happy to help!
You're passing in parameters that don't exist.
There's no such thing as initial_billing_cycle_anchor for example.
The allowed parameters are documented in the API reference here: https://docs.stripe.com/api/subscriptions/create
its weird "they dont exist" because they were on this request post body: req_k6q6AMtTtsTgxV
That request was made by the Dashboard. The Dashboard has access to Dashboard-only functionality that isn't available in the general API.
You should not be using Dashboard requests as a template for making your own requests.
You should use our documentation and API reference instead.
Yeah - Im trying to replicate the behavior of a subscription I created in the dashboard
You'll need to map what the Dashboard is doing to the documented API parameters in that case.
seems like i cant create phases
Ah, sorry, I should have caught that earlier. You need to create a Subscription Schedule, not a Subscription: https://docs.stripe.com/billing/subscriptions/subscription-schedules
seems like im close
weird because i passed a customer
oh nvm -- trying again
hmm
Yep, you're getting there, but you're missing Customer location data.
That would have to happen separately, before this request, on the Customer.
okay i got that, i feel very close
here's where I need help
I want to start billing in future, but start subscription now
Sounds like you should add a trial period to the Subscripton.
When using Subscription Schedules you can set a phase to be a trial: https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-phases-trial
hmm using the dashboard, you can create a subscription so the duration is TODAY -> indefinite end date
Bill starting: x date
Is it not possible to do this via subscription_schedules endpoint?
Not sure what you mean, can you provide more details?
When I set start_date to the future, i get an error:
https://dashboard.stripe.com/logs/req_0ocYncWIKCV5KR?t=1712768735
Is it possible to set start_date = now, but set first billing date to 1st of next month?
Hi, taking over as Rubeus needs to step away. Let me catch up
thx
What you're describing is possible if you offer a free trial, https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-phases-trial
ok so basically i have to have an initial phase of a trial