HereKey Developer

Build HereKey into your workflow.

Add QR sign-in, phone-based payments, and service ordering with ready-to-run PHP, Python, JavaScript, and cURL examples.

https://herekey.app/api/v1

https://req.herekey.app/api/auth

QR authentication relay

Business-key payment API

Service search and paid dispatch API

POST /api/v1/query

Request Payment

Send a payment request to a customer by telephone number and optionally receive a completion callback.

filter_type: payment_request

Sample parameters

Edit a value to update the sample code.

Samples only generate code. They do not submit a live payment from this page.

Download PHP kit
PHP example
<?php

$payload = json_decode(<<<'JSON'
{
  "filter_type": "payment_request",
  "phone": "+15555550123",
  "amount": "25.00",
  "currency": "USD",
  "message": "Service deposit",
  "callback_url": "https://example.com/webhooks/herekey",
  "callback_data": {
    "order_id": "ORDER-1001"
  }
}
JSON, true);

$curl = curl_init('https://herekey.app/api/v1/query');
curl_setopt_array($curl, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
    CURLOPT_HTTPHEADER => [
        'API-KEY: ' . getenv('HEREKEY_BUSINESS_KEY'),
        'SECRET-KEY: ' . getenv('HEREKEY_BUSINESS_PASSWORD'),
        'Content-Type: application/json',
    ],
]);

$body = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($body === false) {
    throw new RuntimeException(curl_error($curl));
}
curl_close($curl);

$response = json_decode($body, true);
if ($status >= 400) {
    throw new RuntimeException($response['message'] ?? 'HereKey API error');
}
print_r($response);