CREATES a new preallocated voucher with ``amount`` vingd cents reserved
        until ``expires``.
        
        :type amount: ``bigint``
        :param amount:
            Voucher amount in vingd cents.
        :type expires: ``datetime``/``dict``
        :param expires:
            Voucher expiry timestamp, absolute (``datetime``) or relative
            (``dict``). Valid keys for relative expiry timestamp dictionary are
            same as keyword arguments for `datetime.timedelta` (``days``,
            ``seconds``, ``minutes``, ``hours``, ``weeks``). Default:
            `Vingd.EXP_VOUCHER`.
        :type message: ``string``
        :param message:
            Short message displayed to user when she redeems the voucher on
            Vingd frontend.
        :type gid: ``alphanum(32)``
        :param gid:
            Voucher group id. An user can redeem only one voucher per group.
        
        :rtype: ``dict``
        :returns:
            Created voucher description::
                
                voucher = {
                    'vid': <voucher_integer_id>,
                    'vid_encoded': <voucher_string_id>,
                    'amount_allocated': <int_cents | None if not allocated>,
                    'amount_vouched': <int_cents>,
                    'id_fort_transfer': <id_of_allocating_transfer |
                                         None if not allocated>,
                    'fee': <int_cents>,
                    'uid_from': <source_account_uid>,
                    'uid_proxy': <broker_id>,
                    'uid_to': <destination_account_id | None if not given>,
                    'gid': <voucher_group_id | None if undefined>,
                    'ts_valid_until': <iso8601_timestamp_absolute>,
                    'description': <string | None>,
                    'message': <string | None>
                }
            
            combined with voucher redeem urls on Vingd frontend.
        
        :raises GeneralException:
        
        :resource: ``vouchers/``
        :access: authorized users (ACL flag: ``voucher.add``)

def create_voucher(self, amount, expires=None, message='', gid=None):
        """
        CREATES a new preallocated voucher with ``amount`` vingd cents reserved
        until ``expires``.
        
        :type amount: ``bigint``
        :param amount:
            Voucher amount in vingd cents.
        :type expires: ``datetime``/``dict``
        :param expires:
            Voucher expiry timestamp, absolute (``datetime``) or relative
            (``dict``). Valid keys for relative expiry timestamp dictionary are
            same as keyword arguments for `datetime.timedelta` (``days``,
            ``seconds``, ``minutes``, ``hours``, ``weeks``). Default:
            `Vingd.EXP_VOUCHER`.
        :type message: ``string``
        :param message:
            Short message displayed to user when she redeems the voucher on
            Vingd frontend.
        :type gid: ``alphanum(32)``
        :param gid:
            Voucher group id. An user can redeem only one voucher per group.
        
        :rtype: ``dict``
        :returns:
            Created voucher description::
                
                voucher = {
                    'vid': <voucher_integer_id>,
                    'vid_encoded': <voucher_string_id>,
                    'amount_allocated': <int_cents | None if not allocated>,
                    'amount_vouched': <int_cents>,
                    'id_fort_transfer': <id_of_allocating_transfer |
                                         None if not allocated>,
                    'fee': <int_cents>,
                    'uid_from': <source_account_uid>,
                    'uid_proxy': <broker_id>,
                    'uid_to': <destination_account_id | None if not given>,
                    'gid': <voucher_group_id | None if undefined>,
                    'ts_valid_until': <iso8601_timestamp_absolute>,
                    'description': <string | None>,
                    'message': <string | None>
                }
            
            combined with voucher redeem urls on Vingd frontend.
        
        :raises GeneralException:
        
        :resource: ``vouchers/``
        :access: authorized users (ACL flag: ``voucher.add``)
        """
        expires = absdatetime(expires, default=self.EXP_VOUCHER).isoformat()
        voucher = self.request('post', 'vouchers/', json.dumps({
            'amount': amount,
            'until': expires,
            'message': message,
            'gid': gid
        }))
        return {
            'raw': voucher,
            'urls': {
                'redirect': urljoin(self.usr_frontend, '/vouchers/%s' % voucher['vid_encoded']),
                'popup': urljoin(self.usr_frontend, '/popup/vouchers/%s' % voucher['vid_encoded'])
            }
        }