#srujan
1 messages · Page 1 of 1 (latest)
Before an invoice is finalised, you're able to add the custom_fields when invoice is still in draft state: https://stripe.com/docs/api/invoices/create#create_invoice-custom_fields
is there a way to pass them when creating a subscription. so that these values can be used in all upcoming invoices
custom_fields can't be set at subscription level. Two ways I can think of:
- Listen to
invoice.createdevent and update thecustom_fieldswhile invoice is still in draft: https://stripe.com/docs/api/invoices/update#update_invoice-custom_fields - Set the
invoice_settings.custom_fieldsat Customer level and it'll apply to all invoices for the customer: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-custom_fields
okay. so each invoice should be updated if i want the custom fields to persist. Stripe can't persist the custom fields in next invoice by itself. right ?
Yup! It's not possible with subscription invoices unless custom_fields is set at Customer level
if we want to use custom fields at customer level, can we make them have dynamic values based on subscription metadata?
That's not supported