Send docname on creation via API

I want to create a Purchase Invoice via API, by sending his “name” on the JSON data.

eg.

    {
    "name": "ACC-PINV-2021-00009",
    "docstatus": 1,
    "supplier": "test",
    "tax_id": "xxxxxxxxx",
    "posting_date": "2021-04-21",
    "due_date": "2021-04-21",
    "bill_no": "4345",
    "items": [
        {
            "item_code": "test",
            "qty": 1,
            "rate": 7500,
            "expense_account": "620703 - test- xx"
        }
    ],
    "credit_to": "210201 - test - xx"
}

but the name s taking it by the last Purchase Invoice created in the system.
Is there something that I’m doing wrong? or there is some workarround?