> ## Documentation Index
> Fetch the complete documentation index at: https://help.lobyco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get available challenges

> When no StoreId or ChainId is provided, all available challenges for the customer are returned.
When StoreId and/or ChainId are provided, only the challenges available for the specified store/chain are returned.
If both StoreId and ChainId are provided, challenges available in specified store or specified chain are returned.
If Challenge is configured with list of chains, but only StoreId is provided in the request, challenges available for the chain are not returned.



## OpenAPI

````yaml openapi/challenge-v3.json GET /v3/cards
openapi: 3.0.4
info:
  title: Challenges.Api V3
  version: v3
servers:
  - url: https://{host}/challenge
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security:
  - Bearer: []
paths:
  /v3/cards:
    get:
      tags:
        - Cards
      summary: Get available challenges
      description: >-
        When no StoreId or ChainId is provided, all available challenges for the
        customer are returned.

        When StoreId and/or ChainId are provided, only the challenges available
        for the specified store/chain are returned.

        If both StoreId and ChainId are provided, challenges available in
        specified store or specified chain are returned.

        If Challenge is configured with list of chains, but only StoreId is
        provided in the request, challenges available for the chain are not
        returned.
      parameters:
        - name: memberId
          in: header
          description: Current customer id.
          required: true
          schema:
            type: string
        - name: storeId
          in: query
          description: The selected store to retrieve related available cards.
          schema:
            type: string
        - name: chainId
          in: query
          description: The selected chain to retrieve related available cards.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/Challenge.Api.DTO.MobileApp.BasicCardInfo
        '400':
          description: Returned only if required parameters are not specified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
