POST api/Vouchers

Creates a voucher.

Request Information

URI Parameters

None.

Body Parameters

The voucher model to create with.

AddVoucherDto
NameDescriptionTypeAdditional information
Description

string

Required

VoucherCode

string

Required

_StartDateDay

integer

None.

_StartDateMonth

integer

None.

_StartDateYear

integer

None.

_ExpiryDateDay

integer

None.

_ExpiryDateMonth

integer

None.

_ExpiryDateYear

integer

None.

StartDate

string

None.

ExpiryDate

string

None.

IsPercentageDiscount

boolean

None.

Entitlement

decimal number

None.

MinSpend

decimal number

None.

MaxSpend

decimal number

None.

MaxDiscount

decimal number

None.

AllUsers

boolean

None.

VoucherUsers

Collection of VoucherUserDto

None.

MinimumQuantity

integer

None.

VoucherProductType

string

None.

NewCustomerOnly

boolean

None.

VoucherProperties

Collection of VoucherPropertyDto

None.

Request Formats

application/json, text/json

Sample:
{
  "Description": "sample string 1",
  "VoucherCode": "sample string 2",
  "_StartDateDay": 1,
  "_StartDateMonth": 1,
  "_StartDateYear": 1,
  "_ExpiryDateDay": 1,
  "_ExpiryDateMonth": 1,
  "_ExpiryDateYear": 1,
  "StartDate": "sample string 3",
  "ExpiryDate": "sample string 4",
  "IsPercentageDiscount": true,
  "Entitlement": 6.0,
  "MinSpend": 1.0,
  "MaxSpend": 1.0,
  "MaxDiscount": 1.0,
  "AllUsers": true,
  "VoucherUsers": [
    {
      "UserId": "0a48b9d8-106f-425e-b6fc-9ae527d91069",
      "SingleUse": true,
      "ApplyAutomatically": true
    },
    {
      "UserId": "0a48b9d8-106f-425e-b6fc-9ae527d91069",
      "SingleUse": true,
      "ApplyAutomatically": true
    }
  ],
  "MinimumQuantity": 1,
  "VoucherProductType": "sample string 8",
  "NewCustomerOnly": true,
  "VoucherProperties": [
    {
      "Id": "32b00536-b39a-4293-a47c-547791b907e1",
      "CreationDateUtc": "2025-12-06T02:26:38.2852792+00:00",
      "VoucherId": 3,
      "Name": "sample string 4",
      "Value": "sample string 5",
      "Type": 0
    },
    {
      "Id": "32b00536-b39a-4293-a47c-547791b907e1",
      "CreationDateUtc": "2025-12-06T02:26:38.2852792+00:00",
      "VoucherId": 3,
      "Name": "sample string 4",
      "Value": "sample string 5",
      "Type": 0
    }
  ]
}

application/xml, text/xml

Sample:
<AddVoucherDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Aardvark.Pay.Models">
  <AllUsers>true</AllUsers>
  <Description>sample string 1</Description>
  <Entitlement>6</Entitlement>
  <ExpiryDate>sample string 4</ExpiryDate>
  <IsPercentageDiscount>true</IsPercentageDiscount>
  <MaxDiscount>1</MaxDiscount>
  <MaxSpend>1</MaxSpend>
  <MinSpend>1</MinSpend>
  <MinimumQuantity>1</MinimumQuantity>
  <NewCustomerOnly>true</NewCustomerOnly>
  <StartDate>sample string 3</StartDate>
  <VoucherCode>sample string 2</VoucherCode>
  <VoucherProductType>sample string 8</VoucherProductType>
  <VoucherProperties>
    <VoucherPropertyDto>
      <CreationDateUtc>2025-12-06T02:26:38.2852792+00:00</CreationDateUtc>
      <Id>32b00536-b39a-4293-a47c-547791b907e1</Id>
      <Name>sample string 4</Name>
      <Type>PrintingOptions</Type>
      <Value>sample string 5</Value>
      <VoucherId>3</VoucherId>
    </VoucherPropertyDto>
    <VoucherPropertyDto>
      <CreationDateUtc>2025-12-06T02:26:38.2852792+00:00</CreationDateUtc>
      <Id>32b00536-b39a-4293-a47c-547791b907e1</Id>
      <Name>sample string 4</Name>
      <Type>PrintingOptions</Type>
      <Value>sample string 5</Value>
      <VoucherId>3</VoucherId>
    </VoucherPropertyDto>
  </VoucherProperties>
  <VoucherUsers>
    <VoucherUserDto>
      <ApplyAutomatically>true</ApplyAutomatically>
      <SingleUse>true</SingleUse>
      <UserId>0a48b9d8-106f-425e-b6fc-9ae527d91069</UserId>
    </VoucherUserDto>
    <VoucherUserDto>
      <ApplyAutomatically>true</ApplyAutomatically>
      <SingleUse>true</SingleUse>
      <UserId>0a48b9d8-106f-425e-b6fc-9ae527d91069</UserId>
    </VoucherUserDto>
  </VoucherUsers>
  <_ExpiryDateDay>1</_ExpiryDateDay>
  <_ExpiryDateMonth>1</_ExpiryDateMonth>
  <_ExpiryDateYear>1</_ExpiryDateYear>
  <_StartDateDay>1</_StartDateDay>
  <_StartDateMonth>1</_StartDateMonth>
  <_StartDateYear>1</_StartDateYear>
</AddVoucherDto>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

None.