#jan123459371
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- jan123459371, 3 days ago, 43 messages
- jan123459371, 4 days ago, 63 messages
- jan123459371, 5 days ago, 28 messages
- jan123459371, 5 days ago, 20 messages
that is the invoice
if I submit 164.20 as refund_amount I get the first error.
If I submit 214.20 as refund_amount I get the second error.
Invoice is in status "paid"
first request:
{
"invoice": "in_1OgQOiFbb57yWjuKuSbgXYnR",
"lines": {
"0": {
"type": "invoice_line_item",
"quantity": "2",
"invoice_line_item": "il_1OgQOiFbb57yWjuKurSMt8gG"
}
},
"refund_amount": "16420",
"memo": "USt-IdNr: DEPROVIDER | Leistungszeitraum: Mai 2024"
}
second request:
{
"lines": {
"0": {
"type": "invoice_line_item",
"quantity": "2",
"invoice_line_item": "il_1OgQOiFbb57yWjuKurSMt8gG"
}
},
"invoice": "in_1OgQOiFbb57yWjuKuSbgXYnR",
"refund_amount": "21420",
"memo": "USt-IdNr: DEPROVIDER | Leistungszeitraum: Mai 2024"
}
Hi, may I get a reaction? ๐
Sure, we're taking a look
hi! I'm taking over this thread. give me a few minutes to catchup.
so this is the request that's failling? https://dashboard.stripe.com/test/logs/req_gYKzEW1G855n3w
hum... I agree this is a big strange. looking into this...
it has something to do with the used customer balance. But I cannot find the "applied balance" in the invoice object to put it back as credit_amount
but balance is negative
starting_balance
should be positive if it can be used for paying ๐
or am I wrong?
this is explained here: https://stripe.com/docs/billing/customer/balance#debits-and-credits
the link I shared explains the difference between a positive balance and negative balance
doesnt work
but let me check
man
i get nuts
I submit this in "create" of creditnotes
that is what arrives in the API log
can you share the request ID (req_xxx)?
req_aq0xKqhkTsiiW0
$data = [
'invoice' => $invoice->id,
'lines' => $lineItems,
'memo' => "{$vatKey}: {$vatValue->value} | {$performancePeriodKey}: {$performancePeriodValue->value}",
];
if ($invoice->paid)
{
array_push($data, ['refund_amount' => $invoice->amount_paid]);
array_push($data, ['credit_amount' => $invoice->ending_balance - $invoice->starting_balance]);
var_dump($data);
}
$creditNote = $stripe->creditNotes->create($data);
code in PHP
yes there are multipls issues here
ok. Sorry. Wrong code
need to push it by key
One more question
I use connect accounts and customer
the refund I created of an Invoice which was created as issuer (the connect account) is withdrawn from my bank account not from the bank account of the connect account
is the invoice created on the platform account or on the connected accoutn directly?
then if you refund it, the funds will be taken from the platform account
and if I create the invoice on the connected account by invoices->create($data, 'account' => 'acc_afdmksljl') it will be withdrawn from the connect accounts bank account?
yes
No, we wouldn't use that to pay invoices
Your question is confusing
You're talking about creating a new invoice and withdrawing funds. Why would we withdraw funds from an external account in a refund?
- invoices->create($data, 'account' => 'acc_afdmksljl') >>> create invoice on connected account
- refund that invoice.
Question from which bank account is the fund withdrawn to pass it to the customer
The payment would be refunded to the method used to pay the invoice
We'd either:
- Charge the
cus_xxxdefault PM - You'd bring the customer on-session to collect payment details from them
no
not my question
I asked from which bank account the fund for the refund is taken
customer has already paid it ๐
It'd depend on the type of Connect payment. Direct I assume?
destination charge
Well then the platform is liable for refunds: https://stripe.com/docs/connect/destination-charges#issuing-refunds
You'd need to reverse the transfer from the conncted account
but it only works if the invoice is created on the connected account or can it be done if I create the invoice on plattform account by specifing the connected account as issuer?
I dont use the payment intents
What only works? You're describing 2 completely separate payment flows here
An Invoice has an associated Payment Intent, you don't 'refund' the Invoice
I know that
Then why say this?
thats why I said, I dont use payment intent. But the page you sent outlines the refunds only for payment intents ๐
But you would be refunding a Payment Intent
Anyway, I've honestly no idea what you're asking me. Can you share some examples that demonstrate the problem you're trying to solve?
Equally, all of this can be simulated in test mode to understand how funds flow through various Connect scenarios
It'd be way easier if you create an example Invoice that mirrors the scenario you describe
currently I am creating invoices on the plattform account with the connected account specified as issuer
Then I can see the exact parameters you're pasisng
all my invoices on my environment
You can send me a in_xxx ID from your Stripe account
sec
in_1OgRzOFbb57yWjuKZ0OrPPXW
that one must be refunded. But passing the money from connected bank account to customers. NOT from plattforms bank account to customer
Yeah I mean you can't really do that initial refund from the connected account directly. It's a destination charge, so ultimately platform is liable for the refunds and then they 'recoup' fund from the connected account by reversing the associated charge: https://stripe.com/docs/connect/charges#destination:~:text=flow diagrams below).-,Your%20account%20balance%20is%20debited%20for%20the%20cost%20of%20the%20Stripe%20fees%2C%20refunds%2C%20and%20chargebacks.,-Send%20the%20balance
Stripe fees are non-refundable
ah yeah
that sounds correct for me ๐ (application fee refund)
because the refunds target is the cutomer... And the application fee is subtracted from the amount the customer paying to the connected account ๐
Yes, ultimately the platform would decide whether the refund the application fee
i see
but its not logical
doc says, if "refund_app_fee" is true it is refunded to the connected account
That is correct, yes
but that is not the goal if I try to refund a payment from a customer to a connected account
if I refund that
lets say the customer pays 100โฌ. Then I get a cut of 10โฌ and the connected account gets 90โฌ
if I refund that then 10โฌ need to be passed to the customer not to the connected account
If you choose to refund the full 100โฌ payment then then customer will receive the full 100โฌ payment from the platform balance
At that point the connected account still has the 90โฌ transfer (minus the app fee)
90โฌ is already minus the app fee
You can reverse that back to the platform to cover the (most) refund
ok
Optionally you can reverse the application fee back to the connected account
Either way, whatever you decide to refund to the customer will come from your platform balance
in what scenario is that relevant? With that I am paying the customer 100โฌ and the connected account 100โฌ
In some platform scenarios it might be, not all. Perhaps the refund was unrelated to the connected account (an error by the platform), so they want to return the fee to the connected account
Do you have a specific question?
not for now