Redeem Voucher

To redeem a voucher, you create a redemption object. It increments redemption counter and updates history of the voucher.

Response schema

{
    "id": "r_57t5J2mUVjqlXhp0iKx3EFXw", // unique redemption identifier
    "object": "redemption",
    "date": "2021-07-20T11:22:52.923Z", // redemption date time
    "customer_id": "cust_vKmJ3z0LLnkbpmhaTf8r68il", // related customer id
    "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==",
    "order": {
        "id": "ord_ya7gYzNcltOL2AuFhN9Lzt7W", // unique order id
        "source_id": null,
        "created_at": "2021-07-20T11:22:52.595Z",
        "updated_at": null,
        "status": "PAID",
        "amount": 200000, // total order amount before applying any discount
        "items_discount_amount": 20000, // sums up all product-specific discounts applied to this order id, if there is order-level discount API returns discount_amount that sums up all order-level discounts applied to a patricular order
        "total_discount_amount": 20000, // sums up all order-level and all product-specific discounts applied to this order id
        "total_amount": 180000, // order amount after applying all the discounts
        "items_applied_discount_amount": 20000,// sums up all product-specific discounts applied in a particular request
        "total_applied_discount_amount": 20000,// sums up all order-level and all product-specific discounts applied in a particular request
        "items": [
            {
                "object": "order_item",
                "source_id": "apple534",
                "related_object": "product",
                "product_id": "prod_anJ03RZZq74z4v",
                "quantity": 2,
                "amount": 100000,
                "discount_amount": 10000, // sum of all discounts applied to this line item
                "applied_discount_amount": 10000, // sum of discounts applied to this line item in a particular request
                "price": 50000,
                "product": {
                    "id": "prod_09929913898fa69e80",
                    "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,
                "discount_amount": 10000, // sum of all discounts applied to this line item
                "applied_discount_amount": 10000, // sum of discounts applied to this line item in a particular request
                "price": 100000,
                "sku": {
                    "sku": "Apple iPad 10 Silver 64GB",
                    "metadata": {
                        "category": "electronics"
                    }
                }
            }
        ],
        "customer": {
            "id": "cust_vKmJ3z0LLnkbpmhaTf8r68il",
            "object": "customer"
        },
        "customer_id": "cust_vKmJ3z0LLnkbpmhaTf8r68il",
        "referrer_id": null,
        "object": "order",
        "redemptions": {
            "r_57t5J2mUVjqlXhp0iKx3EFXw": {
                "date": "2021-07-20T11:22:52.923Z",
                "related_object_type": "voucher",
                "related_object_id": "v_dNQstxvlp3AkhCOSktXzG1ztqkABm5MV"
            }
        }
    },
    "metadata": null,
    "result": "SUCCESS",
    "customer": {
        "id": "cust_vKmJ3z0LLnkbpmhaTf8r68il",
        "name": "Annie Lemon",
        "email": "[email protected]",
        "source_id": "[email protected]",
        "object": "customer"
    },
    "related_object_type": "voucher",
    "voucher": { // returns details of redeemed code
        "id": "v_dNQstxvlp3AkhCOSktXzG1ztqkABm5MV",
        "code": "Electronics10OFF",
        "campaign_id": null,
        "type": "DISCOUNT_VOUCHER",
        "discount": {
            "type": "PERCENT",
            "effect": "APPLY_TO_ITEMS",
            "percent_off": 10
        },
        "start_date": "2021-07-20T00:00:00.000Z",
        "expiration_date": "2023-07-01T00:00:00.000Z",
        "active": true,
        "metadata": {},
        "assets": { // returns QR and barcodes URL
            "qr": {
                "id": "U2FsdGVkX19Y47G2vevDNEnTJu2oEZ1Ou45x6YiL60KNrPMZ6rsN+c9G+flj2nzll/vyCRZSZusBowojyUFlwqBQREhY5Q/RBhqrklKK1bKM/vtar5w6zYhwpgDI0BEwgjjuj3qg61hZ4lEIWjMK+cG5QA1zNijZ1rh485UZjEU=",
                "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19Y47G2vevDNEnTJu2oEZ1Ou45x6YiL60KNrPMZ6rsN%2Bc9G%2Bflj2nzll%2FvyCRZSZusBowojyUFlwqBQREhY5Q%2FRBhqrklKK1bKM%2Fvtar5w6zYhwpgDI0BEwgjjuj3qg61hZ4lEIWjMK%2BcG5QA1zNijZ1rh485UZjEU%3D"
            },
            "barcode": {
                "id": "U2FsdGVkX1+4ISz2rjG/xMcUwxyn4wAXqwdNYu8/bu0+QM61+VtsAgDVwR+mWnRoqsXgPknKo7SglKzUTpzsNWgJwuG+jcGKfMo2OsDEGUWH6jqI43gZm2KvRXJh6o1tZeopky1hgN/+fpKfGXuiSckVbapBRIyrEfd/qQuqOPQ=",
                "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2B4ISz2rjG%2FxMcUwxyn4wAXqwdNYu8%2Fbu0%2BQM61%2BVtsAgDVwR%2BmWnRoqsXgPknKo7SglKzUTpzsNWgJwuG%2BjcGKfMo2OsDEGUWH6jqI43gZm2KvRXJh6o1tZeopky1hgN%2F%2BfpKfGXuiSckVbapBRIyrEfd%2FqQuqOPQ%3D"
            }
        },
        "is_referral_code": false,
        "created_at": "2021-07-20T10:30:14.391Z",
        "updated_at": "2021-07-20T11:22:52.923Z",
        "validation_rules_assignments": { // returns details of assgined validation rules
            "object": "list",
            "data_ref": "data",
            "data": [
                {
                    "id": "asgm_mHMgvkSmvO7U6Pm6",
                    "rule_id": "val_SjbMlkgriyhT", // validation rules unique id
                    "related_object_id": "v_dNQstxvlp3AkhCOSktXzG1ztqkABm5MV",
                    "related_object_type": "voucher",
                    "object": "validation_rules_assignment"
                }
            ],
            "total": 1 // number of assigned validation rule ids
        },
        "redemption": { // summary of code redemptions
            "quantity": null, // unlimitted redemptions allowed
            "redeemed_quantity": 3,
            "object": "list",
            "url": "/v1/vouchers/Electronics10OFF/redemptions?page=1&limit=10"
        },
        "publish": { // summary of code publications
            "object": "list",
            "count": 0, 
            "url": "/v1/vouchers/Electronics10OFF/publications?page=1&limit=10"
        },
        "object": "voucher",
        "applicable_to": { // this object returns collection(s), products and skus from the order that qualify for a discount
            "data": [
                {
                    "object": "products_collection",
                    "id": "pc_jTTFY7id2QNiJJR38Pf9LLWv",
                    "source_id": null,
                    "strict": false
                },
                {
                    "object": "sku",
                    "id": "sku_0KtP4rvwEECQ2U",
                    "source_id": "apple534-ihd5",
                    "strict": true
                },
                {
                    "object": "product",
                    "id": "prod_09929913898fa69e80",
                    "source_id": "prod_anJ03RZZq74z4v",
                    "strict": true
                }
            ],
            "total": 3,
            "data_ref": "data",
            "object": "list"
        },
        "inapplicable_to": { // this object returns collection(s), products and skus excluded from getting a discount
            "data": [],
            "total": 0,
            "data_ref": "data",
            "object": "list"
        }
    }
}

📘

Testing

test-jBcGvs14 - you can use this code for testing the above method.

SDKs

You can invoke the redemption endpoint with one of the official libraries:

Customer tracking

Redeem operation is a key part of Customer tracking workflow. There're 3 ways you can identify your end customer in Voucherify within this request. You can provide either a tracking ID (e.g. your customer's login or a generated id), customer ID (if customer already stored in Voucherify) or a full customer object in payload. Note that you can pass and thus store any customer-related metadata. See examples on the right.

