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

# List templates

> Retrieve templates for your API key's account.

## GET `/templates`

Retrieve templates for your API key's account.

Send `Authorization: Bearer YOUR_API_KEY` and `X-Device-ID: YOUR_DEVICE_ID`. See [authentication](https://tapcoupon.mintlify.site/authentication.md).

The response wraps the list in `templates`. Check `isActive` before offering a template for issuance.

| Template type | Card type | Configuration |
| - | - | - |
| `couponTemplate` | `couponCard` | Fixed or variable coupon amount |
| `loyaltyTemplate` | `loyaltyCard` | Stamps, reward message, renewals |
| `pointsTemplate` | `pointsCard` | Points program and reward ids |
| `statusTemplate` | `statusCard` | Tier program and rolling duration |

`isLocationBound` controls whether issued cards are restricted to their issuing location. `cardData.lifetime` is in hours. Points and status `cardData` include a populated `program`.

Coupon templates expose `isAmountSpecified`. When true, issuance uses `cardData.amount`; when false, your apply/create request must supply a positive `amount` in cents.

### Example request

```bash theme={null}
curl "https://tapcoupon.at/api/v1/templates" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Device-ID: YOUR_DEVICE_ID"
```


## OpenAPI

````yaml api-reference/openapi.json GET /templates
openapi: 3.1.0
info:
  title: TapCoupon POS and partner API
  version: 1.0.0
  description: >-
    API-key POS operations, customer card views, and partner payment sessions.
    Verified against the tap_coupon backend on 2026-10-02. Dashboard /clients
    and administrative routes use separate authentication and are outside this
    reference.
servers:
  - url: https://tapcoupon.at/api/v1
security: []
paths:
  /templates:
    get:
      tags:
        - Templates
      summary: List templates
      description: Retrieve templates for your API key's account.
      operationId: templates_list
      parameters:
        - name: X-Device-ID
          in: header
          required: true
          description: Stable device identifier. API key binds to this value on first use.
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  templates:
                    type: array
                    items:
                      $ref: '#/components/schemas/Template'
        '400':
          description: Invalid request, card type, balance, points, or location.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Missing or invalid API key, device id, employee token, or
            credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Device binding mismatch, archived location, employee location
            restriction, or account restriction.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limit exceeded. The response body is determined by the
            rate-limit middleware.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Template:
      type: object
      properties:
        id:
          type: string
          description: MongoDB object id.
          pattern: ^[a-fA-F0-9]{24}$
        pocketId:
          type: string
        name:
          type: string
        description:
          type: string
        templateType:
          type: string
          enum:
            - couponTemplate
            - loyaltyTemplate
            - statusTemplate
            - pointsTemplate
        isActive:
          type: boolean
        isLocationBound:
          type: boolean
        isAmountSpecified:
          type: boolean
          description: >-
            Coupon templates only. False requires amount at issuance; true uses
            the fixed template amount.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        cardData:
          $ref: '#/components/schemas/Card'
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error.
        errorCode:
          type: string
          description: >-
            Handler errors include a machine-readable code; middleware errors
            may omit it.
      required:
        - error
    Card:
      oneOf:
        - $ref: '#/components/schemas/BlankCard'
        - $ref: '#/components/schemas/CouponCard'
        - $ref: '#/components/schemas/LoyaltyCard'
        - $ref: '#/components/schemas/StatusCard'
        - $ref: '#/components/schemas/PointsCard'
      discriminator:
        propertyName: cardType
        mapping:
          blankCard: '#/components/schemas/BlankCard'
          couponCard: '#/components/schemas/CouponCard'
          loyaltyCard: '#/components/schemas/LoyaltyCard'
          statusCard: '#/components/schemas/StatusCard'
          pointsCard: '#/components/schemas/PointsCard'
    BlankCard:
      allOf:
        - $ref: '#/components/schemas/BaseCard'
        - type: object
          properties:
            cardType:
              type: string
              enum:
                - blankCard
          required:
            - cardType
    CouponCard:
      allOf:
        - $ref: '#/components/schemas/BaseCard'
        - type: object
          properties:
            cardType:
              type: string
              enum:
                - couponCard
            amountLeft:
              type: integer
              description: Remaining balance in cents.
          required:
            - cardType
    LoyaltyCard:
      allOf:
        - $ref: '#/components/schemas/BaseCard'
        - type: object
          properties:
            cardType:
              type: string
              enum:
                - loyaltyCard
            scansNeeded:
              type: integer
            currentScans:
              type: integer
            rewardMessage:
              type: string
            amountRenews:
              type: integer
            originalAmountRenews:
              type: integer
            unlimitedRenews:
              type: boolean
          required:
            - cardType
    StatusCard:
      allOf:
        - $ref: '#/components/schemas/BaseCard'
        - type: object
          properties:
            cardType:
              type: string
              enum:
                - statusCard
            _:
              type: string
              description: MongoDB object id.
              pattern: ^[a-fA-F0-9]{24}$
            program:
              $ref: '#/components/schemas/StatusProgram'
            level:
              type: string
              description: MongoDB object id.
              pattern: ^[a-fA-F0-9]{24}$
            points:
              type: integer
              description: Progress within the current tier; not the lifetime total.
          required:
            - cardType
    PointsCard:
      allOf:
        - $ref: '#/components/schemas/BaseCard'
        - type: object
          properties:
            cardType:
              type: string
              enum:
                - pointsCard
            _:
              type: string
              description: MongoDB object id.
              pattern: ^[a-fA-F0-9]{24}$
            program:
              $ref: '#/components/schemas/PointsProgram'
            points:
              type: integer
              description: Spendable reward balance.
          required:
            - cardType
    BaseCard:
      type: object
      properties:
        id:
          type: string
          description: MongoDB object id.
          pattern: ^[a-fA-F0-9]{24}$
        cardId:
          type: string
          description: Reusable printed or digital card identifier.
        serialNumber:
          type: integer
        pocketId:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        activatedAt:
          type: string
          format: date-time
        canceledAt:
          type: string
          format: date-time
        activated:
          type: boolean
        lifetime:
          type: integer
          description: Lifetime in hours, measured from createdAt; 0 means unlimited.
          minimum: 0
        description:
          type: string
        amount:
          type: integer
          description: Original coupon value in cents, or template amount for other types.
        location:
          $ref: '#/components/schemas/Location'
        createdByEmployeeId:
          type: string
          description: MongoDB object id.
          pattern: ^[a-fA-F0-9]{24}$
        archived:
          type: boolean
        testCard:
          type: boolean
        isLocationBound:
          type: boolean
          description: When true, use is restricted to the issuing location.
        customerEmail:
          type: string
        templateId:
          type: string
          description: MongoDB object id.
          pattern: ^[a-fA-F0-9]{24}$
        logs:
          type: array
          items:
            type: object
            properties:
              createdAt:
                type: string
                format: date-time
              cardId:
                type: string
              path:
                type: string
              method:
                type: string
              statusCode:
                type: integer
              employeeUsername:
                type: string
    StatusProgram:
      type: object
      properties:
        id:
          type: string
          description: MongoDB object id.
          pattern: ^[a-fA-F0-9]{24}$
        pocketId:
          type: string
        name:
          type: string
        description:
          type: string
        durationDays:
          type: integer
          description: Rolling points window in days.
          minimum: 1
          maximum: 36500
        levels:
          type: array
          items:
            $ref: '#/components/schemas/StatusLevel'
        archived:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    PointsProgram:
      type: object
      properties:
        id:
          type: string
          description: MongoDB object id.
          pattern: ^[a-fA-F0-9]{24}$
        pocketId:
          type: string
        name:
          type: string
        description:
          type: string
        rewardIds:
          type: array
          items:
            type: string
            description: MongoDB object id.
            pattern: ^[a-fA-F0-9]{24}$
        archived:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Location:
      type: object
      properties:
        id:
          type: string
          description: MongoDB object id.
          pattern: ^[a-fA-F0-9]{24}$
        pocketId:
          type: string
        name:
          type: string
        archived:
          type: boolean
      required:
        - id
        - name
    StatusLevel:
      type: object
      properties:
        id:
          type: string
          description: MongoDB object id.
          pattern: ^[a-fA-F0-9]{24}$
        name:
          type: string
        description:
          type: string
        points:
          type: integer
          description: Cost to advance from this level to the next.
          minimum: 0
        color:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Location API key. Also requires X-Device-ID.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.