#sebastian_api

1 messages · Page 1 of 1 (latest)

compact siloBOT
jade nightBOT
#

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.

compact siloBOT
#

👋 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/1270188574490497035

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

still vessel
#

Do I message here? @gilded meteor

gilded meteor
#

What is your question?

#

it needs photo ID otherwise itll stop payouts.
Yes. Onboarding should be completed in order to receive payouts

still vessel
#

Ok so I want to know where the exact demo script is. Ill show you what I am using to upload the photo ID but I feel like its not the right script.

#
import { NextApiRequest, NextApiResponse } from 'next';

const stripe = require("stripe")(process.env.STRIPE_SECRET_KEY);

export default async (req: NextApiRequest, res: NextApiResponse) => {

//   if (req.method !== 'POST') {
//     return res.status(405).send({ message: 'Only POST requests are allowed' });
//   }

  try {

    const fs = require('fs');
    const file = await stripe.files.create({
      purpose: 'identity_document',
      file: {
        data: fs.readFileSync('C:/Users/sebas/Code/trigopolis-web/public/passport_photo.jpg'),
        name: 'passport_photo.jpg',
        type: 'application/octet-stream',
      },
    }, {
      stripeAccount: 'acct_1PkYKDIgtd4f6uLz',
    });

    res.status(200).json({ file });
  } catch (error) {
    res.status(400).json({ error: error });
  }
};
gilded meteor
#

What type of connected account are you using? Do you use Account Links to complete the onboarding or collect your own information and submit it through API?

still vessel
#

No I am using the API. I am trying to make a white glove experience.

#

So all custom

gilded meteor
#

What was the error you received when you uploaded the file? Could you share the request ID of the stripe.files.create()? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request

still vessel
#

No error haha

#
{
  "file": {
    "id": "file_1Pkan4Igtd4f6uLzRL1wWM3i",
    "object": "file",
    "created": 1722902294,
    "expires_at": null,
    "filename": "passport_photo.jpg",
    "links": {
      "object": "list",
      "data": [],
      "has_more": false,
      "url": "/v1/file_links?file=file_1Pkan4Igtd4f6uLzRL1wWM3i"
    },
    "purpose": "identity_document",
    "size": 3929869,
    "title": null,
    "type": "jpg",
    "url": null
  }
}

This was the response

#

I think I have to use another method to upload the docs

gilded meteor
still vessel
#

What bugs me is when I look via the API if anything is needed, I get empty results in the requirements property

#
    "future_requirements": {
      "alternatives": [],
      "current_deadline": null,
      "currently_due": [],
      "disabled_reason": null,
      "errors": [],
      "eventually_due": [],
      "past_due": [],
      "pending_verification": []
    },
#
      "requirements": {
        "alternatives": [],
        "currently_due": [],
        "errors": [],
        "eventually_due": [
          "id_number"
        ],
        "past_due": [],
        "pending_verification": []
      },
gilded meteor
#

Which connected account is this? Are you trying to verify in test or live mode?

still vessel
#

Awesome I see the error now

#

So I need to upload the file, get the ID and then attach that ID back into the api onboarding

gilded meteor
#

Yes, that's right!

still vessel
#

So one more thing

#

Trying to route this payout to one of my connected accounts. I want to send them $5.

#

According to my current balance. I have more than enough

#

This is the error message I am getting:

 "message": "You have insufficient funds in your Stripe account. One likely reason you have insufficient funds is that your funds are automatically being paid out; try enabling manual payouts by going to https://dashboard.stripe.com/account/payouts."
#

And this is the script:

import { NextApiRequest, NextApiResponse } from 'next';

const stripe = require("stripe")(process.env.STRIPE_SECRET_KEY);

export default async (req: NextApiRequest, res: NextApiResponse) => {
  try {
    const transfer = await stripe.transfers.create({
        amount: 5000,
        currency: 'usd',
        destination: 'acct_1PkYKDIgtd4f6uLz',
        transfer_group: 'CONSULTING_1',
    });
    

    res.status(200).json({ transfer });
  } catch (error) {
    res.status(400).json({ error: error });
  }
};
gilded meteor
#

This page shows both pending and available balance. The fund can only be paid out when it becomes available

still vessel
#

I know this works because I did it on test as well.

still vessel
gilded meteor
#

Where does it say pending and available. Its not so clear on dashboard
The Dashboard doesn't show pending and available balance. We will share this feedback to the product team

still vessel
#

Ok but the api will?

#

Awesome. Just built the API on local

#

it worked and it does show the difference

#
{
  "balance": {
    "object": "balance",
    "available": [
      {
        "amount": 0,
        "currency": "usd",
        "source_types": {
          "card": 0
        }
      }
    ],
    "connect_reserved": [
      {
        "amount": 0,
        "currency": "usd"
      }
    ],
    "livemode": true,
    "pending": [
      {
        "amount": 941,
        "currency": "usd",
        "source_types": {
          "card": 941
        }
      }
    ]
  }
}
#

Thanks. So I just gotta wait for the available to have the funds, then I can do the payout

gilded meteor
#

That's great! I'd recommend using available to determine when the funds are available to pay out

still vessel
#

Do you know how long it take Stripe to make the funds available? Like 24 hours?

gilded meteor
still vessel
#

I thought the money I have pending will be available on my stripe dashboard, where then I can do the transfer

#

sorry payout to the connect account

gilded meteor
#

will this arrive to my bank account or sit in my stripe dashboard?
If the connected account is on manual payout, the available balance will sit in Stripe

#

If the connected account is on automatic payout, the available balance will be paid out automatically to connected account's external bank account

still vessel
#

So my connected accounts that are my customers are on automatic. But where does it on the actual stripe dashboard of my business

gilded meteor
#

When the funds are available in the platform, you will be able to make a transfer to the connected account. Once the connected account receive the transferred amount, the funds will be paid out automatically

#

This channel is for developers and technical integration questions. We don't have necessary expertise with Dashboard. For Dashboard related questions, our Support https://support.stripe.com/contact will be able to help

still vessel
#

Awesome. Thanks for your help. talking to them now