"customer": {
  "source_id": "alice.morgan",
  "name": "Alice Morgan",
  "email": "[email protected]",
  "description": "",
  "metadata": {
    "locale": "en-GB",
    "shoeSize": 5,
    "favourite_brands": ["Armani", "L’Autre Chose", "Vicini"]
  }
}

If you already created a customer profile in Voucherify's database, whether it was implicitly by providing it to the redeem function or explicitly by invoking the customer.create method, you can identify your customer in following redemptions by a generated id (starting with cust_).

{
  "customer": {
    "id": "cust_C9qJ3xKgZFqkpMw7b21MF2ow"
  }
}
{
  "customer": "cust_C9qJ3xKgZFqkpMw7b21MF2ow"
}
{
  "customer": "alice.morgan"
}

📘

Redemption rollback

Do you need to undo a redemption? You can do it with redemption rollback.

Redemption failures

There are several reasons why a redemption may fail. You will get the reason in the error key:

  • resource_not_found - voucher with given code does not exist
  • voucher_not_active - voucher is not active yet (before start date)
  • voucher_expired - voucher has already expired (after expiration date)
  • voucher_disabled - voucher has been disabled (active: false)
  • quantity_exceeded - voucher's redemptions limit has been exceeded
  • gift_amount_exceeded - gift amount has been exceeded
  • customer_rules_violated - customer did not match to the segment
  • order_rules_violated - order did not match validation rules
  • invalid_order - order was specified incorrectly
  • invalid_amount - order amount was specified incorrectly
  • missing_amount - order amount was not specified
  • missing_order_items - order items was not specified
  • missing_customer - customer was not specified

