#Eerik Kivistik

1 messages · Page 1 of 1 (latest)

halcyon valeBOT
manic rain
twilit rover
#

Is there any control over how the custom fields and where they are rendered?

manic rain
#

As far as I know, it renders in the invoice header. I don't think there's a way to move it around on the invoice.

twilit rover
#

When I try to submit the custom fields I get an error: com.stripe.exception.InvalidRequestException: Received unknown parameter: custom_fields[0][Vat Number]; code: parameter_unknown; request-id: req_wDZhEdNivdoQuV

#

This happens when creating the invoice

#

And adding a custom field named "Vat Number"

manic rain
#

Can you try custom_fields[0]["Vat Number"]

twilit rover
#

What do you mean?

#

Its a String already, using the Java SDK

manic rain
#

Ah my bad, I'm not super versed in Java as such.
Let me see if there are any examples

#

Can you share snippet of the code you're using to set these key/values?

twilit rover
#

InvoiceCreateParams invoiceParams = InvoiceCreateParams.builder()
.setCustomer(customerId)
.setCurrency("EUR")
.setCollectionMethod(CollectionMethod.CHARGE_AUTOMATICALLY)
.addDefaultTaxRate("--")
.setOnBehalfOf(providerAccountId)
.setApplicationFeeAmount(feeAmountInCents)
.setTransferData(InvoiceCreateParams.TransferData.builder().setDestination(providerAccountId).build())
.setAutoAdvance(true)
.setDefaultPaymentMethod(paymentMethodId)
.setCustomFields(Arrays.asList(InvoiceCreateParams.CustomField.builder().putExtraParam("Vat Number", "TEST").build()))
.build();

#

Removed the tax rate id, since public chat...

manic rain
#

Thanks, let me ask a colleague

twilit rover
#

I got it working. Cant use "putExtraParam" method. Had to separately setName and setValue

#

Thanks, it shows up in the header now

manic rain
#

Ah nice!