Developers & API

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.

Create a paymentPOST /api/v1/payments
# 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.

  1. Get a test key. Test keys start with sk_test_. Live keys (sk_live_) are issued from the dashboard once your account is approved.
  2. Create the payment from your server with POST /api/v1/payments.
  3. Handle the result. Read status: SUCCESSFUL, _3DSVERIFICATION (send the customer to 3ds_url), PROCESSING (wait for the callback) or FAILED.
  4. Confirm. Use the callback to your server, and GET /api/v1/payments/:id to reconcile anything you did not receive.

Environments and keys

One API, two kinds of key. The key decides which environment a request runs in.

KeyBehaviourIssued
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.

Headersevery request
Authorization: Bearer sk_live_…
Content-Type: application/json
  • An invalid or inactive key returns HTTP 401 with error_code: "UNAUTHORIZED".
  • Keep the key on your server. Never ship it in a browser or mobile app.
PCI DSS scope. This endpoint accepts raw card numbers, so the call must come from your server and your own PCI DSS obligations apply to how you handle card data.

Create a payment

POST/api/v1/payments

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

FieldTypeDescription
transaction_refrequiredstringYour unique reference for this payment (also accepted as merchant_txn_id). Reusing one returns DUPLICATE_TRANSACTION.
amountrequirednumberDecimal 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_numberrequiredstringCard number. Spaces are removed; a Luhn check is applied.
expiry_monthrequiredstringMonth, for example 12.
expiry_yearrequiredstringTwo or four digits. An expired card is rejected.
cvvrequiredstring3 or 4 digits.
currencystringISO 4217 code from the supported list below. Defaults to USD.
name_on_cardstringCardholder name.
success_url, failure_urlstringWhere to send the customer after 3-D Secure. Send them with every request.

Supported currencies

USD EUR GBP CAD AUD NZD CHF JPY SEK NOK DKK PLN CZK HUF RON BGN HRK ISK SGD HKD AED SAR ZAR MXN BRL INR CNY TRY ILS

Other currencies are rejected.

Payment results

The response always carries success and status. Branch on status.

statusMeaningExtra fields
SUCCESSFULApproved.auth_code
_3DSVERIFICATIONThe customer must authenticate. Redirect their browser to 3ds_url.3ds_url
PROCESSINGAccepted 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
FAILEDDeclined or failed. A decline is still HTTP 200.error, hp_id, merchant_txn_id
ERRORThe request was rejected before processing (see Errors).error_code, error
Approved200
{
  "success": true,
  "status": "SUCCESSFUL",
  "hp_id": "<our payment id>",
  "merchant_txn_id": "ORD-12345",
  "auth_code": "<auth code>"
}
Customer must authenticate200
{
  "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 status is _3DSVERIFICATION, redirect the customer’s browser to 3ds_url.
  • After authentication the customer’s browser is sent to the success_url or failure_url you 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

GET/api/v1/payments/:id

:id is either your transaction_ref or our hp_id.

Response200
{
  "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

POST/api/v1/refunds

Only payments that are SUCCESSFUL or PARTIALLY_REFUNDED can be refunded.

FieldTypeDescription
transaction_refrequiredstringYour reference or our hp_id (also accepted as payment_id or merchant_txn_id).
amountnumberDecimal in major units. Omit for a full refund. Cannot exceed the original amount.
reasonstringFree text.
Response200
{
  "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).

Callback bodyPOST to your callback URL
{
  "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 2xx status 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 on hp_id and status.
Design for missed callbacks. Poll or re-check any payment that is still 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.

Error bodyusually HTTP 200
{
  "success": false,
  "status": "ERROR",
  "error_code": "VALIDATION_FAILED",
  "error": "Missing required field: cvv"
}
error_codeWhen
UNAUTHORIZEDInvalid or inactive API key (HTTP 401).
INVALID_REQUESTBody is not valid JSON, transaction_ref is missing, or the payment ID is missing on a status or refund call.
VALIDATION_FAILEDA required field is missing, or the card number, expiry, CVV, amount or currency is invalid.
AMOUNT_LIMIT_EXCEEDEDAmount is above the per-transaction limit on your account.
DAILY_LIMIT_EXCEEDED, MONTHLY_LIMIT_EXCEEDED, EXPOSURE_LIMIT_EXCEEDEDA volume limit on your account has been reached.
DUPLICATE_TRANSACTIONThat transaction_ref was already used.
IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_KEY_IN_PROGRESSThe same Idempotency-Key was sent with a different body, or while the first request was still running.
NOT_FOUNDUnknown payment, or not eligible for refund.
INVALID_AMOUNT, AMOUNT_EXCEEDED, REFUND_LIMIT_EXCEEDEDRefund amount is invalid, above the original, or above what is still refundable.
REFUND_IN_DOUBT, REFUND_FAILED, REFUND_ERRORRefund 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.

EndpointPurpose
GET /sandbox/test-cardsList the test card numbers and what each one simulates. Public.
POST /sandbox/test-cards/checkCheck what a test card number will do.
GET /sandbox/3ds/challenge, POST /sandbox/3ds/completeSimulated 3-D Secure challenge.
GET /sandbox/webhooks/events, POST /sandbox/webhooks/triggerList and trigger simulated callbacks.
GET /sandbox/webhooks/historyDelivery history for your test callbacks.
POST /sandbox/api-keys/generateCreate 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