Skip to content

Constants ​

The values below are stable in v1.6. 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.5)
Local devhttp://localhost:8801

API Prefix ​

/api/v1/openapi

HTTP Convention ​

ItemValue
MethodAll POST (project hard rule)
Request Content-Typeapplication/json (multipart/form-data for /cardholder/files/upload only)
Response Content-Typeapplication/json; charset=utf-8
Max body4 MB (4194304 bytes) for every endpoint, including /cardholder/files/upload (one file ≤ 2 MB plus multipart overhead). A larger body is rejected as HTTP 401 openapi_invalid_credentials
CharsetUTF-8

Response Envelope & Codes ​

ItemValue
Success{"code": 0, "message": "Success", "data": {...}}
Error{"code": <business code>, "message": "<localized>", "error_key": "<stable key>"}
error_keyPresent on every error response, never on success
Success checkcode == 0 — not the HTTP status
SituationHTTPcode
Success (incl. idempotent replay)2000
Business / validation rejection20040000
Request body cannot be parsed20040001
Authentication failure40140100
Authenticated but not allowed40340300
Card not found / not owned40440400
Idempotency-Key conflict / in progress40940900
Rate limited42942900
Server-side failure handled by the endpoint20050000
Unhandled server crash50050000

See Error Codes for every error_key.

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 / the cardholder write endpoints /api/v1/openapi/cardholder/files/upload / create / update / delete / submit / kyc/init / kyc/cancel
Max length128 characters
Dedup window24 hours
Missing / too long / invalid charactersHTTP 200 / 40000 (openapi_idempotency_key_required / openapi_idempotency_key_too_long / openapi_idempotency_key_invalid_chars)
Same key, different bodyHTTP 409 / 40900 openapi_idempotency_key_conflict
Same key + same body while the first request is still runningHTTP 409 / 40900 openapi_idempotency_key_in_progress (does not wait)
Responses stored for replayAny HTTP 2xx response, including business errors (HTTP 200 + 40000 / 50000); non-2xx responses are not stored

Rate Limit ​

ItemValue
Dimension(AppID, IP)
Quota600 / minute
Window60 seconds, fixed (starts with the first counted request; not rolling)
ExceededHTTP 429 / 42900 / too_many_requests, header Retry-After: 60
Gateway limitThe gateway in front of the API may also answer HTTP 429 with the same body (42900 / too_many_requests)

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✅ (HTTPS only)
HostDomain name only (no IP addresses in any form); every resolved address must be public
Allowed ports443 only

Webhook Event Types ​

card.opened / card.open_failed / card.recharged / card.recharge_failed / card.closed / card.status_changed — delivered for all card types listed below. cardholder.status_changed (v1.6) — cardholder review / verification status. See Webhook Spec.

Webhook Delivery Status ​

Returned by /webhook_events/list as status / status_desc.

statusstatus_descMeaning
0pendingQueued, not yet attempted
1deliveredYour endpoint answered 2xx
2failed_retryLast attempt failed; another attempt is scheduled (next_attempt_at)
3dead_letterRetries exhausted (or the URL was rejected); no further attempts
4skippedNot delivered by design (e.g. no webhook URL configured)

