Exemplary Workflows

Here's what you can do with vouchers in Voucherify

Simple Coupon Campaign

1. Create voucher

{
    "category": "New Customers",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
        "percent_off": 10.0,
        "type": "PERCENT",
        "effect": "APPLY_TO_ORDER"
    },
    "start_date": "2021-01-01T00:00:00Z",
    "expiration_date": "2021-12-31T23:59:59Z",
    "redemption": {
        "quantity": 100 
    },
    "metadata": {
      "test": true,
      "locale": "de-en"
    }
}

// POST https://api.voucherify.io/v1/vouchers/sample10off
{
    "id": "v_njn6RSORBuMPKVYaEi882HGaogpcmIzm",
    "code": "sample10off",
    "campaign": null,
    "campaign_id": null,
    "category": "New Customers",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
        "type": "PERCENT",
        "percent_off": 10,
        "effect": "APPLY_TO_ORDER"
    },
    "gift": null,
    "loyalty_card": null,
    "start_date": "2021-01-01T00:00:00.000Z",
    "expiration_date": "2021-12-31T23:59:59.000Z",
    "validity_timeframe": null,
    "validity_day_of_week": null,
    "active": true,
    "additional_info": null,
    "metadata": {
        "test": true,
        "locale": "de-en"
    },
    "assets": {
        "qr": {
            "id": "U2FsdGVkX19CP5Kbzog5YN/AAJhOc/PAEUWiBhcrQdCyG/pgE0CtjZ+4WKKsloaHeV9L56K7vh+Rk4FY7k7/w8ZQdOCCeNbSH/r/m/D02Wo6xWSesp5h4Ke80yierRHwjzES45KrxEWHrPakIqzmsA==",
            "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19CP5Kbzog5YN%2FAAJhOc%2FPAEUWiBhcrQdCyG%2FpgE0CtjZ%2B4WKKsloaHeV9L56K7vh%2BRk4FY7k7%2Fw8ZQdOCCeNbSH%2Fr%2Fm%2FD02Wo6xWSesp5h4Ke80yierRHwjzES45KrxEWHrPakIqzmsA%3D%3D"
        },
        "barcode": {
            "id": "U2FsdGVkX1+TtEEGsVCq5gBYMBgpl2J3Bpyc9Z4mWzS5LR1S/vnWP9SS37tM8eM2gA6dXto8JWFj+so+Eg1JAlxuE9Ur+DXqcQqDopmmoLxTTJBHYeFY/0VLQYpVfW9B0uMYkUNZEPb21KUyMFNr6A==",
            "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BTtEEGsVCq5gBYMBgpl2J3Bpyc9Z4mWzS5LR1S%2FvnWP9SS37tM8eM2gA6dXto8JWFj%2Bso%2BEg1JAlxuE9Ur%2BDXqcQqDopmmoLxTTJBHYeFY%2F0VLQYpVfW9B0uMYkUNZEPb21KUyMFNr6A%3D%3D"
        }
    },
    "is_referral_code": false,
    "created_at": "2021-10-07T09:35:34.734Z",
    "updated_at": null,
    "redemption": {
        "quantity": 100,
        "redeemed_quantity": 0,
        "object": "list",
        "url": "/v1/vouchers/sample10off/redemptions?page=1&limit=10"
    },
    "publish": {
        "object": "list",
        "count": 0,
        "url": "/v1/vouchers/sample10off/publications?page=1&limit=10"
    },

In response, the API returns details of newly created standalone code.

Read more:

📘

Create vouchers and campaigns

We highly recommend creating campaigns and vouchers using the dashboard and a user-fiendly Campaign Manager.

2. Validate Voucher
At any point in time, you can validate a selected voucher to find out if the voucher is eligible for the given customer/order and to learn what discount it carries.

Validation can only be performed via API.

// POST https://api.voucherify.io/v1/vouchers/sample10off/validate
{
    "customer": {
        "source_id": "[email protected]",
        "name": "Nana Lemon",
        "email": "[email protected]"
    },
    "metadata": {
        "payment_method": "PayPal",
        "shipping-zone": "EU-Spain"  
    },
    "order": {
        "amount": 200000,
        "items": [
            {
                "source_id": "apple534",
                "product_id": "prod_anJ03RZZq74z4v",
                "related_object": "product",
                "quantity": 2,
                "price": 50000,
                "product": {
                    "override": true,
                    "name": "Apple iPhone 8",
                    "metadata": {
                        "shop": "citycenter",
                        "category": "electronics"
                    }
                },
                "metadata": {
                    "series": "2022-783CV"
                }
            },
            {
                "sku_id": "sku_0KtP4rvwEECQ2U",
                "source_id": "apple534-ihd5",
                "related_object": "sku",
                "quantity": 1,
                "price": 100000,
                "sku": {
                    "override": true,
                    "sku": "Apple iPad 10 Silver 64GB",
                    "metadata": {
                        "category": "electronics"
                    }
                }
            }
        ]
    }
}
{
    "valid": true,
    "applicable_to": {
        "data": [],
        "total": 0,
        "data_ref": "data",
        "object": "list"
    },
    "inapplicable_to": {
        "data": [],
        "total": 0,
        "data_ref": "data",
        "object": "list"
    },
    "tracking_id": "track_otz3irNtDcvoZO+7uwUGiSTTeJ0BnNFq",
    "order": {
        "amount": 200000,
        "discount_amount": 20000,
        "total_discount_amount": 20000,
        "total_amount": 180000,
        "applied_discount_amount": 20000,
        "total_applied_discount_amount": 20000,
        "items": [
            {
                "object": "order_item",
                "source_id": "apple534",
                "related_object": "product",
                "product_id": "prod_anJ03RZZq74z4v",
                "quantity": 2,
                "amount": 100000,
                "price": 50000,
                "subtotal_amount": 100000,
                "product": {
                    "id": "prod_09eb7c37e98a86267e",
                    "source_id": "prod_anJ03RZZq74z4v",
                    "name": "Apple iPhone 8",
                    "metadata": {
                        "shop": "citycenter",
                        "category": "electronics"
                    },
                    "override": true
                },
                "metadata": {
                    "series": "2022-783CV"
                }
            },
            {
                "object": "order_item",
                "source_id": "apple534-ihd5",
                "related_object": "sku",
                "sku_id": "sku_0KtP4rvwEECQ2U",
                "quantity": 1,
                "amount": 100000,
                "price": 100000,
                "subtotal_amount": 100000,
                "sku": {
                    "sku": "Apple iPad 10 Silver 64GB",
                    "metadata": {
                        "category": "electronics"
                    },
                    "override": true
                }
            }
        ],
        "customer_id": null,
        "referrer_id": null,
        "object": "order"
    },
    "code": "sample10off",
    "discount": {
        "type": "PERCENT",
        "percent_off": 10,
        "effect": "APPLY_TO_ORDER"
    },
    "start_date": "2021-01-01T00:00:00.000Z",
    "expiration_date": "2021-12-31T23:59:59.000Z",
    "metadata": {
        "test": true,
        "locale": "de-en"
    }
}

