The Voucherify Developer Hub

Welcome to the Voucherify developer hub. You'll find comprehensive guides and documentation to help you start working with Voucherify as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started
Suggest Edits

Introduction

 

The Voucherify API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website's client-side code). JSON is returned by all API responses, including errors, although our API libraries convert responses to appropriate language-specific objects.

To make the API as explorable as possible, this documentation has test mode. You can test all methods with no cost.

In general Vouchers API consists of 2 sets:

  • application API - full capabilitiy, designed to be accessed from your server application
  • client API - limited capability, designed to be accessed from your website or mobile application

Your API keys

Find out more about how to authenticate your application to access the API.

The Voucherify API uses conventional HTTP status codes to indicate success or failure. Responses with a status code starting with 4xx or 5xx can be considered as failed. The API returns errors in JSON format in following structure:

{
  "code": 405,
  "message": "HTTP Method Not Allowed",
  "details": "PUT is not supported by this endpoint. Did you mean GET or POST?"
}

Developer-friendly API

Voucherify attempts to provide a developer-friendly API, hence sometimes you can find a hint how to fix an error right in its details (like in the example above).

ATTRIBUTES

code

The HTTP status code of error returned. Can be: 2xx, 4xx or 5xx.

key

For API object errors, a short string from amongst those listed on the right describing the kind of error that occurred.

message

A human-readable message providing short description about the error.

details

A human-readable message providing more details about the error.

HTTP status code summary

HTTP Status Code
Text
Description

400

Bad Request

The request was invalid. It may occur for various reasons - a malformed JSON or a violated rule (e.g. an attempt to redeem an expired voucher).

401

Unauthorized

Authentication has failed or has not yet been provided.

402

Payment Required

The request exceeded your current pricing plan.

404

Not Found

The requested resource could not be found.

405

Method Not Allowed

The request used a method (GET, POST, etc.) that is not available for given resource. Error details include a hint which methods are allowed.

406

Not Acceptable

The API is unable to produce a response in a format specified by the Accept header. In most cases the only available response format is application/json.

415

Unsupported Media Type

The API is unable to consume a request in a format specified by the Content-Type header.

500

Internal Server Error

An internal API error occurred. Don't worry. We track and verify all such errors.

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

already_rolled_back

redemption was rolled back before the current operation start time

invalid_voucher

voucher object was specified incorrectly (e.g., gift or discount is missing)

invalid_gift

gift object was specified incorrectly

duplicate_resource_key

resource identifier is in use

no_voucher_suitable_for_publication

lack of vouchers suitable for publication

Suggest Edits

Versioning

 

When we make backwards-incompatible changes to the API, we release new, dated versions. The current version is v2017-04-05. Read our API changelog and to learn more about API versions in Voucherify.

All requests will use your account API settings, unless you override the API version. The changelog lists every available version.

To set the API version on a specific request, send X-Voucherify-API-Version header.

curl -X GET \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -H "X-Voucherify-API-Version: v2017-04-05" \
  https://api.voucherify.io/v1/vouchers/Testing7fjWdr

API Upgrades

Keep track of changes and upgrades to the Voucherify API. If you need help, talk to support on live chat or Slack channel.

Suggest Edits

The voucher object

Data model description

 

Vouchers are essential resources in Voucherify. Every voucher has a unique code that a customer needs to know in order to redeem the voucher. Voucherify provides 2 types of vouchers - discount vouchers and gift vouchers.

Discount

You can choose one of three types of discounts:

  • amount (e.g. $10 off),
  • percent (e.g. 20% off),
  • unit (e.g. 2 piano lessons).

Gift vouchers

They are like pre-paid gift cards. Redeemable once e.g. a fixed-price voucher for 3 hours golf course or redeemable multiple times against any of your product or service given a positive balance.

You can group vouchers in campaigns and categories. Depending on your strategy vouchers can be valid only once or multiple times. Marketers and developers can activate vouchers at any time. Voucher's lifetime is either limited or unlimited. Vouchers include a detailed history of their redemptions.

Attributes
Description
Example

code
string

A code that identifies the voucher.

object
string
[coming soon]

Type of the object represented by JSON. Value is voucher.

type
string

Voucher's type.

DISCOUNT_VOUCHER
or
GIFT_VOUCHER (see above)

campaign
string

The campaign name this voucher belongs to.

category
string

The category this voucher belongs to.

discount
object

This object represents discount parameters. Present only if type is DISCOUNT_VOUCHER.

Child attributes:

  • type (string) - Type of the discount - AMOUNT, PERCENT or UNIT.

  • percent_off (float, optional) - Percent that will be taken off the subtotal of any amount to pay. For example, a discount with percent_off of 50 will make a $100 bill $50 instead.

  • amount_off (integer, optional) - Amount that will be taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $10 discount is written as 1000.

  • unit_off (float, optional) - Number of units that will be taken off the subtotal of any bill to pay. For example, 1 hour discount for booking a football court.

  • unit_type (string, optional) - Type of unit discount (e.g. time, items).

"discount": {
    "type": "PERCENT",
    "percent_off": 10
}
"discount": {
    "type": "AMOUNT",
    "amount_off": 1000
}

gift
object

This object represent gift parameters. Present only if type is GIFT_VOUCHER.

Child attributes:

  • amount (integer, required) - Initial amount associated with the voucher. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.
  • balance (integer) - Funds that are available to be used. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.
"gift": {
    "amount": 10000,
    "balance": 10000
}

start_date
string, ISO 8601 date format

Voucher's activation date.

2016-11-16T14:14:31Z

expiration_date
string, ISO 8601 date format

Voucher's expiration date.

2099-11-16T14:14:31Z

active
boolean

A flag that allows to disable a voucher even though it's within its activity period.

redemption
list

A list of redemptions that have been applied to the voucher.

Child attributes:

  • quantity (integer, required) - Default: null. How many times a voucher can be redeemed. A null value means unlimited.

  • redeemed_quantity (integer, required) - How many times a voucher has already been redeemed.

  • redeemed_amount (integer) - Total Amount redeemed by the voucher. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 balance is written as 10000.

  • redemption_entries (array) - A list of redemptions and rollbacks that have been applied to the voucher.

  • url (string) - The URL where this list can be accessed.

"redemption": {
  "object": "list",
  "total": 2,
  "data_ref": "redemption_entries",
  "quantity": null,
  "redeemed_quantity": 2,
  "redeemed_amount": 20000,
  "redemption_entries": [
    {},
    {}
  ]
}

publish
list

An object gets updated whenever a voucher has been published (e.g. through Export to MailChimp or publish voucher API method). It stores an array of each publish event details and the events counter.

"publish": {
  "object": "list",
  "count": 1,
  "data_ref": "entries",
  "entries": [
    {
      "customer_id": "",
      "channel": "API",
      "published_at": "",
      "metadata": {
        "test": true,
        "app": "postman"
      }
    }
  ]
}

assets
object

An object stores links to images with QR codes in which Voucherify encrypts voucher code.

As a query string params you can attach following attributes to URL:

  • size (integer) - value from 1 to 100

  • format (string) - png (default) or svg

"assets": {
    "qr": {
      "id": "",
      "url": ""
    }
  }

metadata
object

A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format.

"metadata": {
    "test": true,
    "locale": "pl-en"
}

additional_info
string

A field to keep any extra textual information.

{
  "code": "GIFT_1",
  "campaign": null,
  "category": "test",
  "type": "GIFT_VOUCHER",
  "discount": null,
  "gift": {
    "amount": 100000000,
    "balance": 90000000
  },
  "start_date": "2016-10-31T23:00:00Z",
  "expiration_date": null,
  "publish": {
    "object": "list",
    "count": 1,
    "url": "/v1/vouchers/GIFT_1/publications",
    "data_ref": "entries",
    "entries": [
      {
        "customer_id": "cust_BXduSjtFw9aMrLoW8sfewWLv",
        "customer": "test@myshop.com",
        "channel": "API",
        "published_at": "2016-11-26T17:24:05Z",
        "metadata": {
          "test": true,
          "app": "postman"
        }
      }
    ]
  },
  "redemption": {
    "object": "list",
    "total": 2,
    "url": "/v1/vouchers/GIFT_1/redemptions",
    "data_ref": "redemption_entries",
    "quantity": null,
    "redeemed_quantity": 2,
    "redeemed_amount": 20000,
    "redemption_entries": [
      {
        "id": "r_RaqsHhD5sPWw1yb0CGXASpPI",
        "object": "redemption",
        "date": "2016-11-23T13:49:15Z",
        "customer_id": "cust_ibxhJgzsXNplC3ojggfnOWWl",
        "tracking_id": "(tracking_id not set)",
        "amount": 10000,
        "order": {
          "amount": 10000,
          "items": []
        },
        "result": "SUCCESS"
      },
      {
        "id": "r_WdQGoDAaPT19kFWIGp434yzS",
        "object": "redemption",
        "date": "2016-11-23T13:50:35Z",
        "customer_id": "cust_ibxhJgzsXNplC3ojggfnOWWl",
        "tracking_id": "(tracking_id not set)",
        "amount": 10000,
        "order": {
          "amount": 10000,
          "items": []
        },
        "result": "SUCCESS"
      }
    ]
  },
  "active": true,
  "additional_info": null,
  "metadata": {},
  "assets": {
    "qr": {
      "id": "U2FsdGVkX18q6LE4stziCYvdHckywW5lCzMB3UdcK29ZZhzzc1YZ+vYnk3FTFrqsxaWqQXwGTf9RdS+qqUuAJzu1uM6QcohRLR6XkJWOQvZcZ11h0rglPIF2lFtC4E0SrLGsUWFUKH3N8SA1uSz7lA==",
      "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18q6LE4stziCYvdHckywW5lCzMB3UdcK29ZZhzzc1YZ%2BvYnk3FTFrqsxaWqQXwGTf9RdS%2BqqUuAJzu1uM6QcohRLR6XkJWOQvZcZ11h0rglPIF2lFtC4E0SrLGsUWFUKH3N8SA1uSz7lA%3D%3D"
    }
  }
}
Suggest Edits

Create Voucher

Method to create single voucher. You can choose varied types of vouchers.

 
posthttps://api.voucherify.io/v1/vouchers/code
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "category": "New Customers",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
        "percent_off": 10.0,
        "type": "PERCENT"
    },
    "start_date": "2016-01-01T00:00:00Z",
    "expiration_date": "2016-12-31T23:59:59Z",
    "redemption": {
        "quantity": 1 
    },
    "code_config": {
        "pattern": "PROMO-#####"
    },
    "metadata": {
      "test": true,
      "locale": "de-en"
    }
  }' \
  https://api.voucherify.io/v1/vouchers/
A binary file was returned

You couldn't be authenticated

{
  "code": "PROMO-BVodE",
  "campaign": null,
  "category": "New Customers",
  "type": "DISCOUNT_VOUCHER",
  "discount": {
    "type": "PERCENT",
    "percent_off": 10
  },
  "gift": null,
  "start_date": "2016-01-01T00:00:00Z",
  "expiration_date": "2016-12-31T23:59:59Z",
  "publish": {
    "object": "list",
    "count": 0,
    "url": "/v1/vouchers/PROMO-BVodE/publications?page=1&limit=10"
  },
  "redemption": {
    "object": "list",
    "quantity": 1,
    "redeemed_quantity": 0,
    "url": "/v1/vouchers/PROMO-BVodE/redemptions?page=1&limit=10"
  },
  "active": true,
  "additional_info": null,
  "metadata": {
    "test": true,
    "locale": "de-en"
  }
}

Path Params

code
string
required

A code that identifies the voucher. It is optional. Code will be generated automatically if not provided.

Body Params

type
string
required

Voucher's type. Possible options: DISCOUNT_VOUCHER or GIFT_VOUCHER (see above in the voucher object description).

discount
object
 
discount.type
string

Type of the discount - AMOUNT, PERCENT or UNIT.

discount.percent_off
float

Percent that will be taken off the subtotal of any amount to pay. For example, a discount with percent_off of 50 will make a $100 bill $50 instead.

discount.amount_off
int64

Amount that will be taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $10 discount is written as 1000.

discount.unit_off
float

Number of units that will be taken off the subtotal of any bill to pay. For example, 1 hour discount for booking a football court.

discount.unit_type
string

Type of unit discount (e.g. time, items).

gift
object
 
gift.amount
int64

Amount associated with the voucher. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

category
string

The category this voucher belongs to.

additional_info
string

A field to keep any extra textual information.

start_date
date

Voucher's activation date in ISO 8601 date format.

expiration_date
date

Voucher's expiration date in ISO 8601 date format.

active
boolean

A flag that allows to disable a voucher even though it's within its activity period.

redemption
object
 
redemption.quantity
int32

Default: null. How many times a voucher can be redeemed. A null value means unlimited.

metadata
object

A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format.

 
 

Voucher Model

You can find a full list of possible voucher properties in voucher object description.

Voucher code pattern

You can specify how to create the random code by passing a code_config:

  • length - Number of characters in a generated code (excluding prefix and postfix).
  • charset - Characters that can appear in the code.
  • prefix - A text appended before the code.
  • postfix - A text appended after the code.
  • pattern - A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.

Returns

Returns a voucher object if the call succeeded. The returned object will have information about discount type, and discount amount, if that information has been provided.

If you want to create a voucher with a given code (e.g. "WELCOME"):

curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "category": "New Customers",
    "discount": {
        "percent_off": 10.0,
        "type": "PERCENT"
    },
    "start_date": "2016-01-01T00:00:00Z",
    "expiration_date": "2016-12-31T23:59:59Z",
    "redemption": {
        "quantity": 100 
    }
  }' \
  http://api.voucherify.io/v1/vouchers/WELCOME
"code_config": {
    "pattern": "##-##-##",
}
"code_config": {
    "prefix": "PROMO-",
    "length": 5,
    "charset": "0123456789"
}
Suggest Edits

Get Voucher

Retrieves the voucher with the given code.

 
gethttps://api.voucherify.io/v1/vouchers/code
curl -X GET \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  https://api.voucherify.io/v1/vouchers/Testing7fjWdr
A binary file was returned

You couldn't be authenticated

{
  "code": "Testing7fjWdr",
  "campaign": null,
  "category": "test",
  "type": "DISCOUNT_VOUCHER",
  "discount": {
    "type": "AMOUNT",
    "amount_off": 1000
  },
  "gift": null,
  "start_date": null,
  "expiration_date": null,
  "publish": {
    "object": "list",
    "count": 0,
    "data_ref": "entries",
    "entries": [],
    "total": 0,
    "url": "/v1/vouchers/Testing7fjWdr/publications?page=1&limit=10"
  },
  "redemption": {
    "object": "list",
    "total": 2,
    "data_ref": "redemption_entries",
    "quantity": null,
    "redeemed_quantity": 2,
    "redeemed_amount": 20050,
    "url": "/v1/vouchers/Testing7fjWdr/redemptions?page=1&limit=10",
    "redemption_entries": [
      {
        "id": "r_XbytKOFW8wnheSScssMgRNMm",
        "object": "redemption",
        "date": "2016-11-17T10:22:46Z",
        "customer_id": "cust_ztSxSmEZr8a4rop60yzjVZIq",
        "tracking_id": "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
        "amount": 20050,
        "order": {
          "amount": 20050,
          "items": [
            {
              "product_id": "prod_anJ03RZZq74z4v",
              "sku_id": null,
              "quantity": 2
            },
            {
              "product_id": null,
              "sku_id": "sku_0KtP4rvwEECQ2U",
              "quantity": 1
            }
          ]
        },
        "result": "SUCCESS"
      },
      {
        "id": "r_zCNrR5UdWHTFa7ABQtqH36Yb",
        "object": "redemption",
        "date": "2016-11-17T12:05:54Z",
        "customer_id": "cust_ztSxSmEZr8a4rop60yzjVZIq",
        "tracking_id": "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
        "order": {
          "amount": null,
          "items": []
        },
        "result": "SUCCESS"
      }
    ]
  },
  "active": true,
  "additional_info": null,
  "metadata": null,
  "assets": {
    "qr": {
      "id": "U2FsdGVkX1+VOQlTlRoSKfY7mISP6o/vtc76wyxwGpIuzVAboyfg9Z+yAd0uW79KTuoZDBPrNPRgaGFtF/+fW/8JbbdNiIyYdtK9KCEf2XdLwXkkxWwp4YlL1xp71WD96NH+L68Nj3GUpEU55CoZhQ==",
      "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVOQlTlRoSKfY7mISP6o%2Fvtc76wyxwGpIuzVAboyfg9Z%2ByAd0uW79KTuoZDBPrNPRgaGFtF%2F%2BfW%2F8JbbdNiIyYdtK9KCEf2XdLwXkkxWwp4YlL1xp71WD96NH%2BL68Nj3GUpEU55CoZhQ%3D%3D"
    }
  }
}

