younifyd
Menu

Create Points Expiration Export

Export Loyalty Campaign Point Expiration

POST/v1/loyalties/{campaignId}/points-expiration/export

Use it in a workflow

  1. Add a step and choose the Voucherify connector.
  2. Pick the Create Points Expiration Export action (under Loyalties).
  3. Fill in the fields below, then reference the result from later steps as {{createPointsExpirationExport.response.data}}.

Request

Path parameters

campaignIdstringrequired

Unique campaign ID or name.

Request body

Enter the body as JSON in the step's Body field.

parametersobject

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

orderstring

How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.

One ofexpires_at-expires_at

fieldsarray<string>

Array of strings containing the data that was exported. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields: | **Field** | **Definition** | **Example Export** | |:---|:---|:---| | id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n | | campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic | | voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 | | status | Status of the loyalty point bucket. | `ACTIVE` or `EXPIRED` | | expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 | | points | Number of points. | 1000 |

filtersobject3 fields

Data filters used to narrow down the data records to be returned in the export.

json
{
  "parameters": {
    "order": "expires_at",
    "fields": [
      "id"
    ],
    "filters": {
      "junction": "and",
      "voucher_id": {
        "conditions": {
          "$in": [
            "string"
          ],
          "$not_in": [
            "string"
          ],
          "$is": "string",
          "$is_not": "string"
        }
      },
      "campaign_id": {
        "conditions": {
          "$in": [
            "string"
          ],
          "$not_in": [
            "string"
          ],
          "$is": "string",
          "$is_not": "string"
        }
      }
    }
  }
}

Response

Returns 200 with an object. Read it in later steps with {{createPointsExpirationExport.response.data.<field>}}.

idstring

Unique export ID.

objectstring

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

One ofexportDefault "export"

created_atstring (date-time)

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

statusstring

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

One ofSCHEDULED

channelstring

The channel through which the export was triggered.

One ofAPIWEBSITE

exported_objectstring

The type of exported object.

One ofpoints_expirationDefault "points_expiration"

parametersobject

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

orderstring

How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.

One ofexpires_at-expires_at

fieldsarray<string>

Array of strings containing the data that was exported. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields: | **Field** | **Definition** | **Example Export** | |:---|:---|:---| | id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n | | campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic | | voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 | | status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` | | expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 | | points | Number of points. | 1000 |

filtersobject3 fields

Data filters used to narrow down the data records to be returned in the export.

resultobject

Always null.

user_idstring

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

json
{
  "id": "exp_FFfp9o7daWuJqJCKp5xqqli4",
  "object": "export",
  "created_at": "2022-04-28T11:23:20.922Z",
  "status": "SCHEDULED",
  "channel": "API",
  "exported_object": "points_expiration",
  "parameters": {
    "order": "expires_at",
    "fields": [
      "id"
    ],
    "filters": {
      "junction": "and",
      "voucher_id": {
        "conditions": {
          "$in": [
            "string"
          ],
          "$not_in": [
            "string"
          ],
          "$is": "string",
          "$is_not": "string"
        }
      },
      "campaign_id": {
        "conditions": {
          "$in": [
            "string"
          ],
          "$not_in": [
            "string"
          ],
          "$is": "string",
          "$is_not": "string"
        }
      }
    }
  },
  "result": {},
  "user_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0Fr"
}

Need more? See the Voucherify guide for connection setup and behaviour shared by every action.