3. Redeem Voucher
The voucher can be redeemed as many times as you defined – once, X number of times, or indefinitely. The history of the redemptions is accessible via API and dashboard.

// POST https://api.voucherify.io/v1/vouchers/sample10off/redemption
{
    "customer": {
        "source_id": "[email protected]",
        "name": "Nana Lemon",
        "email": "[email protected]"
    },
    "metadata": {
        "payment_method": "PayPal",
        "shipping-zone": "EU-Spain"  
    },
    "order": {
        "amount": 200000,
        "items": [
            {
                "source_id": "apple534",
                "product_id": "prod_anJ03RZZq74z4v",
                "related_object": "product",
                "quantity": 2,
                "price": 50000,
                "product": {
                    "override": true,
                    "name": "Apple iPhone 8",
                    "metadata": {
                        "shop": "citycenter",
                        "category": "electronics"
                    }
                },
                "metadata": {
                    "series": "2022-783CV"
                }
            },
            {
                "sku_id": "sku_0KtP4rvwEECQ2U",
                "source_id": "apple534-ihd5",
                "related_object": "sku",
                "quantity": 1,
                "price": 100000,
                "sku": {
                    "override": true,
                    "sku": "Apple iPad 10 Silver 64GB",
                    "metadata": {
                        "category": "electronics"
                    }
                }
            }
        ]
    }
}
{
    "id": "r_L2GmyC0L7JWlF068fVwOTlhT",
    "object": "redemption",
    "date": "2021-10-07T09:42:30.624Z",
    "customer_id": "cust_2FJk3ugCZ1sevAFNAWDwW5dv",
    "tracking_id": "track_otz3irNtDcvoZO+7uwUGiSTTeJ0BnNFq",
    "order": {
        "id": "ord_GZJOUtYIByUdeFOdUtNZPQdE",
        "source_id": null,
        "created_at": "2021-10-07T09:42:30.437Z",
        "updated_at": null,
        "status": "PAID",
        "amount": 200000,
        "discount_amount": 20000,
        "total_discount_amount": 20000,
        "total_amount": 180000,
        "applied_discount_amount": 20000,
        "total_applied_discount_amount": 20000,
        "items": [
            {
                "object": "order_item",
                "source_id": "apple534",
                "related_object": "product",
                "product_id": "prod_anJ03RZZq74z4v",
                "quantity": 2,
                "amount": 100000,
                "price": 50000,
                "subtotal_amount": 100000,
                "product": {
                    "id": "prod_09eb7c37e98a86267e",
                    "source_id": "prod_anJ03RZZq74z4v",
                    "name": "Apple iPhone 8",
                    "metadata": {
                        "shop": "citycenter",
                        "category": "electronics"
                    }
                },
                "metadata": {
                    "series": "2022-783CV"
                }
            },
            {
                "object": "order_item",
                "source_id": "apple534-ihd5",
                "related_object": "sku",
                "sku_id": "sku_0KtP4rvwEECQ2U",
                "quantity": 1,
                "amount": 100000,
                "price": 100000,
                "subtotal_amount": 100000,
                "sku": {
                    "sku": "Apple iPad 10 Silver 64GB",
                    "metadata": {
                        "category": "electronics"
                    }
                }
            }
        ],
        "customer": {
            "id": "cust_2FJk3ugCZ1sevAFNAWDwW5dv",
            "object": "customer"
        },
        "customer_id": "cust_2FJk3ugCZ1sevAFNAWDwW5dv",
        "referrer_id": null,
        "object": "order",
        "redemptions": {
            "r_L2GmyC0L7JWlF068fVwOTlhT": {
                "date": "2021-10-07T09:42:30.624Z",
                "related_object_type": "voucher",
                "related_object_id": "v_njn6RSORBuMPKVYaEi882HGaogpcmIzm"
            }
        }
    },
    "metadata": {
        "payment_method": "PayPal",
        "shipping-zone": "EU-Spain"
    },
    "result": "SUCCESS",
    "customer": {
        "id": "cust_2FJk3ugCZ1sevAFNAWDwW5dv",
        "name": "Nana Lemon",
        "email": "[email protected]",
        "source_id": "[email protected]",
        "object": "customer"
    },
    "related_object_type": "voucher",
    "voucher": {
        "id": "v_njn6RSORBuMPKVYaEi882HGaogpcmIzm",
        "code": "sample10off",
        "campaign": null,
        "campaign_id": null,
        "category": "New Customers",
        "type": "DISCOUNT_VOUCHER",
        "discount": {
            "type": "PERCENT",
            "percent_off": 10,
            "effect": "APPLY_TO_ORDER"
        },
        "gift": null,
        "loyalty_card": null,
        "start_date": "2021-01-01T00:00:00.000Z",
        "expiration_date": "2021-12-31T23:59:59.000Z",
        "validity_timeframe": null,
        "validity_day_of_week": null,
        "active": true,
        "additional_info": null,
        "metadata": {
            "test": true,
            "locale": "de-en"
        },
        "assets": {
            "qr": {
                "id": "U2FsdGVkX19CP5Kbzog5YN/AAJhOc/PAEUWiBhcrQdCyG/pgE0CtjZ+4WKKsloaHeV9L56K7vh+Rk4FY7k7/w8ZQdOCCeNbSH/r/m/D02Wo6xWSesp5h4Ke80yierRHwjzES45KrxEWHrPakIqzmsA==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19CP5Kbzog5YN%2FAAJhOc%2FPAEUWiBhcrQdCyG%2FpgE0CtjZ%2B4WKKsloaHeV9L56K7vh%2BRk4FY7k7%2Fw8ZQdOCCeNbSH%2Fr%2Fm%2FD02Wo6xWSesp5h4Ke80yierRHwjzES45KrxEWHrPakIqzmsA%3D%3D"
            },
            "barcode": {
                "id": "U2FsdGVkX1+TtEEGsVCq5gBYMBgpl2J3Bpyc9Z4mWzS5LR1S/vnWP9SS37tM8eM2gA6dXto8JWFj+so+Eg1JAlxuE9Ur+DXqcQqDopmmoLxTTJBHYeFY/0VLQYpVfW9B0uMYkUNZEPb21KUyMFNr6A==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BTtEEGsVCq5gBYMBgpl2J3Bpyc9Z4mWzS5LR1S%2FvnWP9SS37tM8eM2gA6dXto8JWFj%2Bso%2BEg1JAlxuE9Ur%2BDXqcQqDopmmoLxTTJBHYeFY%2F0VLQYpVfW9B0uMYkUNZEPb21KUyMFNr6A%3D%3D"
            }
        },
        "is_referral_code": false,
        "created_at": "2021-10-07T09:35:34.734Z",
        "updated_at": "2021-10-07T09:42:30.710Z",
        "validation_rules_assignments": {
            "object": "list",
            "data_ref": "data",
            "data": [],
            "total": 0…
        },
        "redemption": {
            "quantity": 100,
            "redeemed_quantity": 1,
            "object": "list",
            "url": "/v1/vouchers/sample10off/redemptions?page=1&limit=10"
        },
        "publish": {
            "object": "list",
            "count": 0,
            "url": "/v1/vouchers/sample10off/publications?page=1&limit=10"
        },
        "object": "voucher",
        "applicable_to": {
            "data": [],
            "total": 0,
            "data_ref": "data",
            "object": "list"
        },
        "inapplicable_to": {
            "data": [],
            "total": 0,
            "data_ref": "data",
            "object": "list"
        }
    }
}