Path Params

code
string
required

A code that identifies the voucher.

 

Returns

Returns a voucher object if a valid identifier was provided. When requesting the code of a voucher that has been deleted, resource will not be returned, including a 404 HTTP status code.

Suggest Edits

Update Voucher

Updates the specified voucher by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Updates a voucher. You can modify following fields: category, start_date, expiration_date, active, additional_info, metadata, gift.amount. Other fields than listed above won't be modified. Even if provided they will be silently skipped.

 
puthttps://api.voucherify.io/v1/vouchers/code
curl -X PUT \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "category" : "New Customers",
    "start_date" : "2016-08-01T00:00:00Z",
    "expiration_date" : "2017-07-31T23:59:59Z"
  }' \
  https://api.voucherify.io/v1/vouchers/ZyaIZ
A binary file was returned

You couldn't be authenticated

{  
  "code":"ZyaIZ",
  "campaign":null,
  "category":"New Customers",
  "type":"DISCOUNT_VOUCHER",
  "discount":{
    "type":"PERCENT",
    "percent_off":10.0
  },
  "gift":null,
  "start_date":"2016-08-01T00:00:00Z",
  "expiration_date":"2017-07-31T23:59:59Z",
  "publish":{
    "object": "list",
    "count": 1,
    "url": "/v1/vouchers/ZyaIZ/publications?page=1&limit=10"
  },
  "redemption":{
    "object": "list",
    "quantity": 1,
    "redeemed_quantity": 0,
    "url": "/v1/vouchers/ZyaIZ/redemptions?page=1&limit=10"
  },
  "active":true,
  "additional_info":null,
  "metadata":null
}

Path Params

code
string
required

A code that identifies the voucher.

Body Params

category
string

The category this voucher belongs to.

start_date
string

Voucher's activation date in ISO 8601 date format.

expiration_date
string

Voucher's expiration date in ISO 8601 date format.

active
boolean

A flag that allows to disable a voucher even though it's within its activity period.

additional_info
string

A field to keep any extra textual information.

metadata
object

A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format.

 
gift
object

It gives an option to recharge gift vouchers. This property is valid only for GIFT_VOUCHER type.

 
gift.amount
long

Amount associated with the voucher. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

 

Returns

Returns the voucher object if the update succeeded. Returns an error if update parameters are invalid (e.g. specifying an invalid gift amount).

Suggest Edits

Delete Voucher

Permanently deletes a voucher. It cannot be undone. Also immediately removes any redemptions on the voucher.

 
deletehttps://api.voucherify.io/v1/vouchers/code
curl -X DELETE \
-H "X-App-Id: b0214323-77a9-46e9-bd6f-f8a91cca8de9" \
-H "X-App-Token: c834d4ea-c0d4-4d7d-ba37-79b47432e80c" \
https://api.voucherify.io/v1/vouchers/VOUCHER-CODE?force=true
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

code
string
required

It identifies voucher to delete.

Query Params

force
boolean

If this flag is set to true, voucher will be removed permanently. It means that afterwards user will be able to create next voucher with the same code.

 

Returns

Returns an 200 HTTP status code on success. If the voucher code does not exist, this call returns an error (404 - resource not found).

Suggest Edits

List Vouchers

Returns a list of your vouchers. The vouchers are returned sorted by creation date, with the most recent vouchers appearing first.

 
gethttps://api.voucherify.io/v1/vouchers
curl -X GET \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  https://api.voucherify.io/v1/vouchers?limit=3
A binary file was returned

You couldn't be authenticated

[
  {
    "code": "GIFT_1",
    "campaign": null,
    "category": "test",
    "type": "GIFT_VOUCHER",
    "discount": null,
    "gift": {
      "amount": 100000000,
      "balance": 100000000
    },
    "start_date": "2016-10-31T23:00:00Z",
    "expiration_date": null,
    "publish": {
      "object": "list",
      "count": 1,
      "url": "/v1/vouchers/GIFT_1/publications?page=1&limit=10"
    },
    "redemption": {
      "object": "list",
      "quantity": 1,
      "redeemed_quantity": 1,
      "redeemed_amount": 10173000,
      "url": "/v1/vouchers/GIFT_1/redemptions?page=1&limit=10"
    },
    "active": true,
    "additional_info": null,
    "metadata": {},
    "assets": {
      "qr": {
        "id": "U2FsdGVkX18q6LE4stziCYvdHckywW5lCzMB3UdcK29ZZhzzc1YZ+vYnk3FTFrqsxaWqQXwGTf9RdS+qqUuAJzu1uM6QcohRLR6XkJWOQvZcZ11h0rglPIF2lFtC4E0SrLGsUWFUKH3N8SA1uSz7lA==",
        "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18q6LE4stziCYvdHckywW5lCzMB3UdcK29ZZhzzc1YZ%2BvYnk3FTFrqsxaWqQXwGTf9RdS%2BqqUuAJzu1uM6QcohRLR6XkJWOQvZcZ11h0rglPIF2lFtC4E0SrLGsUWFUKH3N8SA1uSz7lA%3D%3D"
      }
    }
  },
  {
    "code": "EXPIRED",
    "campaign": null,
    "category": "test",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "AMOUNT",
      "amount_off": 1000
    },
    "gift": null,
    "start_date": "2016-08-31T22:00:00Z",
    "expiration_date": "2017-02-27T23:00:00Z",
    "publish": {
      "object": "list",
      "count": 0,
      "url": "/v1/vouchers/EXPIRED/publications?page=1&limit=10"
    },
    "redemption": {
      "object": "list",
      "quantity": 1,
      "redeemed_quantity": 0,
      "url": "/v1/vouchers/EXPIRED/redemptions?page=1&limit=10"
    },
    "active": true,
    "additional_info": null,
    "metadata": {
      "test": true
    },
    "assets": {
      "qr": {
        "id": "U2FsdGVkX1/STfKvSqbjC49gmTP+5eaLQyqqb1NCNpsi/x3GMxqdED6Jigk+h5QSr2dU+HuwGEt0J3JQ9eS+WUBSJ2akbeghgWy0aACBV9+UlSBuCN4MwdaVmCzolgMMavKJatj9Ks8HWI5pfZos2Q==",
        "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FSTfKvSqbjC49gmTP%2B5eaLQyqqb1NCNpsi%2Fx3GMxqdED6Jigk%2Bh5QSr2dU%2BHuwGEt0J3JQ9eS%2BWUBSJ2akbeghgWy0aACBV9%2BUlSBuCN4MwdaVmCzolgMMavKJatj9Ks8HWI5pfZos2Q%3D%3D"
      }
    }
  },
  {
    "code": "z3dJb0pB",
    "campaign": "TO-DELETE",
    "category": null,
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "AMOUNT",
      "amount_off": 1000
    },
    "gift": null,
    "start_date": null,
    "expiration_date": null,
    "publish": {
      "object": "list",
      "count": 0,
      "url": "/v1/vouchers/z3dJb0pB/publications?page=1&limit=10"
    },
    "redemption": {
      "object": "list",
      "quantity": 1,
      "redeemed_quantity": 0,
      "url": "/v1/vouchers/z3dJb0pB/redemptions?page=1&limit=10"
    },
    "active": true,
    "additional_info": null,
    "metadata": null,
    "assets": {
      "qr": {
        "id": "U2FsdGVkX19Q0WHOOKM/fKkDTu8r0iRxyfVosiuFBmz66AVhERiP3szXtNic7hBlpowWtxmjuUGAaq0Lf/FY0MAV7zAHhOjlnvSXlCtn/xhJ+8G4qy3M9y8w8WtGBstrRDYj7tYG0Q42r7pZ6jjPKg==",
        "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19Q0WHOOKM%2FfKkDTu8r0iRxyfVosiuFBmz66AVhERiP3szXtNic7hBlpowWtxmjuUGAaq0Lf%2FFY0MAV7zAHhOjlnvSXlCtn%2FxhJ%2B8G4qy3M9y8w8WtGBstrRDYj7tYG0Q42r7pZ6jjPKg%3D%3D"
      }
    }
  }
]

Query Params

limit
int32

A limit on the number of objects to be returned. Limit can range between 1 and 100 items.

page
int32

Which page of results to return.

category
string

Limit vouchers to the ones that are within the specified category

campaign
string

Limit vouchers to the ones that belong to the specified campaign.

 

Returns

A dictionary with a data property that contains an array of up to limit vouchers. Each entry in the array is a separate voucher object. If no more vouchers are available, the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.

Suggest Edits

Enable Voucher

There are various times when you'll want to manage voucher accessibility. This can be done by two API method for managing voucher state - enable and disable. It puts voucher to state in which it is active and can be redeemed - only when it is not expired or before start date.

 
posthttps://api.voucherify.io/v1/vouchers/code/enable
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  https://api.voucherify.io/v1/vouchers/N5HjdC13/enable
A binary file was returned

You couldn't be authenticated

{
  "code":"N5HjdC13",
  "campaign":null,
  "category":"test",
  "type":"DISCOUNT_VOUCHER",
  "discount": {
    "type":"AMOUNT",
    "amount_off":1000
  },
  "gift":null,
  "start_date":null,
  "expiration_date":null,
  "publish":{
    "object":"list",
    "count":0,
    "data_ref":"entries",
    "entries":[],
    "url": "/v1/vouchers/N5HjdC13/publications?page=1&limit=10"
  },
  "redemption":{
    "object":"list",
    "total":0,
    "data_ref":"redemption_entries",
    "quantity":1,
    "redeemed_quantity":0,
    "redemption_entries":[],
    "url": "/v1/vouchers/N5HjdC13/redemptions?page=1&limit=10"
  },"active":true,
  "additional_info":null,
  "metadata":null,
  "assets":{
    "qr":{
      "id":"U2FsdGVkX181CLWKN9/au5CphFdwyw0VR8i6AFvNISgdkMJ/6QZax8XRl4pq9KjXe1mZUIq12+4haxf3wLbs8QaKXPkF33trzZuJ12OZurHHtmfmYFjROkBS9+1AHE5andtTwvpa2/9k1fgedCzBCQ==",
 "url":"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX181CLWKN9%2Fau5CphFdwyw0VR8i6AFvNISgdkMJ%2F6QZax8XRl4pq9KjXe1mZUIq12%2B4haxf3wLbs8QaKXPkF33trzZuJ12OZurHHtmfmYFjROkBS9%2B1AHE5andtTwvpa2%2F9k1fgedCzBCQ%3D%3D"
    }
  },
  "is_referral_code":false,
  "updated_at":"2017-04-11T10:50:16Z",
  "object":"voucher"
}

Path Params

code
string
required

It identifies voucher to enable.

 

Returns

Returns an 200 HTTP status code on success. If the voucher code does not exist, this call returns an error (404 - resource not found).

Suggest Edits

Disable Voucher

There are various times when you'll want to manage voucher accessibility. This can be done by two API method for managing voucher state - enable and disable. It puts voucher to state in which it is inactive and cannot be redeemed.

 
posthttps://api.voucherify.io/v1/vouchers/code/disable
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  https://api.voucherify.io/v1/vouchers/N5HjdC13/disable
A binary file was returned

You couldn't be authenticated

{
  "code":"N5HjdC13",
  "campaign":null,
  "category":"test",
  "type":"DISCOUNT_VOUCHER",
  "discount": {
    "type":"AMOUNT",
    "amount_off":1000
  },
  "gift":null,
  "start_date":null,
  "expiration_date":null,
  "publish":{
    "object":"list",
    "count":0,
    "data_ref":"entries",
    "entries":[],
    "url": "/v1/vouchers/N5HjdC13/publications?page=1&limit=10"
  },
  "redemption":{
    "object":"list",
    "total":0,
    "data_ref":"redemption_entries",
    "quantity":1,
    "redeemed_quantity":0,
    "redemption_entries":[],
    "url": "/v1/vouchers/N5HjdC13/redemptions?page=1&limit=10"
  },"active":true,
  "additional_info":null,
  "metadata":null,
  "assets":{
    "qr":{
      "id":"U2FsdGVkX181CLWKN9/au5CphFdwyw0VR8i6AFvNISgdkMJ/6QZax8XRl4pq9KjXe1mZUIq12+4haxf3wLbs8QaKXPkF33trzZuJ12OZurHHtmfmYFjROkBS9+1AHE5andtTwvpa2/9k1fgedCzBCQ==",
 "url":"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX181CLWKN9%2Fau5CphFdwyw0VR8i6AFvNISgdkMJ%2F6QZax8XRl4pq9KjXe1mZUIq12%2B4haxf3wLbs8QaKXPkF33trzZuJ12OZurHHtmfmYFjROkBS9%2B1AHE5andtTwvpa2%2F9k1fgedCzBCQ%3D%3D"
    }
  },
  "is_referral_code":false,
  "updated_at":"2017-04-11T10:50:16Z",
  "object":"voucher"
}

Path Params

code
string
required

It identifies voucher to enable.

 

Returns

Returns an 200 HTTP status code on success. If the voucher code does not exist, this call returns an error (404 - resource not found).

Suggest Edits

Add Gift Voucher Balance

This method gives a possibility to add balance to an existing gift voucher.

 
posthttps://api.voucherify.io/v1/vouchers/code/balance
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 2000
  }' \
  "https://api.voucherify.io/v1/vouchers/TestingyE6FwQbT/balance"
A binary file was returned

You couldn't be authenticated

{
  "amount": 2000,
  "object": "balance",
  "type": "gift_voucher",
  "related_object": {
    "type": "voucher",
    "id": "TestingyE6FwQbT"
  }
}

Path Params

code
string
required

Body Params

amount
int64
 

Returns

Returns a balance object if the operation succeeded. Returns an error if something goes wrong. A common source of error is an invalid type of voucher, or not existing code.

Suggest Edits

Import Vouchers

Method imports vouchers to the repository.

 
posthttps://api.voucherify.io/v1/vouchers/import
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "code": "CODE1",
      "category": "new customer acquisition",
      "type": "DISCOUNT_VOUCHER",
      "discount": {
        "amount_off": 3000,
        "type": "AMOUNT"
      },
      "start_date": "2015-12-01T23:00:00Z",
      "expiration_date": "2015-12-19T23:00:00Z",
      "redemption": {
        "quantity": 1.0
      },
      "metadata": {"unit": "EUR"},
      "additional_info": "secret-code1"
    },
    {
      "code": "CODE2",
      "type": "DISCOUNT_VOUCHER",
      "discount": {
        "percent_off": 30,
        "type": "PERCENT"
      },
      "start_date": "2015-12-10T23:00:00Z",
      "expiration_date": "2015-12-31T23:00:00Z",
      "redemption": {
        "quantity": 1.0
      },
      "metadata": {"unit": "EUR"},
      "additional_info": "secret-code2"
    }
  ]'\
  https://api.voucherify.io/v1/vouchers/import
