Build on theHenkerrPay API.
Create payments, check their status and refund them with three endpoints, and receive the outcome by callback.
Server-to-server REST API. Reference checked against the production gateway code on 16 November 2026.
# Test key; amount is a decimal in major units
curl -X POST https://apis.henkerrpay.online/api/v1/payments \
-H "Authorization: Bearer sk_test_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c0d2e-…" \
-d '{
"transaction_ref": "ORD-12345",
"amount": 125.00,
"currency": "EUR",
"card_number": "<test card>",
"expiry_month": "12",
"expiry_year": "2028",
"cvv": "<cvv>",
"name_on_card": "A Customer"
}'
Quick start
Four steps from a test key to a confirmed payment.
- Get a test key. Test keys start with
sk_test_. Live keys (sk_live_) are issued from the dashboard once your account is approved. - Create the payment from your server with
POST /api/v1/payments. - Handle the result. Read
status:SUCCESSFUL,_3DSVERIFICATION(send the customer to3ds_url),PROCESSING(wait for the callback) orFAILED. - Confirm. Use the callback to your server, and
GET /api/v1/payments/:idto reconcile anything you did not receive.
Environments and keys
One API, two kinds of key. The key decides which environment a request runs in.
| Key | Behaviour | Issued |
|---|---|---|
sk_test_… | Sandbox: simulated acquirer responses, test cards, simulated 3-D Secure and callbacks. | From the sandbox, to an authenticated dashboard user. |
sk_live_… | Real processing through your configured providers. | From the dashboard, after your account is approved. |
API base URL: https://apis.henkerrpay.online. All paths below are relative to it.
Authentication
Send your secret key as a Bearer token. Requests and responses are JSON.
Authorization: Bearer sk_live_…
Content-Type: application/json- An invalid or inactive key returns HTTP
401witherror_code: "UNAUTHORIZED". - Keep the key on your server. Never ship it in a browser or mobile app.
Create a payment
Optional header Idempotency-Key (or X-Idempotency-Key): replaying a request with the same key returns the original result instead of charging again.
Request body
| Field | Type | Description |
|---|---|---|
transaction_refrequired | string | Your unique reference for this payment (also accepted as merchant_txn_id). Reusing one returns DUPLICATE_TRANSACTION. |
amountrequired | number | Decimal in major units, for example 125.00, not cents. Above zero, at most 999999.99, at most two decimal places, and within your account’s per-transaction limit. |
card_numberrequired | string | Card number. Spaces are removed; a Luhn check is applied. |
expiry_monthrequired | string | Month, for example 12. |
expiry_yearrequired | string | Two or four digits. An expired card is rejected. |
cvvrequired | string | 3 or 4 digits. |
currency | string | ISO 4217 code from the supported list below. Defaults to USD. |
name_on_card | string | Cardholder name. |
success_url, failure_url | string | Where to send the customer after 3-D Secure. Send them with every request. |
Supported currencies
Other currencies are rejected.
Payment results
The response always carries success and status. Branch on status.
| status | Meaning | Extra fields |
|---|---|---|
SUCCESSFUL | Approved. | auth_code |
_3DSVERIFICATION | The customer must authenticate. Redirect their browser to 3ds_url. | 3ds_url |
PROCESSING | Accepted by the provider, not yet confirmed. Check the payment later. If pending_reason is in_doubt, do not retry the payment. | 3ds_url (when a challenge is needed), pending_reason, message |
FAILED | Declined or failed. A decline is still HTTP 200. | error, hp_id, merchant_txn_id |
ERROR | The request was rejected before processing (see Errors). | error_code, error |
{
"success": true,
"status": "SUCCESSFUL",
"hp_id": "<our payment id>",
"merchant_txn_id": "ORD-12345",
"auth_code": "<auth code>"
}{
"success": true,
"status": "_3DSVERIFICATION",
"hp_id": "<our payment id>",
"merchant_txn_id": "ORD-12345",
"3ds_url": "https://…"
}hp_id is our identifier for the payment. Keep it next to your own reference.
3-D Secure
- When
statusis_3DSVERIFICATION, redirect the customer’s browser to3ds_url. - After authentication the customer’s browser is sent to the
success_urlorfailure_urlyou supplied with the request, or to a generic completion page, which may show the result in place, if you supplied none. - What, if anything, is added to your URL depends on the provider. Do not rely on the query string. Confirm the outcome from the callback, or by checking the payment.
Check a payment
:id is either your transaction_ref or our hp_id.
{
"success": true,
"hp_id": "<our payment id>",
"merchant_txn_id": "ORD-12345",
"status": "SUCCESSFUL",
"amount": "125.00",
"currency": "EUR",
"auth_code": "<auth code>",
"created_at": "…"
}Statuses include SUCCESSFUL, FAILED, PROCESSING, PARTIALLY_REFUNDED and REFUNDED, and can include others such as CHARGEBACK and SETTLED. A payment whose outcome is unconfirmed also carries pending_reason and message. An unknown payment returns error_code: "NOT_FOUND".
Refunds
Only payments that are SUCCESSFUL or PARTIALLY_REFUNDED can be refunded.
| Field | Type | Description |
|---|---|---|
transaction_refrequired | string | Your reference or our hp_id (also accepted as payment_id or merchant_txn_id). |
amount | number | Decimal in major units. Omit for a full refund. Cannot exceed the original amount. |
reason | string | Free text. |
{
"success": true,
"status": "REFUND_COMPLETED",
"refund_id": "…",
"hp_id": "<our payment id>",
"merchant_txn_id": "ORD-12345",
"refund_amount": 125.0
}merchant_txn_id echoes the reference you sent. A completed refund also returns gateway_refund_id. Some providers have no refund API. For those the status is REFUND_PENDING_MANUAL and the refund is queued for manual processing. If a previous refund on the same payment is unconfirmed, further refunds are blocked with REFUND_IN_DOUBT.
Callbacks
When a payment ends as SUCCESSFUL or FAILED we send an HTTP POST with a JSON body to the callback URL registered on your account. There is no callback for PROCESSING, and none for refunds you start with POST /api/v1/refunds: check those with the API. Provider notifications can also produce a callback with status REFUNDED (a full refund started at the provider).
{
"hp_id": "<our payment id>",
"merchant_txn_id": "ORD-12345",
"status": "SUCCESSFUL",
"amount": "125.00",
"currency": "EUR",
"auth_code": "<auth code>",
"error": null,
"timestamp": 1790000000,
"signature": "<hex>"
}auth_code and error can be absent. Do not require them.
Verify the signature
signature is a hex HMAC-SHA256 over the string hp_id + merchant_txn_id + status + amount, concatenated with no separators, keyed with the lowercase hex SHA-256 of your account’s API password, used as the key string. It is not your sk_ key. Use the values exactly as they arrive in the body, and compare in constant time.
Delivery
- Reply with any
2xxstatus to confirm receipt. - We make three attempts: the first when a background worker picks the notification up, normally within seconds, then after about 2 seconds and about 5 seconds. Each attempt times out after 10 seconds, and redirects are not followed.
- Do not expect later retries after the third failure, and a worker restart can drop a notification that was not yet sent. Reconcile with
GET /api/v1/payments/:id. - The signature does not cover
timestamp. Treat callbacks as idempotent, keyed onhp_idandstatus.
PROCESSING after a short wait, rather than relying on the callback alone.Errors and limits
Most errors come back with HTTP 200 and success: false. Check success and error_code, not only the HTTP status. The exceptions are HTTP 401 for an invalid key and HTTP 429 for rate limiting.
{
"success": false,
"status": "ERROR",
"error_code": "VALIDATION_FAILED",
"error": "Missing required field: cvv"
}| error_code | When |
|---|---|
UNAUTHORIZED | Invalid or inactive API key (HTTP 401). |
INVALID_REQUEST | Body is not valid JSON, transaction_ref is missing, or the payment ID is missing on a status or refund call. |
VALIDATION_FAILED | A required field is missing, or the card number, expiry, CVV, amount or currency is invalid. |
AMOUNT_LIMIT_EXCEEDED | Amount is above the per-transaction limit on your account. |
DAILY_LIMIT_EXCEEDED, MONTHLY_LIMIT_EXCEEDED, EXPOSURE_LIMIT_EXCEEDED | A volume limit on your account has been reached. |
DUPLICATE_TRANSACTION | That transaction_ref was already used. |
IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_KEY_IN_PROGRESS | The same Idempotency-Key was sent with a different body, or while the first request was still running. |
NOT_FOUND | Unknown payment, or not eligible for refund. |
INVALID_AMOUNT, AMOUNT_EXCEEDED, REFUND_LIMIT_EXCEEDED | Refund amount is invalid, above the original, or above what is still refundable. |
REFUND_IN_DOUBT, REFUND_FAILED, REFUND_ERROR | Refund unconfirmed, declined, or could not be completed. |
Rate limits
Requests are limited to 30 per minute (fixed one-minute windows) per IP address and key, shared by payments, status checks and refunds. Beyond that, requests are blocked for about two minutes and return HTTP 429 with a Retry-After header and a body of { "success": false, "error": "…", "retry_after": … }.
Sandbox
Use a sk_test_ key to run against simulated acquirer responses, including 3-D Secure and callbacks. These helper endpoints are on the API host.
| Endpoint | Purpose |
|---|---|
GET /sandbox/test-cards | List the test card numbers and what each one simulates. Public. |
POST /sandbox/test-cards/check | Check what a test card number will do. |
GET /sandbox/3ds/challenge, POST /sandbox/3ds/complete | Simulated 3-D Secure challenge. |
GET /sandbox/webhooks/events, POST /sandbox/webhooks/trigger | List and trigger simulated callbacks. |
GET /sandbox/webhooks/history | Delivery history for your test callbacks. |
POST /sandbox/api-keys/generate | Create a test key. Needs an authenticated dashboard user, and only ever issues test keys. |
Apart from the public test-card list, the sandbox helper endpoints need a dashboard login. Live keys are never issued from the sandbox. They come from the dashboard once your account is approved.
Ready to integrate? Tell us your markets, methods and volume and we will set up your account.
Request access