#Longbraz-invoice-error

1 messages · Page 1 of 1 (latest)

livid prawn
#

@boreal jewel can you share the full req_xxx unredacted? it's not sensitive.

#

but usually it means you are not passing any plans to the subscription(which often can be that you use some variables in your code to specify them to the API call and the variables are null)

boreal jewel
#

req_1tXNm3Vv9uef1r

#

yeah, thought so, probably the item is not correctly linked so it is missing (not sure)

livid prawn
#

taking a step back a bit, what are you trying to do?

#

because you already created the subscription, and creating the subscription invoices the customer, that's already done

#

you don't need to manually create an invoice unless you specifically want to charge the customer again for something else

boreal jewel
#

it is done by an outsource dev. Idea is to create the subscr. plan, have the customer to subscribe and save the payment method and create a custom invoice with custom fields which to be sent to the customer

livid prawn
#

hmm ok. But you have to realise that "have the customer to subscribe" issues an invoice and charge them already.

boreal jewel
#

try {
$invoice = $stripe->invoices->create([
'customer' => $customer_id,
'subscription'=>$subscriptionId,
'custom_fields'=>[
'0'=>[
'name'=>"Vendor Information",
'value'=>"Neighborhood",
]
],
'footer'=>$footer,
]);

print_r($invoice);die;

} catch (Exception $e) {
$e->getMessage();
}

livid prawn
#

thanks, but what's the relevance of that code?

#

like I know , that's what gives you the error you mentioned, but it's expected since you're creating the Invoice after the subscription was already created, and as I am trying to explain, that might not be what you actually want to do

#

I think you need to take a step back and understand how the Subscriptions API works in general and what you're trying to do.

boreal jewel
#

so, the issue is because the invoice is created via the api after the subscription is created, is that correct? I need to explain it with next steps to the developer (as I am not one myself) and they claim they did everything as required