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

# Static QR Codes

> Comprehensive guide on integrating and using Static QR Code payments through HitPay API.

## Introduction

HitPay's Static QR feature enables businesses to create multiple "Static" QR codes that will facilitate QR payments. This solution is particularly beneficial for small and micro businesses, donation drives, and businesses with multiple locations.

## What is a Static QR Code ?

A Static QR Code for payments contains fixed payment information, such as the merchant account or business name. Once generated, the code does not change and can be reused indefinitely by any number of customers.

Learn more about HitPay Static QRs [here](../static-qrs/static-qr)

<Warning> Because the payment amount is not embedded in the QR code, customers must enter the correct amount during payment. Consider using [Embedded QR codes](embedded-qr-code-payments) for automated billing and precise transaction tracking. </Warning>

## Core Concept

At a high level, integrating Static QR codes into your system involves a 4-step process:

<CardGroup cols={2}>
  <Card title="Create a Static QR" icon="square-1" color="#ea5a0c" href="#step-1-create-payment-request">
    The first step is to create a static QR code. You can name the QR & assign it to a HitPay location.
  </Card>

  <Card title="Present the Static QR code to the customer" icon="square-2" color="#0285c7" href="#step-2-generate-present-qr-code">
    Once the Static QR is created, get the QR value and present the QR code to the end-user.
  </Card>

  <Card title="Client Scans and Initiates Payment" icon="square-3" color="#16a34a" href="#step-3-client-scans-initiates-payment">
    The client scans the QR code and initiates the payment through their banking app.
  </Card>

  <Card title="Handle Webhooks and Server Communication" icon="square-4" color="#a63db8" href="#step-4-handle-webhooks-server-communication">
    After the payment is processed, handle webhooks to receive payment notifications and manage server-client communication.
  </Card>
</CardGroup>

## Supported Methods

Please note that Static QR Codes is supported only for some payment methods and countries. Here is the list of methods that support QR Codes:

| Payment Method | Code | Country |
| - | - | - |
| PayNow | paynow\_online | SG |
| QRPH | qprh\_netbank | PH |

### Authentication

Before integration, it's essential to understand how Hitpay APIs are authenticated. Hitpay utilizes API keys to grant access to the API. You can locate this key in your dashboard under "API keys."

Hitpay requires the API key to be included in all API requests to the server. This key should be placed in a header that follows the format shown below:

`X-BUSINESS-API-KEY: meowmeowmeow`

<CodeGroup>
  ```php PHP theme={"system"}
  $request->setHeaders(array(
    'X-BUSINESS-API-KEY' => 'meowmeowmeow',
    'Content-Type' => 'application/x-www-form-urlencoded',
    'X-Requested-With' => 'XMLHttpRequest'
  ));
  ```

  ```shell Shell theme={"system"}
  # With shell, you can just pass the correct header with each request
  curl "api_endpoint_here"
    -H "X-BUSINESS-API-KEY: meowmeowmeow"
    -H "X-Requested-With: XMLHttpRequest"
  ```
</CodeGroup>

<Warning>API keys should be kept confidential and only stored on your servers. Do not store it on your mobile or web client</Warning>

## Step 1: Create a Static QR

### Endpoint

**POST /v1/static\_qr**

Creates a payment request and generates a QR code for the `paynow_online` payment method.

### Request Parameters

| Parameter | Type | Description |
| - | - | - |
| name | string | Required. The amount to be paid. |
| payment\_provider\_method | string | Required. Eg. Specify `paynow_online` as the payment method. |
| location\_id | string | Optional. The HitPay `location_id` to be tagged under all transactions made thorugh this Static QR |

### Example Request

```json theme={"system"}
{
  "name": "My First Static QR",
  "payment_provider_method": ["paynow_online"],
  "location_id": "96e2163c-d9bb-4f36-8bbd-09ca1381d3e6"
}
```

### Response