Order object

The purchase of previously defined products by end customers is handled through the order objects. You are obligated to pass order object in case you use validation rules. You can learn more about the validation rules structure.

Attributes

Description

Example

amount
integer

A positive integer representing the total amount for the order.

items
list

List of items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.

Child attributes:

  • product_id (string) - The ID of the associated product object for this line item.

  • sku_id (string) - The ID of the associated variant (sku) object for this line item.

  • quantity (integer) - A positive integer representing the number of instances of item that are included in this order line.

  • price (integer) - A positive integer representing the cost of an item.

  • amount (integer) - quantity * price (you should provide it to retrieve discount_amount for a particular order item if the discount is applied only to this item learn more

"order": {
  "amount": 10000,
  "items": [
    {
      "product_id": "prod_Bi7sRr3kwvxH2I",
      "sku_id": null,
      "quantity": 1
    }
  ]
}

Gift Vouchers - redeem Gift Card and control redeemed amount

Voucherify also gives the possibility to create a gift card, which allows using credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition.

When the user wants to define how many gift credits he uses from the gift card to complete the order, it's possible by property credits in the request body of the voucher code he wants to redeem. The value of credits cannot be higher than the current balance on the gift card.

curl -i -X POST \
   -H "Content-Type:application/json" \
   -H "X-App-Id:c70a6f00-cf91-4756-9df5-47628850002b" \
   -H "X-App-Token:3266b9f8-e246-4f79-bdf0-833929b1380c" \
   -d \
'{
    "order": {
        "amount": 2500
    },
    "gift": {
        "credits": 1500
    }
}' \
 'https://api.voucherify.io/v1/vouchers/aDm4CRR3/redemption'

Loyalty Coins - redeem loyalty card and pay with points

Voucherify offers the possibility to set up a reward type in the Loyalty Program, which allows using loyalty points as gift credits. The available balance of credits is counted based on policy rules attached to the reward definition.

If a user configures just one reward type of paying in points, in the redemption request, there is no additional information required. Voucherify will automatically select as a proper reward definition and will calculate the discount based on the attached policy.

