PUT api/Vouchers/CreateVoucher

Allows a voucher to be updated or created by passing an APIVoucher within the body, containing the valid details to create or update.

Request Information

URI Parameters

None.

Body Parameters

The APIVoucher object to be updated or created as a voucher.

APIVoucher
NameDescriptionTypeAdditional information
VoucherCode

string

None.

Description

string

None.

Amount

decimal number

None.

CriteriaType

eCriteriaType

None.

CriteriaValue

integer

None.

ApplicationPerSale

eApplicationPerSale

None.

MultipleApplications

eMultipleApplications

None.

UsedInConjunction

eUsedInConjuction

None.

AllowNegativeTotal

eAllowNegativeTotal

None.

DiscountType

eDiscountType

None.

StartDate

date

None.

EndDate

date

None.

Request Formats

application/json, text/json

Sample:
{"VoucherCode":"","Description":"","Amount":0.0,"CriteriaType":0,"CriteriaValue":0,"ApplicationPerSale":0,"MultipleApplications":0,"UsedInConjunction":0,"AllowNegativeTotal":0,"DiscountType":0,"StartDate":"0001-01-01T00:00:00","EndDate":"0001-01-01T00:00:00"}

application/xml, text/xml

Sample:
<?xml version="1.0" encoding="utf-16"?>
<Vouchers xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <VoucherCode />
  <Description />
  <Amount>0</Amount>
  <CriteriaType>ctPLU</CriteriaType>
  <CriteriaValue>0</CriteriaValue>
  <ApplicationPerSale>apsPerValidItem</ApplicationPerSale>
  <MultipleApplications>maYes</MultipleApplications>
  <UsedInConjunction>ucYes</UsedInConjunction>
  <AllowNegativeTotal>antYes</AllowNegativeTotal>
  <DiscountType>Percentage</DiscountType>
  <StartDate>0001-01-01T00:00:00</StartDate>
  <EndDate>0001-01-01T00:00:00</EndDate>
</Vouchers>

Response Information

Resource Description

HttpResponseMessage
NameDescriptionTypeAdditional information
Version

Version

None.

Content

HttpContent

None.

StatusCode

HttpStatusCode

None.

ReasonPhrase

string

None.

Headers

Collection of Object

None.

RequestMessage

HttpRequestMessage

None.

IsSuccessStatusCode

boolean

None.

Response Formats

application/json, text/json

Sample:
{"Result":"SUCCESS","Message":"The Voucher: Test Voucher has been saved under code: 001"}

application/xml, text/xml

Sample:
<?xml version="1.0" encoding="utf-16"?>
<InformationResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Result>SUCCESS</Result>
  <Message>The Voucher: Test Voucher has been saved under code: 001</Message>
</InformationResponse>