#ian-goldberg_api

1 messages ยท Page 1 of 1 (latest)

hushed plazaBOT
#

๐Ÿ‘‹ 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.

worthy pelicanBOT
atomic canyon
#

No Customer, no line items, no details at all.

wild geode
#

Weird.

#

should i not send as a raw body?

#

or can i not, rather

atomic canyon
#

Our API does not accept incoming JSON.

#

We only accept form-encoded request bodies.

wild geode
#

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:

atomic canyon
#

I'm not sure what to say. Our API only accepts form-encoded requests.

wild geode
#

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"
        }
      }```
atomic canyon
#

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...

wild geode
#

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

atomic canyon
#

Happy to help!

wild geode
#

hmm

#

req_9QL1RZhzFeIMqG?t=1712767603

atomic canyon
#

You're passing in parameters that don't exist.

#

There's no such thing as initial_billing_cycle_anchor for example.

wild geode
#

its weird "they dont exist" because they were on this request post body: req_k6q6AMtTtsTgxV

atomic canyon
#

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.

wild geode
#

Yeah - Im trying to replicate the behavior of a subscription I created in the dashboard

atomic canyon
#

You'll need to map what the Dashboard is doing to the documented API parameters in that case.

wild geode
#

seems like i cant create phases

atomic canyon
wild geode
#

seems like im close

#

weird because i passed a customer

#

oh nvm -- trying again

#

hmm

atomic canyon
#

Yep, you're getting there, but you're missing Customer location data.

#

That would have to happen separately, before this request, on the Customer.

wild geode
#

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

atomic canyon
#

Sounds like you should add a trial period to the Subscripton.

wild geode
#

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?

hushed plazaBOT
atomic canyon
#

Not sure what you mean, can you provide more details?

wild geode
gusty dock
#

Hi, taking over as Rubeus needs to step away. Let me catch up

wild geode
#

thx

gusty dock
wild geode
#

ok so basically i have to have an initial phase of a trial