A binary file was returned

You couldn't be authenticated

Try the API to see results
 

Categories

In structure representing your data you can define a category voucher belongs to. You can use the category of a voucher to group and search by specific criteria.

Returns

Returns 202 HTTP status code on success. It informs that your request has been accepted and vouchers will be added to the repository asynchronously.

Suggest Edits

Import Vouchers by CSV

Method imports vouchers to the repository.

 
posthttps://api.voucherify.io/v1/vouchers/importCSV
Code,Voucher Type,Value,Discount Type,Category,country
CODE010,DISCOUNT_VOUCHER,3.5,AMOUNT,import,de
CODE020,DISCOUNT_VOUCHER,5.0,AMOUNT,import,us
CODE030,GIFT_VOUCHER,100,,import,de
A binary file was returned

You couldn't be authenticated

Try the API to see results
 

The CSV file has to include headers in the first line. All properties which cannot be mapped to standard voucher fields will be added as fields in metadata object.

Standard voucher fields mapping

"Code", "Voucher Type", "Value", "Discount Type", "Category", "Start Date", "Expiration Date", "Redemption Limit", "Active", "Additional Info"

Categories

In structure representing your data you can define a category voucher belongs to. You can use the category of a voucher to group and search by specific criteria.

Returns

Returns 202 HTTP status code on success. It informs that your request has been accepted and vouchers will be added to the repository asynchronously.

Suggest Edits

The campaign object

Data model description

 

A campaign is used to group vouchers of a specific type. Amongst others the campaign type describes the discount you want to offer your customers and the expiry date. Once you create a new campaign Voucherify will generate the given number of corresponding codes. We put together a tutorial on how to create a Campaign.

Attributes
Description
Example

id
string [coming soon]

object
string

Type of the object represented by JSON. Value is campaign.

type
string

Campaign's type.

Voucherify offers two types:

  • STATIC - can't be changed after it's created - system will not generate new vouchers to this campaign.
  • AUTO-UPDATE - choosing the auto update option will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method).

STATIC (default)
or
AUTO_UPDATE

name
string

start_date
string, ISO 8601 date format

When the campaign begins. Before this date vouchers are inactive.

2016-11-16T14:14:31Z

expiration_date
string, ISO 8601 date format

When the campaign ends. After this date vouchers are inactive.

2020-11-16T14:14:31Z

voucher
object

A description of the vouchers collected in campaign. It contains whole voucher definition which is being used to generate unique codes along with the campaign creation. The same parameters are being used when you add new codes after campaign creation date.

"voucher": {
  "code_config": {
    "length": 8,
    "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
    "prefix": null,
    "postfix": null,
    "pattern": "TC6-PROMO-#######"
  },
  "type": "DISCOUNT_VOUCHER",
  "discount": {
    "type": "PERCENT",
    "percent_off": 10
  },
  "start_date": "2016-09-26T00:00:00Z",
  "expiration_date": "2020-12-26T00:00:00Z",
  "redemption": {
    "quantity": 1
  }
}

validation_rules
object

vouchers_count
integer

The size of the list of vouchers generated for campaign.

vouchers_generation_status
string

Status describing codes generation progress. Possible values: IN_PROGRESS, DONE, ERROR

metadata
object

A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format.

"metadata": {
    "test": true,
    "locale": "pl-en"
}

description
string

A field to keep any extra textual information.

{
  "name": "TC6 - test campaign - 11",
  "object": "campaign",
  "type": "AUTO_UPDATE",
  "description": "test",
  "metadata": {
    "test": true
  },
  "voucher": {
    "code_config": {
      "length": 8,
      "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
      "prefix": null,
      "postfix": null,
      "pattern": "TC6-PROMO-#######"
    },
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "PERCENT",
      "percent_off": 10
    },
    "start_date": "2016-09-26T00:00:00Z",
    "expiration_date": "2020-12-26T00:00:00Z",
    "redemption": {
      "quantity": 1
    }
  }
}
Suggest Edits

Create Campaign

Method to create a batch of vouchers aggregated in one campaign. You can choose varied types of vouchers and define unique codes pattern.

 
posthttps://api.voucherify.io/v1/campaigns
curl -X POST \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
-d '{
  "name": "Test Campaign",
  "start_date": "2016-10-26T00:00:00Z",
  "expiration_date": "2016-12-26T00:00:00Z",
  "vouchers_count": 100,
  "voucher": {
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "percent_off": "10.0",
      "type": "PERCENT"
    },
    "redemption": {
      "quantity": 1
    },
    "code_config": {
      "pattern": "TC6-PROMO-#######"
    }
  },
  "metadata": {
    "test": true
  }
}' \
https://api.voucherify.io/v1/campaigns
A binary file was returned

You couldn't be authenticated

{
  "name": "TC6 - test campaign - 13",
  "object": "campaign",
  "type": "STATIC",
  "description": null,
  "metadata": null,
  "vouchers_count": 100,
  "vouchers_generation_status": "IN_PROGRESS",
  "voucher": {
    "code_config": {
      "length": 8,
      "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
      "prefix": null,
      "postfix": null,
      "pattern": "TC6-PROMO-#######"
    },
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "PERCENT",
      "percent_off": 10
    },
    "redemption": {
      "quantity": null
    }
  }
}

Body Params

name
string
required

A unique campaign name.

start_date
date

Date vouchers from the created campaign become active.

expiration_date
date

Date vouchers become expired.

type
string

STATIC or AUTO_UPDATE learn more. By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method).

vouchers_count
int32

Size of the campaign.

voucher
object
 
voucher.type
string
required

Voucher's type - definition.

voucher.discount
object

This object represents discount parameters. Present only if type is DISCOUNT_VOUCHER.

 
voucher.discount.amount_off
long
voucher.discount.precent_off
float
voucher.discount.unit_off
float
voucher.discount.unit_type
string
voucher.gift
object

This object represent gift parameters. Present only if type is GIFT_VOUCHER.

 
voucher.gift.amount
long

Amount associated with the voucher. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

voucher.redemption
object
 
voucher.redemption.quantity
int32

Default: null. How many times a voucher can be redeemed. A null value means unlimited.

voucher.code_config
object

You can specify how to create the random code by passing this property (details).

 
metadata
object

Set of custom key/value pairs

 
 

Global uniqueness

All campaign codes are unique across the whole project. Voucherify won't allow to generate 2 campaigns with the same coupon code.

This is an asynchronous action, you can't read or modify a newly created campaign until the code generation is completed. See creation_status field in the campaign object description.

Returns

Returns a campaign object if the call succeeded. The returned object will have information about discount type, and discount amount.

Suggest Edits

Update Campaign

Updates the specified campaign by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

You can modify following fields: start_date, expiration_date, metadata, description, type. Other fields than listed above won't be modified. Even if provided they will be silently skipped. This method will update vouchers aggregated in the campaign. It will affect all vouchers which are not published or redeemed yet.

 
puthttps://api.voucherify.io/v1/campaigns/campaign
curl -X PUT \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "metadata" : {
    	"locale": "de-de"
    },
    "start_date" : "2016-08-01T00:00:00Z",
    "expiration_date" : "2017-07-31T23:59:59Z"
  }' \
  https://api.voucherify.io/v1/campaigns/test
A binary file was returned

You couldn't be authenticated

{
  "name": "test",
  "type": "STATIC",
  "start_date": "2016-08-01T00:00:00Z",
  "expiration_date": "2017-07-31T23:59:59Z",
  "metadata": {
    "test": null,
    "test_1": null,
    "locale": "de-de"
  },
  "updated_at": "2017-08-30T10:22:17Z",
  "vouchers_count": 10,
  "vouchers_generation_status": "DONE",
  "voucher": {
    "code_config": {
      "length": 8,
      "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
      "pattern": "########"
    },
    "type": "DISCOUNT_VOUCHER",
    "is_referral_code": false,
    "discount": {
      "type": "PERCENT",
      "percent_off": 10
    },
    "start_date": "2016-08-01T00:00:00Z",
    "expiration_date": "2017-07-31T23:59:59Z",
    "redemption": {
      "quantity": 1
    }
  },
  "object": "campaign"
}

Path Params

campaign
string
required

A name that identifies the campaign.

Body Params

start_date
string

Campaign's activation date in ISO 8601 date format.

expiration_date
string

Campaign's expiration date in ISO 8601 date format.

type
string

A property describing a campaign's type.

description
string

A field to keep any extra textual information.

metadata
object

A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the campaign and vouchers in a structured format.

 
 

Returns

Returns the campaign object if the update succeeded. Returns an error if update parameters are invalid (e.g. specifying an invalid campaign type).

Suggest Edits

Add Voucher to Campaign

This method gives a possibility to push new vouchers to existing campaign. Voucher definition will be inherited from this one kept in campaign profile. However you are able to overwrite few properties inherited from campaign: metadata, additional_info, redemption.quantity, category.

 
posthttps://api.voucherify.io/v1/campaigns/name/vouchers
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "category": "New voucher",
    "metadata": {
    	"locale": "de-en"
    },
    "additional_info": "Test voucher",
    "redemption": {
        "quantity": 1 
    }
  }' \
  https://api.voucherify.io/v1/campaigns/TESTING-CAMPAIGN/vouchers/
A binary file was returned

You couldn't be authenticated

{
  "code": "TC6-PROMO-brWnVUz",
  "campaign": "TC6 - test campaign - 11",
  "category": "TEST_CODE",
  "type": "DISCOUNT_VOUCHER",
  "discount": {
    "type": "PERCENT",
    "percent_off": 10
  },
  "gift": null,
  "start_date": "2016-09-26T00:00:00Z",
  "expiration_date": "2020-12-26T00:00:00Z",
  "publish": {
    "count": 0,
    "entries": []
  },
  "redemption": {
    "quantity": 15,
    "redeemed_quantity": 0,
    "redemption_entries": []
  },
  "active": true,
  "additional_info": "Test for adding codes",
  "metadata": {
    "test": true,
    "shop": "nowy"
  }
}

Path Params

name
string
required

Name of the campaign to which voucher will be added.

Body Params

additional_info
string

A field to keep any extra textual information.

metadata
object

A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. It will be merged with metadata object inherited from campaign.

 
redemption
object
 
redemption.quantity
int32

How many times a voucher can be redeemed. A null value means unlimited.

category
string

The category this voucher belongs to. It is not mandatory.

 

Returns

Returns a voucher object if the call succeeded. The returned object will have information about discount type, and discount amount, and all other which you provided to overwrite the origin one from campaign definition.

Suggest Edits

Add Voucher with certain code to Campaign

This method gives a possibility to push new vouchers to existing campaign. Voucher definition will be inherited from this one kept in campaign profile. However you are able to overwrite few properties inherited from campaign: metadata, additional_info, redemption.quantity, category.

 
posthttps://api.voucherify.io/v1/campaigns/name/vouchers/code
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "category": "New voucher",
    "metadata": {
    	"locale": "de-en"
    },
    "additional_info": "Test voucher",
    "redemption": {
        "quantity": 1 
    }
  }' \
  https://api.voucherify.io/v1/campaigns/TESTING-CAMPAIGN/vouchers/EXAMPLE-CODE
A binary file was returned

You couldn't be authenticated

{
  "code": "EXAMPLE-CODE",
  "campaign": "TESTING-CAMPAIGN",
  "category": "TEST_CODE",
  "type": "DISCOUNT_VOUCHER",
  "discount": {
    "type": "PERCENT",
    "percent_off": 10
  },
  "gift": null,
  "start_date": "2016-09-26T00:00:00Z",
  "expiration_date": "2020-12-26T00:00:00Z",
  "publish": {
    "count": 0,
    "entries": []
  },
  "redemption": {
    "quantity": 15,
    "redeemed_quantity": 0,
    "redemption_entries": []
  },
  "active": true,
  "additional_info": "Test for adding codes",
  "metadata": {
    "test": true,
    "shop": "nowy"
  }
}

Path Params

name
string
required

Name of the campaign to which voucher will be added.

code
string
required

Code which you want to use for identifying this certain voucher.

Body Params

additional_info
string

A field to keep any extra textual information.

metadata
object

A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format. It will be merged with metadata object inherited from campaign.

 
redemption
object
 
redemption.quantity
int32

How many times a voucher can be redeemed. A null value means unlimited.

category
string

The category this voucher belongs to. It is not mandatory.

 

Returns

Returns a voucher object if the call succeeded. The returned object will have information about discount type, and discount amount, and all other which you provided to overwrite the origin one from campaign definition.

Suggest Edits

Import Vouchers to Campaign

Imports vouchers to an existing campaign.

 
posthttps://api.voucherify.io/v1/campaigns/name/import
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "code": "CODE1",
      "redemption": {
      	"quantity": 1.0
      },
      "metadata": {"unit": "EUR"},
      "additional_info": "secret-code1"
    },
    {
      "code": "CODE2",
      "redemption": {
        "quantity": 1.0
      },
      "metadata": {"unit": "EUR"},
      "additional_info": "secret-code2"
    }
  ]'\
  https://api.voucherify.io/v1/campaigns/TESTING-CAMPAIGN/import
A binary file was returned

You couldn't be authenticated

Path Params

name
string
required

Name of an existing campaign

 

Discount type and expiration date will be taken from the Campaign definition.

Returns

Returns 202 HTTP status code on success. It informs that your request has been accepted and vouchers will be added to the repository asynchronously.

Suggest Edits

Import Vouchers to Campaign by CSV

Imports vouchers to an existing campaign.

 
posthttps://api.voucherify.io/v1/campaigns/name/importCSV
Code
CODE1
CODE2
A binary file was returned

You couldn't be authenticated

Path Params

name
string
required

Name of an existing campaign

 

Discount type and expiration date will be taken from the campaign object definition. You can import values for following fields: Code, Category, Active and other columns will be mapped to metadata properties.

Active

The CSV file is allowed in two versions - either with or without a Active column. It indicates if voucher is enabled after import event.

The header has to contain column Code.

Returns

Returns 202 HTTP status code on success. It informs that your request has been accepted and vouchers will be added to the repository asynchronously.

Suggest Edits

Delete Campaign

Permanently deletes a campaign and all related vouchers. It cannot be undone. Also immediately removes any redemptions on the voucher.

 
deletehttps://api.voucherify.io/v1/campaigns/name
curl -X DELETE \
-H "X-App-Id: b0214323-77a9-46e9-bd6f-f8a91cca8de9" \
-H "X-App-Token: c834d4ea-c0d4-4d7d-ba37-79b47432e80c" \
https://api.voucherify.io/v1/campaigns/CAMPAIGN_NAME?force=true
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

name
string
required

It identifies campaign to delete.

Query Params

force
boolean

If this flag is set to true, campaign and related vouchers will be removed permanently. It means that afterwards user will be able to create next campaign with the same name.

 

Returns

Returns an 200 HTTP status code on success. If the voucher code does not exist, this call returns an error (404 - resource not found).

Suggest Edits

Publish Voucher

This method selects a voucher that is suitable for publication and assigns it to given customer.

 
posthttps://api.voucherify.io/v1/vouchers/publish
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "campaign": "300k-vouchers",
    "customer": {
      "source_id": "test-user@voucherify.io",
      "email": "test-user@voucherify.io",
      "name": "Test User"
    },
    "metadata": {
      "test": true,
      "provider": "Shop Admin"
    }
  }' \
  https://api.voucherify.io/v1/vouchers/publish
A binary file was returned

You couldn't be authenticated

{  
  "code":"300k-phXfc",
  "campaign":"300k-vouchers",
  "category":null,
  "type":"DISCOUNT_VOUCHER",
  "discount":{  
    "type":"AMOUNT",
    "amount_off":1000
  },
  "gift":null,
  "start_date":null,
  "expiration_date":null,
  "publish":{
    "object":"list",
    "count":1,
		"url": "/v1/vouchers/300k-phXfc/publications"
  },
  "redemption":{  
    "object":"list",
    "quantity":1,
    "redeemed_quantity":0,
		"url": "/v1/vouchers/300k-phXfc/redemptions"
  },
  "active":true,
  "additional_info":null,
  "metadata":{
    "test":true
  }
}