components:
  schemas:
    Challenge.Api.DTO.MobileApp.BasicCardInfo:
      required:
        - hideInList
      type: object
      properties:
        isActive:
          type: boolean
          description: >-
            Specifies if the card can accumulate progress. True after manual
            activation, or automatically for preactivated challenges.
        currentProgress:
          type: number
          description: >-
            Progress accumulated for the specific instance of challenge. Can be
            integer when calculation types are ProductCount and StoreVisit, or a
            float value otherwise.
          format: double
        cardsActivatedCount:
          type: integer
          description: >-
            Amount of cards that user has activated in the given challenge.
            Includes current card, if it was activated.
          format: int32
        closedAt:
          type: string
          description: >-
            Populated only if the card was already completed. Such cards no
            longer accumulate progress, so user can see what they already
            completed. Closed cards are returned until their challenge expires.
          format: date-time
          nullable: true
        cardId:
          type: string
          description: >-
            Id of the specific card. If challenge is renewable, this id will be
            different on each of the cards, while ActivityId will be the same.
            Will be null, if card is not activated.
          nullable: true
        hideInList:
          type: boolean
          description: Configuration to make the challenge card invisible.
        currentTier:
          type: integer
          description: >-
            The highest tier reached on this card. Null for non-tiered
            challenges or when no tier has been reached yet.
          format: int32
          nullable: true
        cardDetails:
          $ref: '#/components/schemas/Challenge.Api.DTO.MobileApp.CardDetails'
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    Challenge.Api.DTO.MobileApp.CardDetails:
      required:
        - activityId
        - campaignId
        - details
        - endDate
        - imageUrl
        - requiredProgress
        - startDate
        - termsAndConditions
        - title
      type: object
      properties:
        campaignId:
          type: string
          description: Obsolete, use ActivityId instead
          format: uuid
        activityId:
          type: string
          description: >-
            Id of the full challenge. Will be the same for all cards relating to
            the same offer.
          format: uuid
        title:
          maxLength: 250
          minLength: 1
          type: string
          description: Title to be shown of challenge list
        requiredProgress:
          type: number
          description: Progress required to finish challenge.
          format: double
        startDate:
          type: string
          description: >-
            Date when challenge becomes available and progress can be
            accumulated
          format: date-time
        endDate:
          type: string
          description: >-
            Date when challenge stops being available and progress can no longer
            be accumulated
          format: date-time
        activationLimit:
          type: integer
          description: >-
            How many times cards in the challenge can be renewed. Null for
            unlimited
          format: int32
          nullable: true
        imageUrl:
          minLength: 1
          type: string
          description: Image for challenge, always populated
        backgroundImageUrl:
          type: string
          description: >-
            Optional background image. Can be null or empty, if no specific
            image was uploaded in the admin tool
          nullable: true
        chainIds:
          type: array
          items:
            type: string
          description: >-
            Chain ids where challenge progress can be accumulated. Mutually
            exclusive with StoreIds
          nullable: true
        storeIds:
          type: array
          items:
            type: string
          description: >-
            Store ids where challenge progress can be accumulated. Mutually
            exclusive with ChainIds
          nullable: true
        details:
          minLength: 1
          type: string
          description: Free-text details. Maximum length not limited
        termsAndConditions:
          minLength: 1
          type: string
          description: Free-text terms and conditions. Maximum length not limited
        rewardType:
          $ref: '#/components/schemas/DomainModel.Models.RewardType'
        progressCalculationType:
          $ref: >-
            #/components/schemas/Challenge.Api.DTO.MobileApp.CardProgressCalculationType
        isSinglePurchase:
          type: boolean
          description: >-
            Specifies if progress can be accumulated over multiple purchases, or
            enough progress to complete challenge should be present in 1
            purchase.
        completionLabel:
          type: string
          description: >-
            Optional label to be shown when challenge is completed instead of
            title. If not present, title should be used instead
          nullable: true
        completedCardsLabel:
          type: string
          description: Optional label to show amount of completed cards
          nullable: true
        completedCardsCount:
          type: integer
          description: Amount of completed cards
          format: int32
        progressLabel:
          type: string
          description: >-
            Optional label to show on card, instead of default "Buy 3 to get an
            offer" label. If not specified, default label from the app should be
            used
          nullable: true
        unitOfMeasure:
          $ref: '#/components/schemas/DomainModel.Models.UnitOfMeasure'
        couponRewards:
          type: array
          items:
            $ref: '#/components/schemas/Challenge.Api.DTO.MobileApp.CardCouponReward'
          description: >-
            Coupon rewards for the challenge. Empty array for lottery or
            non-coupon challenges.
          nullable: true
        bonusRewards:
          type: array
          items:
            $ref: '#/components/schemas/Challenge.Api.DTO.MobileApp.CardBonusReward'
          description: >-
            Bonus rewards for the challenge. Empty array for lottery or
            non-bonus challenges.
          nullable: true
        customRewards:
          type: array
          items:
            $ref: '#/components/schemas/Challenge.Api.DTO.MobileApp.CardCustomReward'
          description: >-
            Custom rewards for the challenge. Empty array for lottery or
            non-custom challenges.
          nullable: true
        tags:
          type: array
          items:
            type: string
          description: Challenge optional tags used for alternative segmentation
          nullable: true
      additionalProperties: false
    DomainModel.Models.RewardType:
      enum:
        - Coupon
        - Bonus
        - Custom
        - LotteryTicket
        - Multiple
      type: string
    Challenge.Api.DTO.MobileApp.CardProgressCalculationType:
      enum:
        - ProductCount
        - PurchaseAmount
        - StoreVisit
        - PaymentMethod
        - Complex
      type: string
    DomainModel.Models.UnitOfMeasure:
      enum:
        - Item
        - Litre
        - Gram
        - Kilogram
      type: string
    Challenge.Api.DTO.MobileApp.CardCouponReward:
      type: object
      properties:
        offerId:
          type: string
          description: Offer id of the coupon reward
          nullable: true
      additionalProperties: false
    Challenge.Api.DTO.MobileApp.CardBonusReward:
      type: object
      properties:
        bonusAmount:
          type: number
          description: Bonus amount to be granted
          format: double
          nullable: true
      additionalProperties: false
    Challenge.Api.DTO.MobileApp.CardCustomReward:
      type: object
      properties:
        name:
          type: string
          description: Reward name
          nullable: true
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        Opaque Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````