Hi everyone,
I’m working with Square’s (web.developer.squareup.com/docs/invoices-api/overview), and I’m running into an issue when trying to add custom fields to an invoice. I’m using the following request to create the invoice:
{
"invoice": {
"order_id": "4NuiKTlFzWmbLnRz9YfoL8example",
"primary_recipient": {
"customer_id": "HXJKX5BBKGWX34XEMS2example"
},
"payment_requests": [
{
"request_type": "BALANCE",
"due_date": "2023-12-31"
}
],
"accepted_payment_methods": {
"card": true,
"square_gift_card": true,
"buy_now_pay_later": true
},
"custom_fields": [
{
"label": "Service Agreement",
"value": "The terms of service apply.",
"placement": "ABOVE_LINE_ITEMS"
}
]
}
}
However, I’m getting a “BAD_REQUEST” error with the detail: "custom_fields must be empty or omitted."
I’ve checked the documentation, and I believe the Invoices Plus subscription is active on the seller’s account. But I still keep getting the error. Is there a specific configuration I’m missing, or do I need to handle the custom fields differently in this case?
Any help would be greatly appreciated!
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
Additional Documentation
Create and Publish Invoices
Square Developer
Create and Publish Invoices
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
The error message you’re receiving suggests that the seller account you’re working with doesn’t have an active Invoices Plus subscription. The Invoices Plus subscription is required to use the custom fields feature of the Invoices API.
Even though you believe the Invoices Plus subscription is active, the error suggests otherwise. Please double-check the subscription status on the seller’s account. If the subscription is indeed active and you’re still encountering this issue, it might be a problem that needs further investigation.
Remember, when using the Invoices Plus features, your application must be able to handle errors returned when attempting to create or update an invoice with custom fields. These premium features are available only with an Invoices Plus subscription. If an invoice contains an unsupported feature, your application must remove any premium features from the invoice and retry the request. Specifically, “custom_fields” must be empty or omitted.
This answer was reviewed by @Bryan-Square.