# Get redeemable promotions of a Profile

- Operation ID: `GetRedeemablePromotions`
- HTTP method: `GET`
- Path: `/v4/promotions/promotion/get-for-client-possible-to-redeem/{identifierType}/{identifierValue}`
- [Human-readable API reference](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Promotions/operation/GetRedeemablePromotions)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /v4/promotions/promotion/get-for-client-possible-to-redeem/{identifierType}/{identifierValue}:
    get:
      tags:
        - Promotions
      summary: Get redeemable promotions of a Profile
      description: |
        Retrieve all redeemable promotions related to a Profile.

        **IMPORTANT**: 
        - As a result of this request, the `targetSegments` of all the matching promotions are checked. If this results in checking more than 100 unique segments, any segments above this limit may be ignored.
        - The endpoint is limited to 25000 requests per minute (per workspace).

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `PROMOTIONS_REDEEM_PROMOTIONS_READ`

        **User role permission required:** `campaigns_promotions: read`
      operationId: GetRedeemablePromotions
      parameters:
        - name: identifierType
          in: path
          description: |
            The Profile identifier to use for the request.

            `externalId` is known as `customId` or `custom_identify` in other Synerise services.
          required: true
          schema:
            type: string
            example: email
            enum:
              - email
              - phone
              - externalId
              - uuid
              - clientId
        - name: identifierValue
          in: path
          description: The value of the selected identifier
          required: true
          schema:
            type: string
        - name: sort
          in: query
          required: false
          description: |
            The sorting order of the response.


              You can sort by any combination of the following attributes:
              * `headerName`: promotion header name
              * `name`: promotion name
              * `code`: promotion code
              * `startAt`: time when the promotion starts
              * `createdAt`: time when the promotion was created
              * `updatedAt`: time when the promotion was last updated
              * `expireAt`: time when the promotion expires
              * `requireRedeemedPoints`: how many loyalty points are needed to redeem the promotion
              * `type`: type of the promotion
              * `priority`: priority of the promotion
              * `status` : status of the promotion for the Profile

              You can sort ascending (default) or descending by adding `asc` or `desc` after the parameter, separated by a comma.

              **Example**: `sort=requireRedeemedPoints&sort=expireAt,asc&sort=status,desc`
          style: form
          explode: true
          allowReserved: true
          schema:
            type: string
            example: requireRedeemedPoints,desc
        - name: presentOnly
          in: query
          description: |
            When set to:
            - `true`, the response includes only promotions that are currently active (startAt later than now or null, expireAt later than now or null)
            - `false`, the response includes the above and also promotions that are expired or will become active in the future.
          required: false
          style: form
          explode: false
          schema:
            type: boolean
            example: true
            default: true
        - name: lastingOnly
          in: query
          description: When set to `true`, shows promotions/vouchers that are currently active and those that are still inactivated. (lastingAt set to null or lastingAt in future)
          required: false
          style: form
          explode: false
          schema:
            type: boolean
            example: true
            default: true
        - name: displayableOnly
          in: query
          description: When set to `true`, promotions which are not currently active are included in response, according to date range defined in promotion fields `displayFrom` and `displayTo`.
          required: false
          style: form
          explode: false
          schema:
            type: boolean
            example: true
            default: false
        - name: status
          in: query
          description: Filter by promotion status
          required: false
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - ACTIVE
                - ASSIGNED
                - REDEEMED
        - name: type
          in: query
          description: Promotion type
          required: false
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - GENERAL
                - CUSTOM
                - MEMBERS_ONLY
                - HANDBILL
        - name: statusByType
          in: query
          description: A combination of status and type, for example `[CUSTOM]=ACTIVE`
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: "[CUSTOM]=ACTIVE"
        - name: targetByType
          in: query
          description: A combination of target and type, for example `[SEGMENT]=ACTIVE`
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: "[SEGMENT]=ACTIVE"
        - name: includeMeta
          in: query
          description: |
            
            When `true`, pagination metadata is included in the response body.

            When `false`, the data is included in the response headers:

            - Link: links to neighbors, first, and last pages in pagination.

            - X-Pagination-Total-Count: total number of items on all pages

            - X-Pagination-Total-Pages: total number of pages

            - X-Pagination-Page: current page

            - X-Pagination-Limit: maximum number of items on a page
          required: false
          schema:
            type: boolean
            example: false
            default: false
        - name: page
          in: query
          description: Page number to return for pagination. The first page has the index `1`.
          required: false
          schema:
            type: integer
            format: int32
            example: 4
            default: 1
        - name: limit
          in: query
          description: The number of items to return per page
          required: false
          schema:
            type: integer
            example: 100
            default: 100
            maximum: 1000
        - name: target
          in: query
          required: false
          description: The target of the promotion
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - ALL
                - SEGMENT
              default: ALL
        - name: storeIds
          in: query
          description: Limits the response to data from particular stores, identified by IDs.
          required: false
          schema:
            type: string
          style: form
          explode: false
      responses:
        "200":
          description: An array of promotions
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          maxLength: 64
                          description: Unique code
                        possibleRedeems:
                          type: integer
                          description: Number of available redeems left
                        lastingAt:
                          type: string
                          nullable: true
                          format: date-time
                          description: Time when promotion becomes expire for the Profile.
                  meta:
                    type: object
                    description: Optional metadata
                    properties:
                      code:
                        type: integer
                        description: HTTP code
                      limit:
                        type: integer
                        description: The number of items per page
                      link:
                        type: array
                        description: Links to other pages
                        items:
                          type: object
                          description: Link to another page on the list
                          properties:
                            rel:
                              type: string
                              enum:
                                - first
                                - last
                                - next
                                - prev
                              description: The type of relationship to the current page
                            url:
                              type: string
                              description: The URL of the page
                      page:
                        type: integer
                        description: The current page
                      totalCount:
                        type: integer
                        description: The total number of items on all pages
                      totalPages:
                        type: integer
                        description: The total number of pages
        "400":
          description: Request body invalid/malformed/missing elements
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    title: JSON content issue
                    properties:
                      message:
                        type: string
                        description: Summary of the error
                      error:
                        description: Details of the error
                        anyOf:
                          - type: array
                            description: An array of objects with error details
                            items:
                              type: object
                              description: Details of an error
                              properties:
                                message:
                                  type: string
                                  description: Short description of the error
                                  example: Internal Error
                                additionalProperties:
                                  description: Additional information, if applicable
                          - type: string
                            description: Description of the error
                  - type: object
                    title: JSON structure issue
                    properties:
                      message:
                        type: string
                        description: Summary of the error
                      code:
                        type: string
                        description: String-type code of the error
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP code of the problem
                  error:
                    type: string
                    description: Summary of the error
                  message:
                    type: string
                    description: Error details
                  timestamp:
                    type: string
                    description: Time when the error occurred
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP code of the problem
                  error:
                    type: string
                    description: Summary of the error
                  message:
                    type: string
                    description: Error details
                  timestamp:
                    type: string
                    description: Time when the error occurred
      deprecated: false
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/loyalty-and-engagement#tag/Promotions/operation/GetRedeemablePromotions
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/v4/promotions/promotion/get-for-client-possible-to-redeem/email/%7BidentifierValue%7D?sort=requireRedeemedPoints%2Cdesc&presentOnly=true&lastingOnly=true&displayableOnly=true&status=SOME_ARRAY_VALUE&type=SOME_ARRAY_VALUE&statusByType=%5BCUSTOM%5D%3DACTIVE&targetByType=%5BSEGMENT%5D%3DACTIVE&includeMeta=false&page=4&limit=100&target=SOME_ARRAY_VALUE&storeIds=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/v4/promotions/promotion/get-for-client-possible-to-redeem/email/%7BidentifierValue%7D?sort=requireRedeemedPoints%2Cdesc&presentOnly=true&lastingOnly=true&displayableOnly=true&status=SOME_ARRAY_VALUE&type=SOME_ARRAY_VALUE&statusByType=%5BCUSTOM%5D%3DACTIVE&targetByType=%5BSEGMENT%5D%3DACTIVE&includeMeta=false&page=4&limit=100&target=SOME_ARRAY_VALUE&storeIds=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/v4/promotions/promotion/get-for-client-possible-to-redeem/email/%7BidentifierValue%7D?sort=requireRedeemedPoints%2Cdesc&presentOnly=true&lastingOnly=true&displayableOnly=true&status=SOME_ARRAY_VALUE&type=SOME_ARRAY_VALUE&statusByType=%5BCUSTOM%5D%3DACTIVE&targetByType=%5BSEGMENT%5D%3DACTIVE&includeMeta=false&page=4&limit=100&target=SOME_ARRAY_VALUE&storeIds=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/v4/promotions/promotion/get-for-client-possible-to-redeem/email/%7BidentifierValue%7D?sort=requireRedeemedPoints%2Cdesc&presentOnly=true&lastingOnly=true&displayableOnly=true&status=SOME_ARRAY_VALUE&type=SOME_ARRAY_VALUE&statusByType=%5BCUSTOM%5D%3DACTIVE&targetByType=%5BSEGMENT%5D%3DACTIVE&includeMeta=false&page=4&limit=100&target=SOME_ARRAY_VALUE&storeIds=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/v4/promotions/promotion/get-for-client-possible-to-redeem/email/%7BidentifierValue%7D');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'sort' => 'requireRedeemedPoints,desc',
              'presentOnly' => 'true',
              'lastingOnly' => 'true',
              'displayableOnly' => 'true',
              'status' => 'SOME_ARRAY_VALUE',
              'type' => 'SOME_ARRAY_VALUE',
              'statusByType' => '[CUSTOM]=ACTIVE',
              'targetByType' => '[SEGMENT]=ACTIVE',
              'includeMeta' => 'false',
              'page' => '4',
              'limit' => '100',
              'target' => 'SOME_ARRAY_VALUE',
              'storeIds' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/v4/promotions/promotion/get-for-client-possible-to-redeem/email/%7BidentifierValue%7D?sort=requireRedeemedPoints%2Cdesc&presentOnly=true&lastingOnly=true&displayableOnly=true&status=SOME_ARRAY_VALUE&type=SOME_ARRAY_VALUE&statusByType=%5BCUSTOM%5D%3DACTIVE&targetByType=%5BSEGMENT%5D%3DACTIVE&includeMeta=false&page=4&limit=100&target=SOME_ARRAY_VALUE&storeIds=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Promotions
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
```