{
    "order": {
        "amount": 25000,
        "items": [
            { "product_id": "test_source_1", "quantity": "1", "price": 15000 },
            { "product_id": "test_source_2", "quantity": "1", "price": 10000 }
        ]
    },
    "metadata":{
        "category":"vip",
        "shop":"s1",
        "location": "l1"
    }
}
{
    "id": "r_zv5Qn7cF68RbVX4foKxgwUi1",
    "object": "redemption",
    "date": "2020-05-24T13:44:20Z",
    "customer_id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
    "amount": 250,
    "order": {
        "status": "PROCESSING",
        "items": [
            {
                "object": "order_item",
                "product_id": "test_source_1",
                "quantity": 1,
                "amount": 15000,
                "price": 15000
            },
            {
                "object": "order_item",
                "product_id": "test_source_2",
                "quantity": 1,
                "amount": 10000,
                "price": 10000
            }
        ],
        "customer": {
            "id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
            "object": "customer",
            "referrals": {
                "campaigns": [],
                "total": 0
            }
        },
        "amount": 25000,
        "object": "order",
        "id": "ord_Tgi2ApelDyl86sm5AYDKCBMZ",
        "created_at": "2020-05-24T13:44:20Z",
        "discount_amount": 25000
    },
    "customer": {
        "id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
        "source_id": "[email protected]",
        "name": "Tom Loyalty",
        "email": "[email protected]",
        "metadata": {},
        "object": "customer"
    },
    "reward": {
        "assignment_id": "rewa_pHilLjHWOD7oNjJZnog3VoEi",
        "loyalty_tier_id": "ltr_3q5dW6GaRC4QkA1oYmfGy1k1",
        "id": "rew_3qmzGPWJ7LfLXnPAjmbPacIl",
        "name": "1 point - 25 cents",
        "created_at": "2020-05-22T18:39:52Z",
        "updated_at": "2020-05-23T08:18:55Z",
        "parameters": {
            "automation_id": null,
            "coin": {
                "exchange_ratio": 0.25
            }
        },
        "type": "COIN",
        "object": "reward"
    },
    "metadata": {
        "category": "vip",
        "shop": "s1",
        "location": "l1"
    },
    "result": "SUCCESS",
    "tracking_id": "track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=",
    "voucher": {
        "id": "v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb",
        "code": "Dm1x8MuX",
        "campaign": "TestLoyalty-GivePoints",
        "campaign_id": "camp_qVVaC4vpVlof03eBi8qb5gE7",
        "category": null,
        "type": "LOYALTY_CARD",
        "discount": null,
        "gift": null,
        "loyalty_card": {
            "points": 489,
            "balance": 23
        },
        "start_date": null,
        "expiration_date": null,
        "validity_timeframe": null,
        "validity_day_of_week": null,
        "publish": {
            "object": "list",
            "count": 1,
            "url": "/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10"
        },
        "redemption": {
            "object": "list",
            "quantity": null,
            "redeemed_quantity": 8,
            "url": "/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10",
            "redeemed_points": 466
        },
        "active": true,
        "additional_info": null,
        "metadata": {},
        "assets": {
            "qr": {
                "id": "U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D"
            },
            "barcode": {
                "id": "U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D"
            }
        },
        "is_referral_code": false,
        "holder_id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
        "updated_at": "2020-05-24T13:44:20Z",
        "holder": {
            "id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
            "source_id": "[email protected]",
            "name": "Tom Loyalty",
            "email": "[email protected]",
            "metadata": {},
            "object": "customer"
        },
        "object": "voucher",
        "validation_rules_assignments": {
            "data": [],
            "object": "list",
            "total": 0,
            "data_ref": "data"
        }
    }
}

In case the user wants to define how much he spends in points, it is configurable by property points in a request body.

