Base URLs & Hosts
HL Hunt's API is served from two hostnames that reach the same application. Use whichever you prefer; the paths differ only in the /api prefix.
| Family | On api.hlhunt.org | On payments.hlhunt.org | Auth |
|---|---|---|---|
| REST API (charges, customers, payment methods, refunds, checkout, subscriptions, invoices, products, prices, payouts, webhooks, arrangements, billing, portal sessions, capture-session, test-cards, auth/me) | https://api.hlhunt.org/v1/... (also /api/v1/...) | https://payments.hlhunt.org/api/v1/... | API key |
| Legacy tokenization | https://api.hlhunt.org/api/tokenize/session and /api/tokenize/capture | https://payments.hlhunt.org/api/tokenize/... | API key / session secret |
| Browser scripts | redirected (302) to payments.hlhunt.org | https://payments.hlhunt.org/js/hlhunt.js, /js/hlhunt-checkout.js | publishable key in the script |
| Hosted pages (checkout, embed, pay links, invoices, portal) | not served | https://payments.hlhunt.org/checkout/{session_key}, /embed/checkout/{session_key}, … | none |
| Documentation | not served | https://payments.hlhunt.org/docs/..., /api/docs/{slug} (markdown), /openapi.json | none |
Rules the edge applies:
- On
api.hlhunt.orga request whose path starts with/v1is rewritten to the same path under/apibefore routing, sohttps://api.hlhunt.org/v1/chargesandhttps://payments.hlhunt.org/api/v1/chargeshit the same handler. api.hlhunt.orgserves only/v1/*,/api/v1/*and/api/tokenize/*. Any other path answers404 { "error": { "type": "invalid_request_error", "code": "not_found", "message": "No such route: GET /foo. The API base URL is https://api.hlhunt.org/v1/" } }.- Any
/js/*.jsrequest onapi.hlhunt.orgis redirected tohttps://payments.hlhunt.org/js/..., so a script URL derived from your API base still loads. api.hlhunt.combehaves exactly likeapi.hlhunt.org.- There is one base URL for both modes. Test and live are selected by the key prefix (
sk_test_/pk_test_versussk_live_/pk_live_), never by the host.
The reference pages use https://api.hlhunt.org/v1 as the base.