The response will include a qr\_value object, which contains the data to be converted into a scannable QR code (qr\_code).

<Accordion title="Example Response for Create Static QR Code Request">
  <code>
    ```json theme={"system"}
    {
      "id": "9eabab19-da42-4913-9644-2b3d8b55070e",
      "name": "Static QR 2025-04-14T03:31:11.758Z",
      "reference": "DICNSQRCM3EUHQAMQNX2",
      "payment_provider": "dbs_sg",
      "payment_provider_method": "paynow_online",
      "payment_provider_method_logos": [
          {
              "sm": "https://api.hit-pay.com/icons/methods/sm/dbs_paylah.png",
              "md": "https://api.hit-pay.com/icons/methods/md/dbs_paylah.png",
              "lg": "https://api.hit-pay.com/icons/methods/lg/dbs_paylah.png",
              "svg": "https://api.hit-pay.com/icons/methods/svg/dbs_paylah.svg",
              "svg_square": "https://api.hit-pay.com/icons/methods/svg_square/dbs_paylah.svg",
              "png_square": "https://api.hit-pay.com/icons/methods/png_square/dbs_paylah.png",
              "method": "dbs_paylah",
              "iconName": "dbs_paylah",
              "displayName": "dbs_paylah"
          },
          {
              "sm": "https://api.hit-pay.com/icons/methods/sm/grabpay.png",
              "md": "https://api.hit-pay.com/icons/methods/md/grabpay.png",
              "lg": "https://api.hit-pay.com/icons/methods/lg/grabpay.png",
              "svg": "https://api.hit-pay.com/icons/methods/svg/grabpay.svg",
              "svg_square": "https://api.hit-pay.com/icons/methods/svg_square/grabpay.svg",
              "png_square": "https://api.hit-pay.com/icons/methods/png_square/grabpay.png",
              "method": "grabpay",
              "iconName": "grabpay",
              "displayName": "GrabPay"
          },
          {
              "sm": "https://api.hit-pay.com/icons/methods/sm/googlepay.png",
              "md": "https://api.hit-pay.com/icons/methods/md/googlepay.png",
              "lg": "https://api.hit-pay.com/icons/methods/lg/googlepay.png",
              "svg": "https://api.hit-pay.com/icons/methods/svg/googlepay.svg",
              "svg_square": "https://api.hit-pay.com/icons/methods/svg_square/googlepay.svg",
              "png_square": "https://api.hit-pay.com/icons/methods/png_square/googlepay.png",
              "method": "googlepay",
              "iconName": "googlepay",
              "displayName": "googlepay"
          },
          {
              "sm": "https://api.hit-pay.com/icons/methods/sm/dbs.png",
              "md": "https://api.hit-pay.com/icons/methods/md/dbs.png",
              "lg": "https://api.hit-pay.com/icons/methods/lg/dbs.png",
              "svg": "https://api.hit-pay.com/icons/methods/svg/dbs.svg",
              "svg_square": "https://api.hit-pay.com/icons/methods/svg_square/dbs.svg",
              "png_square": "https://api.hit-pay.com/icons/methods/png_square/dbs.png",
              "method": "dbs",
              "iconName": "dbs",
              "displayName": "dbs"
          },
          {
              "sm": "https://api.hit-pay.com/icons/methods/sm/uob.png",
              "md": "https://api.hit-pay.com/icons/methods/md/uob.png",
              "lg": "https://api.hit-pay.com/icons/methods/lg/uob.png",
              "svg": "https://api.hit-pay.com/icons/methods/svg/uob.svg",
              "svg_square": "https://api.hit-pay.com/icons/methods/svg_square/uob.svg",
              "png_square": "https://api.hit-pay.com/icons/methods/png_square/uob.png",
              "method": "uob",
              "iconName": "uob",
              "displayName": "uob"
          },
          {
              "sm": "https://api.hit-pay.com/icons/methods/sm/ocbc.png",
              "md": "https://api.hit-pay.com/icons/methods/md/ocbc.png",
              "lg": "https://api.hit-pay.com/icons/methods/lg/ocbc.png",
              "svg": "https://api.hit-pay.com/icons/methods/svg/ocbc.svg",
              "svg_square": "https://api.hit-pay.com/icons/methods/svg_square/ocbc.svg",
              "png_square": "https://api.hit-pay.com/icons/methods/png_square/ocbc.png",
              "method": "ocbc",
              "iconName": "ocbc",
              "displayName": "ocbc"
          },
          {
              "sm": "https://api.hit-pay.com/icons/methods/sm/citi.png",
              "md": "https://api.hit-pay.com/icons/methods/md/citi.png",
              "lg": "https://api.hit-pay.com/icons/methods/lg/citi.png",
              "svg": "https://api.hit-pay.com/icons/methods/svg/citi.svg",
              "svg_square": "https://api.hit-pay.com/icons/methods/svg_square/citi.svg",
              "png_square": "https://api.hit-pay.com/icons/methods/png_square/citi.png",
              "method": "citi",
              "iconName": "citi",
              "displayName": "citi"
          },
          {
              "sm": "https://api.hit-pay.com/icons/methods/sm/standard_chartered.png",
              "md": "https://api.hit-pay.com/icons/methods/md/standard_chartered.png",
              "lg": "https://api.hit-pay.com/icons/methods/lg/standard_chartered.png",
              "svg": "https://api.hit-pay.com/icons/methods/svg/standard_chartered.svg",
              "svg_square": "https://api.hit-pay.com/icons/methods/svg_square/standard_chartered.svg",
              "png_square": "https://api.hit-pay.com/icons/methods/png_square/standard_chartered.png",
              "method": "standard_chartered",
              "iconName": "standard_chartered",
              "displayName": "standard_chartered"
          }
      ],
      "payment_provider_method_main_logo": {
          "sm": "https://api.hit-pay.com/icons/methods/sm/paynow.png",
          "md": "https://api.hit-pay.com/icons/methods/md/paynow.png",
          "lg": "https://api.hit-pay.com/icons/methods/lg/paynow.png",
          "svg": "https://api.hit-pay.com/icons/methods/svg/paynow.svg",
          "svg_square": "https://api.hit-pay.com/icons/methods/svg_square/paynow.svg",
          "png_square": "https://api.hit-pay.com/icons/methods/png_square/paynow.png",
          "method": "paynow_online",
          "iconName": "paynow",
          "displayName": "PayNow"
      },
      "created_by": {
          "id": "902ddc83-9b67-4dd3-9d84-0e6c0f69fa48",
          "display_name": "Nitin",
          "first_name": "Nitin",
          "last_name": "Muthyala"
      },
      "location_id": null,
      "location": null,
      "device_id": null,
      "device": null,
      "qr_value": "00020101021226370009SG.PAYNOW010120210201605883W030115204000053037025802SG5912HitPay Store6009Singapore62240120DICNSQRCM3EUHQAMQNX263045585",
      "created_at": "2025-04-14T11:31:11+08:00",
      "updated_at": "2025-04-14T11:31:11+08:00"
    }
    ```
  </code>
</Accordion>

## Step 2: Print / Present the QR Code

Once the Static QR code value is obtained, you can display the QR code using the `qr_value` data and present it to the user.

## Step 3: Client Scans and Initiates Payment

The client scans the presented QR code with their banking app, enters the amount and initiates the payment process.

## Step 4: Handle Webhooks and Server Communication

After the payment is processed, handle webhooks to receive payment notifications and manage server-client communication to update the payment status in your system.

### What is a Webhook?

Webhook is a POST request sent from HitPay's server to your server about the payment confirmation. If you are using hitpay APIs to integrate into your e-commerce checkout you must mark your order as paid ONLY after the webhook is received and validated.

<Snippet file="snippet-handle-webhook-v1.mdx" />


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