Skip to main content
POST
/
v1
/
loyalties
/
{campaignId}
/
transactions
/
export
Export Loyalty Campaign Transactions
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/transactions/export \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '{
  "order": "-created_at",
  "parameters": {
    "fields": [
      "id",
      "type",
      "source_id",
      "created_at"
    ],
    "filters": {
      "created_at": {
        "conditions": {
          "$after": [
            "2024-10-01T00:00:00.000Z"
          ]
        }
      }
    }
  }
}'
{
"id": "exp_KBunyG5vwkuF3jSWD03kmnLx",
"object": "export",
"created_at": "2024-10-25T14:35:12.019Z",
"status": "SCHEDULED",
"channel": "API",
"exported_object": "voucher_transactions",
"parameters": {
"fields": [
"id",
"type",
"source_id",
"created_at"
],
"filters": {
"junction": "AND",
"created_at": {
"conditions": {
"$after": [
"2024-10-01T00:00:00.000Z"
]
}
},
"campaign_id": {
"conditions": {
"$in": [
"camp_5pgKwSKsAeQtFkRz6mfKpxxD"
]
}
}
}
},
"result": null,
"user_id": null
}

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.

Path Parameters

campaignId
string
required

You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value.

Example:

"camp_rRsfatlwN7unSeUIJDCYedal"

Body

application/json

Specify the parameters for the transaction export.

Request body schema for POST v1/loyalties/{campaignId}/transactions/export.

parameters
object

List of available parameters containing fields and filters that can be exported for transactions in a loyalty card campaign, along with the sorting order of the returned data.

Response

An object representing an export.

Response body schema for POST v1/campaigns/{campaignId}/transactions/export. This is an object representing an export.

id
string
required

Unique export ID.

Example:

"exp_FFfp9o7daWuJqJCKp5xqqli4"

object
enum<string>
default:export
required

The type of object being represented. This object stores information about the export.

Available options:
export
created_at
string<date-time>
required

Timestamp representing the date and time when the export was scheduled in ISO 8601 format.

Example:

"2022-04-28T11:23:20.922Z"

status
enum<string>
default:SCHEDULED
required

Status of the export. Informs you whether the export has already been completed, i.e. indicates whether the file containing the exported data has been generated.

Available options:
SCHEDULED
channel
enum<string>
default:API
required

The channel through which the export was triggered.

Available options:
API
exported_object
enum<string>
default:voucher_transactions
required

The type of exported object.

Available options:
voucher_transactions
parameters
object
required
result
object | null
required

Contains the URL of the CSV file.

user_id
string | null
required

Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the channel value is WEBSITE.

Example:

"user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH"

I