curl --request GET \
--url https://{cluster}.voucherify.io/v1/publications \
--header 'Authorization: Bearer <token>' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"object": "list",
"data_ref": "publications",
"publications": [
{
"id": "pub_QzQT50e5i2y3bRoEVvhFgrKbZ7t6BRwu",
"object": "publication",
"created_at": "2022-09-28T13:31:23.522Z",
"customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd",
"tracking_id": "cindy.jones@email.com",
"metadata": {
"distribution_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei",
"source_type": "distribution",
"source_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei"
},
"channel": "Automation",
"source_id": null,
"result": "SUCCESS",
"customer": {
"id": "cust_tAED42tFhLM9v7GmZUaklJFd",
"name": "Cindy Jones",
"email": "cindy.jones@email.com",
"source_id": "cindy.jones@email.com",
"metadata": {
"acquisition_channel": "Facebook"
},
"object": "customer"
},
"voucher": {
"code": "FNV5IrtY",
"object": "voucher",
"campaign": "Loyalty Campaign",
"loyalty_card": {
"points": 0,
"balance": 0
},
"is_referral_code": false
},
"vouchers_id": [
"v_i3HOzVClfJUDia0qCu7TSuGfDj7c0dgD"
]
},
{
"id": "pub_8KOKHObAjuemuI0b6225emIhmWDL1ZoX",
"object": "publication",
"created_at": "2022-09-28T13:31:02.766Z",
"customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd",
"tracking_id": "sandy.jones@email.com",
"metadata": {},
"channel": "voucherify-website",
"source_id": null,
"result": "SUCCESS",
"customer": {
"id": "cust_tAED42tFhLM9v7GmZUaklJFd",
"name": "Sandy Jones",
"email": "sandy.jones@email.com",
"source_id": "sandy.jones@email.com",
"metadata": {
"acquisition_channel": "Facebook"
},
"object": "customer"
},
"voucher": {
"code": "Voucher-1",
"object": "voucher",
"campaign": null,
"discount": {
"type": "AMOUNT",
"amount_off": 200,
"amount_off_formula": "IF(VOUCHER_PUBLISH_COUNT = 1;25;5)",
"effect": "APPLY_TO_ORDER"
},
"is_referral_code": false
},
"vouchers_id": [
"v_1iEL92K634EIOqeYJw6AHrnjEhGPEdpu"
]
},
{
"id": "pub_DcQPfyVYzomtkQGXFW7dcdyNoJ6vQ4NV",
"object": "publication",
"created_at": "2022-09-13T06:15:08.249Z",
"customer_id": "cust_ur1hIPGflbaAe14mLlLdon3G",
"tracking_id": "1",
"metadata": {},
"channel": "voucherify-website",
"source_id": null,
"result": "SUCCESS",
"customer": {
"id": "cust_ur1hIPGflbaAe14mLlLdon3G",
"name": "Bob Jones",
"email": "bob.jones@email.com",
"source_id": "1",
"metadata": {
"accepts_marketing": false
},
"object": "customer"
},
"voucher": {
"code": "GIFT-WOZaK5YF1Fs87tAX",
"object": "voucher",
"campaign": "Gift Cards",
"gift": {
"amount": 0,
"balance": 0
},
"is_referral_code": false
},
"vouchers_id": [
"v_yzOeb7vw63vbPfA30215dFm7aRXa8Xoc"
]
}
],
"total": 3
}Retrieve a list of publications. To return a particular publication, you can use the source_id query parameter and provide the source_id of the publication you are looking for specifically.
🚧 Important!
If you want to scroll through a huge set of records, it is recommended to use the Exports API. This API will return an error
page_over_limitif you reach a page above 1000.
The filters query parameter allows for joining multiple parameters with logical operators. The syntax looks as follows:
"$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"
GET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL
GET /v1/publications?filters[customer_id][conditions][$in][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$in][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc
GET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$is][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc&filters[junction]=OR
curl --request GET \
--url https://{cluster}.voucherify.io/v1/publications \
--header 'Authorization: Bearer <token>' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"object": "list",
"data_ref": "publications",
"publications": [
{
"id": "pub_QzQT50e5i2y3bRoEVvhFgrKbZ7t6BRwu",
"object": "publication",
"created_at": "2022-09-28T13:31:23.522Z",
"customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd",
"tracking_id": "cindy.jones@email.com",
"metadata": {
"distribution_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei",
"source_type": "distribution",
"source_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei"
},
"channel": "Automation",
"source_id": null,
"result": "SUCCESS",
"customer": {
"id": "cust_tAED42tFhLM9v7GmZUaklJFd",
"name": "Cindy Jones",
"email": "cindy.jones@email.com",
"source_id": "cindy.jones@email.com",
"metadata": {
"acquisition_channel": "Facebook"
},
"object": "customer"
},
"voucher": {
"code": "FNV5IrtY",
"object": "voucher",
"campaign": "Loyalty Campaign",
"loyalty_card": {
"points": 0,
"balance": 0
},
"is_referral_code": false
},
"vouchers_id": [
"v_i3HOzVClfJUDia0qCu7TSuGfDj7c0dgD"
]
},
{
"id": "pub_8KOKHObAjuemuI0b6225emIhmWDL1ZoX",
"object": "publication",
"created_at": "2022-09-28T13:31:02.766Z",
"customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd",
"tracking_id": "sandy.jones@email.com",
"metadata": {},
"channel": "voucherify-website",
"source_id": null,
"result": "SUCCESS",
"customer": {
"id": "cust_tAED42tFhLM9v7GmZUaklJFd",
"name": "Sandy Jones",
"email": "sandy.jones@email.com",
"source_id": "sandy.jones@email.com",
"metadata": {
"acquisition_channel": "Facebook"
},
"object": "customer"
},
"voucher": {
"code": "Voucher-1",
"object": "voucher",
"campaign": null,
"discount": {
"type": "AMOUNT",
"amount_off": 200,
"amount_off_formula": "IF(VOUCHER_PUBLISH_COUNT = 1;25;5)",
"effect": "APPLY_TO_ORDER"
},
"is_referral_code": false
},
"vouchers_id": [
"v_1iEL92K634EIOqeYJw6AHrnjEhGPEdpu"
]
},
{
"id": "pub_DcQPfyVYzomtkQGXFW7dcdyNoJ6vQ4NV",
"object": "publication",
"created_at": "2022-09-13T06:15:08.249Z",
"customer_id": "cust_ur1hIPGflbaAe14mLlLdon3G",
"tracking_id": "1",
"metadata": {},
"channel": "voucherify-website",
"source_id": null,
"result": "SUCCESS",
"customer": {
"id": "cust_ur1hIPGflbaAe14mLlLdon3G",
"name": "Bob Jones",
"email": "bob.jones@email.com",
"source_id": "1",
"metadata": {
"accepts_marketing": false
},
"object": "customer"
},
"voucher": {
"code": "GIFT-WOZaK5YF1Fs87tAX",
"object": "voucher",
"campaign": "Gift Cards",
"gift": {
"amount": 0,
"balance": 0
},
"is_referral_code": false
},
"vouchers_id": [
"v_yzOeb7vw63vbPfA30215dFm7aRXa8Xoc"
]
}
],
"total": 3
}The access token received from the authorization server in the OAuth 2.0 flow.
Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
1 <= x <= 100Which page of results to return. The lowest value is 1.
1 <= x <= 100Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
id, -id, voucher_code, -voucher_code, tracking_id, -tracking_id, customer_id, -customer_id, created_at, -created_at, channel, -channel Filters by a given campaign name.
Filters by a unique customer ID.
"cust_nk0N1uNQ1YnupAoJGOgvsODC"
Filters by a given voucher code.
"2CpRCE2c"
Filters by a publication result.
SUCCESS, FAILURE Filters by a voucher type.
discount, loyalty This filter works only for the true option. If set to true, the query returns only publications of codes from referral campaigns.
Filters for listing publications.
Show child attributes
Logical Operator Between Filters. Filter by conditions set on the junction parameter indicating how the conditions should be accounted for in the query. An AND is an all-inclusive logical operator, meaning the AND operator displays a record if ALL the conditions separated by AND are TRUE, while an OR operator displays a record if ANY of the conditions separated by OR is TRUE.
and, or Filter publications by ids.
Show child attributes
Data filters used to narrow down the data records to be returned in the result.
Show child attributes
Array of resource values that should be included in the results (multiple values).
Array of resource values that should be included in the results (multiple values).
Value is exactly this value (single value).
Results omit this value (single value).
Value is NOT null. The value for this parameter is an empty string.
Value is null. The value for this parameter is an empty string.
Value starts with the specified string.
Value ends with the specified string.
Value includes the specified string.
Value does NOT include the specified string.
Filter publications by names.
Show child attributes
Data filters used to narrow down the data records to be returned in the result.
Show child attributes
Array of resource values that should be included in the results (multiple values).
Array of resource values that should be included in the results (multiple values).
Value is exactly this value (single value).
Results omit this value (single value).
Value is NOT null. The value for this parameter is an empty string.
Value is null. The value for this parameter is an empty string.
Value starts with the specified string.
Value ends with the specified string.
Value includes the specified string.
Value does NOT include the specified string.
Filter publications by customer ids.
Show child attributes
Data filters used to narrow down the data records to be returned in the result.
Show child attributes
Array of resource values that should be included in the results (multiple values).
Array of resource values that should be included in the results (multiple values).
Value is exactly this value (single value).
Results omit this value (single value).
Value is NOT null. The value for this parameter is an empty string.
Value is null. The value for this parameter is an empty string.
Value starts with the specified string.
Value ends with the specified string.
Value includes the specified string.
Value does NOT include the specified string.
Filter publications by campaign names.
Show child attributes
Data filters used to narrow down the data records to be returned in the result.
Show child attributes
Array of resource values that should be included in the results (multiple values).
Array of resource values that should be included in the results (multiple values).
Value is exactly this value (single value).
Results omit this value (single value).
Value is NOT null. The value for this parameter is an empty string.
Value is null. The value for this parameter is an empty string.
Value starts with the specified string.
Value ends with the specified string.
Value includes the specified string.
Value does NOT include the specified string.
Filter publications by voucher types.
Show child attributes
Data filters used to narrow down the data records to be returned in the result.
Show child attributes
Array of resource values that should be included in the results (multiple values).
Array of resource values that should be included in the results (multiple values).
Value is exactly this value (single value).
Results omit this value (single value).
Value is NOT null. The value for this parameter is an empty string.
Value is null. The value for this parameter is an empty string.
Value starts with the specified string.
Value ends with the specified string.
Value includes the specified string.
Value does NOT include the specified string.
Filter publications by is referall code.
Show child attributes
Data filters used to narrow down the data records to be returned in the result.
Show child attributes
Array of resource values that should be included in the results (multiple values).
Array of resource values that should be included in the results (multiple values).
Value is exactly this value (single value).
Results omit this value (single value).
Value is NOT null. The value for this parameter is an empty string.
Value is null. The value for this parameter is an empty string.
Value starts with the specified string.
Value ends with the specified string.
Value includes the specified string.
Value does NOT include the specified string.
Filter publications by parent object id.
Show child attributes
Data filters used to narrow down the data records to be returned in the result.
Show child attributes
Array of resource values that should be included in the results (multiple values).
Array of resource values that should be included in the results (multiple values).
Value is exactly this value (single value).
Results omit this value (single value).
Value is NOT null. The value for this parameter is an empty string.
Value is null. The value for this parameter is an empty string.
Value starts with the specified string.
Value ends with the specified string.
Value includes the specified string.
Value does NOT include the specified string.
Filter publications by related object id.
Show child attributes
Data filters used to narrow down the data records to be returned in the result.
Show child attributes
Array of resource values that should be included in the results (multiple values).
Array of resource values that should be included in the results (multiple values).
Value is exactly this value (single value).
Results omit this value (single value).
Value is NOT null. The value for this parameter is an empty string.
Value is null. The value for this parameter is an empty string.
Value starts with the specified string.
Value ends with the specified string.
Value includes the specified string.
Value does NOT include the specified string.
Filter publications by source id.
Show child attributes
Data filters used to narrow down the data records to be returned in the result.
Show child attributes
Array of resource values that should be included in the results (multiple values).
Array of resource values that should be included in the results (multiple values).
Value is exactly this value (single value).
Results omit this value (single value).
Value is NOT null. The value for this parameter is an empty string.
Value is null. The value for this parameter is an empty string.
Value starts with the specified string.
Value ends with the specified string.
Value includes the specified string.
Value does NOT include the specified string.
Using this endpoint with a particular publication source_id, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular source_id.
Returns a list of publications you've previously created with create publication or implicitly by the distribution manager. The publications are returned in sorted order, with the most recent ones appearing first.
Response body schema for listing publications using GET v1/publications.
The type of the object represented by JSON. This object stores information about publications in a dictionary.
Identifies the name of the attribute that contains the array of publications.
Contains array of publication objects, voucher object will be simplified.
Response schema model for publishing vouchers to a specific customer.
Show child attributes
Unique publication ID, assigned by Voucherify.
"pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp"
The type of the object represented by the JSON. This object stores information about the publication.
publication Timestamp representing the date and time when the publication was created. The value is shown in the ISO 8601 format.
"2022-09-23T09:57:00.434Z"
Unique customer ID of the customer receiving the publication.
"cust_eWgXlBBiY6THFRJwX45Iakv4"
The metadata object stores all custom attributes assigned to the publication. 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 in a structured format.
How the publication was originated. It can be your own custom channel or an example value provided here.
The merchant's publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service.
Show child attributes
Show child attributes
Show child attributes
Total number of redemptions made by the customer.
Total number of redemptions that failed.
Total number of redemptions that succeeded.
Total number of redemptions that were rolled back for the customer.
Total number of redemption rollbacks that failed.
Total number of redemption rollbacks that succeeded.
Summary of gift card credits.
Show child attributes
Total amount of gift card credits redeemed by customer. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
Remaining gift card balance across all gift cards. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
Summary of loyalty points.
Show child attributes
Lists details about orders related to the customer. Lists only data for orders with the PAID or FULFILLED status. Data from orders with a CREATED or CANCELED status are not included. The data is updated also when an order changes status.
Show child attributes
The total amount spent by the customer. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
Total number of orders made by the customer.
Average amount spent on orders. total_amount ÷ total_count. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
Amount spent on last order. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
Timestamp representing the date and time of the customer's last order in ISO 8601 format.
"2022-08-30T11:51:08.029Z"
Show child attributes
Customer's loyalty points minus expired for all loyalty cards which the customer has.
Total number of customers referred by the customer.
Contains campaigns with details about point balances and how many customers were referred by the customer.
Show child attributes
Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.
Show child attributes
Remaining point balance in campaign.
Customer's loyalty tier within the campaign.
"ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x"
Number of customers referred by the customer in campaign.
Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.
Show child attributes
Total number of times this customer received a referral, i.e. was referred by another customer.
Contains an array of campaigns that served as the source of a referral for the customer.
Show child attributes
Unique campaign ID, assigned by Voucherify.
"camp_rRsfatlwN7unSeUIJDCYedal"
Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer.
"cust_sehkNIi8Uq2qQuRqSr7xn4Zi"
Related object id
"r_0b9d4cc4aa164dd073"
Related object type, i.e. redemption.
Timestamp representing the date and time when the customer was referred in ISO 8601 format.
"2022-08-30T10:19:39.196Z"
The type of the object represented by JSON.
customer The ID of an existing customer that will be linked to redemption in this request.
A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.
Object used to store system metadata information.
Timestamp representing the date and time when the customer was created. The value is shown in the ISO 8601 format.
"2022-08-30T06:32:07.380Z"
Timestamp representing the date and time when the customer was updated. The value is shown in the ISO 8601 format.
"2022-08-31T06:32:07.380Z"
Customer's first and last name.
An arbitrary string that you can attach to a customer object.
Customer's email address.
Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel.
Deprecated. Customer's birthdate; format YYYY-MM-DD.
Customer's birthdate; format YYYY-MM-DD.
Customer's address.
Show child attributes
City
State
First line of address.
Second line of address.
Country.
Postal code.
A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.
Contains the unique internal voucher IDs that was assigned by Voucherify.
Status of the publication attempt.
SUCCESS Show child attributes
Voucher code.
The type of the object represented by JSON.
voucher Campaign name
Gift object response
Show child attributes
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00. balance = amount - subtracted_amount - redemption.redeemed_amount.
Total amount of subtracted credits over the gift card lifetime.
Defines how the credits are applied to the customer's order.
APPLY_TO_ORDER, APPLY_TO_ITEMS Defines the loyalty card details.
Contains information about discount.
Show child attributes
Defines the type of the voucher.
AMOUNT Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000.
Formula used to dynamically calculate the discount.
Maximum discount amount per order.
Defines how the discount is applied to the customer's order.
APPLY_TO_ORDER, APPLY_TO_ITEMS, APPLY_TO_ITEMS_PROPORTIONALLY, APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY, APPLY_TO_ITEMS_BY_QUANTITY Flag indicating whether the discount was calculated using a formula.
Flag indicating whether this voucher is a referral code; true for campaign type REFERRAL_PROGRAM.
Customer's source_id.
Contains the voucher IDs that was assigned by Voucherify.
Total number of publications.
Was this page helpful?