#rpardela
1 messages ยท Page 1 of 1 (latest)
Hi
Are you referring to Stripe Customer or Accounts?
For customer you can't set that. meanwhile for Accounts you can specify the default customer when creating the Connected Account:
https://stripe.com/docs/api/accounts/create#create_account-default_currency
And can I issue invoices for the account? Now I have such a problem that the customer has EUR currency set automatically and I want to expose him an invoice in USD currency (such payments I take from the card).
๐ taking over for my colleague. Let me catch up.
please refer to this support guide https://support.stripe.com/questions/setting-a-customers-default-currency
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
How to do it. I need an example in the source code. "The only way to change the default currency in which you charge a customer is to create a new Customer object representing that customer, attach a payment method, and then execute the requested task in the appropriate currency."
you can create a one-time invoice with another currency then the default one
I create the invoice this way. I get an error related to a different currency on the invoice and a different currency at the customer. What am I doing wrong?
My code: const sendInvoice = async (customerId, priceId, quantity) => {
console.log('sendInvoice');
try {
// Create a draft invoice with the invoice item and collection method set to 'send_invoice'
const invoice = await stripe.invoices.create({
customer: customerId,
collection_method: 'send_invoice',
days_until_due: 7, // Set the number of days until the invoice is due
auto_advance: false, // Keep the invoice in draft mode
});
// Create a pending invoice item with the actual fee and a description
const invoiceItem = await stripe.invoiceItems.create({
customer: customerId,
price: priceId,
quantity,
// description: 'Fees charged (Already Paid)',
invoice: invoice.id,
});
// Mark the invoice as paid
await stripe.invoices.pay(invoice.id, {
paid_out_of_band: true,
});
// Finalize and send the invoice
await stripe.invoices.sendInvoice(invoice.id);
// Finalize the invoice
//const finalizedInvoice = await stripe.invoices.finalizeInvoice(invoice.id);
console.log(invoice, 'invoice');
return ({ success: true, invoiceId: invoice.id });
} catch (error) {
console.log(error.message, 'error');
return ({ error: error.message });
}
}
what's the error?
do you have any request ID I could take a look at? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Error: "The price specified supports currencies of usd which doesn't include the expected currency of eur."
Error occur in this step: / Create a pending invoice item with the actual fee and a description
const invoiceItem = await stripe.invoiceItems.create({
customer: customerId,
price: priceId,
quantity,
// description: 'Fees charged (Already Paid)',
invoice: invoice.id,
});
you need to follow these steps https://stripe.com/docs/invoicing/multi-currency-customers
The only difference is that I shouldn't use "price: priceId" and insert the amount and currency manually?
no you need to pass currency to both the invoice items and the invoice
so if you have priceIDs in your invoiceItems
you just need to specify the currency when creating the invoice
It works! Many thanks ๐