# Quick start: QR Pay at Table with Pay By Link

Build an on-site Pay at Table flow where guests settle the bill themselves by scanning a QR code - printed on the receipt, or on the table via your online menu. You create a payment link, present it as a QR code, and track the payment by webhook or polling.

This works with your existing acquiring setup and POSLink partner credentials. **No Teya ecommerce subscription is required.**

```admonition
icon: fas fa-info-circle
title: Who this is for
content: Teya ePOS integration partners building on-premise Pay at Table where the paying customer is on site. If the merchant has an ecommerce subscription, use the full Pay By Link partner integration instead.
link: /partners/online-payments/pay-by-link/api
```

## 1. Authenticate

Payment Link APIs support both user authentication and the ePOS M2M token, covering existing and new ePOS authentication modes. You need a Teya developer account and application - see [Authenticate](/poslink/authenticate), or contact [partnersupport@teya.com](mailto:partnersupport@teya.com) if you don't have one yet.

## 2. Create a payment link for the bill

Create the link with `POST /v2/payment-links` when the guest asks to pay:

- Use `success_url`, `cancel_url`, and `post_success_payment` to configure where the guest lands after paying
- Use `supported_card_brands` to control which card brands you accept

Render the returned link as a QR code on the printed bill, or open it from your table-side menu. The guest scans, lands on the Teya payment page, and pays. Request and response details: [Pay By Link API](/partners/online-payments/pay-by-link/api) and the [API Reference](/apis/online-payments/apis).

## 3. Track the payment

**Webhook (recommended)** - register once per store for `payment.succeeded.v1` events:

```shell
curl -X POST "https://api.teya.com/v1/webhooks" \
  -H "Authorization: Bearer [ACCESS_TOKEN]" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "payment-status-webhook",
    "event_types": ["payment.succeeded.v1"],
    "destination_url": "https://api.example.com/webhooks/payment-status",
    "resource": { "type": "STORE", "value": "8f2a80c4-2f3c-4f97-9943-d6ed0b1b374e" }
  }'
```

The response includes a `public_key`. Every delivery carries an `X-Teya-Signature` header (a Base64-encoded RSA signature of the body) - verify it with that key. See [Webhooks](/partners/online-payments/webhooks) and the [signature validator](/partners/online-payments/webhook-signature-validator). Webhook registration currently supports user authentication only.

**Polling** - alternatively, fetch the payment link status with the GET Payment Link API. Mark the bill as paid on the ePOS when the payment succeeds.

## 4. Issue refunds from the ePOS

Webhook events include a `transaction_id`. Use it as the `gateway_payment_id` in your existing POSLink refund flow: [Make a refund](/poslink/develop/make-refund).

```admonition
icon: fas fa-exclamation-triangle
title: Collecting tips?
content: Collecting tips separately on an online transaction is not currently supported. You can add the tip to the total transaction value where local tax law allows - check with your Teya contact first.
```