Body Params

campaign
string

It is a camping name from which Voucheriy will try to take voucher and publish to customer.

voucher
string

It is a voucher code which Voucheriy will try to publish to customer.

channel
string

publication channel

customer
object
 
customer.id
string

The ID of an existing customer that will be linked to redemption in this request.

customer.source_id
string

A tracking identifier of a user that will receive a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returned by Voucherify.js (voucher validation), or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud.

customer.name
string
customer.email
string
customer.description
string
customer.metadata
object

A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.

 
metadata
object

A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication and customer in a structured format.

 
 

This method selects a voucher that is suitable for publication, adds a publish entry and returns the voucher.

A voucher is suitable for publication when it's active and hasn't been published more times than the redemption limit.

Clearly define source of the voucher

You must clearly defined from which source you want to publish voucher code. It can be either a campaign or specific voucher identified by code.

Auto-update campaign

In case you want to ensure the number of codes spread among customers and not limit it by number of vouchers in campaign, you must build auto-update campaign.

Returns

Returns a voucher object if a valid identifier was provided. Object will contain publication entry.

Suggest Edits

The Export object

 

/exports endpoint allows you to retrieve Voucherify objects such as vouchers and redemptions as a CSV file. This functionality works asynchronously and comes down to 3 steps:

  • create an export object and return its id so you can track its status
  • trigger a CSV file generation, change the status to SCHEDULED
  • when the generation is over, store the file in S3 and change the status to DONE (now you can get it)

With parameters you can select which fields will be exported and filter out the relevant data

  {
    "fields": [
      "code",
      "voucher_type"
    ],
    "filters": {
      "categories": {
        "conditions": {
          "$in": [
            "postman"
          ]
        }
      }
    }
  }

fields options:

  • voucher: code, voucher_type, value, discount_type, campaign, category, start_date, expiration_date, gift_balance, redemption_quantity, active, qr_code
  • redemption: id, object, date, voucher_code, campaign, customer_id, tracking_id, order_amount, gift_amount, result, failure_code, failure_message
  • publication: voucher_code, customer_id, date, channel, campaign
  • customer: name, customer_id, description, email, source_id, created_at, address_city, address_state, address_line_1, address_line_2, address_country, address_postal_code
Attributes
Description
Example

id

-

exp_8A4J1QLYeBrZsa7XNs1OZBpj

created_at

-

2017-02-24T13:10:50Z

status

SCHEDULED, DONE, or ERROR

DONE

channel

Info how the export was triggered

API

exported_object

voucher, redemption, customer or publication

voucher

parameters

Defines fields and filters for retrieved objects

  {
    "fields": [
      "code",
      "voucher_type"
    ],
    "filters": {
      "categories": {
        "conditions": {
          "$in": [
            "postman"
          ]
        }
      }
    }
  }

result

URL to a CSV file

{
    "url": "https://s3-eu-west-1.amazonaws.com/voucherify-exports/mike%40voucherify.io/export_moGIxqMuCYxLNUJFviiJ8uVA.csv"
}
Suggest Edits

Create Export

 
posthttps://api.voucherify.io/v1/exports
curl -X POST 
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" 
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" 
-H "Content-Type: application/json" 
-d '{
  "exported_object": "voucher",
  "parameters" : {
    "fields": ["code", "voucher_type"],
    "filters" : {
      "categories" : {
        "conditions" : {
          "$in" : ["postman"]
        }
      }
    }
  }
}' "https://api.voucherify.io/v1/exports"
A binary file was returned

You couldn't be authenticated

{
  "id": "export_v5sz5qyIUSubPCFbeIBGXWNV",
  "object": "export",
  "created_at": "2017-02-24T13:31:05.643Z",
  "status": "SCHEDULED",
  "channel": "API",
  "exported_object": "voucher",
  "parameters": {
    "fields": [
      "code",
      "voucher_type"
    ],
    "filters": {
      "categories": {
        "conditions": {
          "$in": [
            "postman"
          ]
        }
      }
    }
  },
  "result": null
}

Body Params

exported_object
string

Exported object, can be voucher, redemption, publication or customer

parameters
object

Defines fields and filters for retrieved objects

 
 
Suggest Edits

Get Export

 
gethttps://api.voucherify.io/v1/exports
curl -X GET 
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" 
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" 
-H "Content-Type: application/json" "https://api.voucherify.io/v1/exports/exp_moGIxqMuCYxLNUJFviiJ8uVA"
A binary file was returned

You couldn't be authenticated

{
  "id": "exp_moGIxqMuCYxLNUJFviiJ8uVA",
  "object": "export",
  "created_at": "2017-02-24T13:34:14.257Z",
  "status": "DONE",
  "channel": "API",
  "exported_object": "voucher",
  "parameters": {
    "fields": [
      "code",
      "voucher_type"
    ],
    "filter": {
      "categories": {
        "conditions": {
          "$in": [
            "postman"
          ]
        }
      }
    }
  },
  "result": {
    "url": "https://s3-eu-west-1.amazonaws.com/voucherify-exports/mike%40voucherify.io/exp_moGIxqMuCYxLNUJFviiJ8uVA.csv"
  }
}

Path Params

id
string
required

Export object id

 
Suggest Edits

Delete Export

 
deletehttps://api.voucherify.io/v1/exports
curl -X DELETE
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" 
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" 
-H "Content-Type: application/json" "https://api.voucherify.io/v1/exports/exp_moGIxqMuCYxLNUJFviiJ8uVA"
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required

Export object id

 
Suggest Edits

List Publications

 
gethttps://api.voucherify.io/v1/publications
curl -X GET
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" 
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" 
-H "Content-Type: application/json" 
"https://api.voucherify.io/v1/publications"
A binary file was returned

You couldn't be authenticated

{
  "object": "list",
  "total": "1705",
  "data_ref": "publications",
  "publications": [
    {
      "id": "pub_baXO6cwguEX16M4t5IgivaWR",
      "object": "publication",
      "created_at": "2017-04-03T22:22:34.976Z",
      "customer_id": "cust_KS152w7uharcv0B6mb9XbvMN",
      "tracking_id": "lkmhaTGebgEZaCP0ZLytFxboCB96q1Yw",
      "metadata": null,
      "channel": "API",
      "result": "SUCCESS",
      "customer": {
        "object": "customer",
        "id": "cust_KS152w7uharcv0B6mb9XbvMN"
      },
      "voucher": {
        "code": "PtzUbO9v",
        "object": "voucher",
        "campaign": "enable",
        "gift": null,
        "discount": {
          "type": "AMOUNT",
          "amount_off": 500
        },
        "is_referral_code": false
      },
      "failure_code": null,
      "failure_message": null
    }
  ]
}

Query Params

limit
int32

A limit on the number of objects to be returned. The limit can range between 1 and 100 items.

page
int32

Which page of result to return

order
string

Sorts the results, options: "id", "voucher_code", "tracking_id", "customer_id", "created_at", "channel"

campaign
string

Filters by a given campaign

customer
string

Filters by a customer

voucher
string

Filters by a given voucher code

result
string

Filters by a publication result

voucher_type
string

Filters by a voucher type

is_referral_code
boolean

If true, the query returns only publications of codes from a referral campaign. Otherwise, only publications from coupon campaigns

filters
string

Allows for combining the filters mentioned above, see below for the reference

 

Returns a list of publications you’ve previously created with Publish Voucher (explicitly or implicitly with exports). The publications are returned in sorted order, with the most recent publications appearing first.

filters query param allow for joining multiple parameters with logical operators. The syntax looks as follows:

filters[<field_name>][conditions][<operator>][<index>]=<value>

Operators:

    "$in"
    "$not_in"
    "$is"
    "$is_not"
    "$has_value"
    "$is_unknown"
    "$contains"
    "$starts_with"
    "$ends_with"
    "$more_than"
    "$less_than"
    "$more_than_equal"
    "$less_than_equal"

Example 1 - list publications of a given customer

GET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL

Example 2 - list publications of 2 customers

GET /v1/publications?filters[customer_id][conditions][$in][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$in][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc

or with the junction operator

GET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$is][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc&filters[junction]=OR
Suggest Edits

Validate Voucher

To verify a voucher code given by customer, you can use this method. It is designed for server side integration which means that is accessible only through private keys.

 
posthttps://api.voucherify.io/v1/vouchers/code/validate
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "customer" : {
      "id" : "cust_07sVjVsr71Ewot9lVZSrIVLH",
      "source_id" : "john@lemon.com",
      "name": "John Lemon"
    },
    "order" : {
      "amount" : 1000,
      "items": [
        { "product_id": "prod_anJ03RZZq74z4v", "quantity": "1" },
        { "sku_id": "sku_dSbRQfbyUMyHnt", "quantity": "1" },
        { "sku_id": "sku_0KtP4rvwEECQ2U", "quantity": "1" }
      ]
    },
    "metadata": {
      "locale": "en-GB"
    }
  }' \
  https://api.voucherify.io/v1/vouchers/Testing7fjWdr/validate
A binary file was returned

You couldn't be authenticated

{
  "code": "Testing7fjWdr",
  "valid": true,
  "discount": {
    "amount_off": 1000,
    "type": "AMOUNT"
  },
  "tracking_id": "track_uP6K80aZLxpKYZWvVIVW4A=="
}

Path Params

code
string
required

A code that identifies the voucher (e.g., Testing7fjWdr).

Body Params

customer
object
 
customer.id
string

The ID of an existing customer that will be linked to redemption in this request.

customer.source_id
string

A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID).

customer.name
string
customer.email
string
customer.description
string
customer.metadata
string

A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.

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.

 
metadata
object
 
 

Returns

This operation returns information about validity of the code. Moreover it returns hashed source identifier which can be used as tracking id in future calls.

Voucher validation might fail because of one of these reasons:

  • voucher not found - voucher doesn't exist or was deleted
  • voucher expired - voucher is out of [start date - expiration date] time frame
  • voucher is disabled - learn more disable voucher
  • customer does not match segment rules - learn more customer tracking
  • order does not match validation rules - learn more about validation rules
{
  "code": "91Ft4U",
  "valid": true,
  "gift": {
    "amount": 10000,
  },
  "tracking_id": "track_uP6K80aZLxpKYZWvVIVW4A=="
}
{
  "code": "m4DeUp",
  "valid": false,
  "reason": "voucher not found",
  "tracking_id": "track_uP6K80aZLxpKYZWvVIVW4A=="
}
{
  "code": "fUtuR3",
  "valid": false,
  "reason": "voucher not active yet",
  "tracking_id": "track_uP6K80aZLxpKYZWvVIVW4A=="
}
{
  "code": "3xP1reD",
  "valid": false,
  "reason": "voucher expired",
  "tracking_id": "track_uP6K80aZLxpKYZWvVIVW4A=="
}
{
  "code": "d154bLeD",
  "valid": false,
  "reason": "voucher is disabled",
  "tracking_id": "track_uP6K80aZLxpKYZWvVIVW4A=="
}
{
  "code": "91Ft4U",
  "valid": false,
  "reason": "gift amount exceeded",
  "tracking_id": "track_uP6K80aZLxpKYZWvVIVW4A=="
}
Suggest Edits

Validate Voucher (client-side)

To verify a voucher code given by customer, you can use this method. It is designed for client side integration which means that is accessible only through public keys. This method is designed to be run directly either in web browsers or mobile apps.

 
gethttps://api.voucherify.io/client/v1/validate?code=code&tracking_id=tracking_id&amount=amount
curl -X GET \
  -H "X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5" \
  -H "X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20" \
  -H "Content-Type: application/json" \
  -H "origin: yourdomain.com" \
  'https://api.voucherify.io/client/v1/validate?code=5OFF5&amount=1500&item%5B0%5D%5Bsku_id%5D=sku_13SWYzm3tuMXSP&item%5B0%5D%5Bquantity%5D=2&item%5B1%5D%5Bproduct_id%5D=prod_DSFGCz3IFxpkiL&item%5B1%5D%5Bquantity%5D=2'
A binary file was returned

You couldn't be authenticated

{
  "code": "Testing7fjWdr",
  "valid": true,
  "discount": {
    "amount_off": 1000,
    "type": "AMOUNT"
  },
  "tracking_id": "track_uP6K80aZLxpKYZWvVIVW4A=="
}

Query Params

code
string
required

A code that identifies the voucher (e.g., Testing7fjWdr).

tracking_id
string

A tracking identifier of a user that validated a voucher. Identifier generated during voucher validation based on your internal id during the first request (e.g., email, database ID). If you do request a first time, you should pass your internal id to track customer. Although not all information is required, the extra info helps prevent fraud.

amount
int32

A positive integer representing the total amount for the order.

order items
string

See examples belows

 
<script type="text/javascript" src="https://cdn.rawgit.com/rspective/voucherify.js/v1.4.5/dist/voucherify-1.4.5.js"></script>

<script type="text/javascript">
  function init() {
    Voucherify.initialize(
      "011240bf-d5fc-4ef1-9e82-11eb68c43bf5", //YOUR-CLIENT-APPLICATION-ID-FROM-SETTINGS
      "9e2230c5-71fb-460a-91c6-fbee64707a20" //YOUR-CLIENT-TOKEN-FROM-SETTINGS
    );
  };
  init();
  
  //-- [Optional] If you want us to track your customers' activity, then you should invoke the following function to set identity. You have to do it only once. If the identity parameter is not passed, then we will generate it for you.
  Voucherify.setIdentity("your-customer-uniq-id");
  Voucherify.validate("Testing7fjWdr", function callback (response) {
    console.log(response);
  });
</script>

Returns

This operation returns information about validity of the code. Moreover it returns hashed source identifier which can be used as tracking id in future calls.

Voucher validation might fail because of one of these reasons:

  • voucher not found - voucher doesn't exist or was deleted
  • voucher expired - voucher is out of [start date - expiration date] time frame
  • voucher is disabled - learn more disable voucher
  • customer does not match segment rules - learn more customer tracking
  • order does not match validation rules - learn more about validation rules
curl -X GET \
  -H "X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5" \
  -H "X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20" \
  -H "Content-Type: application/json" \
  -H "origin: yourdomain.com" \
  'https://api.voucherify.io/client/v1/validate?code=5OFF5&amount=1500&item[0][sku_id]=sku_13SWYzm3tuMXSP&item[0][quantity]=2&item[1][product_id]=prod_DSFGCz3IFxpkiL&item[1][quantity]=2'
Suggest Edits

The redemption object

Data model description

 

Redemption is the key operation in voucher's lifecycle. A customer can redeem a voucher once or multiple times depending on selected limit (quantity). Each redemption is recorded in voucher's history (redemption_entries). There is also an option to cancel a redemption. We call such operation a redemption rollback.

Attributes
Description
Example

id
string

r_iMsIlXpjfQwMWFJPEPJFeJ4h

object
string

Type of the object represented by JSON. Value is redemption.

date
string, ISO 8601 date format

2016-11-16T14:14:31Z

customer_id
string

An identifier of a customer stored in Voucherify that redeemed a voucher.

cust_PqojQVpYAmwtcddM3oGfRh05

tracking_id
string

A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation.

track_122jQVpYAmwtcddM3oHhHh05

gift.amount
integer

A positive integer representing total value redeemed for gift voucher. It is not presented for discount vouchers. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 discount is written as 10000.

"gift": {
    "amount": 10000
}

order
object

The purchase of previously defined products by end customers is handled through the creation of order objects. Order object is used to evaluate redemption rules based on products and total order volume.

Child attributes:

  • amount (integer) - A positive integer representing total order value. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 discount is written as 10000.

  • items (list) - A list of products and variants that have been applied to the order.

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

