POST WebVouchers/CreateVoucher
This call is used to create a web voucher
Request Information
URI Parameters
None.
Body Parameters
CreateVoucherCommandName | Type | Description | Additional information |
---|---|---|---|
SiteID | integer |
Required |
|
VoucherExpires | boolean |
True if the voucher expires, vouchers that don't expire have the same solddate and expirydate |
Required |
ExpiryDate | date |
If the voucher expires and the expiry date is left empty then the default voucher expiry date is used (from system settings), otherwise a custom expiry date |
|
SerialNumber | string |
If left blank then a guid will be auto generated, if inserting custom serial numbers will throw errors if serial number already exists |
|
Value | decimal number |
Voucher Value e.g. 5.50 -> £5.50 |
Required |
Notes | string |
Optional Notes |
Request Formats
application/json, text/json
Sample:
{ "SiteID": 1, "VoucherExpires": true, "ExpiryDate": "2024-11-21T06:28:45.7521945+00:00", "SerialNumber": "sample string 1", "Value": 1.0, "Notes": "sample string 2" }
application/xml, text/xml
Sample:
<CreateVoucherCommand xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Tevalis.API.Core.Models.WebVouchers.Commands"> <ExpiryDate xmlns="http://schemas.datacontract.org/2004/07/Tevalis.Enterprise.Core.Models.Commands">2024-11-21T06:28:45.7521945+00:00</ExpiryDate> <Notes xmlns="http://schemas.datacontract.org/2004/07/Tevalis.Enterprise.Core.Models.Commands">sample string 2</Notes> <SerialNumber xmlns="http://schemas.datacontract.org/2004/07/Tevalis.Enterprise.Core.Models.Commands">sample string 1</SerialNumber> <SiteID xmlns="http://schemas.datacontract.org/2004/07/Tevalis.Enterprise.Core.Models.Commands">1</SiteID> <Value xmlns="http://schemas.datacontract.org/2004/07/Tevalis.Enterprise.Core.Models.Commands">1</Value> <VoucherExpires xmlns="http://schemas.datacontract.org/2004/07/Tevalis.Enterprise.Core.Models.Commands">true</VoucherExpires> </CreateVoucherCommand>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
WebVoucherDtoName | Type | Description | Additional information |
---|---|---|---|
WebVoucherId | integer |
None. |
|
SerialNumber | string |
None. |
|
DateSold | date |
None. |
|
ExpiryDate | date |
None. |
|
Value | decimal number |
None. |
|
Notes | string |
None. |
Response Formats
application/json, text/json
Sample:
{ "WebVoucherId": 1, "SerialNumber": "sample string 2", "DateSold": "2024-11-21T06:28:45.7521945+00:00", "ExpiryDate": "2024-11-21T06:28:45.7521945+00:00", "Value": 5.0, "Notes": "sample string 6" }
application/xml, text/xml
Sample:
<WebVoucherDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Tevalis.API.Core.WebVouchers.Dto"> <DateSold>2024-11-21T06:28:45.7521945+00:00</DateSold> <ExpiryDate>2024-11-21T06:28:45.7521945+00:00</ExpiryDate> <Notes>sample string 6</Notes> <SerialNumber>sample string 2</SerialNumber> <Value>5</Value> <WebVoucherId>1</WebVoucherId> </WebVoucherDto>