#AndreaDev2023
1 messages · Page 1 of 1 (latest)
hello! what do you mean by it has an invalid id?
there's no error in the request id that you provided
what's the actual error message or request id where you received that error?
this the id req_F0qU1qkSjc7vLM
Missing required param: customer.
What should I put in the customer parameter?
you should probably be inputting the id of the Customer. But the request that you've shared doesn't have any errors in the response. Without specific details of your code for example and/or the correct request id where you're getting this error, there's not much more I can comment on
req_PeQ8szVMfNQF5Q
Have you created a Customer? https://stripe.com/docs/api/customers/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.
once you've done that, then you can pass in the Customer id in customer for that request
$paymentMethod = \Stripe\PaymentMethod::retrieve($paymentMethodId);
$subscription = \Stripe\Subscription::create([
'customer' => $paymentMethod->customer,
'items' => [['price' => $amount]],
'payment_behavior' => 'default_incomplete',
'expand' => ['latest_invoice.payment_intent'],
]);
'customer' => $paymentMethod->customer,
this is correct?
i pass the paymentId to customer parameter
If that parameter is a cus_xxx ID, sure
no
i create the customer id with the var $paymentMethod in the backend code, not pass var customer by frontend
it's wrong?
Yes, the customer parameter expects a cus_xxx ID
in react is correct this:
const customer = await stripe.customers.create({
email: 'customer@example.com',
name: 'John Doe',
});
That looks like a valid API call, yes
Well that's an API request tat requires your secret key so you should be making that from a server environment like Node (not React)
{
"error": "No such customer: 'pm_1NTLbXJIIISYEGLzHx1n7Qj6'"
}
Seems reasonable considering that's not a cus_xxx ID, but a Payment Method ID
$stripe->customers->create([
'description' => 'My First Test Customer (created for API docs at https://www.stripe.com/docs/api)',
]);
in this function can pass paymentId for create id customer?
No, that API will return a response that includes an id field which is the cus_xxx ID you need
This seems fine. AFAIK, there's no required fields
{
"paymentMethodId": "pm_1NTLogJIIISYEGLzqe6YJ00t",
"amount": 9900,
"customer": "cus_OFrXav2zJKkLkh"
}
this is the object that pass to server, but return error: Missing required param: customer.
Can you share the ID (req_xxx) of the failing API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_8E8Ypg5sxa4u4d
Hi! I'm taking over this thread.
The error message is pretty clear:
Missing required param: customer."
Error creating subscription: The price parameter should be the ID of a price object, rather than the literal numerical price
You need to pass a customer ID when creating a subscription: https://stripe.com/docs/api/subscriptions/create#create_subscription-customer
another error
Can you share the request ID where you saw this error?
req_toom1dndS9xR5z
Again, the error message is pretty clear:
message: "The
priceparameter should be the ID of a price object,
You should either create a Price object: https://stripe.com/docs/api/prices/create
Or if you want to directly set the amount, you should use https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data
do i have to create the products inside the stripe dashboard?