metadata
object

A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption in a structured format.

"metadata": {
    "test": true,
    "locale": "pl-en"
}

voucher
object

Object presenting redeemed voucher.

"voucher": {
    "code": "Testing7fjWdr",
    "campaign": null,
    "category": "test",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "AMOUNT",
      "amount_off": 1000
    },
    "gift": null,
    "start_date": null,
    "expiration_date": null,
    "publish": {},
    "redemption": {},
    "active": true,
    "additional_info": null,
    "metadata": {},
    "assets": null
}

customer
object

Object of the customer this redemption is for if one exists.

"customer": {
    "object": "customer",
    "id": "cust_PqojQVpYAmwtcddM3oGfRh05",
    "source_id": "joe@op.pl",
    "name": "Joe Doa"
}

result
string

The status of the redemption is either SUCCESS or FAILURE.

failure_code
string

Error code explaining reason for redemption failure if available (see the errors section for a list of keys).

{
  "id": "r_iMsIlXpjfQwMWFJPEPJFeJ4h",
  "object": "redemption",
  "date": "2016-11-16T14:14:31Z",
  "customer_id": "cust_PqojQVpYAmwtcddM3oGfRh05",
  "tracking_id": "joe@op.pl",
  "order": {
    "amount": 10000,
    "items": [
      {
        "product_id": "prod_EkU6J42uLEMkSJ",
        "sku_id": null,
        "quantity": 1
      }
    ]
  },
  "metadata": {
    "test": true,
    "locale": "pl-en"
  },
  "result": "SUCCESS",
  "voucher": {
    "code": "Testing7fjWdr",
    "campaign": null,
    "category": "test",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "AMOUNT",
      "amount_off": 1000
    },
    "gift": null,
    "start_date": null,
    "expiration_date": null,
    "publish": {
      "count": 0,
      "entries": []
    },
    "redemption": {
      "quantity": null,
      "redeemed_quantity": 1,
      "redeemed_amount": 10000,
      "redemption_entries": []
    },
    "active": true,
    "additional_info": null,
    "metadata": {
      "test": true,
      "locale": "pl-en"
    },
    "assets": {
      "qr": {
        "id": "U2FsdGVkX19kSEL6ZbJWNQP/0Nt5ddIJDdvJDgHoeWo25FAq1aAn1L3kd6S/sSHUHYwHXaFtsnJ1Lesh0yzGA7aMNf6kgMUD/dDw1e77kedfhV3BpBWEgYWY1GurPbzV50rexNBppZjPTVJN5DQXJQ==",
        "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19kSEL6ZbJWNQP%2F0Nt5ddIJDdvJDgHoeWo25FAq1aAn1L3kd6S%2FsSHUHYwHXaFtsnJ1Lesh0yzGA7aMNf6kgMUD%2FdDw1e77kedfhV3BpBWEgYWY1GurPbzV50rexNBppZjPTVJN5DQXJQ%3D%3D"
      }
    }
  }
}
Suggest Edits

Redeem Voucher

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

 
posthttps://api.voucherify.io/v1/vouchers/code/redemption
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "source_id": "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
      "name": "Alice Morgan",
      "email": "alice@morgan.com",
      "metadata": {
        "locale": "en-GB",
        "shoeSize": 5,
        "favourite_brands": ["Armani", "L’Autre Chose", "Vicini"]
      }
    },
    "order": {
      "amount": 20050,
      "items": [
        { "product_id": "prod_anJ03RZZq74z4v", "quantity": "2" },
        { "sku_id": "sku_0KtP4rvwEECQ2U", "quantity": "1" }
      ]
    },
    "metadata": {
      "locale": "en-GB"
    }
  }' \
  "https://api.voucherify.io/v1/vouchers/Testing7fjWdr/redemption"
A binary file was returned

You couldn't be authenticated

{
  "id": "r_XbytKOFW8wnheSScssMgRNMm",
  "object": "redemption",
  "date": "2016-11-17T10:22:46Z",
  "customer_id": "cust_ztSxSmEZr8a4rop60yzjVZIq",
  "tracking_id": "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
  "order": {
    "amount": 20050,
    "items": [
      {
        "product_id": "prod_anJ03RZZq74z4v",
        "sku_id": null,
        "quantity": 2
      },
      {
        "product_id": null,
        "sku_id": "sku_0KtP4rvwEECQ2U",
        "quantity": 1
      }
    ]
  },
  "result": "SUCCESS",
  "voucher": {
    "code": "Testing7fjWdr",
    "campaign": null,
    "category": "test",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "AMOUNT",
      "amount_off": 1000
    },
    "gift": null,
    "start_date": null,
    "expiration_date": null,
    "publish": {
      "object": "list",
      "count": 1,
      "url": "/v1/vouchers/Testing7fjWdr/publications?page=1&limit=10"
    },
    "redemption": {
      "object": "list",
      "quantity": null,
      "redeemed_quantity": 1,
      "url": "/v1/vouchers/Testing7fjWdr/redemptions?page=1&limit=10"
    },
    "active": true,
    "additional_info": null,
    "metadata": null,
    "assets": {
      "qr": {
        "id": "U2FsdGVkX1+VOQlTlRoSKfY7mISP6o/vtc76wyxwGpIuzVAboyfg9Z+yAd0uW79KTuoZDBPrNPRgaGFtF/+fW/8JbbdNiIyYdtK9KCEf2XdLwXkkxWwp4YlL1xp71WD96NH+L68Nj3GUpEU55CoZhQ==",
        "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVOQlTlRoSKfY7mISP6o%2Fvtc76wyxwGpIuzVAboyfg9Z%2ByAd0uW79KTuoZDBPrNPRgaGFtF%2F%2BfW%2F8JbbdNiIyYdtK9KCEf2XdLwXkkxWwp4YlL1xp71WD96NH%2BL68Nj3GUpEU55CoZhQ%3D%3D"
      }
    }
  }
}

Path Params

code
string
required

A code that identifies the voucher (e.g., Testing7fjWdr).

Query Params

tracking_id
string

A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returned by Voucherify.js (voucher validation), or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud.

Body Params

customer
object
 
customer.id
string

The ID of an existing customer that will be linked to redemption in this request.

customer.source_id
string

A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returned by Voucherify.js (voucher validation), or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud.

customer.name
string
customer.email
string
customer.description
string
customer.metadata
object

A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.

 
order
object
 
order.amount
int64

A positive integer representing the total amount for the order.

order.items
array

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.

metadata
object

A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption and customer in a structured format.

 
 

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.

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_).

Redemption rollback

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

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.

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.

Testing

Testing7fjWdr - use this code for testing purposes above

"customer": {
  "source_id": "alice.morgan",
  "name": "Alice Morgan",
  "email": "alice@morgan.com",
  "description": "",
  "metadata": {
    "locale": "en-GB",
    "shoeSize": 5,
    "favourite_brands": ["Armani", "L’Autre Chose", "Vicini"]
  }
}
{
  "customer": {
    "id": "cust_C9qJ3xKgZFqkpMw7b21MF2ow"
  }
}
{
  "customer": "cust_C9qJ3xKgZFqkpMw7b21MF2ow"
}
{
  "customer": "alice.morgan"
}
"order": {
  "amount": 10000,
  "items": [
    {
      "product_id": "prod_Bi7sRr3kwvxH2I",
      "sku_id": null,
      "quantity": 1
    }
  ]
}
Suggest Edits

Redeem Voucher (client-side)

To redeem a voucher, you create a redemption object. Increments redemption counter and updates history of the voucher. This method is accessible through public keys which you can use in client side apps - mobile and web browser apps.

 
posthttps://api.voucherify.io/client/v1/redeem?code=code
curl -X POST \
  -H "X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5" \
  -H "X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20" \
  -H "Content-Type: application/json" \
  -H "origin: yourdomain.com" \
  -d '{
    "customer" : {
        "source_id" : "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
        "name": "Alice Morgan"
    },
    "order" : {
        "amount" : 1000,
        "items" : [
            { "product_id": "prod_Bi7sRr3kwvxH2I", "sku_id": null, "quantity": 1 }
        ]
    },
    "metadata" : {
        "referrer": "pinterest.com"
    }
  }' \
  "https://api.voucherify.io/client/v1/redeem?code=Testing7fjWdr"
A binary file was returned

You couldn't be authenticated

{
  "id":"r_gw7tBRLgfVjmtuts52EpE2xA",
  "object":"redemption",
  "date":"2016-11-17T14:02:41Z",
  "customer_id":"cust_ztSxSmEZr8a4rop60yzjVZIq",
  "tracking_id":"track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
  "order": {
    "amount":1000,
    "items": [
      {"product_id":"prod_Bi7sRr3kwvxH2I","sku_id":null,"quantity":1}
    ]
  },
  "metadata": {
    "referrer":"pinterest.com"
  },
  "result":"SUCCESS",
  "voucher": {
    "code":"Testing7fjWdr",
    "campaign":null,
    "category":"test",
    "type":"DISCOUNT_VOUCHER",
    "discount": {
      "type":"AMOUNT",
      "amount_off":1000
    },
    "gift":null,
    "start_date":null,
    "expiration_date":null,
    "publish": {
      "count":0,
      "entries":[]
    },
    "redemption":{
      "quantity":null,
      "redeemed_quantity":14,
      "redeemed_amount":62150,
      "redemption_entries":[]
    },
    "active":true,
    "additional_info":null,
    "metadata":null,
    "assets": {
      "qr":{
        "id": "U2FsdGVkX1+VOQlTlRoSKfY7mISP6o/vtc76wyxwGpIuzVAboyfg9Z+yAd0uW79KTuoZDBPrNPRgaGFtF/+fW/8JbbdNiIyYdtK9KCEf2XdLwXkkxWwp4YlL1xp71WD96NH+L68Nj3GUpEU55CoZhQ==",
        "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVOQlTlRoSKfY7mISP6o%2Fvtc76wyxwGpIuzVAboyfg9Z%2ByAd0uW79KTuoZDBPrNPRgaGFtF%2F%2BfW%2F8JbbdNiIyYdtK9KCEf2XdLwXkkxWwp4YlL1xp71WD96NH%2BL68Nj3GUpEU55CoZhQ%3D%3D"
      }
    }
  }
}

Query Params

code
string
required

A code that identifies the voucher (e.g., Testing7fjWdr).

tracking_id
string

A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returned by Voucherify.js (voucher validation), or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud.

Body Params

customer
object
 
customer.id
string

The ID of an existing customer that will be linked to redemption in this request.

customer.source_id
string

A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returned by Voucherify.js (voucher validation), or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud.

customer.name
string
customer.email
string
customer.description
string
customer.metadata
object

A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.

 
order
object
 
order.amount
int64

A positive integer representing the total amount for the order.

order.items
array

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

metadata
object

A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption and customer in a structured format.

 

Headers

origin
string
 

The client-side redemption works pretty the same as the regular voucher redemption. The difference lies in the authorization. For the client-side you can use client-side keys.

Opt-in

By default this feature is disabled. If you want to use it, you will need to enable function explicitly in Project Settings.

Security Threat

Be careful if you want to include the voucher redemption functionality directly at your client side (website or mobile app). In such configuration there is a chance that discounts can be modified before being sent to the server.

Suggest Edits

List Redemptions

Returns a list of redemptions you’ve previously created. The redemptions are returned in sorted order, with the most recent redemptions appearing first.

 
gethttps://api.voucherify.io/v1/redemptions
curl -X GET \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  "https://api.voucherify.io/v1/redemptions?limit=3"
A binary file was returned

You couldn't be authenticated

{
  "object": "list",
  "total": "502",
  "data_ref": "redemptions",
  "redemptions": [
    {
      "object": "redemption",
      "id": "r_gPblbyHwQh7f07kLE0O7beJB",
      "customer_id": null,
      "tracking_id": null,
      "date": "2016-11-17T14:13:16.277Z",
      "result": "SUCCESS",
      "failure_code": null,
      "order": {
        "amount": null,
        "items": []
      },
      "metadata": null,
      "voucher": {
        "code": "Testing7fjWdr",
        "campaign": null
      },
      "customer": null
    },
    {
      "object": "redemption",
      "id": "r_v6SFvKBw0b4uPS9NlK5XqCPo",
      "customer_id": null,
      "tracking_id": null,
      "date": "2016-11-17T14:03:57.354Z",
      "result": "SUCCESS",
      "failure_code": null,
      "order": {
        "amount": null,
        "items": []
      },
      "metadata": null,
      "voucher": {
        "code": "Testing7fjWdr",
        "campaign": null
      },
      "customer": null
    },
    {
      "object": "redemption",
      "id": "r_jEcg1GkjxznfW6AKgTUwEFU8",
      "customer_id": null,
      "tracking_id": null,
      "date": "2016-11-17T14:03:39.222Z",
      "result": "SUCCESS",
      "failure_code": null,
      "order": {
        "amount": null,
        "items": []
      },
      "metadata": null,
      "voucher": {
        "code": "Testing7fjWdr",
        "campaign": null
      },
      "customer": null
    }
  ]
}

Query Params

limit
int32

A limit on the number of objects to be returned.

page
int32

Which page of results to return.

result
string

A filter on the list based on the redemption result. Available options are: SUCCESS, FAILURE. You can provide multiple values by repeating the param.

customer
string

Return redemptions performed by the customer with given id.

 

Returns a list of redemptions of all vouchers. The result can be narrowed according to specified (or default) filters.

Failed redemptions

A redemption may fail for various reasons. You can figure out an exact reason from failure_code:

  • 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

Returns

A dictionary with a redemptions property that contains an array of up to limit redemptions, starting after starting_date and ending before end_date. Each entry in the array is a separate redemption object. If no more redemptions are available, the resulting array will be empty. If you provide a non-existent customer ID, this call returns an empty object.

Suggest Edits

Get Voucher's Redemptions

 
gethttps://api.voucherify.io/v1/vouchers/code/redemption
curl -X GET \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  "https://api.voucherify.io/v1/vouchers/Testing7fjWdr/redemption"
A binary file was returned

You couldn't be authenticated

{
  "object": "list",
  "total": 3,
  "data_ref": "redemption_entries",
  "quantity": null,
  "redeemed_quantity": 3,
  "redeemed_amount": 20050,
  "redemption_entries": [
    {
      "id": "r_XbytKOFW8wnheSScssMgRNMm",
      "object": "redemption",
      "date": "2016-11-17T10:22:46Z",
      "customer_id": "cust_ztSxSmEZr8a4rop60yzjVZIq",
      "tracking_id": "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
      "order": {
        "amount": 20050,
        "items": [
          {
            "product_id": "prod_anJ03RZZq74z4v",
            "sku_id": null,
            "quantity": 2
          },
          {
            "product_id": null,
            "sku_id": "sku_0KtP4rvwEECQ2U",
            "quantity": 1
          }
        ]
      },
      "result": "SUCCESS"
    },
    {
      "id": "r_zCNrR5UdWHTFa7ABQtqH36Yb",
      "object": "redemption",
      "date": "2016-11-17T12:05:54Z",
      "customer_id": "cust_ztSxSmEZr8a4rop60yzjVZIq",
      "tracking_id": "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
      "order": {
        "amount": null,
        "items": []
      },
      "result": "SUCCESS"
    },
    {
      "id": "r_JISfjfSrCErBn4Vrxu9h3nZ4",
      "object": "redemption",
      "date": "2016-11-17T12:06:10Z",
      "customer_id": "cust_ztSxSmEZr8a4rop60yzjVZIq",
      "tracking_id": "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
      "order": {
        "amount": null,
        "items": []
      },
      "result": "SUCCESS"
    }
  ]
}

Path Params

code
string
required

A code that identifies the voucher (e.g., Testing7fjWdr).

 

Returns

A dictionary with a redemption_entries property that contains an array of voucher's redemptions.