4. Track Voucher
You can track the performance of the voucher via dashboard activity logs and visual charts or by calling Get Voucher API endpoint to see details of the given voucher.

With Voucherify, you can also easily export voucher details and a list of redemptions to BI and analytics tools of your choice for improved tracking.

Read more in Fraud Prevention and Tracking and Export data guides.

// GET https://api.voucherify.io/v1/vouchers/sample10off
{
    "id": "v_njn6RSORBuMPKVYaEi882HGaogpcmIzm",
    "code": "sample10off",
    "campaign": null,
    "category": "New Customers",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
        "type": "PERCENT",
        "percent_off": 10.0,
        "effect": "APPLY_TO_ORDER"
    },
    "gift": null,
    "loyalty_card": null,
    "start_date": "2021-01-01T00:00:00Z",
    "expiration_date": "2021-12-31T23:59:59Z",
    "validity_timeframe": null,
    "validity_day_of_week": null,
    "publish": {
        "object": "list",
        "count": 0,
        "data_ref": "entries",
        "entries": [],
        "total": 0,
        "url": "/v1/vouchers/sample10off/publications?page=1&limit=10"
    },
    "redemption": {
        "object": "list",
        "quantity": 100,
        "redeemed_quantity": 1,
        "data_ref": "redemption_entries",
        "redemption_entries": [],
        "total": 1,
        "url": "/v1/vouchers/sample10off/redemptions?page=1&limit=10"
    },
    "active": true,
    "additional_info": null,
    "metadata": {
        "test": true,
        "locale": "de-en"
    },
    "assets": {
        "qr": {
            "id": "U2FsdGVkX19CP5Kbzog5YN/AAJhOc/PAEUWiBhcrQdCyG/pgE0CtjZ+4WKKsloaHeV9L56K7vh+Rk4FY7k7/w8ZQdOCCeNbSH/r/m/D02Wo6xWSesp5h4Ke80yierRHwjzES45KrxEWHrPakIqzmsA==",
            "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19CP5Kbzog5YN%2FAAJhOc%2FPAEUWiBhcrQdCyG%2FpgE0CtjZ%2B4WKKsloaHeV9L56K7vh%2BRk4FY7k7%2Fw8ZQdOCCeNbSH%2Fr%2Fm%2FD02Wo6xWSesp5h4Ke80yierRHwjzES45KrxEWHrPakIqzmsA%3D%3D"
        },
        "barcode": {
            "id": "U2FsdGVkX1+TtEEGsVCq5gBYMBgpl2J3Bpyc9Z4mWzS5LR1S/vnWP9SS37tM8eM2gA6dXto8JWFj+so+Eg1JAlxuE9Ur+DXqcQqDopmmoLxTTJBHYeFY/0VLQYpVfW9B0uMYkUNZEPb21KUyMFNr6A==",
            "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BTtEEGsVCq5gBYMBgpl2J3Bpyc9Z4mWzS5LR1S%2FvnWP9SS37tM8eM2gA6dXto8JWFj%2Bso%2BEg1JAlxuE9Ur%2BDXqcQqDopmmoLxTTJBHYeFY%2F0VLQYpVfW9B0uMYkUNZEPb21KUyMFNr6A%3D%3D"
        }
    },
    "is_referral_code": false,
    "updated_at": "2021-10-07T09:42:30Z",
    "created_at": "2021-10-07T09:35:34Z",
    "object": "voucher",
    "validation_rules_assignments": {
        "data": [],
        "object": "list",
        "total": 0,
        "data_ref": "data"
    }
}

5. Disable/Enable Voucher
Each voucher can be disabled and re-enabled on the fly. You can perform these activities with API or via the dashboard.

// POST https://api.voucherify.io/v1/vouchers/10off/disable
// POST https://api.voucherify.io/v1/vouchers/10off/enable

Cart-level Promotion (Auto-applied Discount)

1. Create Promotion
Cart discounts are applied automatically to predefined orders without any coupon code.

This endpoint enables you to create cart-promotion via API but it's much easier to configure all details and validation rules by using the dashboard and the Campaign Manager. Customizable promotion parameters include promotion type and value, timeframe, banner, and multiple discount tiers with validation rules.
In order to create a promotion, you need to specify at least one promotion tier.

See how to launch a cart promotion using the dashboard. (recommended)

2. List Promotion Tiers
Get a list of active promotion tiers, including their details and the discount that can be applied if the conditions are met. You can list all available promotion tiers or only promotion tiers that belong to the specified campaign.

Listing Promotion tiers is only available via API.

