Random Billing Address
Returns one randomly generated billing address in the shape of the billing_address object (v1.6.6). Use it to prefill billing_address on /cardholder/create / /cardholder/update, or on /card/apply when opening a card without a cardholder. Nothing is saved, and the endpoint does not require any cardholder on your account.
The address comes from the platform's own address source and is normalized to a clean address: country / state / city / line1 / postcode are always present, address lines contain only English letters, digits and spaces, the postcode has 4–10 characters, and state falls back to the city for countries without states — so the result passes the billing_address validation of /card/apply and of /cardholder/create as is.
Endpoint
| Item | Value |
|---|---|
| Method | POST |
| Path | /api/v1/openapi/cardholder/billing_address/random |
| Auth | HMAC |
| Idempotency | Not required |
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
header_id | string | hdr_<id> of the header you will open the card on or register the cardholder for (/card_headers/list). It decides the country scope (below). Omit it to get an address from any country | |
country | string | ISO 3166-1 alpha-2, case-insensitive. When set, only that country is tried — there is no fallback to another country. When omitted: the header's issuing region, else any country in scope |
Country scope by header:
| Header | Scope |
|---|---|
Uses cardholders (virtual_v / virtual_r / virtual_g / virtual_a / virtual_s921 headers — all of them require one, required=true on /cardholder/requirement) | Only countries in the header's billing country list (rules.country_lists.billing_countries, flat form support_billing_region): no list = any country, a list present but empty = no country. A country outside the list is rejected with cardholder_billing_country_unsupported |
Does not use cardholders (virtual_l / virtual_p headers, supported=false) | No country list — any country, as /card/apply accepts for billing_address on a card opened without a cardholder. Default country = the header's issuing region |
No header_id | Any country |
Only the header's billing country list is applied. Since v1.6.8 the platform has no residence restriction list of its own; any other country / residence restriction (e.g. rules.country_lists.blocked_residence_countries on /cardholder/requirement) is checked by the issuer at check / submit / card issuance. When the address is meant for a cardholder, you can pass a country that suits the header's rules.country_lists.
{ "header_id": "hdr_194" }{ "header_id": "hdr_5", "country": "SG" }Response Fields
data is the billing address object — the same fields as billing_address on /cardholder/create and /card/apply:
| Field | Type | Description |
|---|---|---|
country | string | ISO 3166-1 alpha-2, upper case |
state | string | State / province (the city when the country has none) |
city | string | City |
district | string | Usually an empty string |
line1 | string | Address line 1 — English letters, digits and spaces only |
line2 | string | Address line 2 — may be an empty string |
postcode | string | 4–10 letters or digits |
Example Response
{
"code": 0,
"message": "Success",
"data": {
"country": "SG",
"state": "Singapore",
"city": "Singapore",
"district": "",
"line1": "1 Raffles Place",
"line2": "",
"postcode": "048616"
}
}Common Errors
| HTTP | code | error_key | Description |
|---|---|---|---|
| 200 | 40001 | validation_failed | Request body cannot be parsed |
| 200 | 40000 | openapi_invalid_header_id | header_id is malformed |
| 404 | 40400 | cardholder_header_not_found | No such header |
| 200 | 40000 | openapi_card_type_not_supported | The header is not a virtual-card header (OpenAPI only opens virtual cards, so only virtual-card headers are accepted here) |
| 200 | 40000 | cardholder_country_code_invalid | country is not two letters (data.field=country) |
| 200 | 40000 | cardholder_billing_country_unsupported | The header requires a cardholder and country is not in its support_billing_region (data.field=country) |
| 200 | 40000 | cardholder_random_address_unavailable | No usable address for the requested country / scope right now (data.field=country) — try another country or let the end user enter the address |
| 200 | 50000 | cardholder_provider_unavailable | The address source is temporarily unavailable — retry later |
| 200 | 50000 | cardholder_service_not_configured | The cardholder service is not enabled — contact us |
| 401 | 40100 | openapi_invalid_credentials | Auth failure |
| 429 | 42900 | too_many_requests | Rate limited — this endpoint's own quota of 60 calls per account per 60 s, or the general rate limit; honor Retry-After |
| 200 | 50000 | openapi_cardholder_failed | Server error |
Notes
- Every call returns a fresh random address; nothing is stored and no card or cardholder is changed. Show it to your end user to confirm or edit before you send it on.
- A random address is a plausible address, not the end user's real one. Use the real address whenever the header asks for a proof of address (
identity.proof_of_address_*inrequired_fieldsor in a conditional requirement on/cardholder/requirement) — a random address cannot be backed by a document. /card/billing_address/generateneeds an existing card and returns the platform record shape (street/zip_code); this endpoint works before the card exists and returns the create / apply shape.- This endpoint has its own quota on top of the general rate limit: 60 calls per account per 60-second window. One random address per end user is normally enough — do not call it in a loop.