#nadeem_transfer-balance
1 messages ยท Page 1 of 1 (latest)
๐ 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/1401938292043157556
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there ๐
What you're describing sounds like expected behavior. Creating a Transfer from a Platform Account to a Connected Account is expected to pull funds from the Platform's Stripe balance, not their associated bank account.
Stripe may allow the Stripe Account's balance to go negative, and in those cases may debit the associated bank account to recover those funds. But the specifics about whether that will be allowed, and how far negative you can go if so, are account-specific so they aren't something we're able to review or discuss in this forum. You'd need to speak with our Support team to discuss those limits for your Platform:
https://support.stripe.com/?contact=true
https://support.stripe.com/questions/reserves-for-connect-platforms-and-connected-accounts
I've heard of people building payroll systems on Stripe before, but it's going to be a bit different since Stripe is intended for processing payments rather than be a payroll system. You'll need to explore the best approach for getting funds into your Stripe account (assuringly from the employer using your system).
Topping up your Platform balance may be a good option, if you're in a region where that is supported:
https://docs.stripe.com/connect/top-ups
i have balance on platform bank but it uses card balance why?
What does that mean?
it menns i charged the customer bank and get balance on stripe platform and now want to transfer some amount of it to any connected account. it show you have insufficient balance in card, where i want to transfer from amount present on platform's bank that i received form my customer earlier
What's your available balance as shown by the API when you retrieve your account's balance?
https://docs.stripe.com/api/balance/balance_retrieve
{
"available": [
{
"amount": 43302,
"currency": "usd",
"source_types": {
"bank_account": 2282,
"card": 41020
}
}
],
"pending": [
{
"amount": 102634,
"currency": "usd",
"source_types": {
"bank_account": 0,
"card": 102634
}
}
],
"connectReserved": [
{
"amount": 0,
"currency": "usd",
"source_types": null
}
],
"instantAvailable": null
}
Can you also share the ID of the request that is failing, so I can take a closer look at how much you're trying to Transfer?
request is not completing therfore id is not present
The failed request will still generate a request ID that capture the error you encountered. That ID will have a req_ prefix, and will be in the response via the request_log_url field:
https://docs.stripe.com/api/errors#errors-request_log_url
"error": "You have insufficient available funds in your Stripe account. Try adding funds directly to your available balance by creating Charges using the 4000000000000077 test card. See: https://stripe.com/docs/testing#available-balance"
}
Can you share your Account ID, I'll find the ID that way.
acct_1Rjk2LABglXEEQBS
@wicked lava are you there?
Please refrain from pinging our team members directly. I was bouncing around to other threads while waiting for you to share the relevant information.
I don't see any requests to create Transfers coming from that account at all. What code are you running that is leading to an error?
[HttpPost("transfer-to-connected-account")]
public async Task<IActionResult> TransferToConnectedAccount([FromBody] TransferRequestDto dto)
{
if (dto == null || dto.AmountInCents <= 0 || string.IsNullOrEmpty(dto.Currency)
|| string.IsNullOrEmpty(dto.ConnectedAccountId))
{
return BadRequest("Invalid request.");
}
try
{
var transferService = new TransferService();
var transfer = await transferService.CreateAsync(new TransferCreateOptions
{
Amount = dto.AmountInCents,
Currency = dto.Currency.ToLower(),
Destination = dto.ConnectedAccountId,
Description = $"Platform โ Connected Account transfer"
});
return Ok(new
{
transferId = transfer.Id,
status = "TRANSFER_CREATED"
});
}
catch (StripeException ex)
{
return StatusCode(500, new { error = ex.StripeError?.Message ?? ex.Message });
}
}
Is the API key you're using to run that one from the account you shared? There aren't any logs on the Account you shared that align with that code.
i am using API with api keys provided by stripe
From which Stripe Account?
acct_1Rjk2LABglXEEQBS
registered with email info@eworkforcepayroll.com
Please double check that the API keys that you're using match the API keys you see when logged into your Stripe dashboard in the Account you're referring to.
Right now there seems to be a misalignment. Your code is for creating Transfer objects, but there are no requests on the Account you shared to our /v1/transfers endpoint, which indicates the requests being made from your code are being made to a different Stripe Account.
where i can find info about Stripe Account?
What do you mean?
Stripe Account about which you want to know
i think this is the acct_1Rjk2LABglXEEQBS
I don't believe it is. That doesn't seem to be the account that your code is running for, since there are no requests in the account's logs that align with your code.
https://dashboard.stripe.com can be used to log into your Stripe accounts and review their associated API keys.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
SANDBOX ID: wksp_test_6St7zu2LSQIyfjFIu84lJm4
please check this
wksp_test_6St7zu2LSQIyfjFIu84lJm4
@wicked lava are u there?
Please refrain from pinging our team members directly. I was bouncing around to other threads while waiting for you to share the relevant information.
I'm unfortunately not sure what ID you're sharing with me, but now knowing you're working in a Sandbox may give me the insight I needed to find where you're testing this.
what kind of id you need to checking log. and where i can find it on dashboard?
there is a SANDBOX ID: wksp_test_6St7zu2LSQIyfjFIu84lJm4
i also got SecretKey and PublishableKey
It's okay, I found an example of a failed request:
https://dashboard.stripe.com/test/logs/req_pEURKcfRgoWp2Y
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
then what is the solution?
I'm still piecing that together
waiting....
is anybody there?
Yes, I'm looking
Unless you have the exact output of the Balance requests that you made before and after the Transfer creation request I shared, so I can have more context over the state of the balance's of your account when our system said its balance was insufficient.
{
"available": [
{
"amount": 2282,
"currency": "usd",
"source_types": {
"bank_account": 2282,
"card": 0
}
}
],
"pending": [
{
"amount": 102634,
"currency": "usd",
"source_types": {
"bank_account": 0,
"card": 102634
}
}
],
"connectReserved": [
{
"amount": 0,
"currency": "usd",
"source_types": null
}
],
"instantAvailable": null
}
Which request was that from? The one you made before the transfer creation request that failed, or the one after?
Neither of the source types in the available hash look like they have the funds to cover the Transfer you're trying to create.
[HttpPost("charge-bank-account")]
public async Task<IActionResult> ChargeBankAccount([FromBody] ChargeBankAccountDto dto)
{
if (dto == null ||
string.IsNullOrEmpty(dto.CustomerId) ||
string.IsNullOrEmpty(dto.BankAccountId) ||
dto.AmountInCents <= 0 ||
string.IsNullOrEmpty(dto.Currency))
{
return BadRequest("Invalid input.");
}
var chargeService = new ChargeService();
try
{
var chargeOptions = new ChargeCreateOptions
{
Amount = dto.AmountInCents,
Currency = dto.Currency,
Customer = dto.CustomerId,
Source = dto.BankAccountId, // ACH bank account source
Description = dto.Description ?? "ACH bank account charge"
};
var charge = await chargeService.CreateAsync(chargeOptions);
return Ok(new
{
charge.Id,
charge.Status,
charge.Amount,
charge.Currency,
charge.Description,
charge.PaymentMethodDetails
});
}
catch (StripeException ex)
{
// Stripe-specific errors (e.g., failed payment)
return StatusCode(500, new { error = ex.StripeError?.Message ?? ex.Message });
}
catch (System.Exception ex)
{
// General errors
return StatusCode(500, new { error = ex.Message });
}
}
for charging customer's bank
and then for transfring to connected id
[HttpPost("transfer-to-connected-account")]
public async Task<IActionResult> TransferToConnectedAccount([FromBody] TransferRequestDto dto)
{
if (dto == null || dto.AmountInCents <= 0 || string.IsNullOrEmpty(dto.Currency)
|| string.IsNullOrEmpty(dto.ConnectedAccountId))
{
return BadRequest("Invalid request.");
}
try
{
var transferService = new TransferService();
var transfer = await transferService.CreateAsync(new TransferCreateOptions
{
Amount = dto.AmountInCents,
Currency = dto.Currency.ToLower(),
Destination = dto.ConnectedAccountId,
Description = $"Platform โ Connected Account transfer"
});
return Ok(new
{
transferId = transfer.Id,
status = "TRANSFER_CREATED"
});
}
catch (StripeException ex)
{
return StatusCode(500, new { error = ex.StripeError?.Message ?? ex.Message });
}
}
it was asked from your side
Am I understanding correctly that the Transfer is failing because you don't have enough balance? Because you shared 2 separate pieces of code. One creates a Charge (which is a legacy API we deprecated multiple years ago) and then the other creates a Transfer, but with no "link" to the existing Charge
then please prvide solution for cgarging customer's bank and getting payment on platform and then transfer to connected account external bank or on its platform balance
Question 1: Why are you using the legacy API here? Is this an existing integration or are you starting from scratch?
i am starting from scratch and testing required senario
Perfect so the first part of your code is mostly wrong. You are following an API recommendation from many years ago.
If you are trying to charge a customer's bank account in the US via ACH Debit, use the PaymentIntents API. See: https://docs.stripe.com/payments/ach-direct-debit
Question 2: Why are you creating a "Charge" and then after creating aTransfer? Are you trying to hold funds in your own balance?
no i dont want to hold , if possible transfer directly
Perfect so instead of creating a Charge and then a Transfer, you should use Destination Charges: https://stripe.com/docs/connect/destination-charges
This will make the Transfer happen automatically when the payment succeeds
So really if you combine both docs it should work!