#OpenExO

1 messages · Page 1 of 1 (latest)

lethal heronBOT
quick holly
#

Hi there

#

Haven't used those tools but maybe I can help?

#

What are you seeing/trying?

shrewd citrus
#

I don't know where to put the expand call to query the discount/ promo data from a user subscription

#

I want to get what Discount the customer used

#

on checkout

quick holly
#

And you are using Stripe Checkout here?

shrewd citrus
#

yeah

lethal heronBOT
shrewd citrus
#

expand: subscription.discount.coupon

#

was the suggested call

#

but...

regal dawn
#

Hello! I'm taking over and catching up...

shrewd citrus
#

i tried lots of things in the body part of the request

regal dawn
#

I'm also not familiar with this tool, but is there an option to specify the body as form or URL encoded?

#

If not, maybe try expand[0]=subscription.discount.coupon and see if that works?

shrewd citrus
#

I can add an item to headers?

regal dawn
#

No, it's not a header, you need to add the expand property in the body of the request.

#

Or, actually, you can do it in the query string there.

#

What does it look like if you expand that part of the UI?

#

Like if you click on add item there?

shrewd citrus
#

sec

regal dawn
#

Ah, okay, you can do it in there. For the key add expand[0] and for the value add subscription.discount.coupon and then remove what's in the body and try again.

shrewd citrus
#

idk if it did anything, it'd fall under one of those expansions right?

regal dawn
shrewd citrus
#

req_cTugpNBJNcs54b

#

I think?

regal dawn
#

Oh, hang on, the discount on the Subscription isn't expandable, and the coupon on the Discount also isn't expandable. They're already full objects. All you should need to expand is the subscription on the Checkout Session.

#

The request you provided is to create a Customer, but that's okay, I think I can find the request from here...

#

Are you doing this in test mode or live mode?

shrewd citrus
#

Should be live

#

and I'm request a specific customer I know used a discount

#

I see, it was filtering out 'get'

#

although....

#

all these are Hubspot requests..........

regal dawn
#

Hm, I'm not seeing the request here. Is it on a different account perhaps?

shrewd citrus
#

are you able to see my API keys I genn'd?

#

I'm using the 'Make.coms' one specifically, says I've used it 118 times so far - so it's doing something

#

req_aLgKy5QyMXTwNP

#

ok, found a request ID from it

regal dawn
#

Looking...

#

Ah, okay, so there are two issues here. First you're trying to fetch a Customer, but I thought you wanted to fetch a Checkout Session? Second, you only need to expand subscription, not subscription.discount.coupon.

shrewd citrus
#

Yeah I switched to requesting a customer that I knew used one, to see if ti worked

#

my goal is to request all customers who used a discount...

#

but... didnt know what I was doing wrong

#

so should it be: /v1/customers + the expand Subscriptions? or would that only give me the last 10 customers, and they might not of even subbed

#

or

regal dawn
#

Customers don't have a subscription property though.

#

Checkout Sessions do.

shrewd citrus
#

Could I request a promo/ coupon and expand the customer list?

regal dawn
#

Are you trying to get the Coupon used during a specific Checkout Session or the Coupon associated with a Customer?

shrewd citrus
#

Coupon associated with the customers

#

like ultimate goal, These users: XXXXX used this coupon: FREE20

regal dawn
#

Okay, so you don't need to expand anything then. Retrieve the Customer using their ID and look inside their discount property.

shrewd citrus
#

but how do I see everyone who used a specific coupon?

#

without looking them up individually?

shrewd citrus
regal dawn
#

So I think there may be a misunderstanding. Just because a particular Customer uses a promo code at one point it doesn't mean that Customer will be assigned the associated discount/coupon at the Customer level. That discount may have only applied to that one transaction.

shrewd citrus
#

ah I see

#

is there a way to request the user redemptions who used the code? the coupon product?

regal dawn
#

I believe you can see that in the Dashboard, but I'm not sure if it's available via the API...

shrewd citrus
#

ah ok - that's really want I needed to deliver to Hubspot.. hmm

regal dawn
#

But if you want to know who specifically redeemed them and when you would need to list Checkout Sessions and look for ones with a discount.

shrewd citrus
#

Mmm ok

#

so when I pull that it give me last 10, is there a function to pull all?

regal dawn
shrewd citrus
#

Parameters I'd put in the same place as expand?

regal dawn
#

Yes, more or less. Do you know anyone who has a lot of experience with HTTP and setting query parameters and whatnot who can assist you?

shrewd citrus
#

not atm

regal dawn
#

Doing this manually would be tricky. Can you use one of our libraries instead?

shrewd citrus
#

I see, I was hoping to do it all in the Make.com platform for the sales/marketing team to direct it to whereever and use in different places

regal dawn
#

It seems like it would be possible to do it there, as you can make API requests, but it would be a lot more difficult than using one of our libraries and writing a bit of code to do it.

#

But you can use the API reference and translate the curl commands into the raw HTTP requests in Make.com's system.

shrewd citrus
#

Mmm ok

regal dawn
shrewd citrus
#

Yeah seems most of them are just prewritten API calls

#

Maybe I could use Watch event

#

and just go from here on and look for discount code use

#

ok maybe not...

regal dawn
#

That might work if all you care about is future activity.

shrewd citrus
#

Yeah, atm anything that could work haha and then just manually do the exisitng

regal dawn
#

If you're using Stripe Checkout try listening for checkout.session.completed Events and see if that gives you the info you need.

shrewd citrus
#

for the specific customer? or which would be the specific API call?>

regal dawn
#

No, in the Watch Events thing.

shrewd citrus
#
This property cannot be expanded (checkout).```
#

Ooo

#

ok sec let me see

regal dawn
#

The idea would be that you set up Make.com to listen for checkout.session.completed Events, and then every time someone completes a Checkout Session you'll get the Checkout Session in the watch thing and can handle it from there.

#

You can't expand the Event, but maybe you can trigger a GET request that fetches the Checkout Session with the subscription expanded?

shrewd citrus
#

it doesnt allow me to edit the watch event item

#

it only allows me to look at a specific webhook

regal dawn
#

What options do you have? Like, what's the point of setting up a watch if you can't do anything when one of those events happens?

shrewd citrus
#

which only shows how to create an API key...

#

:l

regal dawn
#

They trigger some other step or process, right?

shrewd citrus
#

Yeah just starts the chain of events

#

Like Zapier, pipedream etc.

lethal heronBOT
regal dawn
#

Okay, so can you set up a trigger for checkout.session.completed Events and then trigger whatever workflow you want when someone checks out?

shrewd citrus
#

let me see if I can

shrewd citrus
#

I cant make a trigger based on Stripe stuff :l - So I'll just have to figure out getting checkout session list and parsing it or something for discount use

short flume
#

I wish I had a better answer for you @shrewd citrus, but we don't have a lot of context on 3rd party connectors/plugins. Let us know if you have any other Stripe-related questions though

shrewd citrus
#

Thanks again, no worries

#

@short flume What items can I expand on in: /v1/checkout/sessions