Skip to content

Code Samples

The 6 samples below are all tested and include:

  • HMAC signature generation
  • HTTP call wrappers
  • Webhook signature verification

Pick the right one

Dependencies

LanguageDependenciesNotes
Pythonrequests (or httpx / urllib3)hmac / hashlib / secrets are stdlib
Node.jsNode.js ≥ 18 (native fetch)crypto is built-in
Gostdlib crypto/hmac / crypto/sha256 / net/httpNo third-party deps
JavaJDK 11+ stdlib (HttpClient / Mac / MessageDigest)No third-party deps
PHPPHP 7.4+ with curl extensionhash_hmac / random_bytes are built-in
cURLopenssl + awkGeneric shell tools

Common Variables

APP_ID  = "cp_a1b2c3d4..."         # 31 chars, cp_ + 28 hex
SECRET  = "f1e2d3c4..."            # 64 hex chars
BASE    = "https://api.coinepay.net"

Don't hardcode

Samples have SECRET inline for clarity; production code should read from env vars / Vault / Secret Manager.

Released under MIT-equivalent terms.