#Sarvesh
1 messages · Page 1 of 1 (latest)
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.
- Sarvesh, 1 day ago, 7 messages
What's your question
I'm trying to call subscription APIs
AccountId: acct_1O7HDODqS2wlzBKD
ProductId: prod_Ov8we510MJb4kv
PriceId: price_1O7IejDqS2wlzBKD8aC2EPGZ
already created on Stripe dashboard and call API
$stripe->subscriptions->create([
'customer' => $stripeCustomerId,
'items' => [[
'price' => $stripePriceId,
]],
'metadata' => $metaData,
'payment_behavior' => 'default_incomplete',
'payment_settings' => ['save_default_payment_method' => 'on_subscription'],
'expand' => ['latest_invoice.payment_intent'],
]);
but getting error as No such price: 'price_1O7IejDqS2wlzBKD8aC2EPGZ'
what could be the reason?
customerId: cus_OvVErkDqiF6PjS
That customer exists on acct_19whH8CpNdAy2T1b but the price exists on acct_1O7HDODqS2wlzBKD
Different accounts
ok, so what I need to do?
Price and customer need to exist on the same stripe account
You seem to be mixing accounts here
In fact all the objects need to exist on the same stripe account
but I logged in to account acct_1O7HDODqS2wlzBKD and using its secret and public keys
and I can see the products created there
But that customer exists on a different account
And the secret key you're using is for acct_19whH8CpNdAy2T1b
yes, customer list is empty
ok, let me verify the accounts again
still in test mode subscription integration will work?
in restricted mode?
You'd need to use test payment methods, but yeah
customer also gets created under this?
Never share secret keys publicly...
You need to roll them now: https://stripe.com/docs/keys#rolling-keys
$stripe = new StripeClient($stripeSecret);
$customer = $stripe->customers->create([
'email' => $companyData['company_data']['email'],
'name' => $companyData['company_data']['name'],
'metadata' => $metaData,
]);
If this is a conenct scenario you need to do https://stripe.com/docs/connect/authentication
Did you see my above links?
Looks like acct_1O7HDODqS2wlzBKD is a connect account
You can't have some objects exist on the connect account and some on the platform
Either do destination charges (only recommended with express and custom connect) and have everything exist on the platform: https://stripe.com/docs/connect/destination-charges or do direct charges and have everything exist on the connect account (only recommended with standard connect): https://stripe.com/docs/connect/direct-charges
ok, we do not need connect account
we only need subscriptions with monthly recurring payment to capture for our services, there will be 3-4 subscriptins packages
Ok then don't use multiple accounts 😃
Just create all objects (prices, customers, etc) right on your platform account
ok, strange how it is connecting to multiple accounts, as I am using keys of single account, Let me create new account and try again