Getting "client id is invalid: in response when creating invoice using API

API: POST - /api/v1/invoices
Request : {
“assigned_user_id”: “”,
“client_id”: “1”,
“number”: “”,
“po_number”: “”,
“terms”: “”,
“public_notes”: “”,
“private_notes”: “”,
“footer”: “”,
“custom_value1”: “”,
“custom_value2”: “”,
“custom_value3”: “”,
“custom_value4”: “”,
“tax_name1”: “”,
“tax_name2”: “”,
“tax_rate1”: “”,
“tax_rate2”: “”,
“tax_name3”: “”,
“tax_rate3”: “”,
“line_items”:"",
“discount”: “”,
“partial”: “”,
“is_amount_discount”: 0,
“uses_inclusive_taxes”: 0,
“date”: “2021-11-26”,
“partial_due_date”: “”,
“due_date”: “2021-12-31”,
“custom_surcharge1”: “”,
“custom_surcharge2”: “”,
“custom_surcharge3”: “”,
“custom_surcharge4”: “”
}

Response:

{
“message”: “The given data was invalid.”,
“errors”: {
“client_id”: [
“The selected client id is invalid.”
]
}
}

Even passing the right client id gets this error.
Kindly suggest.

Hi,

In the sample above you’re passing 1 as the id, in v5 the ids are alphanumeric.

Thank you for your reply.

From where alphanumeric ids I can be found in the system? it’s stored in DB?

Can you please give example?

You can send a GET request to /clients to see the ids.

Thank you… !! @hillel