{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/lightspark/main/json-schema/lightspark-card-create-request-schema.json",
  "title": "CardCreateRequest",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lightspark-cards-api-openapi.yml#/components/schemas/CardCreateRequest",
  "type": "object",
  "required": [
    "cardholderId",
    "form",
    "fundingSources"
  ],
  "properties": {
    "cardholderId": {
      "type": "string",
      "description": "The id of the `Customer` to issue the card to. The customer must have KYC status `APPROVED`; otherwise the request is rejected with `CARDHOLDER_KYC_NOT_APPROVED`."
    },
    "platformCardId": {
      "type": "string",
      "description": "Optional platform-specific card identifier. System-generated when omitted, mirroring `platformCustomerId` semantics."
    },
    "form": {
      "$ref": "#/$defs/CardForm"
    },
    "fundingSources": {
      "type": "array",
      "description": "Internal account ids to bind as funding sources, in priority order. The first entry is tried first by Authorization Decisioning. Every card must be bound to at least one source, and every source must belong to the cardholder and be denominated in a card-eligible currency (USDB in v1); otherwise the request is rejected with `FUNDING_SOURCE_INELIGIBLE`.",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "CardForm": {
      "type": "string",
      "enum": [
        "VIRTUAL"
      ],
      "description": "Physical form factor of the card. Only `VIRTUAL` is supported in v1;\n`PHYSICAL` will be added in a later release.\n"
    }
  }
}