#oleg.moseiko
1 messages · Page 1 of 1 (latest)
That's because type isn't a parameter. If it's just a one-time, non-recurring Price then just omit it: https://stripe.com/docs/api/prices/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
omit what?
$stripe->prices->create([
'unit_amount' => 500000,
'currency' => 'usd',
'recurring' => ['interval' => 'year'], <<<<<????
'product' => 'prod_NWdgCC8ysbMeXf',
]);
actually i need Free Plan
The type parameter, as per the error
so i did
$freeProduct = \Stripe\Product::create([
'name' => 'Free Plan',
'metadata' => [
'alias' => 'free_product',
],
]);
$freeProductPrice = \Stripe\Price::create([
'unit_amount' => 0,
'currency' => 'usd',
'product' => $freeProduct->id,
'nickname' => 'free_product_price',
'metadata' => [
'alias' => 'free_product_price',
],
]);
Then pass unit_amount => 0
{
"error": {
"message": "Only active, per unit licensed prices are supported. The following price(s) are invalid: price_1MlqaIFZ7k4UhKB3OyKX1lDn.",
"param": "features[subscription_update][products]",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_LYGjycRnIfvkYV?t=1678872334",
"type": "invalid_request_error"
}
}
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
price_1MlqaIFZ7k4UhKB3OyKX1lDn is archived, that's why: https://dashboard.stripe.com/test/prices/price_1MlqaIFZ7k4UhKB3OyKX1lDn
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
{
"error": {
"message": "Only active, per unit licensed prices are supported. The following price(s) are invalid: price_1MlqlCFZ7k4UhKB3MFvkqIGT.",
"param": "features[subscription_update][products]",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_kaqgvBkbBX6wR5?t=1678873013",
"type": "invalid_request_error"
}
}
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I suspect it's because it's not a recurring Price: https://stripe.com/docs/api/prices/create#create_price-recurring
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.