Skip to main content
GET
/
v1
/
publications
List Publications
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
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Query Parameters

limit
integer

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.

Required range: 1 <= x <= 100
page
integer

Which page of results to return. The lowest value is 1.

Required range: 1 <= x <= 100
order
enum<string>

Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

Available options:
id,
-id,
voucher_code,
-voucher_code,
tracking_id,
-tracking_id,
customer_id,
-customer_id,
created_at,
-created_at,
channel,
-channel
campaign
string

Filters by a given campaign name.

customer
string

Filters by a unique customer ID.

Example:

"cust_nk0N1uNQ1YnupAoJGOgvsODC"

voucher
string

Filters by a given voucher code.

Example:

"2CpRCE2c"

result
enum<string>

Filters by a publication result.

Available options:
SUCCESS,
FAILURE
voucher_type
enum<string>

Filters by a voucher type.

Available options:
discount,
loyalty
is_referral_code
boolean

This filter works only for the true option. If set to true, the query returns only publications of codes from referral campaigns.

filters
object

Filters for listing publications.

source_id
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.

Response

Returns a list of publications you've previously created with <!-- [create publication](OpenAPI.json/paths/~1publications/post) -->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.

object
string
default:list
required

The type of the object represented by JSON. This object stores information about publications in a dictionary.

data_ref
string
default:publications
required

Identifies the name of the attribute that contains the array of publications.

publications
(Valid Single Voucher · object | Valid Multiple Vouchers · object | Invalid · object)[]
required

Contains array of publication objects, voucher object will be simplified.

  • Valid Single Voucher
  • Valid Multiple Vouchers
  • Invalid
total
integer
required

Total number of publications.

I