Suggest Edits

The redemption rollback object

Data model description

 

There is a possibility to withdraw a voucher redemption. We call such operation a redemption rollback.

Attributes
Description
Example

id
string

ID of a redemption rollback (starts with rr_).

rr_Panu3W5OBfZo2djeEh2yqLFB

object
string

Value is redemption_rollback.

date
string, ISO 8601 date format

Occurrence date.

2016-11-16T14:14:31Z

customer_id
string

An identifier of a customer stored in Voucherify that is linked to the rolled back redemption. In rollback operation customer can be overwritten.

cust_PqojQVpYAmwtcddM3oGfRh05

tracking_id
string

A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation. In rollback operation it can be overwritten.

track_122jQVpYAmwtcddM3oHhHh05

redemption
string

ID of the redemptions that was rolled back.

gift.amount
integer

A negative integer representing total value the gift voucher will be charged back. Property is visible only in case of gift vouchers. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 discount is written as 10000.

"gift": {
    "amount": -10000
}

voucher
object

Object presenting redeemed voucher.

"voucher": {
    "code": "Testing7fjWdr",
    "campaign": null,
    "category": "test",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "AMOUNT",
      "amount_off": 1000
    },
    "gift": null,
    "start_date": null,
    "expiration_date": null,
    "publish": {},
    "redemption": {},
    "active": true,
    "additional_info": null,
    "metadata": {},
    "assets": null
}

customer
object

Object of the customer this rollback redemption is for if one exists. If not given as parameter to rollback operation, it will be inherited from origin redemption.

"customer": {
    "object": "customer",
    "id": "cust_PqojQVpYAmwtcddM3oGfRh05",
    "source_id": "joe@op.pl",
    "name": "Joe Doa"
}

reason
string

Reason for the rollback.

result
string

The status of the redemption is either SUCCESS or FAILURE.

failure_code

Error code explaining reason for operation failure if available (see the errors section for a list of keys).

{
  "id": "rr_c4loD6wOSTK7elmq6yNfgkGc",
  "object": "redemption_rollback",
  "date": "2016-11-24T12:23:32Z",
  "customer_id": "cust_g1OFNMgwqtISWZ9hjyKeb7ib",
  "tracking_id": "track_9KevqqtmGcUcjy2eAzMDeQ==",
  "redemption": "r_pTclIxpGU08dB4KWT0Kg7wnK",
  "reason": "Mistake",
  "result": "SUCCESS",
  "voucher": {
    "code": "PROMO-VMb4LyH",
    "campaign": null,
    "category": "docs_test",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "PERCENT",
      "percent_off": 10
    },
    "gift": null,
    "start_date": null,
    "expiration_date": null,
    "publish": {
      "count": 0,
      "entries": []
    },
    "redemption": {
      "quantity": null,
      "redeemed_quantity": 0,
      "redeemed_amount": 0,
      "redemption_entries": []
    },
    "active": true,
    "additional_info": null,
    "metadata": {
      "channel": "online-shop",
      "locale": "de-en"
    },
    "assets": {
      "qr": {
        "id": "U2FsdGVkX1/MOrwVNRLth3m1Q+4uiam+pRhPZOTCEk0sJHJ2jvPCTeaWHr2aiIm9iNR+4pVyvOqVSUu8V+uw7T7gQBURI/RBBNez0759Cdmq2N4CRab1LRGy5ZpGi0mI/SFHjZiZDyS0PcU1sRFrzg==",
        "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FMOrwVNRLth3m1Q%2B4uiam%2BpRhPZOTCEk0sJHJ2jvPCTeaWHr2aiIm9iNR%2B4pVyvOqVSUu8V%2Buw7T7gQBURI%2FRBBNez0759Cdmq2N4CRab1LRGy5ZpGi0mI%2FSFHjZiZDyS0PcU1sRFrzg%3D%3D"
      }
    }
  }
}
Suggest Edits

Rollback Redemption

Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. The operation creates a rollback entry in voucher's redemption history (redemption.redemption_entries) and gives 1 redemption back to the pool (decreases redeemed_quantity by 1). In case of gift vouchers, method returns funds back according to source redemption.

 
posthttps://api.voucherify.io/v1/redemptions/redemption_id/rollback
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "source_id": "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
      "name": "Alice Morgan",
      "email": "alice@morgan.com",
      "description": "",
      "metadata": {
        "locale": "en-GB",
        "status": "CANCELLED"
      }
    }
  }' \
  "https://api.voucherify.io/v1/redemptions/r_jPm47nWMBNlK9r0IjjmXJrP5/rollback"
A binary file was returned

You couldn't be authenticated

{
  "id": "rr_RDzmIvJxoWS6xQ2qclY3sGzT",
  "object": "redemption_rollback",
  "date": "2016-11-17T15:53:18Z",
  "customer_id": "cust_ztSxSmEZr8a4rop60yzjVZIq",
  "tracking_id": "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
  "redemption": "r_XbytKOFW8wnheSScssMgRNMm",
  "result": "SUCCESS",
  "voucher": {
    "code": "Testing7fjWdr",
    "campaign": null,
    "category": "test",
    "type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "AMOUNT",
      "amount_off": 1000
    },
    "gift": null,
    "start_date": null,
    "expiration_date": null,
    "publish": {
      "count": 0,
      "entries": []
    },
    "redemption": {
      "quantity": null,
      "redeemed_quantity": 16,
      "redeemed_amount": 42100,
      "redemption_entries": []
    },
    "active": true,
    "additional_info": null,
    "metadata": null,
    "assets": {
      "qr": {
        "id": "U2FsdGVkX1+VOQlTlRoSKfY7mISP6o/vtc76wyxwGpIuzVAboyfg9Z+yAd0uW79KTuoZDBPrNPRgaGFtF/+fW/8JbbdNiIyYdtK9KCEf2XdLwXkkxWwp4YlL1xp71WD96NH+L68Nj3GUpEU55CoZhQ==",
        "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVOQlTlRoSKfY7mISP6o%2Fvtc76wyxwGpIuzVAboyfg9Z%2ByAd0uW79KTuoZDBPrNPRgaGFtF%2F%2BfW%2F8JbbdNiIyYdtK9KCEf2XdLwXkkxWwp4YlL1xp71WD96NH%2BL68Nj3GUpEU55CoZhQ%3D%3D"
      }
    }
  }
}

Path Params

redemption_id
string
required

Identifier of original redemption which is supposed to be rolled back.

Query Params

reason
string

Reason for the rollback.

Body Params

customer
object
 
customer.id
string

The ID of an existing customer that will be linked to redemption rollback in this request.

customer.source_id
string

A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returned by Voucherify.js (voucher validation), or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud.

customer.name
string
customer.email
string
customer.description
string
customer.metadata
string

A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.

 
Suggest Edits

Get Redemption

Return a redemption you’ve previously created.

 
gethttps://api.voucherify.io/v1/redemptions/id
curl -X GET \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  "https://api.voucherify.io/v1/redemptions/r_7dYuCymHlhzaL2YIPFVuL1RY"
A binary file was returned

You couldn't be authenticated

{
  "object": "redemption",
  "id": "r_gPblbyHwQh7f07kLE0O7beJB",
  "customer_id": null,
  "tracking_id": null,
  "date": "2016-11-17T14:13:16.277Z",
  "result": "SUCCESS",
  "failure_code": null,
  "order": {
    "amount": null,
    "items": []
  },
  "metadata": null,
  "voucher": {
    "code": "Testing7fjWdr",
    "campaign": null
  },
  "customer": null
}

Path Params

id
string
required

ID of previously created redemption.

 

Returns

It returns a redemption you’ve previously created.

Suggest Edits

The customer object

 

This entity allows you to:

  • store customer details in Voucherify,
  • link redemptions and validations to a particular customer,
  • build customer segments and use them in campaigns rules.

Run through validation rules and customer tracking tutorials to understand the most common use cases.

Attribute
Description
Example

id
string

cust_AIVa5X5fmcJJgcyBem8TeLdB

object string

Type of the object represented by JSON. Value is customer.

source_id
string

A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side).

john_doe_7134234

name
string

John Doe

email
string

john@doe.org

description
string

An arbitrary string that you can attach to a customer object. It is displayed alongside a customer in the dashboard.

Lorem ipsum

address
object

A set of key/value pairs which describes address. Allowed keys: city, state, line_1, line_2, country, postal_code.

"address": {
  "city": "Melbourne",
  "state": "FL",
  "line_1": "226 E Fee Ave",
  "line_2": null,
  "country": "Australia",
  "postal_code": "32901"
}

phone

+48 123456789

metadata
object

A set of custom key/value pairs that you can attach to a customer object for segment building.

"metadata": { 
  "lang": "en"
}

created_at
string, ISO 8601 date format

2016-11-16T14:14:31Z

{
  "id":"cust_lYv4yFtT7SGzx81oYpzCntIi",
  "source_id":"your-tracking-id",
  "name":"John Doe",
  "email":"email@example.com",
  "description":"Premium user, ACME Inc.",
  "address": {
    "city": "Melbourne",
    "state": "FL",
    "line_1": "226 E Fee Ave",
    "line_2": null,
    "country": "Australia",
    "postal_code": "32901",
    "phone": "+48 123456789"
  },
  "summary": {
    "redemptions": {
      "total_redeemed": 16,
      "total_failed": 4,
      "total_succeeded": 14,
      "total_rolled_back": 2,
      "total_rollback_failed": 0,
      "total_rollback_succeeded": 0,
      "gift": {
        "redeemed_amount": 25000,
        "amount_to_go": 0
      }
    },
    "orders": {
      "total_amount": 107000,
      "total_count": 12,
      "average_amount": 8916,
      "last_order_amount": 7000,
      "last_order_date": "2016-12-29T09:03:03Z"
    }
  },
  "loyalty": {
    "points": 0,
    "referred_customers": 0
  },
  "metadata":{  
    "lang":"en"
  },
  "created_at":"2016-11-17T15:23:15Z",
  "object":"customer"
}
Suggest Edits

Create Customer

For details check out "Customer tracking" section

 
posthttps://api.voucherify.io/v1/customers
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "source_id":"your-tracking-id", 
    "name": "John Doe",
    "email": "email@example.com",
    "address": {
      "city": "Melbourne",
      "state": "FL",
      "line_1": "226 E Fee Ave",
      "line_2": null,
      "country": "Australia",
      "postal_code": "32901"
    },
    "description":"Premium user, ACME Inc.",
    "metadata": {
      "lang":"en"
    }
  }' \
  https://api.voucherify.io/v1/customers
A binary file was returned

You couldn't be authenticated

{  
  "id":"cust_lYv4yFtT7SGzx81oYpzCntIi",
  "source_id":"your-tracking-id",
  "name":"John Doe",
  "email":"email@example.com",
  "description":"Premium user, ACME Inc.",
  "address": {
    "city": "Melbourne",
    "state": "FL",
    "line_1": "226 E Fee Ave",
    "line_2": null,
    "country": "Australia",
    "postal_code": "32901"
  },
  "summary": {
    "redemptions": {
      "total_redeemed": 0,
      "total_failed": 0,
      "total_succeeded": 0,
      "total_rolled_back": 0,
      "total_rollback_failed": 0,
      "total_rollback_succeeded": 0,
      "gift": {
        "redeemed_amount": 0,
        "amount_to_go": 0
      }
    },
    "orders": {
      "total_amount": 0,
      "total_count": 0,
      "average_amount": 0,
      "last_order_amount": 0,
      "last_order_date": null
    }
  },
  "loyalty": {
    "points": 0,
    "referred_customers": 0
  },
  "metadata":{  
    "lang":"en"
  },
  "created_at": "2016-11-15T15:41:44Z",
  "object": "customer"
}

Body Params

name
string

A customer name

email
string

A customer email

metadata
object

A set of custom key/value pairs that you can attach to a Customer object for segment building.

 
description
string

An arbitrary string that you can attach to a customer object.

source_id
string

A unique customer identifier. You can provide your own or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side).

address
object

A set of key/value pairs which describes address. Allowed keys: city, state, line_1, line_2, country, postal_code.

 
phone
string

A customer phone number. It is mandatory when you try send out codes to customer via SMS channel

 

Upsert mode

If you pass a source_id that already exists in Customer database, Voucherify will return a related Customer object but all fields that differ will get updated beforehand.

Suggest Edits

Get Customer

For details check out "Customer tracking" section

 
gethttps://api.voucherify.io/v1/customers/id
curl -X GET \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  https://api.voucherify.io/v1/customers/cust_lYv4yFtT7SGzx81oYpzCntIi
A binary file was returned

You couldn't be authenticated

{  
  "id":"cust_lYv4yFtT7SGzx81oYpzCntIi",
  "source_id":"your-tracking-id",
  "name":"John Doe",
  "email":"email@example.com",
  "address": {
    "city": null,
    "country": null,
    "line_1": null,
    "line_2": null,
    "postal_code": null,
    "state": null
  },
  "summary": {
    "redemptions": {
      "total_redeemed": 0,
      "total_failed": 0,
      "total_succeeded": 0,
      "total_rolled_back": 0,
      "total_rollback_failed": 0,
      "total_rollback_succeeded": 0,
      "gift": {
        "redeemed_amount": 0,
        "amount_to_go": 0
      }
    },
    "orders": {
      "total_amount": 0,
      "total_count": 0,
      "average_amount": 0,
      "last_order_amount": 0,
      "last_order_date": null
    }
  },
  "loyalty": {
    "points": 0,
    "referred_customers": 0
  },
  "description":"Premium user, ACME Inc.",
  "metadata":{  
    "lang":"en"
  },
  "created_at":"2016-11-17T15:23:15Z",
  "object":"customer"
}

Path Params

id
string
required

A Voucherify customer identifier or source_id

 
Suggest Edits

Update Customer

For details check out "Customer tracking" section

 
puthttps://api.voucherify.io/v1/customers/id
curl -X PUT \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "email": "email@example.com",
    "description":"Premium user, ACME Inc.",
    "metadata": {
      "lang":"en",
      "type":"premium"
    }
  }' \
  https://api.voucherify.io/v1/customers/cust_lYv4yFtT7SGzx81oYpzCntIi
A binary file was returned

You couldn't be authenticated

{  
  "id":"cust_lYv4yFtT7SGzx81oYpzCntIi",
  "source_id":"your-tracking-id",
  "name":"John Doe",
  "email":"email@example.com",
  "description":"Premium user, ACME Inc.",
  "address": {
    "city": null,
    "country": null,
    "line_1": null,
    "line_2": null,
    "postal_code": null,
    "state": null
  },
  "summary": {
    "redemptions": {
      "total_redeemed": 0,
      "total_failed": 0,
      "total_succeeded": 0,
      "total_rolled_back": 0,
      "total_rollback_failed": 0,
      "total_rollback_succeeded": 0,
      "gift": {
        "redeemed_amount": 0,
        "amount_to_go": 0
      }
    },
    "orders": {
      "total_amount": 0,
      "total_count": 0,
      "average_amount": 0,
      "last_order_amount": 0,
      "last_order_date": null
    }
  },
  "loyalty": {
    "points": 0,
    "referred_customers": 0
  },
  "metadata":{  
    "lang":"en",
    "type":"premium"
  },
  "created_at":"2016-11-17T15:23:15Z",
  "object":"customer"
}

Path Params

id
string
required

A Voucherify customer identifier or source_id

Body Params

name
string

A customer name

email
string

A customer email

metadata
object

A set of custom key/value pairs that you can attach to a Customer object for segment building.

 
description
string

An arbitrary string that you can attach to a customer object.

source_id
string

A unique customer identifier. You can provide your own or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side).

address
object

A set of key/value pairs which describes address. Allowed keys: city, state, line_1, line_2, country, postal_code.

 
phone
string

A customer phone number. It is mandatory when you try send out codes to customer via SMS channel

 
Suggest Edits