{
    "reward":{
        "points": 10
    },
    "order": {
        "amount": 25000,
        "items": [
            { "product_id": "test_source_1", "quantity": "1", "price": 15000 },
            { "product_id": "test_source_2", "quantity": "1", "price": 10000 }
        ]
    },
    "metadata":{
        "category":"vip",
        "shop":"s1",
        "location": "l1"
    }
}
{
    "id": "r_NJIfNYD8uc2lNm3YBAqXr3FF",
    "object": "redemption",
    "date": "2020-05-24T16:28:29Z",
    "customer_id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
    "amount": 10,
    "order": {
        "status": "PROCESSING",
        "items": [
            {
                "object": "order_item",
                "product_id": "test_source_1",
                "quantity": 1,
                "amount": 15000,
                "price": 15000
            },
            {
                "object": "order_item",
                "product_id": "test_source_2",
                "quantity": 1,
                "amount": 10000,
                "price": 10000
            }
        ],
        "customer": {
            "id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
            "object": "customer",
            "referrals": {
                "campaigns": [],
                "total": 0
            }
        },
        "amount": 25000,
        "object": "order",
        "id": "ord_70kKdXIKCSx5cfglKSpz9aHy",
        "created_at": "2020-05-24T16:28:29Z",
        "discount_amount": 250
    },
    "customer": {
        "id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
        "source_id": "[email protected]",
        "name": "Tom Loyalty",
        "email": "[email protected]",
        "metadata": {},
        "object": "customer"
    },
    "reward": {
        "assignment_id": "rewa_pHilLjHWOD7oNjJZnog3VoEi",
        "loyalty_tier_id": null,
        "id": "rew_3qmzGPWJ7LfLXnPAjmbPacIl",
        "name": "1 point - 25 cents",
        "created_at": "2020-05-22T18:39:52Z",
        "updated_at": "2020-05-24T13:44:26Z",
        "parameters": {
            "automation_id": null,
            "coin": {
                "exchange_ratio": 0.25
            }
        },
        "type": "COIN",
        "object": "reward"
    },
    "metadata": {
        "category": "vip",
        "shop": "s1",
        "location": "l1"
    },
    "result": "SUCCESS",
    "tracking_id": "track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=",
    "voucher": {
        "id": "v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb",
        "code": "Dm1x8MuX",
        "campaign": "TestLoyalty-GivePoints",
        "campaign_id": "camp_qVVaC4vpVlof03eBi8qb5gE7",
        "category": null,
        "type": "LOYALTY_CARD",
        "discount": null,
        "gift": null,
        "loyalty_card": {
            "points": 539,
            "balance": 63
        },
        "start_date": null,
        "expiration_date": null,
        "validity_timeframe": null,
        "validity_day_of_week": null,
        "publish": {
            "object": "list",
            "count": 1,
            "url": "/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10"
        },
        "redemption": {
            "object": "list",
            "quantity": null,
            "redeemed_quantity": 9,
            "url": "/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10",
            "redeemed_points": 476
        },
        "active": true,
        "additional_info": null,
        "metadata": {},
        "assets": {
            "qr": {
                "id": "U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D"
            },
            "barcode": {
                "id": "U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D"
            }
        },
        "is_referral_code": false,
        "holder_id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
        "updated_at": "2020-05-24T16:28:29Z",
        "holder": {
            "id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
            "source_id": "[email protected]",
            "name": "Tom Loyalty",
            "email": "[email protected]",
            "metadata": {},
            "object": "customer"
        },
        "object": "voucher",
        "validation_rules_assignments": {
            "data": [],
            "object": "list",
            "total": 0,
            "data_ref": "data"
        }
    }
}

Moreover, it is possible to define many levels of reward in which collected points can be used as gift credits. Per each tier, we can implement different conversion factors. Having many options in the rewards catalog, we will need to select a coins calculation policy (reward ID) that we want to use for calculating a final discount in the redemption request.