// GET https://api.voucherify.io/v1/promotions/camp_pq7y5ZSh2xt1NvC6Bl5Ymlzk/tiers
{
    "object": "list",
    "total": 3,
    "data_ref": "tiers",
    "tiers": [
        {
            "id": "promo_DkBL24GWmNZ1A75bhEiBTNWO",
            "object": "promotion_tier",
            "name": "10% off",
            "banner": "Spend $50 and get 10% off your order",
            "campaign": {
                "id": "camp_pq7y5ZSh2xt1NvC6Bl5Ymlzk",
                "object": "campaign",
                "start_date": "2021-10-01T00:00:00Z",
                "expiration_date": "2021-10-31T00:00:00Z",
                "active": true
            },
            "action": {
                "discount": {
                    "type": "PERCENT",
                    "percent_off": 10.0,
                    "effect": "APPLY_TO_ORDER"
                }
            },
            "metadata": {},
            "summary": {
                "redemptions": {
                    "total_redeemed": 0
                },
                "orders": {
                    "total_amount": 0,
                    "total_discount_amount": 0
                }
            },
            "hierarchy": 3,
            "validation_rule_assignments": {
                "data": [
                    {
                        "id": "asgm_jDLQ7IgpA82GCcRZ",
                        "rule_id": "val_I9xZmL5QgAwq",
                        "related_object_id": "promo_DkBL24GWmNZ1A75bhEiBTNWO",…
                    }
                ],
                "object": "list",
                "total": 1,
                "data_ref": "data"
            },
            "active": true
        },
        {
            "id": "promo_LeDD8tSmLbVsA57LUFLF0IBc",
            "object": "promotion_tier",
            "name": "25% off",
            "banner": "Spend more than $100 and get 25% off!",
            "campaign": {
                "id": "camp_pq7y5ZSh2xt1NvC6Bl5Ymlzk",
                "object": "campaign",
                "start_date": "2021-10-01T00:00:00Z",
                "expiration_date": "2021-10-31T00:00:00Z",
                "active": true
            },
            "action": {
                "discount": {
                    "type": "PERCENT",
                    "percent_off": 25.0,
                    "effect": "APPLY_TO_ORDER"
                }
            },
            "metadata": {},
            "summary": {
                "redemptions": {
                    "total_redeemed": 0
                },
                "orders": {
                    "total_amount": 0,
                    "total_discount_amount": 0
                }
            },
            "hierarchy": 2,
            "validation_rule_assignments": {
                "data": [
                    {
                        "id": "asgm_e8ciR53Gy31Rs74c",
                        "rule_id": "val_cqbLERV7VHtp",
                        "related_object_id": "promo_LeDD8tSmLbVsA57LUFLF0IBc",
                        "related_object_type": "promotion_tier",
                        "created_at": "2021-10-07T11:00:35Z",
                        "updated_at": null,
                        "object": "validation_rules_assignment"
                    }
                ],
                "object": "list",
                "total": 1,
                "data_ref": "data"
            },
            "active": true
        },
        {
            "id": "promo_2X0DEfcD2mvtnjkf0gVAzFks",
            "object": "promotion_tier",
            "name": "Free shipping",
            "banner": "Sale products are now shipped for free!",
            "campaign": {
                "id": "camp_pq7y5ZSh2xt1NvC6Bl5Ymlzk",
                "object": "campaign",
                "start_date": "2021-10-01T00:00:00Z",
                "expiration_date": "2021-10-31T00:00:00Z",
                "active": true
            },
            "action": {
                "discount": {
                    "type": "UNIT",
                    "unit_off": 1.0,
                    "unit_type": "prod_5h1pp1ng",
                    "effect": "ADD_MISSING_ITEMS"
                }
            },
            "metadata": {},
            "summary": {
                "redemptions": {
                    "total_redeemed": 0
                },
                "orders": {
                    "total_amount": 0,
                    "total_discount_amount": 0
                }
            },
            "hierarchy": 1,
            "validation_rule_assignments": {
                "data": [
                    {
                        "id": "asgm_0n3MY9FlFJdx5fnE",
                        "rule_id": "val_8Vgj4wq3LDJP",
                        "related_object_id": "promo_2X0DEfcD2mvtnjkf0gVAzFks",
                        "related_object_type": "promotion_tier",
                        "created_at": "2021-10-07T11:00:34Z",
                        "updated_at": null,
                        "object": "validation_rules_assignment"
                    }
                ],
                "object": "list",
                "total": 1,
                "data_ref": "data"
            },
            "active": true
        }
    ],
    "has_more": false
}

3. Validate Promotion
Check if the current cart structure and customer data match the conditions defined in active promotion tiers. If the customer order is eligible for promotion, specific promotion tiers will be returned by the API.

See details of Validate Promotions endpoint.

// POST https://api.voucherify.io/v1/promotions/validation
{
    "customer": {
        "source_id": "[email protected]",
        "name": "Nana Lemon",
        "email": "[email protected]"
    },
    "metadata": {
        "payment_method": "PayPal",
        "shipping-zone": "EU-Spain"
    },
    "order": {
        "amount": 9000,
        "items": [
            {
                "source_id": "inventory_number_73636",
                "product_id": "prod_anJ03RZZq74z4v",
                "related_object": "product",
                "quantity": 1,
                "price": 9000,
                "product": {
                    "name": "Headphones",
                    "metadata": {
                        "shop": "citycenter",
                        "category": "SALE"
                    }
                }
            }
        ]
    }
}
{
    "valid": true,
    "tracking_id": "track_otz3irNtDcvoZO+7uwUGiSTTeJ0BnNFq",
    "promotions": [
        {
            "valid": true,
            "applicable_to": {
                "data": [],
                "total": 0,
                "data_ref": "data",
                "object": "list"
            },
            "inapplicable_to": {
                "data": [],
                "total": 0,
                "data_ref": "data",
                "object": "list"
            },
            "tracking_id": "track_otz3irNtDcvoZO+7uwUGiSTTeJ0BnNFq",
            "order": {
                "amount": 9000,
                "discount_amount": 900,
                "total_discount_amount": 900,
                "total_amount": 8100,
                "applied_discount_amount": 900,
                "total_applied_discount_amount": 900,
                "items": [
                    {
                        "object": "order_item",
                        "source_id": "inventory_number_73636",
                        "related_object": "product",
                        "product_id": "prod_anJ03RZZq74z4v",
                        "quantity": 1,
                        "amount": 9000,
                        "price": 9000,
                        "subtotal_amount": 9000,
                        "product": {
                            "id": "prod_09eb7c37e98a86267e",
                            "source_id": "prod_anJ03RZZq74z4v",
                            "name": "Headphones",
                            "metadata": {
                                "shop": "citycenter",
                                "category": "SALE"
                            }
                        }
                    }
                ],
                "customer_id": null,
                "referrer_id": null,
                "object": "order"
            },
            "id": "promo_DkBL24GWmNZ1A75bhEiBTNWO",
            "name": "10% off",
            "banner": "Spend $50 and get 10% off your order",
            "discount": {
                "type": "PERCENT",
                "effect": "APPLY_TO_ORDER",
                "percent_off": 10
            },
            "start_date": "2021-10-01T00:00:00.000Z",
            "expiration_date": "2021-10-31T00:00:00.000Z",
            "campaign": {
                "id": "camp_pq7y5ZSh2xt1NvC6Bl5Ymlzk",
                "start_date": "2021-10-01T00:00:00.000Z",
                "expiration_date": "2021-10-31T00:00:00.000Z",
                "active": true,
                "object": "campaign"
            },
            "hierarchy": 3,
            "discount_amount": 900,
            "applied_discount_amount": 900,
            "metadata": {},
            "object": "promotion_tier"
        },
        {
            "valid": true,
            "applicable_to": {
                "data": [],
                "total": 0,
                "data_ref": "data",
                "object": "list"
            },
            "inapplicable_to": {
                "data": [],
                "total": 0,
                "data_ref": "data",
                "object": "list"
            },
            "tracking_id": "track_otz3irNtDcvoZO+7uwUGiSTTeJ0BnNFq",
            "order": {
                "amount": 9000,
                "total_amount": 9000,
                "items": [
                    {
                        "object": "order_item",
                        "source_id": "inventory_number_73636",
                        "related_object": "product",
                        "product_id": "prod_anJ03RZZq74z4v",
                        "quantity": 1,
                        "amount": 9000,
                        "price": 9000,
                        "subtotal_amount": 9000,
                        "product": {
                            "id": "prod_09eb7c37e98a86267e",
                            "source_id": "prod_anJ03RZZq74z4v",
                            "name": "Headphones",
                            "metadata": {
                                "shop": "citycenter",
                                "category": "SALE"
                            }
                        }
                    },
                    {
                        "object": "order_item",
                        "product_id": "prod_5h1pp1ng",
                        "quantity": 1,
                        "discount_quantity": 1,
                        "initial_quantity": 0,
                        "product": {
                            "id": "prod_5h1pp1ng",
                            "source_id": "5h1pp1ng",
                            "name": "Shipping"
                        }
                    }
                ],
                "customer_id": null,
                "referrer_id": null,
                "object": "order"
            },
            "id": "promo_2X0DEfcD2mvtnjkf0gVAzFks",
            "name": "Free shipping",
            "banner": "Sale products are now shipped for free!",
            "discount": {
                "type": "UNIT",
                "effect": "ADD_MISSING_ITEMS",
                "unit_off": 1,
                "unit_type": "prod_5h1pp1ng"
            },
            "start_date": "2021-10-01T00:00:00.000Z",
            "expiration_date": "2021-10-31T00:00:00.000Z",
            "campaign": {
                "id": "camp_pq7y5ZSh2xt1NvC6Bl5Ymlzk",
                "start_date": "2021-10-01T00:00:00.000Z",
                "expiration_date": "2021-10-31T00:00:00.000Z",
                "active": true,
                "object": "campaign"
            },
            "hierarchy": 1,
            "metadata": {},
            "object": "promotion_tier"
        }
    ]
}

