---
title: "Import loyalty points"
method: POST
path: "/v1/loyalty_programs/{loyaltyProgramId}/import_points"
tags: ["Loyalty"]
---

# Import loyalty points

`POST /v1/loyalty_programs/{loyaltyProgramId}/import_points`

## Request

- Base URL: `https://yourbaseurl.talon.one`
- URL: `https://yourbaseurl.talon.one/v1/loyalty_programs/{loyaltyProgramId}/import_points`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/talon/apis/management-api/docs/v1/loyalty_programs/:loyaltyProgramId/import_points/post.ts> (a function with typed inputs; its response is checked against the schema)

> [!note] Management API endpoints are **not** meant to be used in real-time integrations that directly serve your end users. Rate limit: 3 requests per second.

Upload a CSV file containing the loyalty points you want to import into a
given loyalty program.

Send the file as multipart data.

Depending on the type of loyalty program, you can import points into a given
customer profile or loyalty card.

The CSV file contains the following columns:

- `customerprofileid` (optional): For profile-based loyalty programs, the
  integration ID of the customer profile where the loyalty points are
  imported.
  **Note**: If the customer profile does not exist, it will be created. The profile will not be visible in any Application
  until a session or profile update is received for that profile.
- `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported.
- `amount`: The amount of points to award to the customer profile.
- `startdate` (optional): The earliest date when the points can be redeemed. The points are `active` from this date until the expiration date.
  This parameter accepts one of the following values:
    - A timestamp string in RFC3339 format.
    - `immediate`
    - `on_action`
  **Note**: Empty or missing values default to `immediate`.
- `expirydate` (optional): The latest date when the points can be redeemed.
  The points are `expired` after this date.
  **Note**: It must be an RFC3339 timestamp string or string `unlimited`. Empty or missing values are considered `unlimited`.
  If passed, `validityDuration` should be omitted.
- `validityDuration` (optional): The duration for which the points remain active, relative to the
  activation date. The time format is an **integer** followed by one letter indicating the time unit.<br />
  Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`.

  Available units:

  - `s`: seconds
  - `m`: minutes
  - `h`: hours
  - `D`: days
  - `W`: weeks
  - `M`: months
  - `Y`: years

  You can round certain units up or down:

  - `_D` for rounding down days only. Signifies the start of the day.
  - `_U` for rounding up days, weeks, months and years. Signifies the end of
  the day, week, month or year.

  If passed, `expirydate` should be omitted.
- `subledgerid` (optional): The ID of the subledger that should received the points.
- `reason` (optional): The reason why these points are awarded.

You can use the time zone of your choice. It is converted to UTC internally by Talon.One.

> [!note] For existing customer profiles and loyalty cards, the imported
> points are added to any previous active or pending points, depending on the
> value provided for `startdate`. If `startdate` matches the current date, the
> imported points are _active_. If it is later, the points are _pending_ until
> the date provided for `startdate` is reached.

> [!note] We recommend limiting your file size to 500 MB.

## Example for profile-based programs

```text
customerprofileid,amount,startdate,expirydate,subledgerid,reason
URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement
```

## Example for card-based programs

```text
identifier,amount,startdate,expirydate,subledgerid,reason
summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement
```

## Path parameters

- `loyaltyProgramId` integer, required

## Query parameters

- `notificationsEnabled` boolean

## Request body `multipart/form-data`

- object
  - `upFile` string, binary: The CSV file containing the data that is being imported.

## Response `200`

OK

- Import
  - `id` integer, required: The internal ID of this entity.
  - `created` string, date-time, required: The time this entity was created.
  - `accountId` integer, required: The ID of the account that owns this entity.
  - `userId` integer, required: The ID of the user associated with this entity.
  - `entity` string, required: The name of the entity that was imported.
  - `amount` integer, required: The number of values that were imported.

---

[API](https://skmtc.dev/talon/apis/management-api.md) - [All operations](https://skmtc.dev/talon/apis/management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talon/apis/management-api/revisions/7ef1b9504c3a?raw)
