POST api/couponcodes/Generate

Generate unique codes for the given campaign

Request Information

URI Parameters

None.

Body Parameters

Specify the count and the expiry date of the codes

generatecodesarguments
NameDescriptionTypeAdditional information
campaignid

The campaing id for which the codes have to be generated

string

None.

count

The number of unique codes that have to be generated

integer

None.

expirationdate

The expiration date of the generated codes, optional

date

None.

licenceplate

The licenceplate to generate the code(s) for, optional

string

None.

Request Formats

application/json, text/json

Sample:
{
  "campaignid": "sample string 1",
  "count": 2,
  "expirationdate": "2024-11-24T12:50:00.2031657+01:00",
  "licenceplate": "sample string 3"
}

application/xml, text/xml

Sample:
<generatecodesarguments xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TechnoDataSystems.Enterprise.TotalWash.Web.API">
  <campaignid>sample string 1</campaignid>
  <count>2</count>
  <expirationdate>2024-11-24T12:50:00.2031657+01:00</expirationdate>
  <licenceplate>sample string 3</licenceplate>
</generatecodesarguments>

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 'generatecodesarguments'.

Response Information

Resource Description

An array of unique coupon codes

generatecodesresult
NameDescriptionTypeAdditional information
success

Indicates if the action was successfull

boolean

None.

remark

A description regarding the result

string

None.

codes

Returns an array of the generated unique codes

Collection of string

None.

Response Formats

application/json, text/json

Sample:
{
  "success": true,
  "remark": "sample string 2",
  "codes": [
    "sample string 1",
    "sample string 2"
  ]
}

application/xml, text/xml

Sample:
<generatecodesresult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TechnoDataSystems.Enterprise.TotalWash.Web.API">
  <codes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </codes>
  <remark>sample string 2</remark>
  <success>true</success>
</generatecodesresult>