#Rishikesh

1 messages ยท Page 1 of 1 (latest)

high plumeBOT
blazing perch
#

Sure how can we help?

onyx dock
#

i am trying to create transfer

#

from my stripe account to another stripe account

#

but its giving me No such destination: 'acct_1MqUJqF482Ubl4mG' errir

#

error

#

await stripe.transfers.create(
{
amount: 2100, // Amount in cents
currency: "usd", // Currency code
destination: 'acct_1MqUJqF482Ubl4mG',
},
async function (err, transfer) {
if (err) {
console.log(err, "transition error");
}
if (transfer) {
console.log("transfer created");
console.log(transfer, "transfer");
}
}
);

high plumeBOT
onyx dock
#

anyone here ??

plain dragon
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

onyx dock
#

ok

plain dragon
#

what is your platform account?

blazing perch
#

@onyx dock please also provide the request id req_xxx

onyx dock
#

req_JUo5fw1tLE8Mo6

plain dragon
#

thanks taking a look

onyx dock
#

ok

plain dragon
#

ok so what you're doing here is that you're creating a transfer with the platform API keys and a Stripe-Account header meaning you, as a platform, are creating the transfer on behalf of your connected account

#

but the problem is that the destination is the same connected account

#

so basically the account acct_1MqUJqF482Ubl4mG (your connected account) doesn't have a connected account with the same ID that's why the API is returning a "missing resource" error

onyx dock
#

i did not get it

#

i am trying to transfer amount one account to another account

#

what is the process for that

plain dragon
#

the same thing you're doing but you need to remove the Stripe-Account header

onyx dock
#

ohh ok

plain dragon
onyx dock
#

can you provide me some code snippets

#

so by adding stripe.charges.retrieve('ch_3MtQJeF482Ubl4mG0Q9R7ckP', {
stripeAccount: 'acct_1MqUJqF482Ubl4mG'
});

#

this to my code my issue will be solve?

plain dragon
#

no

#

the problem is in the transfer code

#

not here

#

Oh wait!

#

how are you initializing the stripe variable?

onyx dock
#

var stripe = require("stripe")(stripeConfig.secretKey);

#

using node js

plain dragon
#

are you passing stripeAccount to the stripe.transfers.create function?

onyx dock
#

but in main account its showing successful

#

but in my account no amount is getting displayed

onyx dock
plain dragon
#

you shouldn't be passing the stripeAccount

#

otherwise it would fail the same way it did with the request you shared

onyx dock
#

if i wont pass then how to provide destination account?

plain dragon
#

in the parameters

#

you're already passing

#

please keep on using this thread for your messages

onyx dock
#

ok what changes i have to made

#

await stripe.transfers.create(
{
amount: 2100, // Amount in cents
currency: "usd", // Currency code
destination: 'acct_1MqUJqF482Ubl4mG',
},
async function (err, transfer) {
if (err) {
console.log(err, "transition error");
}
if (transfer) {
console.log("transfer created");
console.log(transfer, "transfer");
}
}
);

#

to work this

plain dragon
#

nothing

onyx dock
onyx dock
plain dragon
#

actually you only need to use

      {
        amount: 2100, // Amount in cents
        currency: "usd", // Currency code
        destination: 'acct_1MqUJqF482Ubl4mG',
      });```
onyx dock
#

yes using the same

plain dragon
#

what's the generated request ID? when you run this code

onyx dock
#

wait ill genrate it once more

#

req_s9w7FpMYM1MxJs

#

No such destination: 'acct_1MqUJqF482Ubl4mG'

#

error

plain dragon
#

there's somewhere in your code where you're adding the StripeAccount header

#

with what you're sharing I'm not seeing it

#

but please try to look at anywhere in your code where you have stripeAccount: "acct_1MqUJqF482Ubl4mG"

onyx dock
#

ok just min

#

no

#

i have searched in project there is nothing stripeAccount

#

ok will it reflect immidately ? or will take some time to reflect?

plain dragon
#

would you mind sharing your whole code please?

onyx dock
#

how?

#

console.log("in api call");

let stripeConfig = Payments.app.get("stripe");
var stripe = require("stripe")(stripeConfig.secretKey);

// const accountLink = await stripe.accountLinks.create({
//   account: 'acct_1MqUJqF482Ubl4mG',
//   refresh_url: 'https://example.com/reauth',
//   return_url: 'https://example.com/return',
//   type: 'account_onboarding',
// });

// console.log(link.url);

const accounts = await stripe.accounts.list();

console.log(accounts);

console.log("COM");


await stripe.transfers.create(
  {
    amount: 2100, // Amount in cents
    currency: "usd", // Currency code
    destination: 'acct_1MqUJqF482Ubl4mG',
  });
#

this is the function i am using

#

this is the only code i am using

plain dragon
#

would you mind sharing the request ID generated from this call
const accounts = await stripe.accounts.list(); ?

onyx dock
#

ok

#

where i can find it??

#

its not visible

plain dragon
#

on your dashboard

onyx dock
#

i dont have access to the dashbard

plain dragon
#

without that request ID I don't really know how may I help you

#

you need to ask for a developer user on the dashboard

#

so you can look at the logs and events

onyx dock
#

ok

#

ill ask

high plumeBOT