The API returns a list of valid promotions for a given context (customer and order).

4. Redeem Promotion
The promotion tier can be redeemed as many times as you define – once, X number of times, or an unlimited number of times. The history of the redemptions is accessible via API and dashboard.

Learn more about redeeming promotions via API.

// POST https://api.voucherify.io/v1/promotions/tiers/promo_2X0DEfcD2mvtnjkf0gVAzFks/redemption
{
    "customer": {
        "source_id": "[email protected]",
        "name": "Nana Lemon",
        "email": "[email protected]"
    },
    "metadata": {
        "payment_method": "PayPal",
        "shipping-zone": "EU-Spain"
    },
    "order": {
        "amount": 9000,
        "items": [
            {
                "source_id": "inventory_number_73636",
                "product_id": "prod_anJ03RZZq74z4v",
                "related_object": "product",
                "quantity": 1,
                "price": 9000,
                "product": {
                    "name": "Headphones",
                    "metadata": {
                        "shop": "citycenter",
                        "category": "SALE"
                    }
                }
            }
        ]
    }
}
{
    "id": "r_Zn89sYWUQRrEyvBsP5pl5WGQ",
    "object": "redemption",
    "date": "2021-10-07T12:05:05.320Z",
    "customer_id": "cust_2FJk3ugCZ1sevAFNAWDwW5dv",
    "tracking_id": "track_otz3irNtDcvoZO+7uwUGiSTTeJ0BnNFq",
    "order": {
        "id": "ord_tp4T8C4j8l5EV2MtsRi0ZZVM",
        "source_id": null,
        "created_at": "2021-10-07T12:05:05.162Z",
        "updated_at": null,
        "status": "PAID",
        "amount": 9000,
        "total_amount": 9000,
        "items": [
            {
                "object": "order_item",
                "source_id": "inventory_number_73636",
                "related_object": "product",
                "product_id": "prod_anJ03RZZq74z4v",
                "quantity": 1,
                "amount": 9000,
                "price": 9000,
                "subtotal_amount": 9000,
                "product": {
                    "id": "prod_09eb7c37e98a86267e",
                    "source_id": "prod_anJ03RZZq74z4v",
                    "name": "Headphones",
                    "metadata": {
                        "shop": "citycenter",
                        "category": "SALE"
                    }
                }
            },
            {
                "object": "order_item",
                "product_id": "prod_5h1pp1ng",
                "quantity": 1,
                "discount_quantity": 1,
                "product": {
                    "id": "prod_5h1pp1ng",
                    "source_id": "5h1pp1ng",
                    "name": "Shipping"
                }
            }
        ],
        "customer": {
            "id": "cust_2FJk3ugCZ1sevAFNAWDwW5dv",
            "object": "customer"
        },
        "customer_id": "cust_2FJk3ugCZ1sevAFNAWDwW5dv",
        "referrer_id": null,
        "object": "order",
        "redemptions": {
            "r_Zn89sYWUQRrEyvBsP5pl5WGQ": {
                "date": "2021-10-07T12:05:05.320Z",
                "related_object_type": "promotion_tier",
                "related_object_id": "promo_2X0DEfcD2mvtnjkf0gVAzFks",
                "related_object_parent_id": "camp_pq7y5ZSh2xt1NvC6Bl5Ymlzk"
            }
        }
    },
    "metadata": {
        "payment_method": "PayPal",
        "shipping-zone": "EU-Spain"
    },
    "result": "SUCCESS",
    "customer": {
        "id": "cust_2FJk3ugCZ1sevAFNAWDwW5dv",
        "name": "Nana Lemon",
        "email": "[email protected]",
        "source_id": "[email protected]",
        "object": "customer"
    },
    "related_object_type": "promotion_tier",
    "voucher": null,
    "promotion_tier": {
        "id": "promo_2X0DEfcD2mvtnjkf0gVAzFks",
        "name": "Free shipping",
        "banner": "Sale products are now shipped for free!",
        "action": {
            "discount": {
                "type": "UNIT",
                "effect": "ADD_MISSING_ITEMS",
                "unit_off": 1,
                "unit_type": "prod_5h1pp1ng"
            }
        },
        "metadata": {},
        "hierarchy": 1,
        "campaign": {
            "id": "camp_pq7y5ZSh2xt1NvC6Bl5Ymlzk",
            "start_date": "2021-10-01T00:00:00.000Z",
            "expiration_date": "2021-10-31T00:00:00.000Z",
            "active": true,
            "object": "campaign"
        },
        "active": true,
        "summary": {
            "redemptions": {
                "total_redeemed": 1
            },
            "orders": {
                "total_amount": 9000,
                "total_discount_amount": 0
            }
        },
        "object": "promotion_tier",
        "validation_rule_assignments": {
            "object": "list",
            "data_ref": "data",
            "data": [
                {
                    "id": "asgm_0n3MY9FlFJdx5fnE",
                    "rule_id": "val_8Vgj4wq3LDJP",
                    "related_object_id": "promo_2X0DEfcD2mvtnjkf0gVAzFks",
                    "related_object_type": "promotion_tier",
                    "object": "validation_rules_assignment"
                }
            ],
            "total": 1
        }
    }
}

Examine Qualification and Code Publication

1. Create Gifts Cards Campaign
Create campaign of unique gift card codes.

