#wrent-help

1 messages · Page 1 of 1 (latest)

hollow light
#

Hello @lapis locust let's talk here please!

lapis locust
#

Anyone have any experience with stripe API's and Zoho's Deluge?

hollow light
#

You'd want to talk to Zoho directly I think

lapis locust
#

They have referred me here for this particular issue I am facing

hollow light
#

what's the issue?

lapis locust
#

This is what i run, it works for other APIs

hollow light
#

I'm sorry that's a picture of code

lapis locust
hollow light
#

What do you need help with? What isn't working, what exact API error do you get, etc

lapis locust
#

So I dont get any error codes any more, but the response does not make any changes

#

The unit_amount_decimal is still 5000 instead of 5500

#

sorry, i thought you might want to see it all as context to issue i am facing

hollow light
#

this is the request that created the subscription. Your code is clearly passing plan: 'plan_IzjleXPKbw8pXP' in this case. This is the Plan used for the Subscription (the Plan API is legacy)

#

so it's completely ignoring all the things you are mentioning here

#

is this expected that you do that on creation?

lapis locust
#

I am trying to update an existing subscription to have a new monthly payment amount. ie £50 this year changes to £55 next year, however the exact amount varies and may in reality be £54.58 for one and another may be £52.22 etc

hollow light
#

still looking, sorry the channel got a bit busy

#

okay if you look at this you see you pass zero parameter

#

so doesn't look like your code is passing any parameter right now

#

I don't really know what subUpdate.toString() does. This looks purely on Zoho's end, that's why I said to talk to them earlier and they were wrong to send you to us. This is their own abstraction/platform

#

they need to tell you how all of this works, how to make HTTP requests with application/x-www-form-urlencoded data

#

also it's not items.price

#

items is an array so it should be items[0].price_data....

#

you're also missing the old subscription item id

#

I would encourage you to first write that call outside of Zoho's environment, with curl or a library and then once it works get it in Zoho

lapis locust
#

Thanks for your help. I will get back in touch with Zoho

#

I have the subscription defined as an earlier variable

hollow light
#

no you don't

#

you have the subscription id sub_123. But that's not enough

#

you are trying to switch from Price A to Price B. When you do that, you have to pass the subscription item id si_123

#
  items: [
    {
      id: 'si_123', // Existing SubscriptionItem id to change
      price_data: {
        // price information custom
      }
    }
  ]
}```
#

your params should look like ^ (but not in JSON as we use application/x-www-form-urlencoded

lapis locust
#

Sorry, i miss read that, you are correct.

hollow light
#

so more like this items[0][id]=si_123 items[0][price_data][product]=prod_ABC items[0][price_data][currency]=GBP items[0][price_data][unit_amount]=1111 ...

#

it's a bit complex to do unfortunately when you don't use our real libraries but overall it's not too hard once you get it

lapis locust
#

I am sure I will figure it out, your direction has been very much appreciated. I will get back to it on my end as I dont want to take up more of your time. I will refer back to zoho for further queries.

hollow light
#

Really my advice is to truy without Zoho

#

that way you know when your code works with Stripe and then you "port it to Zoho"

hollow light
#

but we're definitely happy to help you with the Stripe API part, like I just did

hollow light
#

Awesome!

lapis locust
hollow light
#

Amazing, have a great day!