> **Description:** Generate one-time QR codes for secure in-store payments, allowing customers to complete transactions by scanning with their Vipps or MobilePay app.

# One-time payment QR

Generate one-time QR codes for in-store payments. Scanning opens the Vipps  or MobilePay  app for instant approval--no phone number needed.

**TIP**

For a visual walkthrough of the customer's experience with one-time payment QR codes, see [How it works with QR codes](https://developer.vippsmobilepay.com/docs/APIs/epayment-api/how-it-works/qr.md).

## Scenario

Generate the payment request with the
[`POST:/epayment/v1/payments`](https://developer.vippsmobilepay.com/redocusaurus/epayment-swagger-id.yaml) endpoint with:

* `"userFlow": "QR"`.
* (Optional) `qrFormat` and `size` for the QR

Image: A one-time payment QR code displayed on a merchant screen for a customer to scan with their Vipps or MobilePay app.

Since the customer will scan from their phone, you don't need their phone number.
This payment command can do an app-switch and open their Vipps or MobilePay app with the payment request.

## Authorization

All ePayment API requests must include a valid Bearer token in the `Authorization` header.
See [Authorization](https://developer.vippsmobilepay.com/docs/APIs/epayment-api/api-guide/concepts.md#authorization) for how to obtain one.

## Request

Generate the payment request with dynamic QR:

```bash
curl -X POST https://apitest.vipps.no/epayment/v1/payments \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H "Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY" \
-H "Merchant-Serial-Number: YOUR-MSN" \
-H "Idempotency-Key: YOUR-IDEMPOTENCY-KEY" \
-H "Vipps-System-Name: acme" \
-H "Vipps-System-Version: 3.1.2" \
-H "Vipps-System-Plugin-Name: acme-webshop" \
-H "Vipps-System-Plugin-Version: 4.5.6" \
-d '{
  "userFlow": "QR",
  "qrFormat": {
    "format": "IMAGE/SVG+XML",
    "size": 1024
  },
  "amount": {
    "value": 42924,
    "currency": "NOK"
  },
  "paymentMethod": {
    "type": "WALLET"
  },
  "customerInteraction": "CUSTOMER_PRESENT",
  "receipt":{
    "orderLines": [
      {
        "name": "Ear buds",
        "id": "21231211",
        "totalAmount": 42924,
        "totalAmountExcludingTax": 34339,
        "totalTaxAmount": 8585,
        "taxRate": 2500,
      },
    ],
    "bottomLine": {
      "currency": "NOK",
      "posId": "vending_machine_12345",
      "receiptNumber": "0527013501"
    },
  },
  "reference": 2486791679658155992,
  "returnUrl": "http://example.com/redirect?reference=2486791679658155992",
  "paymentDescription": "Ear buds"
}'
```

Specify `"customerInteraction": "CUSTOMER_PRESENT"`, since the customer is present.
You can also specify the order details at this time.

Display the dynamic QR on a screen facing the customer.

When the customer scans the QR code and is directed to the Vipps or MobilePay app,
the payment screen is presented and they click *Pay*.

Once the payment is approved, update the status in your system.
To determine that the user has authorized the payment, you can
get notifications via the [Webhooks API](https://developer.vippsmobilepay.com/docs/APIs/webhooks-api/api-guide.md) and/or poll for the status.

The result of this request will contain a `redirectUrl` pointing to a link where you can download the QR image.

## Related pages

* [How it works guide for one-time payment QRs](https://developer.vippsmobilepay.com/docs/APIs/epayment-api/how-it-works/qr.md)
* [Recommended flows: Dynamic QR directing to the app for payment](https://developer.vippsmobilepay.com/docs/recommended-flows/vending-machines/one-time-payment.md)

> **Full site overview:** For every page in this documentation, read [https://developer.vippsmobilepay.com/llms.txt](https://developer.vippsmobilepay.com/llms.txt).