{
    "name": "Sample Gift Cards Campaign",
    "start_date": "2021-01-01T00:00:00Z",
    "expiration_date": "2021-12-31T00:00:00Z",
    "vouchers_count": 10,
    "type": "AUTO_UPDATE",
    "voucher": {
        "type": "GIFT_VOUCHER",
        "gift": {
            "amount": 10000
        },
        "redemption": {
            "quantity": 1
        },
        "code_config": {
            "pattern": "GIFT-#######"
        }
    },
    "metadata": {
        "test": true
    }
}
{
    "id": "camp_vqjthb0RxFkKItTLWIKXreKP",
    "name": "Sample Gift Cards Campaign",
    "campaign_type": "GIFT_VOUCHERS",
    "type": "AUTO_UPDATE",
    "description": null,
    "start_date": "2021-01-01T00:00:00Z",
    "expiration_date": "2021-12-31T00:00:00Z",
    "activity_duration_after_publishing": null,
    "validity_timeframe": null,
    "validity_day_of_week": null,
    "metadata": {
        "test": true
    },
    "created_at": "2021-10-07T12:59:37Z",
    "vouchers_count": 10,
    "vouchers_generation_status": "IN_PROGRESS",
    "active": true,
    "voucher": {
        "code_config": {
            "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
            "pattern": "GIFT-#######"
        },
        "type": "GIFT_VOUCHER",
        "is_referral_code": false,
        "gift": {
            "amount": 10000,
            "balance": 10000
        },
        "loyalty_card": null,
        "start_date": "2021-01-01T00:00:00Z",
        "expiration_date": "2021-12-31T00:00:00Z",
        "redemption": {
            "quantity": 1
        }
    },
    "validation_rules_assignments": {
        "data": null,
        "object": "list",
        "total": 0,
        "data_ref": "data"
    },
    "promotion": {
        "object": "list",
        "data_ref": "tiers",
        "tiers": null,
        "has_more": false
    },
    "referral_program": null,
    "auto_join": false,
    "join_once": false,
    "use_voucher_metadata_schema": true,
    "protected": false,
    "object": "campaign"
}

📘

Create campaigns and vouchers

We highly recommend creating campaigns and vouchers using the dashboard and the user-friendly Campaign Manager.

2. Examine Qualification
The qualification API endpoint is used to get all campaigns available to the given customer profile and orders that meet predefined validation rules such as total order value or the minimum number of items in the cart.

When it comes to unique codes, the next step would be to publish the particular voucher to the customer so that he or she might redeem the code after placing an order in your store.

{
    "customer": {
        "id": "cust_07sVjVsr71Ewot9lVZSrIVLH",
        "source_id": "[email protected]",
        "name": "Nana Lemon"
    },
    "order": {
        "amount": 13000,
        "items": [
            {
                "product_id": "prod_an03RZZq74z4v",
                "quantity": "1",
                "price": 10000
            },
            {
                "sku_id": "sku_dSbRQfbyMyHnt",
                "quantity": "1",
                "price": 3000

            }
        ]
    },
    "metadata": {
        "locale": "en-GB"
    }
}
{
    "object": "list",
    "data_ref": "data",
    "data": [
        {
            "id": "camp_Q1Pmb1khTHLNR6arHXMgSfVZ",
            "name": "Sample Gift Cards Campaign",
            "campaign_type": "GIFT_VOUCHERS",
            "type": "AUTO_UPDATE",
            "voucher": {
                "type": "GIFT_VOUCHER",
                "discount": null,
                "gift": {
                    "amount": 10000,
                    "effect": "APPLY_TO_ORDER",
                    "balance": 10000
                },
                "loyalty_card": null,
                "redemption": {
                    "quantity": 1
                },
                "code_config": {
                    "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
                    "pattern": "GIFT-#######"
                },
                "is_referral_code": false,
                "start_date": "2021-01-01T00:00:00.000Z",
                "expiration_date": "2021-12-31T00:00:00.000Z"
            },
            "join_once": false,
            "use_voucher_metadata_schema": true,
            "start_date": "2021-01-01T00:00:00.000Z",
            "expiration_date": "2021-12-31T00:00:00.000Z",
            "vouchers_count": 5,
            "active": true,
            "metadata": {},
            "created_at": "2021-10-08T10:25:42.016Z",
            "creation_status": "DONE",
            "vouchers_generation_status": "DONE",
            "object": "campaign",
            "validation_rules_assignments": {
                "object": "list",
                "data_ref": "data",
                "data": [],
                "total": 0
            }
        },
        {
            "id": "camp_sSo9YoAEdHJOB2fwLoAYQrZl",
            "name": "10% off codes",
            "campaign_type": "DISCOUNT_COUPONS",
            "type": "AUTO_UPDATE",
            "voucher": {
                "type": "DISCOUNT_VOUCHER",
                "discount": {
                    "type": "PERCENT",
                    "effect": "APPLY_TO_ORDER",
                    "percent_off": 10
                },
                "gift": null,
                "loyalty_card": null,
                "redemption": {
                    "quantity": 1
                },
                "code_config": {
                    "length": 8,
                    "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
                    "pattern": "########"
                },
                "is_referral_code": false
            },
            "join_once": false,
            "use_voucher_metadata_schema": true,
            "vouchers_count": 1,
            "active": true,
            "metadata": {},
            "created_at": "2021-10-08T10:23:29.498Z",
            "creation_status": "DONE",
            "vouchers_generation_status": "DONE",
            "object": "campaign",
            "validation_rules_assignments": {
                "object": "list",
                "data_ref": "data",
                "data": [],
                "total": 0
            }
        },
        {
            "id": "camp_f1r57C4Mp41gN",
            "name": "Referral Reward - 15% Discount",
            "campaign_type": "DISCOUNT_COUPONS",
            "type": "AUTO_UPDATE",
            "voucher": {
                "type": "DISCOUNT_VOUCHER",
                "discount": {
                    "type": "PERCENT",
                    "percent_off": 15
                },
                "gift": null,
                "loyalty_card": null,
                "redemption": {
                    "quantity": 1
                },
                "code_config": {
                    "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
                    "pattern": "##-###-###"
                },
                "is_referral_code": false
            },
            "vouchers_count": 0,
            "active": true,
            "metadata": {},
            "created_at": "2021-10-08T10:22:52.913Z",
            "creation_status": "DONE",
            "vouchers_generation_status": "DONE",
            "object": "campaign",
            "validation_rules_assignments": {
                "object": "list",
                "data_ref": "data",
                "data": [],
                "total": 0
            }
        }
    ],
    "total": 3,
    "id": "qfl_6k823jDcrveP5A5eNl117u6S",
    "created_at": "2021-10-08T10:27:46.647Z",
    "tracking_id": "track_otz3irNtDcvoZO+7uwUGiSTTeJ0BnNFq"
}

3. Publish Voucher
The publication is used to assign a selected code to specific customer. For instance, your website will display only available codes to customers, and next when the customer clicks on the code, it will be automatically assigned to his/her profile via publish API.

The assignment, in this case, should take place via API, not via the Dashboard.

Learn more about Publication API here.

