Modifier

Partager via


Create itemVariants

Create a itemVariant object in Business Central.

HTTP request

Replace the URL prefix for Business Central depending on environment following the guideline.

POST businesscentralPrefix/companies({id})/itemVariants({id})
POST businesscentralPrefix/companies({id})/items({id})/itemVariants({id})

Request headers

Header Value
Authorization Bearer {token}. Required.
Content-Type application/json
If-Match Required. When this request header is included and the eTag provided does not match the current tag on the itemVariant, the itemVariant will not be updated.

Request body

In the request body, supply a JSON representation of itemVariants object.

Response

If successful, this method returns 201 Created response code and a itemVariants object in the response body.

Example

Request

Here is an example of a request.

POST https://{businesscentralPrefix}/api/v2.0/companies({id})/itemVariants
Content-type: application/json

{
    "id": "c12af665-c1e3-ea11-aa60-000d3ad7cacb",
    "itemId": "fca5738a-44e3-ea11-bb43-000d3a2feca1",
    "itemNumber": "1896-S",
    "code": "TESTCRUD",
    "description": "test crud"
}

Response

Here is an example of the response.

HTTP/1.1 201 Created
Content-type: application/json

{
    "id": "c12af665-c1e3-ea11-aa60-000d3ad7cacb",
    "itemId": "fca5738a-44e3-ea11-bb43-000d3a2feca1",
    "itemNumber": "1896-S",
    "code": "TESTCRUD",
    "description": "test crud"
}

Tips for working with the APIs
itemvariant
Get itemvariant
Delete itemvariant
Update itemvariant