HereKey Developer
Build HereKey into your workflow.
HereSpace Apps run on HereKey and automatically open when customers arrive at your location. Welcome them with a restaurant menu, check-in ticket, doorbell, or vending app—right where they need it.
Build a HereSpace AppGet your API keysEmbed Sign in with HereKeyhttps://herekey.app/api/v1
https://req.herekey.app/api/auth
JavaScript authentication SDK
Business-key payment API
Service search and paid dispatch API
HereSpace Apps: ready when customers arrive
POST /api/v1/query
Request Payment
Send a payment request by telephone number or active login token, with an optional completion callback.
Sample parameters
Edit a value to update the sample code.
Samples only generate code. They do not submit a live payment from this page.
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, 512, JSON_THROW_ON_ERROR);
if ($status >= 400 || ($response['ret'] ?? 1) === 0 || ($response['success'] ?? true) === false) {
throw new RuntimeException($response['message'] ?? $response['msg'] ?? 'HereKey API error');
}
print_r($response);