Vouchers
Add Voucher
post /sites/{siteid}/vouchersDetermines what identifier to use for products in the endpoint. Default is product ID.
- sku
- productid
{ "vouchertype": 200, "vouchername": "Resellers", "value_x": 30}
4
HTTP Status Code Summary | |
---|---|
200 | Returns voucherid |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Get Vouchers
get /sites/{siteid}/vouchersThe index of the item to start from
The number of items returned
Comma separated list of fields to return. Use this to query only the fields you are using. See Voucher for all fields.
Determines what identifier to use for products in the endpoint. Default is product ID.
- sku
- productid
{ "totalcount": 3, "items": [ { "voucherid": 1, "vouchername": "Spring Sale", "datecreated": 1462953900, "vouchertype": 110, "voucherstate": 10 }, { "voucherid": 2, "vouchername": "10% Off", "datecreated": 1462954020, "vouchertype": 210, "voucherstate": 10 }, { "voucherid": 3, "vouchername": "$10 Off", "datecreated": 1462954020, "vouchertype": 200, "voucherstate": 10 } ]}
HTTP Status Code Summary | |
---|---|
200 | Returns an envelope with items of type Voucher. |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Get Voucher
get /sites/{siteid}/vouchers/{voucherid}Determines what identifier to use for products in the endpoint. Default is product ID.
- sku
- productid
{ "voucherid": 4, "active": true, "activepos": true, "vouchercode": "", "voucherpassword": "", "vouchername": "Resellers", "vouchercomment": "", "voucherterms": "", "datecreated": 1550669774, "datestart": null, "dateend": null, "tags": [], "vouchertype": 200, "value_x": 30, "value_y": null, "value_z": null, "money_m": null, "money_n": null, "vouchername1": null, "vouchercode1": null, "vouchername2": null, "vouchercode2": null, "maxuses": null, "priority": 3, "pricelisttags": null, "vouchergrouptype": 20, "voucherstate": 10, "products": [], "productoptions": [], "discountoptions": []}
HTTP Status Code Summary | |
---|---|
200 | Returns an item of type Voucher. |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Update Voucher
put /sites/{siteid}/vouchers/{voucherid}Determines what identifier to use for products in the endpoint. Default is product ID.
- sku
- productid
{ "vouchername": "Voucher for Resellers"}
true
HTTP Status Code Summary | |
---|---|
200 | Returns true |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Delete Voucher
delete /sites/{siteid}/vouchers/{voucherid}true
HTTP Status Code Summary | |
---|---|
200 | Returns true |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Objects
Moneystring
ProductAttributeMappingobject
Object with product custom attribute IDs as property names with an array of string (attribute values) that will be used to identify products for voucher.
Timestampinteger
Number of seconds since the Unix Epoch.
Voucherobject
Vouchers are used for creating campaigns.
The ID of the voucher.
If true then this voucher is active in the webshop.
If true then this voucher is active in the POS.
Code used for this voucher. (Used for grouping vouchers in reports and stats)
Optional password used for this voucher.
Name of this voucher.
Internal description for this voucher.
Terms for this voucher.
The date this voucher was created.
The start date for the validity of this voucher. No start date if value is null.
The end date for the validity of this voucher. No end date if value is null.
The tags for this voucher. If added, then the voucher will only be applied for stores with the same tags.
Voucher Type
The X value (integer) used for calculations on the voucher.
The Y value (integer) used for calculations on the voucher.
The Z value (integer) used for calculations on the voucher.
The M value (money) used for calculations on the voucher.
The N value (money) used for calculations on the voucher.
The vouchername used when voucher of type ProductBuy3For2Or2For1AndAHalf has triggered a 3 for 2 discount.
The vouchercode used when voucher of type ProductBuy3For2Or2For1AndAHalf has triggered a 3 for 2 discount.
The vouchername used when voucher of type ProductBuy3For2Or2For1AndAHalf has triggered a 2 for 1.5 discount.
The vouchercode used when voucher of type ProductBuy3For2Or2For1AndAHalf has triggered a 2 for 1.5 discount.
The maximum number of times the voucher can be applied for a purchase.
The priority of the voucher where 1 is highest and 5 is lowest.
These tags are used to activate price lists with the same tags.
The group type for the voucher. Implicit value depending on the vouchertype.
Voucher state.
An array of product IDs (integer) or SKUs (string). The type is depending on the product_identifier
query parameter.
One of |
---|
integer |
string |
Definition of which products that this voucher should be applied for. Only valid for vouchers with grouptype Order
and Product
.
Product custom attributes matching the set of products that should be included for this voucher.
Product custom attributes matching the set of products that should be excluded for this voucher. Any products in this set will have precedence over the include
set.
An array of VoucherProductOption used for vouchers of Package group type. Each option of the array must be fulfilled for the voucher to be applied.
An array of VoucherDiscountOption used for vouchers of type ProductBuyXGetDiscountList
and ProductBuyForMGetDiscountList
. Each discount option can be used if the products required to meet the conditions have been added to the cart.
If true, then the calculation will be done on top of already discounted prices enabled from a price lists campaign. Only valid for vouchers with grouptype Product
.
VoucherDiscountOptionobject
Used for defining an option for vouchers of type ProductBuyXGetDiscountList
and ProductBuyForMGetDiscountList
. When applying a discount option on a set of products (target). Only one of the parameters moneyprice
, moneydiscount
, moneydiscounttotal
and decimaldiscount
will be used, so only one of them should be set. If for some reason more than one of these properties has a value, the first one in priority order will be used (see each property for priority).
The maximum quantity of products that this discount option can be applied to. If more than num
products are available to give discount on, then the products will be selected by price in reverse order (highest price first).
An optional array of product IDs (integer) or SKUs (string) that determine which products that this option should give discounts on (target products). The type is depending on the product_identifier
query parameter.
One of |
---|
integer |
string |
Definition of which products that this option should give discounts on (target products).
Product custom attributes matching the set of products that should be included for this discount option.
Product custom attributes matching the set of products that should be excluded for this discount option. Any products in this set will have precedence over the include
set.
If set, this is the new price to use for each product in the target group (prio 3).
If set, this is the discount given per item in the target group (prio 2).
If set, this is the total discount given for all items in the target group (prio 1).
If set, this is the percentage given for all items in the target group (prio 4).
VoucherGroupTypeinteger
10
Order - The voucher is applied to the entire purchase with some exceptions20
Product - The voucher is applied to the products that are connected to it30
Package - The voucher is applied to a specific combination of products in a package40
Pricelist - The voucher activates certain price lists using tags
VoucherProductOptionobject
Used for defining an option for vouchers of "Package" type.
The number of products for this option that has to exists in the cart for the option to be fulfilled.
An array of product IDs (integer) or SKUs (string) representing this option. The type is depending on the product_identifier
query parameter.
One of |
---|
integer |
string |
VoucherStateinteger
10
Active20
Planned30
Inactive
VoucherTypeinteger
100
OrderDiscountM - Money discount proportionally distributed on all items in purchase110
OrderDiscountX - Percentage discount on all items in purchase120
OrderBuyForMGetDiscountN - Buy for M (money) get N discount (money)200
ProductDiscountM - Money discount per product210
ProductDiscountX - Percentage discount per product220
ProductBuyXForPriceM - Buy X (quantity) for M (money)230
ProductBuyXPayForY - Buy X (quantity) pay for Y (quantity)240
ProductBuyXPayForYDiscountZRest - Buy X (quantity) pay for Y (quantity) and get rest at discount Z (percentage)250
ProductBuyMinXDiscountY - Buy minimum X (quantity) and get discount Y (percentage)260
ProductBuyXGetDiscountList - Buy X (quantity) get discounts on target products defined in discount options265
ProductBuyForMGetDiscountList - Buy for M (money) get discounts on target products defined in discount options270
ProductBuy3For2Or2For1AndAHalf - Buy 3, pay for 2, or buy 2, pay for 1.5300
PackageBuyForPriceM - Buy product package for M (money)310
PackageDiscountX - Buy product package get discount X (percentage)320
PackageDiscountM - Buy product package get discount M (money)400
PricelistActivate - Activate price lists with selected tags410
PricelistActivateFinal - Activate price lists with selected tags, and set items to not be included for other vouchers