IDs & Prefixes
All public resource IDs are prefixed strings rather than raw integer DB keys. When you send IDs back, keep the prefix as-is.
Prefix Table
| Resource | Prefix | Example | Where it appears |
|---|---|---|---|
| Card | card_ | card_12345 | apply response / card_id field on subsequent endpoints |
| Package | pkg_ | pkg_67 | card_configs/list response / apply request |
| Card header | hdr_ | hdr_5 | card_headers/list response / apply request |
| Recharge transaction | txn_ | txn_OO20260429110012abc | recharge response / webhook payload |
| Webhook event | evt_ | evt_550e8400-e29b-41d4-a716-446655440000 | webhook_events/list response |
| Cardholder | chd_ | chd_1024 | cardholder/create response / cardholder_id on the cardholder endpoints and /card/apply / cardholder.status_changed webhook (v1.6) |
| Cardholder file | chf_ | chf_301 | cardholder/files/upload response / identity.*_file_id on cardholder create / update (v1.6) |
Webhooks use the same convention
All IDs in webhook payloads are also prefixed. The Webhook-Id header value with evt_ stripped is the original UUID.
transaction_id is opaque
Treat txn_<...> as an opaque string for storage, lookup and reconciliation. The internal structure after the txn_ prefix is server-generated and not stable across versions or providers — never parse, slice or pattern-match it. Internal order references are intentionally not exposed.
Validation Rules
A well-formed ID is the prefix followed by a positive decimal integer (card_12345, hdr_5, pkg_67). Anything else — missing or wrong prefix, empty, non-numeric (card_abc), zero or negative — is malformed.
| Case | HTTP | code | error_key |
|---|---|---|---|
card_id missing or malformed (e.g. 12345, card_abc) | 200 | 40000 | openapi_invalid_card_id |
card_id well-formed but the card does not exist or is not owned by your account | 404 | 40400 | card_not_found |
card_id points to one of your cards that is not an OpenAPI virtual card type (e.g. a physical card) | 200 | 40000 | openapi_card_type_not_supported |
header_id missing or malformed, or well-formed but unknown | 200 | 40000 | openapi_invalid_header_id |
package_id missing or malformed | 200 | 40000 | openapi_invalid_package_id |
cardholder_id missing or malformed | 200 | 40000 | openapi_invalid_cardholder_id |
cardholder_id well-formed but not a cardholder registered through OpenAPI on your account | 404 | 40400 | cardholder_not_found |
A *_file_id (cardholder file) malformed | 200 | 40000 | openapi_invalid_cardholder_file_id (data.field names the field) |
A *_file_id well-formed but not uploaded by your account | 404 | 40400 | cardholder_file_not_found |
card_not_found applies to /card/info, /card/freeze, /card/unfreeze, /card/close, /card/recharge, /card/transactions/list and /transactions/list (when its card_id filter is set). A card belonging to another account gets exactly the same card_not_found response as a card that never existed, so ownership cannot be probed.
A well-formed but unknown package_id is not reported through openapi_invalid_package_id: /card/first_deposit/preview answers is_valid=false with invalid_reason bank_card_config_not_found. Use the package_id values returned by /card_configs/list for the same header.
Malformed vs. not found
openapi_invalid_*_id (HTTP 200 / 40000) means the request itself is wrong — fix the ID you are sending; retrying the same value never succeeds. card_not_found (HTTP 404 / 40400) means the ID is syntactically fine but there is no such card under your account — check that you are using the right credential / account.
Internal Fields That Are Never Exposed
The response shape documented for each endpoint is the complete contract. Internal database identifiers, provider-side order references, intermediate computation values, and internal labels are never returned via OpenAPI.
If you see anything outside the documented response shape, please report it to the Brand team.
Tips
- Store IDs with their prefix; send them back as-is (don't strip the digit part)
- Logs/alerts should include the full ID (
card_12345) for debugging - Differentiate from your internal IDs: Brand's IDs are
card_xxx; your internal IDs should use a different prefix (e.g.kart_xxx) to avoid confusion.