which matches the example in the API documentation for line items, however I get the following error back from the API when submitting the request;
{
"status": "error",
"message": "Property values were not valid: [{\"isValid\":false,\"message\":\"The recurring billing duration '24' is not a valid billing duration\",\"error\":\"INVALID_RECURRING_BILLING_DURATION\",\"name\":\"hs_recurring_billing_period\"}]",
"correlationId": "5812b210-c246-435f-a17a-d7c9abf0ed28",
"category": "VALIDATION_ERROR"
}
I've tried variations for the billing period field including setting different numbers (e.g. 2, 12, etc) and also setting it as a number rather than a string but get the same result regardless.
I know it's not well documented, and the Line Items API should actually be fixed for this, but the error you are receiving is correct. "24" is actually not a valid recurring billing duration value. If you go and perform a request at the GET/crm/v3/objects/line_items endpoint you will see that recurring billing duration is actually supposed to be of the format "P24M". So it should be a string "P(Insert an integer here)M" and that is the proper value for that field.
✔️ Was I able to help answer your question? Help the community by marking it as a solution.
I know it's not well documented, and the Line Items API should actually be fixed for this, but the error you are receiving is correct. "24" is actually not a valid recurring billing duration value. If you go and perform a request at the GET/crm/v3/objects/line_items endpoint you will see that recurring billing duration is actually supposed to be of the format "P24M". So it should be a string "P(Insert an integer here)M" and that is the proper value for that field.
✔️ Was I able to help answer your question? Help the community by marking it as a solution.
Unable to set billing period on line items via the API
SOLVE
Is there a way to escalate this to someone to update the documentation? This was pointed out almost a year ago now and it's just tripped me over because the documentation is still wrong.
Unable to set billing period on line items via the API
SOLVE
I believe so @IWebster, though I am unsure if any other units are supported, though it wouldn't be hard to test. In my quick looking around all of my line items are off the form "P#M" no other letters that I can see, though it wouldn't hurt to do a quick test.
✔️ Was I able to help answer your question? Help the community by marking it as a solution.