> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vultlocal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Child Card

> Create a child card with daily spending limits

<Info>
  Child cards allow subscribers to delegate limited spending access to dependents or employees.
</Info>

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer olive_live_xxx` or `Bearer eyJ...` (JWT)
</ParamField>

### Body Parameters

<ParamField body="parent_subscriber_id" type="string" required>
  Parent subscriber UUID
</ParamField>

<ParamField body="card_serial" type="string" required>
  Card serial to assign as child (e.g., `OLIV0002`)
</ParamField>

<ParamField body="parent_pin" type="string" required>
  Parent's 4-digit PIN for authorization
</ParamField>

<ParamField body="child_pin" type="string" required>
  New 4-digit PIN for the child card
</ParamField>

<ParamField body="daily_limit" type="integer" required>
  Daily spending limit in cents (e.g., `5000000` = 50,000 SLE)
</ParamField>

<ParamField body="child_first_name" type="string">
  Child's first name
</ParamField>

<ParamField body="child_last_name" type="string">
  Child's last name
</ParamField>

<ParamField body="child_phone_number" type="string">
  Child's phone number for notifications
</ParamField>

<ParamField body="effective_date" type="string">
  When card becomes active (`YYYY-MM-DD`)
</ParamField>

<ParamField body="allocated_amount" type="integer">
  Initial allocated amount in cents
</ParamField>

***

## Response

<ResponseField name="success" type="boolean">
  Whether creation succeeded
</ResponseField>

<ResponseField name="message" type="string">
  Result message
</ResponseField>

<ResponseField name="card" type="object">
  Child card details
</ResponseField>

***

## Examples

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://demo.api.vultlocal.com/api/v1/cards/child" \
    -H "Authorization: Bearer olive_live_xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "parent_subscriber_id": "sub_abc123",
      "card_serial": "OLIV0002",
      "parent_pin": "1234",
      "child_pin": "5678",
      "daily_limit": 5000000,
      "child_first_name": "Jane",
      "child_last_name": "Doe",
      "child_phone_number": "+23276123456"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "success": true,
    "message": "Child card created successfully",
    "card": {
      "serial": "OLIV0002",
      "type": "CHILD",
      "status": "ACTIVE",
      "parent_serial": "OLIV0001",
      "parent_subscriber_id": "sub_abc123",
      "daily_limit": 5000000,
      "daily_limit_formatted": "50,000.00 SLE",
      "child_name": "Jane Doe",
      "linked_at": "2025-01-15T10:30:00Z"
    }
  }
  ```

  ```json 400 Limit Exceeded theme={null}
  {
    "error": "Maximum child cards reached",
    "code": "MAX_CHILD_CARDS",
    "max_allowed": 4
  }
  ```
</ResponseExample>

***

## Child Card Rules

<CardGroup cols={2}>
  <Card title="Daily Limits" icon="clock">
    * Resets at midnight local time
    * Cannot exceed parent's balance
    * Can be adjusted by parent
  </Card>

  <Card title="Restrictions" icon="shield">
    * Cannot create more child cards
    * Cannot access parent's PIN
    * Limited to assigned limit
  </Card>
</CardGroup>

***

## Max Child Cards

The number of child cards a subscriber can create is limited:

| Subscriber Type | Max Child Cards |
| --------------- | --------------- |
| Standard        | 4               |
| VIP             | 10              |
| Corporate       | Unlimited       |

***

## Errors

| Status | Code                   | Description                 |
| ------ | ---------------------- | --------------------------- |
| 400    | `INVALID_PARENT_PIN`   | Parent PIN incorrect        |
| 400    | `MAX_CHILD_CARDS`      | Subscriber limit reached    |
| 400    | `CARD_ALREADY_LINKED`  | Card already in use         |
| 401    | `UNAUTHORIZED`         | Invalid API key             |
| 404    | `SUBSCRIBER_NOT_FOUND` | Parent subscriber not found |
| 404    | `CARD_NOT_FOUND`       | Card serial not found       |
| 500    | `INTERNAL_ERROR`       | Server error                |


## OpenAPI

````yaml olive-openapi.json POST /cards/child
openapi: 3.0.0
info:
  description: >-
    API Gateway for OLIVE NFC Card Payment System - Comprehensive payment, card
    management, agent operations, and admin authentication. All /api/v1 routes
    require authentication using either API Key or JWT token.
  title: OLIVE NFC Card Payment API
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    email: support@olive.sl
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://olive-gateway-a6ba.onrender.com/api/v1
security: []
paths:
  /cards/child:
    post:
      tags:
        - Cards
      summary: Create child card
      description: >-
        Create a child card linked to parent subscriber with spending limits.
        Requires parent's PIN for authentication and a separate PIN for the
        child's card transactions. The child will use their own PIN when making
        payments for security.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/handler.CreateChildCardRequest'
        description: Child card details
        required: true
      responses:
        '201':
          description: Child card created
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    handler.CreateChildCardRequest:
      type: object
      required:
        - card_serial
        - child_holder_name
        - child_pin
        - child_relationship
        - parent_subscriber_id
        - pin
      properties:
        allocated_amount:
          description: Amount in SLE (will be converted to cents internally)
          type: integer
          example: 200000
        card_serial:
          description: 'Supports any alphanumeric: CARD0001, 48290173K, etc.'
          type: string
          example: OLIV0002
        child_holder_name:
          type: string
          example: Jane Doe
        child_phone_number:
          type: string
          example: '+23276123456'
        child_pin:
          type: string
          example: '5678'
        child_relationship:
          type: string
          example: daughter
        daily_limit:
          description: Amount in SLE (will be converted to cents internally)
          type: integer
          example: 25000
        effective_date:
          type: string
          example: '2025-10-20'
        monthly_limit:
          description: Amount in SLE (will be converted to cents internally)
          type: integer
          example: 250000
        parent_subscriber_id:
          type: string
          example: parent-uuid
        pin:
          type: string
          example: '1234'
  securitySchemes:
    ApiKeyAuth:
      description: >-
        API Key for third-party integrations (WhatsApp, Smart PAY, VULT).
        Format: 'Bearer olive_live_xxxxxxxxxxxxx'
      type: apiKey
      name: Authorization
      in: header
    BearerAuth:
      description: >-
        JWT token from admin login for administrative operations. Format:
        'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
      type: apiKey
      name: Authorization
      in: header

````