Delete Customer

 
deletehttps://api.voucherify.io/v1/customers/id
curl -X DELETE \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  https://api.voucherify.io/v1/customers/cust_TYevabacpji5rLrw7mYJLx0x
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required

A Voucherify customer identifier or source_id

 
Suggest Edits

The order object

Data model description

 

The purchase of previously defined products by end customers is handled through the creation of order objects. You can create, retrieve, and pay individual orders, as well as list all orders. Orders are identified by a unique random ID.

Order are also created when defined as part of the voucher redemption request.

Attributes
Description
Example

id
string

ord_iMsIlXpjfQwMWFJPEPJFeJ4h

object
string

String representing the object’s type. Objects of the same type share the same value. Value is order.

source_id
string

The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service.

created_at
string, ISO 8601 date format

2016-11-16T14:14:31Z

updated_at
string, ISO 8601 date format

customer
object

The customer used for the order.

  "customer": {
    "object": "customer",
    "id": "cust_54euyQiFb4UYIP9wEOw7FgUA"
  }

status
string

Current order status. One of CREATED, PAID, CANCELED, FULFILLED.

amount
integer

A positive integer representing total order value. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

items
list

A list of products and variants that have been applied to the order.

"items": [
    {
      "sku_id": null,
      "quantity": 2,
      "product_id": "prod_anJ03RZZq74z4v"
    },
    {
      "sku_id": "sku_0KtP4rvwEECQ2U",
      "quantity": 1,
      "product_id": null
    }
  ]

metadata
object

A set of key/value pairs that you can attach to an order object. It can be useful for storing additional information about the order in a structured format.

"metadata": {
    "test": true,
    "locale": "pl-en",
    "channel": "mobile_app"
}

referrer
object

The person who referred the customer to make the order.

"referrer": {
    "id": "cust_YOTqNoppN6sC1yepfElDL50S",
    "object": "customer"
}
{
  "id": "ord_Rm1hlzO0jUyci39LoowoJqND",
  "source_id": null,
  "object": "order",
  "created_at": "2017-05-24T15:27:41.008Z",
  "updated_at": null,
  "status": "CREATED",
  "amount": 20050,
  "items": [
    {
      "sku_id": null,
      "quantity": 2,
      "product_id": "prod_anJ03RZZq74z4v"
    },
    {
      "sku_id": "sku_0KtP4rvwEECQ2U",
      "quantity": 1,
      "product_id": null
    }
  ],
  "customer": {
    "object": "customer",
    "id": "cust_54euyQiFb4UYIP9wEOw7FgUA"
  },
  "metadata": null
}
Suggest Edits

Create Order

It creates an order object and triggers order creation event.

 
posthttps://api.voucherify.io/v1/orders
curl -X POST \
  -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
  -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "source_id": "track_+EUcXP8WDKXGf3mYmWxbJvEosmKXi3Aw",
      "name": "Alice Morgan",
      "email": "alice@morgan.com",
      "metadata": {
        "locale": "en-GB",
        "shoeSize": 5,
        "favourite_brands": ["Armani", "L’Autre Chose", "Vicini"]
      }
    },
    "amount": 20050,
    "items": [
      { "product_id": "prod_anJ03RZZq74z4v", "quantity": "2" },
      { "sku_id": "sku_0KtP4rvwEECQ2U", "quantity": "1" }
    ]
  }' \
  "https://api.voucherify.io/v1/orders"
A binary file was returned

You couldn't be authenticated

{  
  "object": "order",
  "id": "ord_5vOwnnxJsVdy82GgiuHPymKV",
  "source_id": null,
  "amount": 20050,
  "created_at": "2017-05-24T19:54:57Z",
  "updated_at": null,
  "items": [
    {
      "product_id": "prod_anJ03RZZq74z4v",
      "sku_id": null,
      "quantity": 2
    },
    {
      "product_id": null,
      "sku_id": "sku_0KtP4rvwEECQ2U",
      "quantity": 1
    }
  ],
  "customer": {
    "id": "cust_FQ9W87tvBkNzHaBWdtSzkinR",
    "object": "customer"
  },
  "status": "CREATED",
  "metadata": null
}

Body Params

customer
object
 
customer.id
string

The ID of an existing customer that will be linked to order in this request.

customer.source_id
string
customer.name
string
customer.email
string
customer.description
string
customer.metadata
object

A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.

 
amount
int64

A positive integer representing the total amount for the order.

items
array

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

metadata
object

A set of key/value pairs that you can attach to an order object. It can be useful for storing additional information about the order in a structured format.

 
 

Returns

Returns an order object if the creating succeeded. Returns an error if something goes wrong.

Suggest Edits

Get Order

 
gethttps://api.voucherify.io/v1/orders/order_id
curl -X GET \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
https://api.voucherify.io/v1/orders/ord_5vOwnnxJsVdy82GgiuHPymKV
A binary file was returned

You couldn't be authenticated

{
  "id": "ord_5vOwnnxJsVdy82GgiuHPymKV",
  "source_id": null,
  "object": "order",
  "created_at": "2017-05-24T19:54:57.046Z",
  "updated_at": null,
  "status": "CREATED",
  "amount": 20050,
  "items": [
    {
      "sku_id": null,
      "quantity": 2,
      "product_id": "prod_anJ03RZZq74z4v"
    },
    {
      "sku_id": "sku_0KtP4rvwEECQ2U",
      "quantity": 1,
      "product_id": null
    }
  ],
  "customer": {
    "object": "customer",
    "id": "cust_FQ9W87tvBkNzHaBWdtSzkinR"
  },
  "metadata": null
}

Path Params

order_id
string
required

A Voucherify order identifier or source_id

 

Returns

Returns an order object if a valid identifier was provided. When requesting the order that has been deleted, resource will not be returned, including a 404 HTTP status code.

Suggest Edits

Update Order

Updates the specified order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

 
puthttps://api.voucherify.io/v1/orders/order_id
curl -X PUT \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
-d '{
	"status" : "PAID"
}' https://api.voucherify.io/v1/orders/ord_t5qQy0SpTuIBFPnlaKMougSr
A binary file was returned

You couldn't be authenticated

{
  "object": "order",
  "id": "ord_t5qQy0SpTuIBFPnlaKMougSr",
  "source_id": null,
  "amount": 20050,
  "created_at": "2017-05-24T20:33:22Z",
  "updated_at": "2017-05-24T20:35:49Z",
  "items": [
    {"product_id":"prod_anJ03RZZq74z4v","sku_id":null,"quantity":2},
    {"product_id":null,"sku_id":"sku_0KtP4rvwEECQ2U","quantity":1}
  ],
  "customer": {
    "id":"cust_ztSxSmEZr8a4rop60yzjVZIq",
    "object":"customer"
  },
  "status":"PAID",
  "metadata":null
}

Path Params

order_id
string
required

A Voucherify order identifier or source_id

Body Params

status
string

New order status. One of CREATED, PAID, CANCELED, FULFILLED.

items
array of strings

A list of product attributes keys used to differentiate product variants.

metadata
object

A set of custom key/value pairs that you can attach to a product.

 
amount
int64

A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount for the order.

customer
object
 
customer.id
string
 

Returns

Returns the order object if the update succeeded. Returns an error if update parameters are invalid.

Suggest Edits

List Orders

Returns a list of your orders.

 
gethttps://api.voucherify.io/v1/orders
curl -X GET \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
https://api.voucherify.io/v1/orders
A binary file was returned

You couldn't be authenticated

{
  "object": "list",
  "total": "12",
  "data_ref": "orders",
  "orders": [
    {
      "id": "ord_2B52YykhJjCNuaDZ0ps1coaI",
      "source_id": "test_1",
      "object": "order",
      "created_at": "2017-05-24T20:27:37.122Z",
      "updated_at": null,
      "status": "CREATED",
      "amount": 20050,
      "items": [
        {
          "sku_id": null,
          "quantity": 2,
          "product_id": "prod_anJ03RZZq74z4v"
        },
        {
          "sku_id": "sku_0KtP4rvwEECQ2U",
          "quantity": 1,
          "product_id": null
        }
      ],
      "customer": {
        "object": "customer",
        "id": "cust_FQ9W87tvBkNzHaBWdtSzkinR"
      },
      "metadata": null
    },
    {
      "id": "ord_5vOwnnxJsVdy82GgiuHPymKV",
      "source_id": null,
      "object": "order",
      "created_at": "2017-05-24T19:54:57.046Z",
      "updated_at": null,
      "status": "CREATED",
      "amount": 20050,
      "items": [
        {
          "sku_id": null,
          "quantity": 2,
          "product_id": "prod_anJ03RZZq74z4v"
        },
        {
          "sku_id": "sku_0KtP4rvwEECQ2U",
          "quantity": 1,
          "product_id": null
        }
      ],
      "customer": {
        "object": "customer",
        "id": "cust_FQ9W87tvBkNzHaBWdtSzkinR"
      },
      "metadata": null
    }
  ]
}

Query Params

limit
int32

A limit on the number of objects to be returned.

page
int32

Which page of results to return.

 

Returns

A dictionary with a data property that contains an array of up to limit orders. Each entry in the array is a separate order object. If no more orders are available, the resulting array will be empty.

Suggest Edits

The product object

 

This entity should be used to map product items from your inventory management system. The aim of products is to build validation rules which reflect product-specific campaigns.

Attribute
Description
Example

id string

prod_yKHc4SyG1agSww

source_id string

A unique product identifier from your inventory system.

internal_prod_id_1477390384

object 'string'

Type of the object represented by JSON. Value is 'product'.

name string

Apple iPhone 7

created_at string, ISO 8601 date format

2016-11-16T14:14:31Z

attributes, array of strings

A list of product attributes keys used to differentiate product variants.

["color", "memory"]

skus object

An object storing the list of product variants.

  "skus": {
    "object": "list",
    "total": 1,
    "data": [
      {
        "id": "sku_jnw8vWYuyYTW7X",
        "source_id": "internal_erp_sku_id_1477399361",
        "sku": "APPLE_IPHONE_7",
        "currency": "USD",
        "price": 70000,
        "attributes": {
          "color": "black",
          "memory": "32"
        },
        "created_at": "2016-10-25T12:43:28Z",
        "object": "sku"
      }
    ]
  }

metadata object

A set of custom key/value pairs that you can attach to a product object.

"metadata": { 
    "country": "us"
}
{  
  "id":"prod_VOBfMBM3sCuGSy",
  "source_id":"internal_crm_id_1477475919",
  "object":"product",
  "name":"Apple iPhone 7",
  "attributes":[  
    "color",
    "memory"
  ],
  "metadata":{  
    "test":true
  },
  "created_at":"2016-10-26T09:58:39Z",
  "skus":{  
    "object":"list",
    "total":1,
    "data":[  
      {  
        "id":"sku_0KtP4rvwEECQ2U",
        "source_id":"internal_erp_sku_id_1477475922",
        "sku":"APPLE_IPHONE_7",
        "currency":"USD",
        "price":70000,
        "attributes":{  
          "color":"black",
          "memory":"32"
        },
        "created_at":"2016-10-26T10:04:52Z",
        "object":"sku"
      }
    ]
  }
}
Suggest Edits

Create Product

 
posthttps://api.voucherify.io/v1/products
curl -X POST \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
-d '{
    "name" : "Apple iPhone 7",
    "source_id" : "internal_prod_id_1477390384",
    "attributes": [ "color", "memory" ]
}' https://api.voucherify.io/v1/products
A binary file was returned

You couldn't be authenticated

{
  "id": "prod_yKHc4SyG1agSww",
  "source_id": "internal_erp_id_1477390384",
  "object": "product",
  "name": "Apple iPhone 7",
  "attributes": [
    "color",
    "memory"
  ],
  "created_at": "2016-10-25T10:12:58Z",
  "skus": {
    "object": "list",
    "total": 0,
    "data": []
  }
}

Body Params

name
string

A product name

source_id
string

A unique customer identifier from your inventory system

attributes
array of strings

A list of product attributes keys used to differentiate product variants.

metadata
object

A set of custom key/value pairs that you can attach to a product.

 
 
Suggest Edits

Get Product

 
gethttps://api.voucherify.io/v1/products/product_id
curl -X GET \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
https://api.voucherify.io/v1/products/prod_VOBfMBM3sCuGSy
A binary file was returned

You couldn't be authenticated

{  
  "id":"prod_VOBfMBM3sCuGSy",
  "source_id":"internal_crm_id_1477475919",
  "object":"product",
  "name":"Apple iPhone 7",
  "attributes":[  
    "color",
    "memory"
  ],
  "metadata":{  
    "test":true
  },
  "created_at":"2016-10-26T09:58:39Z",
  "skus":{  
    "object":"list",
    "total":1,
    "data":[  
      {  
        "id":"sku_0KtP4rvwEECQ2U",
        "source_id":"internal_erp_sku_id_1477475922",
        "sku":"APPLE_IPHONE_7",
        "currency":"USD",
        "price":70000,
        "attributes":{  
          "color":"black",
          "memory":"32"
        },
        "created_at":"2016-10-26T10:04:52Z",
        "object":"sku"
      }
    ]
  }
}

Path Params

product_id
string
required

A Voucherify product identifier or source_id

 
Suggest Edits

Update Product

 
puthttps://api.voucherify.io/v1/products/product_id
curl -X PUT \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
-d '{
	"name" : "Apple iPhone 8",
	"metadata" : {
		"test" : "false"
	}
}' https://api.voucherify.io/v1/products/prod_EG3n21fz5UVNfD
A binary file was returned

You couldn't be authenticated

{
  "id": "prod_EG3n21fz5UVNfD",
  "source_id": "internal_erp_id_1477390384",
  "object": "product",
  "name": "Apple iPhone 8",
  "attributes": [
    "color",
    "memory"
  ],
  "metadata": {
    "test": "false"
  },
  "created_at": "2016-11-17T16:57:19Z",
  "skus": {
    "object": "list",
    "total": 0,
    "data": []
  }
}

Path Params

product_id
string
required

A Voucherify product identifier or source_id

Body Params

name
string

A product name

source_id
string

A unique customer identifier from your inventory system

attributes
array of strings

A list of product attributes keys used to differentiate product variants.

metadata
object

A set of custom key/value pairs that you can attach to a product.

 
 
Suggest Edits

List Products

 
gethttps://api.voucherify.io/v1/products
curl -X GET \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
https://api.voucherify.io/v1/products
A binary file was returned

You couldn't be authenticated

{  
  "object":"list",
  "total":14,
  "products":[  
    {  
      "id":"prod_EG3n21fz5UVNfD",
      "object":"product",
      "name":"Apple iPhone 7",
      "attributes":[  
        "color",
        "memory"
      ],
      "created_at":"2016-11-17T16:57:19Z",
      "skus":{  
        "object":"list",
        "total":0,
        "data":[  

        ]
      }
    },
    {  
      "id":"prod_Bi7sRr3kwvxH2I",
      "object":"product",
      "name":"Fast & Furious 7",
      "attributes":[  
        "Fast & Furious 7"
      ],
      "created_at":"2016-11-15T23:57:22Z",
      "skus":{  
        "object":"list",
        "total":0,
        "data":[  

        ]
      }
    }
    // ...
  ]
}

Query Params

limit
string

A limit on the number of objects to be returned.

page
int32

Which page of results to return.

 
Suggest Edits

Delete Product

 
deletehttps://api.voucherify.io/v1/products/product_id
curl -X DELETE \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
-d '{}' \
https://api.voucherify.io/v1/products/prod_pmkBgWfqt3jVn3
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

product_id
string
required

A Voucherify product identifier or source_id

Query Params

force
boolean

If this flag is set to true, resource will be removed permanently. It means you will be able to create another object with the same source id.

 
Suggest Edits

The sku object

 

