> ## 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.

# Quickstart

> Make authenticated POS requests with an API key, device id, and employee session.

## Prepare a device

Create a location and API key in the [dashboard](https://dashboard.tapcoupon.at). Assign your employee to the location, create a card template, and have an activated card available for redemption.

Set these variables in your terminal. Use a stable device id: the first request binds the key to it.

```bash theme={null}
export TAPCOUPON_API_KEY="YOUR_API_KEY"
export TAPCOUPON_DEVICE_ID="YOUR_STABLE_DEVICE_ID"
export TAPCOUPON_BASE_URL="https://tapcoupon.at/api/v1"
```

## 1. Log in

```bash theme={null}
curl -X POST "$TAPCOUPON_BASE_URL/employee/login" \
  -H "Authorization: Bearer $TAPCOUPON_API_KEY" \
  -H "X-Device-ID: $TAPCOUPON_DEVICE_ID" \
  -H "Content-Type: application/json" \
  -d '{"username":"Cashier","password":"YOUR_EMPLOYEE_PASSWORD"}'
```

The response includes `employee`, `token`, `sessionExpiresAt`, and `message`. Save the token:

```bash theme={null}
export TAPCOUPON_EMPLOYEE_TOKEN="TOKEN_FROM_LOGIN"
```

## 2. Fetch a card

Replace the sample card id with your card's identifier. The timestamp query parameter is required.

```bash theme={null}
curl --get "$TAPCOUPON_BASE_URL/cards" \
  -H "Authorization: Bearer $TAPCOUPON_API_KEY" \
  -H "X-Device-ID: $TAPCOUPON_DEVICE_ID" \
  --data-urlencode "cardId=9866191586296" \
  --data-urlencode "timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
```

Check `cardType` and `activated` before choosing an operation. A blank card needs [a template](https://tapcoupon.mintlify.site/api-reference/cards/apply-template.md).

## 3. Stamp a loyalty card

```bash theme={null}
curl -X POST "$TAPCOUPON_BASE_URL/loyalty-cards" \
  -H "Authorization: Bearer $TAPCOUPON_API_KEY" \
  -H "X-Device-ID: $TAPCOUPON_DEVICE_ID" \
  -H "X-Employee-Token: $TAPCOUPON_EMPLOYEE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"cardId":"9866191586296"}'
```

```json theme={null}
{
  "scansLeft": 4,
  "renewsLeft": 1,
  "rewardEarned": false,
  "success": true,
  "message": "$t(scansCompleted, {current: 1, needed: 5})"
}
```

Give the reward when `rewardEarned` is true. A renewed card can already show a reset stamp count in that same response.

## 4. Charge a coupon card

Use a coupon card for this operation. `amount: 500` deducts €5.00.

```bash theme={null}
curl -X POST "$TAPCOUPON_BASE_URL/coupon-cards" \
  -H "Authorization: Bearer $TAPCOUPON_API_KEY" \
  -H "X-Device-ID: $TAPCOUPON_DEVICE_ID" \
  -H "X-Employee-Token: $TAPCOUPON_EMPLOYEE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"cardId":"1885144192279","amount":500}'
```

For points or status cards, `amount` represents points instead of cents. See [add points](https://tapcoupon.mintlify.site/api-reference/cards/use-points.md), [status cards](https://tapcoupon.mintlify.site/api-reference/cards/use-status.md), and [reward redemption](https://tapcoupon.mintlify.site/api-reference/cards/redeem-reward.md).

Before issuing a card, fetch [client configuration](https://tapcoupon.mintlify.site/api-reference/other/client-config.md) for mandatory customer fields, subscription status, and test limits.


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