#annu-expand

1 messages · Page 1 of 1 (latest)

marsh quail
#

Hi @languid gulch can you send me the plan ID for me to take a look?

languid gulch
#

sure wait

#

pland id:- y5PMoYtxzgMq

marsh quail
#

Hi, the plan ID is something like price_XXX

#

or can you send me the product ID?

languid gulch
#

product ID:- prod_Ktxz6ecMkEIgSR

marsh quail
#

Thanks, can you try ['tiers'] instead of ['data.tiers'] ?

languid gulch
#

yeah already tried but no success

marsh quail
#

How about ['tiers.data'] ?

languid gulch
#

wait lemme try this

languid gulch
#

Here i want to mention one thing. one of my colleague using the same code able to get tiers data in plan when expanding tiers using data.tiers But he is using his own stripe keys.

marsh quail
#

That's interesting, can you check if you have tiers property for this Plan? Also are you using a different API version?

languid gulch
#

yes the billing scheme for this plan is tiered as you can see in the below response and we are using same API version

#

Stripe\Plan {#1739 ▼
+saveWithParent: false
#_opts: Stripe\Util\RequestOptions {#1738 ▶}
#_originalValues: array:19 [▶]
#_values: array:19 [▶]
#_unsavedValues: Stripe\Util\Set {#199 ▶}
#_transientValues: Stripe\Util\Set {#1742 ▶}
#_retrieveOptions: []
#_lastResponse: Stripe\ApiResponse {#1771 ▶}
id: "y5PMoYtxzgMq"
object: "plan"
active: true
aggregate_usage: null
amount: null
amount_decimal: null
billing_scheme: "tiered"
created: 1641294868
currency: "usd"
interval: "month"
interval_count: 1
livemode: false
metadata: Stripe\StripeObject {#1769 ▶}
nickname: "Tier 2"
product: "prod_Ktxz6ecMkEIgSR"
tiers_mode: "volume"
transform_usage: null
trial_period_days: null
usage_type: "licensed"
}

marsh quail
#

Is your colleague retrieving the same plan object?

languid gulch
#

no he is retrieving plan created from his stripe account

sonic vector
#

@languid gulch it's because you have to do this instead
\Stripe\Plan::retrieve(['id'=>"plan_xxx", 'expand'=>["tiers"]]

#

the expand only works in our PHP library when passing the ID of the object that way, not with retrieve($id, [...]), it's confusing!