#tomas-kolakovic_error

1 messages ¡ Page 1 of 1 (latest)

steep hornetBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1404872235927470141

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

light tapir
#

Hi there. It looks like the end of the request log url with the request ID was cut off in the input. Could you give me the req_123 id from the end?

steep hornetBOT
near crater
#

hello! just took a look at the customer you shared and i think i found the failing request:
https://dashboard.stripe.com/test/logs/req_kh00IZMNYiUsBo

if this is the correct request, it looks like you're trying to clone this payment method to a customer owned by the connected account. per the docs on sharing payment methods, you should actually use a customer owned by the platform account. this creates a single use payment method that can then be used on the connected account.
https://docs.stripe.com/connect/direct-charges-multiple-accounts#clone-payment-method

tepid wigeon
#

hi

#

{
"event_message": "Failed to clone payment method: {\n "error": {\n "code": "resource_missing",\n "doc_url": "https://stripe.com/docs/error-codes/resource-missing\",\n "message": "No such customer: 'cus_Sr3jPB5GRWAaR0'",\n "param": "customer",\n "request_log_url": "https://dashboard.stripe.com/acct_1RtBZQ1m7Dm0JgJp/test/logs/req_SgK5zzVpWui6DW?t=1755018250\",\n "type": "invalid_request_error"\n }\n}\n\n",
"id": "55033935-6d6f-4e5e-8aeb-ccbbe3f6d1b1",
"metadata": [
{
"boot_time": null,
"cpu_time_used": null,
"deployment_id": "bjmmugplefxbxcjkybeb_726d4d0a-6d0a-4390-aa07-f4c30ec1cf02_7",
"event_type": "Log",
"execution_id": "76b5faa5-2eff-450f-a9cd-baca0b35d25f",
"function_id": "726d4d0a-6d0a-4390-aa07-f4c30ec1cf02",
"level": "error",
"memory_used": [],
"project_ref": "bjmmugplefxbxcjkybeb",
"reason": null,
"region": "sa-east-1",
"served_by": "supabase-edge-runtime-1.68.0-develop.32 (compatible with Deno v2.1.4)",
"timestamp": "2025-08-12T17:04:10.925Z",
"version": "7"
}
],
"timestamp": 1755018250925000
}
sorry here is the raw response im getting

#

i can copy my function if that is of any help.
as im understanding, im

  1. getting my payment method from the platform account with this id -> cus_SmIafRDdSFozOu
  2. creating a customer object for the connected account.
  3. then cloning as such
#

const clonedPaymentMethodResponse = await fetch("https://api.stripe.com/v1/payment_methods", { method: "POST", headers: { Authorization:Bearer ${Deno.env.get("STRIPE_SANDBOX_SECRET_KEY")}, "Content-Type": "application/x-www-form-urlencoded", "Stripe-Account": connected_account_id }, body: new URLSearchParams({ customer: connectedCustomer.id, payment_method: platformPaymentMethodId }) });

near crater
#

you create the customer and payment method on the platform, then you clone it to the connected account by passing in the platform's customer + payment method along with the Stripe-Account header, which tells us where to create the single use payment method

tepid wigeon
#

i dont understand. i already have a plaform customer with the payment method. you mean i clone the whole customer into the connected ? so i dont need to actually create a previous connected customer ?

near crater
#

which doc are you following? the one i linked above or a different one? if it's a different one can you share it?

#

if you're following the one i linked to, there is no step where you create a customer + payment method on the connected account

tepid wigeon
#

yes that one. i noticed now, i guess i had already created that in my head.

#

one more question. am i getting the new connected customer in my response after cloning ?

near crater
#

not after cloning - all you get after making the call is a single use payment method

#

i would recommend reading that entire page from top to bottom, it should give you all the info you need

tepid wigeon
#

ohhh i see. i can have non customer payment methods

#

that i though was not possible okay

#

it makes sense

near crater
#

yep! you can create single use payment methods that aren't attached to a customer

tepid wigeon
#

a little question. is tehre a place i can look at response objects ?

#

i dont see them on that page i believe

near crater
#

what do you mean? expected response objects?

#

like what you get back from calling an API?

tepid wigeon
#

yes

#

how do i access the new id

near crater
tepid wigeon
#

oh thanks

near crater
#

how do i access the new id
this is going to be returned in the id property

tepid wigeon
#

perfect thank you very much

#

will try now,