Skip to main content
POST
/
v1
/
loyalties
/
{campaignId}
/
points-expiration
/
export
curl --request POST \
--url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/points-expiration/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '{
"parameters": {
"fields": [
"id",
"campaign_id",
"voucher_id",
"status",
"expires_at",
"points"
],
"order": "-expires_at",
"filters": {
"junction": "and",
"voucher_id": {
"conditions": {
"$in": [
"v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF",
"v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655"
]
}
}
}
}
}'
{
"id": "exp_zC3eXAFss17XTMzMkkov4KGq",
"object": "export",
"created_at": "2022-11-28T13:00:23.621Z",
"status": "SCHEDULED",
"channel": "API",
"exported_object": "points_expiration",
"parameters": {
"order": "-expires_at",
"fields": [
"id",
"campaign_id",
"voucher_id",
"status",
"expires_at",
"points"
],
"filters": {
"junction": "and",
"voucher_id": {
"conditions": {
"$in": [
"v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF",
"v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655"
]
}
}
}
},
"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

Unique campaign ID or name.

Example:

"camp_rRsfatlwN7unSeUIJDCYedal"

Body

application/json

Specify the data filters, types of data to return and order in which the results should be returned.

Request schema model for validating a voucher using POST /v1/loyalties/{campaignId}/points-expiration/export

parameters
object

List of fields and filters that will be used to create the export.

Response

200 - application/json

Returns an object with the export ID of the scheduled generation of CSV file with exported points expirations. You can use either the <!-- [Get Export](OpenAPI.json/paths/~1exports~1{exportId}/get) -->Get Export endpoint to view the status and obtain the URL of the CSV file or <!-- [Download Export](OpenAPI.json/paths/~1exports~1{export_Id}/get) -->Download Export endpoint to download the CSV file.

Object representing an export of points expirations.

id
string

Unique export ID.

Example:

"exp_FFfp9o7daWuJqJCKp5xqqli4"

object
enum<string>
default:export

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

Available options:
export
created_at
string<date-time>

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>

Status of the export. Informs you whether the export has already been completed.

Available options:
SCHEDULED
channel
enum<string>

The channel through which the export was triggered.

Available options:
API,
WEBSITE
exported_object
enum<string>
default:points_expiration

The type of exported object.

Available options:
points_expiration
parameters
object

List of fields and filters that were passed in the request body to create the export.

result
object

Always null.

user_id
string

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

Example:

"user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0Fr"

⌘I