#Chhay-invoice

1 messages ยท Page 1 of 1 (latest)

flat rose
#

๐Ÿ‘‹ Happy to help

#

Could you share which API's custom_field are you referring to?

crystal tartan
#

I call API customer update to add the custom_field in order to add some information to the Invoice pdf.

flat rose
#

You can add the invoice_settings.custom_fields to the customer before creating the subscription, so that the it'll be added to the invoice

crystal tartan
#

We have created the customer while the user register.

#

that why, I can only use the customer update api

flat rose
#

Before creating a subscription, you will also be able to call Customer Update API. Is there any reason why you can only update custom_fields after creating a subscription?

crystal tartan
#

because of the user input form UI

#

the customer additional information to the invoice pdf are inside with the Checkout form

#

Ex:
Register Form
Email:
Pass:
FirstName:
LastName:

after the registration (has been create stripe customer), it'll redirect to the checkout form.

Checkout Form
CardNumber:
Expiry:
CVC:

CompanyName:
VATNumber:
Address:

#

so CompanyName, VATNumber, Address are the additional info to the invoice pdf.

flat rose
#

Thanks for sharing the information

#

I'm afraid that the subscription always finalises the invoice immediately with collection_method=charge_automatically after creating a subscription

crystal tartan
#

After the user successful charged, we will provider them to access the system.

Since we schedule the invoice around an hour to be charge.

vernal ermine
crystal tartan
#

I mean, we can't get the invoice.paid webhook immediately after the subscription successful. We need an hour to get the invoice.paid event.

vernal ermine
#

indeed

#

then don't wait an hour, you can call the Finalize Invoice API directly and then attempt a payment. Depends what your requirements are.

#

or just do what I think I said yesterday, set your custom fields on the Customer object so they're automatically inherited to the first invoice so you don't have to try other things to delay invoice finalisation. Was there a reason that doesn't work for you?

crystal tartan
vernal ermine
#

but in general, yes, that's the overall idea

crystal tartan
#

thank you so much

#

let me recheck it again