POST api/Products

Creates a product.

Request Information

URI Parameters

None.

Body Parameters

The product model to create with.

ProductDto
NameDescriptionTypeAdditional information
Id

globally unique identifier

None.

Name

string

Required

String length: inclusive between 0 and 250

ComplianceReference

string

String length: inclusive between 0 and 50

Description

string

None.

ProductCode

string

Required

String length: inclusive between 0 and 50

CreationDate

date

Required

ExpiryDate

date

None.

SortIndex

integer

None.

TemplateId

globally unique identifier

Required

IsRequired

boolean

Required

VatApplicable

boolean

None.

Request Formats

application/json, text/json

Sample:
{
  "Id": "46f0a46b-82b1-45cd-b0ab-aaca7551fa35",
  "Name": "sample string 2",
  "ComplianceReference": "sample string 3",
  "Description": "sample string 4",
  "ProductCode": "sample string 5",
  "CreationDate": "2026-01-11T17:52:58.0793973Z",
  "ExpiryDate": "2026-01-11T17:52:58.0793973Z",
  "SortIndex": 1,
  "TemplateId": "d35a43e0-f8f5-441f-bfa2-e0c5bf3b45f9",
  "IsRequired": true,
  "VatApplicable": true
}

application/xml, text/xml

Sample:
<ProductDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Aardvark.Template.Models">
  <ComplianceReference>sample string 3</ComplianceReference>
  <CreationDate>2026-01-11T17:52:58.0793973+00:00</CreationDate>
  <Description>sample string 4</Description>
  <ExpiryDate>2026-01-11T17:52:58.0793973+00:00</ExpiryDate>
  <Id>46f0a46b-82b1-45cd-b0ab-aaca7551fa35</Id>
  <IsRequired>true</IsRequired>
  <Name>sample string 2</Name>
  <ProductCode>sample string 5</ProductCode>
  <SortIndex>1</SortIndex>
  <TemplateId>d35a43e0-f8f5-441f-bfa2-e0c5bf3b45f9</TemplateId>
  <VatApplicable>true</VatApplicable>
</ProductDto>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'ProductDto'.

Response Information

Resource Description

globally unique identifier

Response Formats

application/json, text/json

Sample:
"dfcd9e57-56e2-457c-9c74-b3eab92a02f6"

application/xml, text/xml

Sample:
<guid xmlns="http://schemas.microsoft.com/2003/10/Serialization/">dfcd9e57-56e2-457c-9c74-b3eab92a02f6</guid>