#Mael CHEMLA
1 messages ยท Page 1 of 1 (latest)
๐
What API Version are you using?
And are you setting anything for pending_invoice_items_behavior?
Also in your screenshot it looks like you have 2 invoices and 2 invoice items
Hello, I create my invoice like that
public createInvoice = async (operation: Operation, stripeAccountId: string, stripeCustomerId: string): Promise<Stripe.Response<Stripe.Invoice>> => {
await this.stripe.invoiceItems.create({
description: operation.operationType.name,
currency: "eur",
quantity: 1,
unit_amount: operation.amount * 100,
customer: stripeCustomerId
}, {
stripeAccount: stripeAccountId
});
const invoiceDraft = await this.stripe.invoices.create({
customer: stripeCustomerId,
metadata: {
operationId: operation.id
},
}, {
stripeAccount: stripeAccountId
});
const invoicePaid = await this.stripe.invoices.pay(
invoiceDraft.id,
{ paid_out_of_band: true },
{ stripeAccount: stripeAccountId }
);
return invoicePaid;
};
The above property (pending_invoice_items_behavior) dictates what happens to those when your invoice is created. See: https://stripe.com/docs/api/invoices/create#create_invoice-pending_invoice_items_behavior
Do you want the invoice to include the invoice item you previously created?
I'd assume so, if so try adding pending_invoice_items_behavior: 'include'
To your invoice creation request
๐