{
    "reward":{
        "points": 30,
        "id": "rew_noP2S5H8PEBFT97mennSA531"
    },
    "order": {
        "amount": 25000,
        "items": [
            { "product_id": "test_source_1", "quantity": "1", "price": 15000 },
            { "product_id": "test_source_2", "quantity": "1", "price": 10000 }
        ]
    },
    "metadata":{
        "category":"vip",
        "shop":"s1",
        "location": "l1"
    }
}
{
    "id": "r_se17sLon6YX5wMhYVzfQa2dc",
    "object": "redemption",
    "date": "2020-05-24T13:41:16Z",
    "customer_id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
    "amount": 10,
    "order": {
        "status": "PROCESSING",
        "items": [
            {
                "object": "order_item",
                "product_id": "test_source_1",
                "quantity": 1,
                "amount": 15000,
                "price": 15000
            },
            {
                "object": "order_item",
                "product_id": "test_source_2",
                "quantity": 1,
                "amount": 10000,
                "price": 10000
            }
        ],
        "customer": {
            "id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
            "object": "customer",
            "referrals": {
                "campaigns": [],
                "total": 0
            }
        },
        "amount": 25000,
        "object": "order",
        "id": "ord_EfMmve84JzQIg2MCM3cAvLgF",
        "created_at": "2020-05-24T13:41:16Z",
        "discount_amount": 25000
    },
    "customer": {
        "id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
        "source_id": "[email protected]",
        "name": "Tom Loyalty",
        "email": "[email protected]",
        "metadata": {},
        "object": "customer"
    },
    "reward": {
        "assignment_id": "rewa_g3QQwQfhJrjBYzEa1NJkub7N",
        "loyalty_tier_id": null,
        "id": "rew_noP2S5H8PEBFT97mennSA531",
        "name": "1 point 25$",
        "created_at": "2020-05-24T12:57:19Z",
        "parameters": {
            "automation_id": null,
            "coin": {
                "exchange_ratio": 25.0
            }
        },
        "type": "COIN",
        "object": "reward"
    },
    "metadata": {
        "category": "vip",
        "shop": "s1",
        "location": "l1"
    },
    "result": "SUCCESS",
    "tracking_id": "track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=",
    "voucher": {
        "id": "v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb",
        "code": "Dm1x8MuX",
        "campaign": "TestLoyalty-GivePoints",
        "campaign_id": "camp_qVVaC4vpVlof03eBi8qb5gE7",
        "category": null,
        "type": "LOYALTY_CARD",
        "discount": null,
        "gift": null,
        "loyalty_card": {
            "points": 439,
            "balance": 223
        },
        "start_date": null,
        "expiration_date": null,
        "validity_timeframe": null,
        "validity_day_of_week": null,
        "publish": {
            "object": "list",
            "count": 1,
            "url": "/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10"
        },
        "redemption": {
            "object": "list",
            "quantity": null,
            "redeemed_quantity": 7,
            "url": "/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10",
            "redeemed_points": 216
        },
        "active": true,
        "additional_info": null,
        "metadata": {},
        "assets": {
            "qr": {
                "id": "U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D"
            },
            "barcode": {
                "id": "U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==",
                "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D"
            }
        },
        "is_referral_code": false,
        "holder_id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
        "updated_at": "2020-05-24T13:41:16Z",
        "holder": {
            "id": "cust_lXisxEaEHYKTEVf1YnNS8AUh",
            "source_id": "[email protected]",
            "name": "Tom Loyalty",
            "email": "[email protected]",
            "metadata": {},
            "object": "customer"
        },
        "object": "voucher",
        "validation_rules_assignments": {
            "data": [],
            "object": "list",
            "total": 0,
            "data_ref": "data"
        }
    }
}

Returns

Returns a redemption object if the redeem operation succeeded. Returns an error if something goes wrong. A common source of error is an invalid or expired voucher, or a valid gift voucher with insufficient available balance.

Language
Response
Click Try It! to start a request and see the response here!