This API method management voucher codes.

This is a pure REST method. Behavior is determined by the HTTP verb used.

URL Endpoint

/voucher/{voucher_id}/{voucher_code}

Warning

This method is only accessible using a Hotelier API account.

1. GET

Returns information about the requested voucher code ( usage count, if it is enabled, if it is locked ).

A 404 is returned if voucher code does not exist.

2. POST or PUT

Creates a new voucher code for the specified voucher.

Returns 200 if created successfully.

Returns 500 if voucher could not be deleted.

Returns 409 if voucher code already exists.

Vouchers code can be associated with an arbitrary price modification. You can send a JSON body specifying the value, for example:

{
	"value": -50.0    // Discount of 50.00 ( currency )
}

3. DELETE

Deletes a voucher code.

Returns 200 if deleted successfully.

Returns 500 if voucher could not be deleted.

Returns 410 if the voucher code did not exist or was already deleted.