Skip to content

Constants

The values below are stable in v1.2. Any breaking changes will ship via a changelog entry + version bump, with advance notice to integrators.

Base URL

EnvironmentURL
Productionhttps://api.coinepay.net
SandboxNone (not provided in v1.2)
Local devhttp://localhost:8801

API Prefix

/api/v1/openapi

HTTP Convention

ItemValue
MethodAll POST (project hard rule)
Request Content-Typeapplication/json
Response Content-Typeapplication/json; charset=utf-8
Max body4 MB (4194304 bytes)
CharsetUTF-8

Authentication

ItemValue
AlgorithmHMAC-SHA256
Required headersX-App-Id / X-Timestamp / X-Nonce / X-Signature
AppID formatcp_<28 hex>, fixed length 31
Secret format64 hex characters
Secret prefix display<first 4>****
Timestamp unitSeconds (not milliseconds)
Timestamp tolerance±300 seconds
Nonce length8–64 characters
Nonce replay window600 seconds
Signature formatlowercase hex
Signature length64 characters

Idempotency

ItemValue
HeaderIdempotency-Key
Required endpoints/api/v1/openapi/card/apply / /api/v1/openapi/card/recharge
Max length128 characters
Dedup window24 hours
Conflict status409

Rate Limit

ItemValue
Dimension(AppID, IP)
Quota600 / minute
Window60 seconds (rolling)
ExceededHTTP 429

Webhook Delivery

ItemValue
Signature headerWebhook-Signature
Signature formatv1,<hex_hmac_sha256>
Signature input{timestamp}.{raw_body}
Event ID headerWebhook-Id
Timestamp headerWebhook-Timestamp
Type headerWebhook-Type
Retry backoff (seconds)[60, 300, 900, 3600, 21600, 86400]
Total delivery attempts7 (1 initial + 6 retries; then dead_letter)
Receiver response-header timeout5 seconds
Receiver total request timeout10 seconds
HTTPS required✅ (production; HTTP only when AllowHTTP=true in dev)
Public IP required✅ (rejects private / loopback / link-local)
Allowed ports443 in production

Card Types (v1.2 OpenAPI scope)

card_typeDescription
virtual_lVirtual card class L
virtual_pVirtual card class P
virtual_vVirtual card class V
virtual_rVirtual card class R
virtual_gVirtual card class G
virtual_aVirtual card class A (email required, phone not collected — see Apply)

OpenAPI rejects non-virtual types

master_e / visa_h / transfer etc. are out of scope and return 400 openapi_card_type_not_supported.

apply does not accept card_type

/card/apply doesn't take card_type; it's derived from header_id.

Business Prefixes

ResourcePrefixExample
Cardcard_card_12345
Packagepkg_pkg_67
Card headerhdr_hdr_5
Recharge transactiontxn_txn_OO20260429110012abc
Webhook eventevt_evt_550e8400-e29b-41d4-a716-446655440000

Useful SHA-256 Constants

Inputsha256 hex
Empty stringe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
{}44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a

Localization

HeaderBehavior
Accept-Language not setDefault Chinese
Accept-Language: zh-CNChinese
Accept-Language: en-USEnglish

message_key is not affected by Accept-Language — always stable, use it for programmatic checks.

Credentials

ItemValue
ValidityIndefinite (until reset / disabled)
Per-user limit1 active credential pair (v1)
After resetOld secret immediately invalid
After disable401 invalid_credentials; can re-enable

Released under MIT-equivalent terms.