{
    "campaign": {
        "name": "Sample Gift Cards Campaign",
        "count": 1
    },
    "customer": {
        "source_id": "[email protected]",
        "email": "[email protected]"
    },
    "metadata": {
        "test": true,
        "provider": "Shop Admin"
    }
}
//POST https://api.voucherify.io/v1/publications
{
    "id": "pub_9qmH754Ef15j5t4lFT6QO6T7v1un8vfP",
    "object": "publication",
    "created_at": "2021-10-08T10:42:32.011Z",
    "customer_id": "cust_A5Eu0MTp00Q4pOrqreupZqVO",
    "tracking_id": "[email protected]",
    "metadata": {
        "test": true,
        "provider": "Shop Admin"
    },
    "channel": "API",
    "source_id": null,
    "result": "SUCCESS",
    "customer": {
        "id": "cust_A5Eu0MTp00Q4pOrqreupZqVO",
        "name": null,
        "email": "[email protected]",
        "source_id": "[email protected]",
        "object": "customer"
    },
    "voucher": {
        "id": "v_687yd3vxaPu0PYBdeMCsxYJ45rS7DawD",
        "code": "GIFT-KqrDcOL",
        "campaign": "Sample Gift Cards Campaign",
        "campaign_id": "camp_Q1Pmb1khTHLNR6arHXMgSfVZ",
        "category": null,
        "type": "GIFT_VOUCHER",
        "discount": null,
        "gift": {
            "amount": 10000,
            "effect": "APPLY_TO_ORDER",
            "balance": 10000
        },
        "loyalty_card": null,
        "start_date": "2021-01-01T00:00:00.000Z",
        "expiration_date": "2021-12-31T00:00:00.000Z",
        "validity_timeframe": null,
        "validity_day_of_week": null,
        "active": true,
        "additional_info": null,
        "metadata": {},
        "assets": {
            "qr": {
                "id": "U2FsdGVkX1+Y+EXElpHdCqlFr8iq3dLk6RrkyYM6Lwae0QnVc09WEVVuKPDa725qgZALVPeNMG4CmWDzB2FTTtfbOHElAjFrZFoABwBsi+lRg9SBh3G7K4de8ckzCRCF2wPGYmWwn1omeiIB9UZ7Ug==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BY%2BEXElpHdCqlFr8iq3dLk6RrkyYM6Lwae0QnVc09WEVVuKPDa725qgZALVPeNMG4CmWDzB2FTTtfbOHElAjFrZFoABwBsi%2BlRg9SBh3G7K4de8ckzCRCF2wPGYmWwn1omeiIB9UZ7Ug%3D%3D"
            },
            "barcode": {
                "id": "U2FsdGVkX1/K6Adqpum6QV8YiX0ARYg5X32jes+0cJVoIB15WP/NczV3TiNM42LcYwBQ6VizmBDwN1PH1S4TRa50kyMwmxMYLKDJjsvmfAeAvZM6rQutY4ZEYu96OnhAcleG+weDnhx86EMwcvQc6Q==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FK6Adqpum6QV8YiX0ARYg5X32jes%2B0cJVoIB15WP%2FNczV3TiNM42LcYwBQ6VizmBDwN1PH1S4TRa50kyMwmxMYLKDJjsvmfAeAvZM6rQutY4ZEYu96OnhAcleG%2BweDnhx86EMwcvQc6Q%3D%3D"
            }
        },
        "is_referral_code": false,
        "created_at": "2021-10-08T10:25:43.515Z",
        "updated_at": "2021-10-08T10:42:32.019Z",
        "holder_id": "cust_A5Eu0MTp00Q4pOrqreupZqVO",
        "object": "voucher",
        "distributions": null,
        "publish": {
            "object": "list",
            "count": 1,
            "url": "/v1/vouchers/GIFT-KqrDcOL/publications?page=1&limit=10"
        },
        "redemption": {
            "quantity": 1,
            "redeemed_quantity": 0,
            "redeemed_amount": 0,
            "object": "list",
            "url": "/v1/vouchers/GIFT-KqrDcOL/redemptions?page=1&limit=10"
        }
    },
    "vouchers_id": [
        "v_687yd3vxaPu0PYBdeMCsxYJ45rS7DawD"
    ]
}

4. Validate Voucher
At any point in time, you can validate a selected voucher to find out if the voucher is eligible for the given customer/order and to learn what discount type it carries.

Validation can only be performed via API.

// POST https://api.voucherify.io/v1/vouchers/GIFT-KqrDcOL/validate
{
    "customer": {
        "id": "cust_07sVjVsr71Ewot9lVZSrIVLH",
        "source_id": "[email protected]",
        "name": "Nana Lemon"
    },
    "order": {
        "amount": 13000,
        "items": [
            {
                "product_id": "prod_an03RZZq74z4v",
                "quantity": "1",
                "price": 10000
            },
            {
                "sku_id": "sku_dSbRQfbyMyHnt",
                "quantity": "1",
                "price": 3000
            }
        ]
    },
    "metadata": {
        "locale": "en-GB"
    }
}
{
    "valid": true,
    "applicable_to": {
        "data": [],
        "total": 0,
        "data_ref": "data",
        "object": "list"
    },
    "inapplicable_to": {
        "data": [],
        "total": 0,
        "data_ref": "data",
        "object": "list"
    },
    "tracking_id": "track_otz3irNtDcvoZO+7uwUGiSTTeJ0BnNFq",
    "order": {
        "amount": 13000,
        "discount_amount": 10000,
        "total_discount_amount": 10000,
        "total_amount": 3000,
        "applied_discount_amount": 10000,
        "total_applied_discount_amount": 10000,
        "items": [
            {
                "object": "order_item",
                "product_id": "prod_an03RZZq74z4v",
                "quantity": 1,
                "amount": 10000,
                "price": 10000,
                "subtotal_amount": 10000
            },
            {
                "object": "order_item",
                "sku_id": "sku_dSbRQfbyMyHnt",
                "quantity": 1,
                "amount": 3000,
                "price": 3000,
                "subtotal_amount": 3000
            }
        ],
        "customer_id": null,
        "referrer_id": null,
        "object": "order"
    },
    "code": "GIFT-KqrDcOL",
    "gift": {
        "amount": 10000,
        "balance": 10000,
        "effect": "APPLY_TO_ORDER"
    },
    "start_date": "2021-01-01T00:00:00.000Z",
    "expiration_date": "2021-12-31T00:00:00.000Z",
    "metadata": {},
    "campaign": "Sample Gift Cards Campaign",
    "campaign_id": "camp_Q1Pmb1khTHLNR6arHXMgSfVZ"
}

5. Redeem Voucher
The voucher can be redeemed as many times as a user has defined – once, X number of times, or indefinitely. The history of the redemptions is accessible via API and Dashboard.

Learn more about Redemption API

See how your customers can redeem Voucherify codes.

