Generate a huggg voucher

Overview

POST /api/v2/hugggs/{hugggId}/voucher/claimed

This endpoint is used to generate a voucher for a huggg. If a voucher already exists for the huggg it will be returned.

Request

URL Parameters

Key Value Description
hugggId string The ID or shortcode of the huggg that you want a voucher for

Data Parameters

Key Value Description
segmentId (optional) string If provided, this generates a voucher for the given segment

Examples

Generate a huggg voucher

POST /api/v2/hugggs/{hugggId}/voucher/claimed

Generate a huggg voucher with segment

POST /api/v2/hugggs/{hugggId}/voucher/claimed

{
    "segmentId": "a_segment_id"
}

Response

The successful response returns a Voucher V2 entity.

HTTP/1.1 200 OK

{
    "voucherType": "wegift",
    "segment": {
        "id": "b6zfA70H4XguvjtZauial",
        "name": "This is a segment",
        "voucherType": "wegift",
        "expiry": 1000,
        "configuration": {
            ...
        }
    },
    "expiresAt": "2020-07-01T00:00:00.000Z",
    "data": [
        {
            "type": "qr",
            "label": "Scan me!",
            "value": "619421851736374"
        },
        {
            "type": "alpha/qr",
            "label": "",
            "value": "619421851736374"
        },
        {
            "type": "alpha/pin",
            "label": "Pin",
            "value": "48739"
        }
    ],
    "dateCreated": "2019-07-01T15:16:58.560Z",
    "dateModified": "2019-07-01T15:16:58.560Z",
    "hugggId": "a_huggg_id"
}