The SKU (acronym from Stock Keeping Unit) is tightly related to the product object. It basically reflects its different variants. One product can have many SKUs which are characterised by the product attributes.

Attribute
Description
Example

id string

A unique sku identifier.

sku_ggQ9BeMJVsdozI

source_id string

A unique sku identifier from your inventory system.

internal_sku_id_1477473569

sku string

A stock keeping unit label.

APPLE_IPHONE_7_BLACK_32

attributes object

A map of sku attributes values (attributes are defined in the product object).

"attributes": {
    "color": "black",
    "memory": "32"
  }

created_at 'string', ISO 8601 date format

A sku creation date.

2016-11-16T14:14:31Z

object string

Value is sku.

metadata object

A set of custom key/value pairs that you can attach to a product object.

"metadata": { 
    "country": "us"
}
{  
  "id":"sku_0KtP4rvwEECQ2U",
  "source_id":"internal_erp_sku_id_1477475922",
  "sku":"APPLE_IPHONE_7_BLACK_32",
  "attributes":{  
    "color":"black",
    "memory":"32"
  },
  "created_at":"2016-10-26T10:04:52Z",
  "object":"sku",
  "metadata": { 
    "country": "us"
	}
}
Suggest Edits

Create SKU

How to add product variants to a created product

 
posthttps://api.voucherify.io/v1/products/product_id/skus
curl -X POST \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
-d '{
    "sku" : "APPLE_IPHONE_7",
    "source_id" : "internal_erp_sku_id_1477391752",
    "attributes": {
      "color": "black",
      "memory": "32"
    }
}' \
https://api.voucherify.io/v1/products/prod_VOBfMBM3sCuGSy/skus
A binary file was returned

You couldn't be authenticated

{  
  "id":"sku_qivmH46vZzyq3I",
  "source_id":"internal_erp_sku_id_1477391752",
  "sku":"APPLE_IPHONE_7",
  "attributes":{  
    "color":"black",
    "memory":"32"
  },
  "created_at":"2016-11-18T08:17:18Z",
  "object":"sku"
}

Path Params

product_id
string
required

A product unique identifier

Body Params

sku
string
required

A product variant name

source_id
string

A unique product variant identifier from your inventory system

attributes
object

Values for attributes defined in a product.

 
metadata
object

Set of custom key/value pairs.

 
 
 
gethttps://api.voucherify.io/v1/products/product_id/skus/sku_id
curl -X GET \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
https://api.voucherify.io/v1/products/prod_aA4XMm4XQLNglg/skus/sku_qivmH46vZzyq3I
A binary file was returned

You couldn't be authenticated

{  
  "id":"sku_qivmH46vZzyq3I",
  "source_id":"internal_erp_sku_id_1477391752",
  "sku":"APPLE_IPHONE_7",
  "attributes":{  
    "color":"black",
    "memory":"32"
  },
  "created_at":"2016-11-18T08:17:18Z",
  "object":"sku"
}

Path Params

product_id
string
required

A Voucherify product identifier or product source_id

sku_id
string
required

A Voucherify SKU identifier or SKU source_id

 
Suggest Edits

Update SKU

 
puthttps://api.voucherify.io/v1/products/product_id/skus/sku_id
curl -X PUT \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
-d '{
    "attributes": {
      "memory": 16
    }
}' \
https://api.voucherify.io/v1/products/prod_aA4XMm4XQLNglg/skus/sku_qivmH46vZzyq3I
A binary file was returned

You couldn't be authenticated

{  
  "id":"sku_qivmH46vZzyq3I",
  "source_id":"internal_erp_sku_id_1477391752",
  "sku":"APPLE_IPHONE_7_BLACK_32",
  "attributes":{  
    "memory":16
  },
  "created_at":"2016-11-18T08:17:18Z",
  "object":"sku"
}

Path Params

product_id
string
required

A Voucherify product identifier or product source_id

sku_id
string
required

A Voucherify SKU identifier or SKU source_id

 
Suggest Edits

List SKUs

 
gethttps://api.voucherify.io/v1/products/product_id/skus
curl -X GET \
-H "X-App-Id: 53623f47-c7dd-4926-bfd3-e060139007d6" \
-H "X-App-Token: 8496bda2-33b5-4888-b8a1-7b69a0b6a8b5" \
-H "Content-Type: application/json" \
https://api.voucherify.io/v1/products/prod_aA4XMm4XQLNglg/skus
A binary file was returned

You couldn't be authenticated

{
  "object": "list",
  "total": 2,
  "skus": [
    {
      "id": "sku_ggQ9BeMJVsdozI",
      "source_id": "internal_erp_sku_id_1477470802",
      "sku": "APPLE_IPHONE_7_BLACK_16",
      "price": 70000,
      "attributes": {
        "color": "black",
        "memory": "16"
      },
      "created_at": "2016-10-26T08:33:21Z",
      "object": "sku"
    },
    {
      "id": "sku_wzdqgzWpq0iFrk",
      "source_id": "internal_erp_sku_id_1477470531",
      "sku": "APPLE_IPHONE_7_BLACK_32",
      "attributes": {
        "color": "black",
        "memory": "32"
      },
      "created_at": "2016-10-26T08:28:51Z",
      "object": "sku"
    }
  ]
}

Path Params

product_id
string
required

A Voucherify product identifier or product source_id

 
Suggest Edits

Delete SKU

 
deletehttps://api.voucherify.io/v1/products/product_id/skus/sku_id
curl -X DELETE \
-H "X-App-Id: 53623f47-c7dd-4926-bfd3-e060139007d6" \
-H "X-App-Token: 8496bda2-33b5-4888-b8a1-7b69a0b6a8b5" \
-H "Content-Type: application/json" \
https://api.voucherify.io/v1/products/prod_FZcR6EiytBOelr/skus/sku_ggQ9BeMJVsdozI
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

product_id
string
required

A Voucherify product identifier or product source_id

sku_id
string
required

A Voucherify SKU identifier or SKU source_id

Query Params

force
boolean

If this flag is set to true, resource will be removed permanently. It means you will be able to create another object with the same source id.

 
Suggest Edits

The validation rule object

 

This entity stores the validation rules used in campaigns and in standalone vouchers.

Attribute
Description
Example

id string

val_elcvePRgR9L2

object string

Type of the object represented by JSON. Value is validation_rules.

voucher_code string

A voucher code the validation rules is assigned to.

xyz

campaign_name 'string'

A campaign the validation rules is assigned to.

test-campaign

junction string

An operator defining the logic operator for defined rules (AND or OR supported).

AND

created_at string, ISO 8601 date format

2016-11-16T14:14:31Z

segments object

A set of rules based on the segment objects.

{ "junction":"AND", "conditions":{ "$is":[ "seg_n3vVcU5t0m3rs4rEPr3C1oU5" ], "$is_not":[ "seg_Rvsjn5PygnamKjRbwVP6Kmqf", "seg_KiGuoPFSp6DdMsHfgNxYNTRY" ] } }

products object

A set of rules based on the product object.

{ "junction":"AND", "conditions":{ "$is":[ { "id":"prod_anJ03RZZq74z4v", "source_id":null } ] } }

skus object

A set of rules based on the sku object.

{ "junction":"AND", "conditions":{ "$is":[ { "id":"sku_P9IF3LSQHQ1wL6", "source_id":null } ] } }

orders object

A set of rules based on the order value and its items.

{ "junction":"AND", "count_per_customer":{ "conditions":{ "$is":[ 1 ] } } }

redemptions object

A set of rules based on redemptions count.

{ "junction":"AND", "count_per_customer":{ "conditions":{ "$is":[ 1 ] } } }

{
  "id": "val_BHMuN4ZGUsjF",
  "created_at": "2016-09-05",
  "voucher_code": "8ZY60Wtw",
  "junction": "AND",
  "segments": {
    "junction": "AND",
    "conditions": {
      "$is": [
        "seg_n3vVcU5t0m3rs4rEPr3C1oU5"
      ],
      "$is_not": [
        "seg_Rvsjn5PygnamKjRbwVP6Kmqf",
        "seg_KiGuoPFSp6DdMsHfgNxYNTRY"
      ]
    }
  },
  "products": {
    "junction": "AND",
    "conditions": {
      "$is": [
        {
          "id": "prod_anJ03RZZq74z4v",
          "source_id": null
        },
        {
          "id": "prod_cCiXO1ZmBipHbz",
          "source_id": null
        }
      ],
      "$is_not": [
        {
          "id": "prod_pmkBgWfqt3jVn3",
          "source_id": null
        }
      ]
    }
  },
  "skus": {
    "junction": "AND",
    "conditions": {
      "$is": [
        {
          "id": "sku_fnQKmVHRqTMqLB",
          "source_id": null
        }
      ],
      "$is_not": [
        {
          "id": "sku_Z5A08UG51BI2I9",
          "source_id": null
        }
      ]
    }
  },
  "orders": {
    "junction": "AND",
    "total_amount": {
      "$more_than": [
        20000
      ]
    },
    "products_count": {
      "$more_than": [
        3
      ]
    }
  },
  "object": "validation_rules"
}
Suggest Edits

Create Validation Rules

 
posthttps://api.voucherify.io/v1/validation-rules
curl -X POST \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
-d '{
	"voucher_code" : "test_val_rules",
	"orders": {
	    "total_amount": {
	    	"$more_than":[10000]
	    }
	  }
}' \
"https://api.voucherify.io/v1/validation-rules"
A binary file was returned

You couldn't be authenticated

{
  "id": "val_BSyoSbxO3ovR",
  "created_at": "2016-10-25T10:12:58Z",
  "voucher_code": "test_val_rules",
  "junction": "AND",
  "orders": {
    "junction": null,
    "total_amount": {
      "$more_than": [
        10000
      ]
    }
  },
  "object": "validation_rules"
}

Body Params

voucher_code
string

A voucher code without any validation rules object assigned.

campaign_name
string

A campaign without any validation rules object assigned.

junction
string

An operator defining the logic operator for defined rules (AND or OR supported).

segments
object

A set of rules based on the segment objects.

 
products
object

A set of rules based on the product object.

 
skus
object

A set of rules based on the sku object.

 
orders
object

A set of rules based on the order value and its items.

 
redemptions
object

A set of rules based on redemptions count.

 
 
Suggest Edits

Get Validation Rules

 
gethttps://api.voucherify.io/v1/validation-rules/validation-rule_id
curl -X GET 
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" 
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" 
-H "Content-Type: application/json" 
"https://api.voucherify.io/v1/validation-rules/val_Z755MnH1Xow1"
A binary file was returned

You couldn't be authenticated

{
  "id": "val_Z755MnH1Xow1",
  "created_at": "2016-10-25T10:12:58Z",
  "voucher_code": "BlackFriday2016",
  "junction": "AND",
  "redemptions": {
    "junction": "AND",
    "count_per_customer": {
      "conditions": {
        "$is": [
          1
        ]
      }
    }
  },
  "object": "validation_rules"
}

Path Params

validation-rule_id
string
required

A unique validation rule identifier

 
Suggest Edits

Update Validation Rules

 
puthttps://api.voucherify.io/v1/validation-rules
curl -X PUT 
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" 
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" 
-H "Content-Type: application/json" 
-d '{
	"orders": {
	    "total_amount": {
	    	"$more_than":[5000]
	    }
	}
}' "https://api.voucherify.io/v1/validation-rules/val_pIDONDsZvnpG"
A binary file was returned

You couldn't be authenticated

{
  "id": "val_pIDONDsZvnpG",
  "created_at": "2017-03-02T07:44:35Z",
  "voucher_code": "val_rul_test",
  "junction": "AND",
  "orders": {
    "junction": null,
    "total_amount": {
      "$more_than": [
        5000
      ]
    }
  },
  "object": "validation_rules"
}

Path Params

validation_rule_id
string
required

-

Body Params

campaign
string

A campaign without any validation rules object assigned.

junction
string

An operator defining the logic operator for defined rules (AND or OR supported).

segments
object

A set of rules based on the segment objects.

 
products
object

A set of rules based on the product object.

 
skus
object

A set of rules based on the sku object.

 
orders
object

A set of rules based on the order value and its items.

 
redemptions
object

A set of rules based on redemptions count.

 
 
Suggest Edits

Delete Validation Rules

 
deletehttps://api.voucherify.io/v1/validation-rules/validation-rule_id
curl -X DELETE
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" 
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" 
-H "Content-Type: application/json" 
"https://api.voucherify.io/v1/validation-rules/val_Z755MnH1Xow1"
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

validation-rule_id
string
required

A unique validation rule identifier

 
Suggest Edits

The segment object

 

This entity describes a customer segment. A customer segment can be static or auto-update learn more. In the case of the former, the entity stores customer ids, the latter means that it stores filters used to automatically select matching customers.

Attribute
Description
Example

id string

seg_TC5iH4KqbpISfyXDiue1t78a

object string

Type of the object represented by JSON. Value is segment.

name string

xyz

created_at string, ISO 8601 date format

2016-11-16T14:14:31Z

metadata

Stores custom meta data

"metadata": {
    "test": true,
    "locale": "pl-en"
}

type string

Can be static or auto-update.

auto-update

filters object

Defines which customers belong to the segment.

{
  "junction":"and",
  "loyalty.campaigns.FRF-campaign.referred_customers":{
    "conditions":{
      "$more_than":[
        0
      ]
    }
  }
}
{
  "id":"seg_9e3ALnjEWVwYGt3zWL96aQQR",
  "name":"ref",
  "created_at":"2016-12-15T15:39:23Z",
  "metadata":{

  },
  "filter":{
    "junction":"and",
    "loyalty.referred_customers.campaigns.Referral Campaign 10":{
      "conditions":{
        "$less_than":[
          "2"
        ]
      }
    },
    "name":{
      "conditions":{
        "$starts_with":[
          "Tom"
        ]
      }
    }
  },
  "customers":null,
  "type":"auto-update",
  "object":"segment"
}
Suggest Edits

Create Segment

 
posthttps://api.voucherify.io/v1/segments
curl -X POST 
-H "X-App-Id: 53623f47-c7dd-4926-bfd3-e060139007d6" 
-H "X-App-Token: 8496bda2-33b5-4888-b8a1-7b69a0b6a8b5" 
-H "Content-Type: application/json" 
-d '{
	"name": "test segment",
	"customers": ["cust_EkqCdCA7JyIDlFBvkOMTnceJ", "cust_abtCdCA7JyIDlFBvkOMTm3f0"],
	"type": "static"
}' "https://api.voucherify.io/v1/segments"
A binary file was returned

You couldn't be authenticated

{
  "id": "seg_ZhLxkpjE3cCxv0kb8kpn86z1",
  "name": "test segment",
  "created_at": "2017-01-31T09:49:09Z",
  "metadata": null,
  "filter": null,
  "type": "static",
  "object": "segment"
}

Body Params

name
string
type
string

Can be static or auto-update

filter
object

Defines which customer belong to the segment.

 
 
Suggest Edits

Get Segment

 
gethttps://api.voucherify.io/v1/segments/segmentId
curl -X GET 
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" 
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" 
-H "Content-Type: application/json" 
"https://api.voucherify.io/v1/segments/seg_BfBDcwmkVqUx6Ko3KZV9W5h9
A binary file was returned

You couldn't be authenticated

{
  "id": "seg_BfBDcwmkVqUx6Ko3KZV9W5h9",
  "name": "test segment2",
  "created_at": "2017-01-31T10:08:04Z",
  "metadata": null,
  "filter": null,
  "type": "static",
  "object": "segment"
}

Path Params

segmentId
string
required
 
Suggest Edits

Delete Segment

 
deletehttps://api.voucherify.io/v1/segments/segmentId
curl -X DELETE 
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" 
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" 
-H "Content-Type: application/json" 
"https://api.voucherify.io/v1/segments/seg_BfBDcwmkVqUx6Ko3KZV9W5h9
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

segmentId
string
required