Card Types (v1.5 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 (cardholder required since v1.6.8 — see Apply)
virtual_s921Virtual card class S921 (USD; cardholder required since v1.6.8 — see Apply)

OpenAPI rejects non-virtual types

master_e / visa_h / transfer etc. are out of scope and return HTTP 200 / 40000 openapi_card_type_not_supported.

apply does not accept card_type

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

Card Status ​

status in the /card/info, /cards/list, /card/apply, /card/freeze, /card/unfreeze and /card/close responses, and from_status_code / to_status_code in card.status_changed. The text form (status_desc, and from_status / to_status in the webhook) is always lowercase English and does not follow Accept-Language.

statusTextMeaning
1pendingCard open submitted, waiting for the provider
2activeUsable
3failedCard open failed (terminal)
4closingClose requested; stays closing with its balance until the provider completes the close
5closedClosed, balance 0 (terminal unless the close refund is rejected in review, which restores active)
6frozenFrozen; see freeze_type

/cards/list accepts statuses values 1–6; anything else returns HTTP 200 / 40000 openapi_invalid_status_value.

freeze_type (in /cards/list): 0 not frozen · 1 frozen by the cardholder (can be undone with /card/unfreeze) · 2 system · 3 platform admin · 4 risk control.

Recharge Status ​

status / status_desc in the /card/recharge response, and status in the card.recharged / card.recharge_failed webhooks.

statusstatus_descMeaning
1processingAccepted, result pending — wait for the webhook
2successCredited to the card (card.recharged)
3failedFailed, funds returned to the wallet (card.recharge_failed)

Card Transactions ​

Applies to /transactions/list and /card/transactions/list.

type — raw provider type, upper-cased ​

The response type is the card provider's own transaction type, upper-cased. It is not a closed enum: values differ by card type and new ones can appear at any time. Examples seen in production: AUTHORIZATION, AUTH, CONSUMPTION, PURCHASE, RECHARGE, TOPUP, TOP UP, REFUND, CREDIT, REVERSAL, FEE, AUTHORIZATION_FEE, WITHDRAW, WITHDRAWAL. Top-ups of virtual_v / virtual_r / virtual_g / virtual_a / virtual_s921 cards appear as RECHARGE.

Do not branch on type. Branch on type_category and display type_i18n (localized names keyed by language code, e.g. en-US / zh-CN / zh-HK).

type_category — closed set ​

type_categoryMeaning
consumptionPurchase / settled authorization
refundRefund / credit back to the card
reversalReversal of an earlier transaction
topupCard top-up (recharge)
feeFee line
closeCard-close entry
transferTransfer
withdrawWithdrawal from the card
interestInterest
3ds3-D Secure verification entry
unknownType not classified yet (response only — cannot be used as a filter)

Request filters ​

FilterAccepted valuesNotes
type_categoryAny value above except unknown (case-sensitive)Recommended. Matches exactly the rows whose response type_category is that value. Invalid value → HTTP 200 / 40000 invalid_params
typePURCHASE (alias CONSUMPTION), AUTHORIZATION, REFUND, REVERSAL, TOPUP (alias TOP_UP), WITHDRAW (alias WITHDRAWAL), FEE (case-insensitive)Legacy standard enum, mapped to each provider's raw values — see below. Any other value is matched exactly (case-sensitive) against the provider's stored type

When both type and type_category are sent, only rows matching both are returned.

type filterMatches response type
PURCHASEAUTH (virtual_l), CONSUMPTION, AUTHORIZATION, PURCHASE
AUTHORIZATIONOnly virtual_p pre-authorizations (shown as AUTH). AUTHORIZATION in the response is a settled purchase on virtual_v / virtual_r cards and is matched by PURCHASE, not by this filter
REFUNDREFUND, CREDIT
REVERSALREVERSAL
TOPUPTOP UP, TOPUP, RECHARGE (v1.5: now includes the virtual_v / virtual_r / virtual_g / virtual_a / virtual_s921 top-ups)
WITHDRAWWITHDRAW, WITHDRAWAL
FEEFEE

Prefer type_category

The type filter is kept for compatibility and is ambiguous (AUTH / AUTHORIZATION mean different things on different card types). Filter with type_category instead.

Hidden types ​

Some types are hidden from these endpoints by platform configuration — system cross-border fee lines and card-close entries by default; the platform may hide others (e.g. plain fee lines). A filter that targets only hidden types returns an empty list.

status ​

Response statusFilter value
PENDINGPENDING
APPROVEDAPPROVED (alias COMPLETED)
FAILEDFAILED
REVERSEDREVERSED

The status filter is case-insensitive. A provider status outside these four is returned unchanged.

Cardholders (v1.6) ​

See Cardholders for how these values are used.

ItemValues
Card types that use cardholdersvirtual_v / virtual_r / virtual_g / virtual_a / virtual_s921 — a cardholder is required on every header of these types since v1.6.8 (never virtual_l / virtual_p)
registration_status0 draft · 1 registered
bindings[].status1 submitting · 2 under review · 3 approved · 4 failed
kyc.statusNOT_STARTED · IN_PROGRESS · APPROVED · REJECTED · CANCELLED (kyc_levels is deprecated and always [])
issues[].rulesrequired_fields · identity_types · field_constraints · holder_age · poa_max_age_months · nationalities · blocked_nationalities · residence_countries · blocked_residence_countries · billing_countries · area_codes · poa_issuing_countries · kyc_required · max_cards_per_cardholder · issuer_check
issues[].constraintmin_length · max_length · charset · format (empty otherwise)
rules.field_constraints charset / formatLATIN_NAME · LATIN_TEXT · LATIN_ALNUM_DASH · DIGITS / EMAIL · ISO_DATE · ISO_COUNTRY · E164
rules.conditionals[].when.opin · not_in · lt · gte
review_status (check / submit, per header)READY · NOT_SUBMITTED · PENDING_REVIEW · REJECTED · COVERAGE_INSUFFICIENT
issues[].typeMISSING_FIELDS · INVALID_FIELDS · COUNTRY_RESTRICTION · KYC_REQUIRED · KYC_NOT_CONFIGURED · CARD_LIMIT
bindings[].failure_reasonCARDHOLDER_FIELDS_INCOMPLETE · CARDHOLDER_KYC_REJECTED · CARDHOLDER_MOBILE_ALREADY_IN_USE · CARDHOLDER_EMAIL_ALREADY_IN_USE · CARDHOLDER_NATIONALITY_NOT_SUPPORTED · CARDHOLDER_BILLING_COUNTRY_NOT_ALLOWED · CARDHOLDER_AREA_CODE_NOT_SUPPORTED · CARDHOLDER_KYC_REFERENCE_DUPLICATE · CARDHOLDER_PROVIDER_REJECTED · CARDHOLDER_INVALID_PARAMETERS · CARDHOLDER_SUBMISSION_FAILED · CARDHOLDER_RESUBMISSION_REQUIRED · CARDHOLDER_KYC_PROOF_UNAVAILABLE · CARDHOLDER_PROVIDER_CONFIGURATION (other values possible — treat as a generic rejection)
ID document identity.typeID_CARD · PASSPORT · HK_HKID · DLN · RESIDENCE_PERMIT
File purposeidentity_front · identity_back · identity_hand · proof_of_address
File types / sizeJPG · PNG · PDF (detected from content), ≤ 2 MB
gender0 not provided · 1 male · 2 female
Headers per check / submit1–20
external_id≤ 128 characters, [A-Za-z0-9._-], unique per account
kyc/init access token validityabout 600 seconds
detail refresh throttleonce per 30 seconds per cardholder
Legacy card candidatesat most 50, virtual_g / physical_g

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
Cardholderchd_chd_1024
Cardholder filechf_chf_301

Useful SHA-256 Constants ​

Inputsha256 hex
Empty stringe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
{}44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a

Localization ​

The language of message is taken from Accept-Language, then the X-Language header, then the ?lang= query parameter.

Requestmessage language
No language sentEnglish (en-US)
zh-CNSimplified Chinese
zh-HK / zh-TW / zh-Hant / zh-MOTraditional Chinese
en-USEnglish
Other site languagesThat language (may be machine-translated)
Unsupported languageEnglish

error_key is not affected by the language — always stable, use it (together with code) for programmatic checks. Never match on message.

Credentials ​

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

Released under MIT-equivalent terms.