#joaovbsberse

1 messages · Page 1 of 1 (latest)

hollow sierraBOT
#

Hello! We'll be with you shortly. 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.

cedar tundra
#

I think i need to query the tiers

ionic tusk
#

Plan doesn't have unit_amount

cedar tundra
#

but look at this

#

plan_Oy85yOkf0Q8lI6

#

{
"id": "plan_Oy85yOkf0Q8lI6",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1699450202,
"currency": "brl",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": "1 reau",
"product": "prod_Oy7tAoNyrAsYkA",
"recurring": {
"aggregate_usage": null,
"interval": "month",
"interval_count": 1,
"trial_period_days": 14,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 100,
"unit_amount_decimal": "100"
}

#

this plan with per unit billing scheme has unit_amount

#

"Only set if billing_scheme=per_unit."

ionic tusk
#

What field are you expanding exactly?

#

There's not a tiers field

#

I see the amount on the plan object you originally shared for what it's worth

cedar tundra
ionic tusk
#

Ah nice

#

It's not default expanded

#

That's why I didn't see it

cedar tundra
#

yep

#

i will try something here

#

you cleared my eyes

#

tysm

ionic tusk
#

No problem

cedar tundra
#

other thing

#

do you know how this expand works?

#

just for a quick question to avoid a wast of time

ionic tusk
#

Sure

cedar tundra
#

im query all prices

#

i can expand using the query to list all

#

or just for querying one?

ionic tusk
#

You can do for both

cedar tundra
#

do you know php?

#

i tryed to do this, but seems not be working

#

Price::all(['active' => 'true', "expand" => ["data.tiers"]])

ionic tusk
#

I think you need data.tiers

#

Yeah

cedar tundra
#

worked for me like this

#

cool

#

thanks

#

!!

ionic tusk
#

When you list all, the objects are in an array called data

#

So to expand individual fields within that array you need to reference that data array by data.*

cedar tundra
#

yeeeah fs

#

cool

#

thanks man