{
    "customer": {
        "id": "cust_07sVjVsr71Ewot9lVZSrIVLH",
        "source_id": "[email protected]",
        "name": "Nana Lemon"
    },
    "order": {
        "amount": 13000,
        "items": [
            {
                "product_id": "prod_an03RZZq74z4v",
                "quantity": "1",
                "price": 10000
            },
            {
                "sku_id": "sku_dSbRQfbyMyHnt",
                "quantity": "1",
                "price": 3000

            }
        ]
    },
    "metadata": {
        "locale": "en-GB"
    }
}
{
    "id": "r_Xp785TFKvVJS306JO7GlCT2o",
    "object": "redemption",
    "date": "2021-10-08T11:23:50.620Z",
    "customer_id": "cust_A5Eu0MTp00Q4pOrqreupZqVO",
    "tracking_id": "track_otz3irNtDcvoZO+7uwUGiSTTeJ0BnNFq",
    "order": {
        "id": "ord_XF1q3uAiqi3Ro3KsYVHQe1bN",
        "source_id": null,
        "created_at": "2021-10-08T11:23:50.511Z",
        "updated_at": null,
        "status": "PAID",
        "amount": 13000,
        "discount_amount": 10000,
        "total_discount_amount": 10000,
        "total_amount": 3000,
        "applied_discount_amount": 10000,
        "total_applied_discount_amount": 10000,
        "items": [
            {
                "object": "order_item",
                "product_id": "prod_an03RZZq74z4v",
                "quantity": 1,
                "amount": 10000,
                "price": 10000,
                "subtotal_amount": 10000
            },
            {
                "object": "order_item",
                "sku_id": "sku_dSbRQfbyMyHnt",
                "quantity": 1,
                "amount": 3000,
                "price": 3000,
                "subtotal_amount": 3000
            }
        ],
        "customer": {
            "id": "cust_A5Eu0MTp00Q4pOrqreupZqVO",
            "object": "customer"
        },
        "customer_id": "cust_A5Eu0MTp00Q4pOrqreupZqVO",
        "referrer_id": null,
        "object": "order",
        "redemptions": {
            "r_Xp785TFKvVJS306JO7GlCT2o": {
                "date": "2021-10-08T11:23:50.620Z",
                "related_object_type": "voucher",
                "related_object_id": "v_687yd3vxaPu0PYBdeMCsxYJ45rS7DawD",
                "related_object_parent_id": "camp_Q1Pmb1khTHLNR6arHXMgSfVZ"
            }
        }
    },
    "metadata": {
        "locale": "en-GB"
    },
    "amount": 10000,
    "result": "SUCCESS",
    "customer": {
        "id": "cust_A5Eu0MTp00Q4pOrqreupZqVO",
        "name": "Nana Lemon",
        "email": "[email protected]",
        "source_id": "[email protected]",
        "object": "customer"
    },
    "related_object_type": "voucher",
    "voucher": {
        "id": "v_687yd3vxaPu0PYBdeMCsxYJ45rS7DawD",
        "code": "GIFT-KqrDcOL",
        "campaign": "Sample Gift Cards Campaign",
        "campaign_id": "camp_Q1Pmb1khTHLNR6arHXMgSfVZ",
        "category": null,
        "type": "GIFT_VOUCHER",
        "discount": null,
        "gift": {
            "amount": 10000,
            "balance": 0,
            "effect": "APPLY_TO_ORDER"
        },
        "loyalty_card": null,
        "start_date": "2021-01-01T00:00:00.000Z",
        "expiration_date": "2021-12-31T00:00:00.000Z",
        "validity_timeframe": null,
        "validity_day_of_week": null,
        "active": true,
        "additional_info": null,
        "metadata": {},
        "assets": {
            "qr": {
                "id": "U2FsdGVkX1+Y+EXElpHdCqlFr8iq3dLk6RrkyYM6Lwae0QnVc09WEVVuKPDa725qgZALVPeNMG4CmWDzB2FTTtfbOHElAjFrZFoABwBsi+lRg9SBh3G7K4de8ckzCRCF2wPGYmWwn1omeiIB9UZ7Ug==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BY%2BEXElpHdCqlFr8iq3dLk6RrkyYM6Lwae0QnVc09WEVVuKPDa725qgZALVPeNMG4CmWDzB2FTTtfbOHElAjFrZFoABwBsi%2BlRg9SBh3G7K4de8ckzCRCF2wPGYmWwn1omeiIB9UZ7Ug%3D%3D"
            },
            "barcode": {
                "id": "U2FsdGVkX1/K6Adqpum6QV8YiX0ARYg5X32jes+0cJVoIB15WP/NczV3TiNM42LcYwBQ6VizmBDwN1PH1S4TRa50kyMwmxMYLKDJjsvmfAeAvZM6rQutY4ZEYu96OnhAcleG+weDnhx86EMwcvQc6Q==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FK6Adqpum6QV8YiX0ARYg5X32jes%2B0cJVoIB15WP%2FNczV3TiNM42LcYwBQ6VizmBDwN1PH1S4TRa50kyMwmxMYLKDJjsvmfAeAvZM6rQutY4ZEYu96OnhAcleG%2BweDnhx86EMwcvQc6Q%3D%3D"
            }
        },
        "is_referral_code": false,
        "created_at": "2021-10-08T10:25:43.515Z",
        "updated_at": "2021-10-08T11:23:50.623Z",
        "holder_id": "cust_A5Eu0MTp00Q4pOrqreupZqVO",
        "holder": {
            "id": "cust_A5Eu0MTp00Q4pOrqreupZqVO",
            "name": null,
            "email": "[email protected]",
            "source_id": "[email protected]",
            "object": "customer"
        },
        "validation_rules_assignments": {
            "object": "list",
            "data_ref": "data",
            "data": [],
            "total": 0
        },
        "redemption": {
            "quantity": 1,
            "redeemed_quantity": 1,
            "redeemed_amount": 10000,
            "object": "list",
            "url": "/v1/vouchers/GIFT-KqrDcOL/redemptions?page=1&limit=10"
        },
        "publish": {
            "object": "list",
            "count": 1,
            "url": "/v1/vouchers/GIFT-KqrDcOL/publications?page=1&limit=10"
        },
        "object": "voucher",
        "applicable_to": {
            "data": [],
            "total": 0,
            "data_ref": "data",
            "object": "list"
        },
        "inapplicable_to": {
            "data": [],
            "total": 0,
            "data_ref": "data",
            "object": "list"
        }
    },
    "gift": {
        "amount": 10000
    }
}

How does the process of validation work?

  1. Your client-side app requests a coupon code validation from the Voucherify server in order to get the discount value.

  2. Voucherify server generates verification result and customer tracking token.

  3. Once the client SDK is initialized and the customer has submitted voucher information, the client app sends that information to your server along with order details.

  4. Your server receives the discount code and tracking token from your client and then uses the Voucherify server SDK to redeem or perform other Voucherify functions detailed in the guides.

  5. Voucherify server returns voucher details and redemptions history.


Did this page help you?