PUT api/vouchers/{id}

Updates a voucher.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

The id of the voucher to update.

integer

Required

Body Parameters

The voucher model to update with.

VoucherDto
NameDescriptionTypeAdditional information
Id

integer

None.

Description

string

None.

VoucherCode

string

None.

TenantId

string

None.

StartDate

date

None.

ExpiryDate

date

None.

Cancelled

boolean

None.

IsPercentageDiscount

boolean

None.

Entitlement

decimal number

None.

MinSpend

decimal number

None.

MaxSpend

decimal number

None.

MaxDiscount

decimal number

None.

ForAllUsers

boolean

None.

Deleted

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:
{
  "Id": 1,
  "Description": "sample string 2",
  "VoucherCode": "sample string 3",
  "TenantId": "sample string 4",
  "StartDate": "2025-12-06T02:26:38.7071668+00:00",
  "ExpiryDate": "2025-12-06T02:26:38.7071668+00:00",
  "Cancelled": true,
  "IsPercentageDiscount": true,
  "Entitlement": 7.0,
  "MinSpend": 1.0,
  "MaxSpend": 1.0,
  "MaxDiscount": 1.0,
  "ForAllUsers": true,
  "Deleted": true,
  "VoucherUsers": [
    {
      "UserId": "86dcf49c-05a9-47a1-bce0-414685354aa4",
      "SingleUse": true,
      "ApplyAutomatically": true
    },
    {
      "UserId": "86dcf49c-05a9-47a1-bce0-414685354aa4",
      "SingleUse": true,
      "ApplyAutomatically": true
    }
  ],
  "MinimumQuantity": 1,
  "VoucherProductType": "sample string 10",
  "NewCustomerOnly": true,
  "VoucherProperties": [
    {
      "Id": "f34be13f-0321-4eb9-a458-e2b534ec9eee",
      "CreationDateUtc": "2025-12-06T02:26:38.7071668+00:00",
      "VoucherId": 3,
      "Name": "sample string 4",
      "Value": "sample string 5",
      "Type": 0
    },
    {
      "Id": "f34be13f-0321-4eb9-a458-e2b534ec9eee",
      "CreationDateUtc": "2025-12-06T02:26:38.7071668+00:00",
      "VoucherId": 3,
      "Name": "sample string 4",
      "Value": "sample string 5",
      "Type": 0
    }
  ]
}

application/xml, text/xml

Sample:
<VoucherDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Aardvark.Pay.Models">
  <Cancelled>true</Cancelled>
  <Deleted>true</Deleted>
  <Description>sample string 2</Description>
  <Entitlement>7</Entitlement>
  <ExpiryDate>2025-12-06T02:26:38.7071668+00:00</ExpiryDate>
  <ForAllUsers>true</ForAllUsers>
  <Id>1</Id>
  <IsPercentageDiscount>true</IsPercentageDiscount>
  <MaxDiscount>1</MaxDiscount>
  <MaxSpend>1</MaxSpend>
  <MinSpend>1</MinSpend>
  <MinimumQuantity>1</MinimumQuantity>
  <NewCustomerOnly>true</NewCustomerOnly>
  <StartDate>2025-12-06T02:26:38.7071668+00:00</StartDate>
  <TenantId>sample string 4</TenantId>
  <VoucherCode>sample string 3</VoucherCode>
  <VoucherProductType>sample string 10</VoucherProductType>
  <VoucherProperties>
    <VoucherPropertyDto>
      <CreationDateUtc>2025-12-06T02:26:38.7071668+00:00</CreationDateUtc>
      <Id>f34be13f-0321-4eb9-a458-e2b534ec9eee</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.7071668+00:00</CreationDateUtc>
      <Id>f34be13f-0321-4eb9-a458-e2b534ec9eee</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>86dcf49c-05a9-47a1-bce0-414685354aa4</UserId>
    </VoucherUserDto>
    <VoucherUserDto>
      <ApplyAutomatically>true</ApplyAutomatically>
      <SingleUse>true</SingleUse>
      <UserId>86dcf49c-05a9-47a1-bce0-414685354aa4</UserId>
    </VoucherUserDto>
  </VoucherUsers>
</VoucherDto>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

None.