Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

scottsuhy's avatar

friendly Plan (pricing) names used in Cashier

I'm sure that this is a very simple question (so apologies upfront) but I can't seem to find an answer to it via Google.

in Cashier/Subscriptions Laravel docs I see references to plan/pricing names like 'monthly' and 'yearly'.

if ($user->subscribedToPlan(['monthly', 'yearly'], 'default')) {
    //
}

up to now, i've been putting the actual price ID in these fields and it works fine. Example: ' price_1IJo9hCDdBCrDroVD3kKZFO3' but it would be a lot better if I could use friendly names.

The Question: How do you actually configure Stripe with a friendly name like 'monthly' or 'yearly'?

I tried to use additional options/price description and that shows up in 'nickname' but doesn't work in the subscribedToPlan API.

Stripe\Plan JSON: { 
"id": "price_1IJo9hCDdBCrDroVD3kKZFO3", 
"object": "plan", 
"active": true, 
"aggregate_usage": null, 
"amount": 2500, 
"amount_decimal": "2500", 
"billing_scheme": "per_unit", 
"created": 1613059295, 
"currency": "usd", 
"interval": "month", 
"interval_count": 1, 
"livemode": false, 
"metadata": [], 
"nickname": null, 
0 likes
3 replies
jlrdw's avatar

Stripe has a nickname field, but check their documentation to see how to apply it, or if it will work in your case.

1 like
scottsuhy's avatar

@jlrdw That's what I originally thought too but the nickname doesn't work in the api, however it does show up in the plan json so i can create something that works better. i just thought i was missing something because of how the laravel docs were written.

martinbean's avatar
Level 80

@scottsuhy When creating Stripe plans you could specify an ID, but you can’t for prices. Stripe automatically generates an ID for prices, so you will need to use that identifier (price_xxx) I’m afraid.

1 like

Please or to participate in this conversation.