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

# Buy an extra number (On Demand)

> Buys N extra number(s). Requires a TENANT-scoped key. A Free tenant is converted to On Demand (bills the converted free number + the new one) — requires confirm:true, otherwise returns 409 CONFIRMATION_REQUIRED with the preview. With a saved card (Plans → Cartão) it is charged immediately; otherwise it returns { checkoutUrl } to pay. Real side effect: it charges. Stripe only.

**Requires a tenant-scoped key.**



## OpenAPI

````yaml openapi.json POST /v1/subscription/extra-numbers
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/subscription/extra-numbers:
    post:
      tags:
        - Subscription
      summary: Buy an extra number (On Demand)
      description: >-
        Buys N extra number(s). Requires a TENANT-scoped key. A Free tenant is
        converted to On Demand (bills the converted free number + the new one) —
        requires confirm:true, otherwise returns 409 CONFIRMATION_REQUIRED with
        the preview. With a saved card (Plans → Cartão) it is charged
        immediately; otherwise it returns { checkoutUrl } to pay. Real side
        effect: it charges. Stripe only.


        **Requires a tenant-scoped key.**
      operationId: post_subscription_extra-numbers
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                quantity:
                  type: number
                  description: How many numbers to buy (default 1).
                  example: '1'
                confirm:
                  type: boolean
                  description: >-
                    Required (true) when the purchase converts the plan (Free →
                    On Demand).
                  example: 'true'
            example:
              quantity: 1
              confirm: true
      responses:
        '200':
          description: Buy 1 (with confirmation)
          content:
            application/json:
              example:
                success: true
                charged: true
                plan: ON_DEMAND
                paidExtraNumbers: 2
                monthlyTotalBRL: 59.8
        '400':
          description: Invalid payload or parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Validation error
        '401':
          description: Missing or invalid `x-api-key` / `x-api-key-id` header
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '403':
          description: Number-scoped key used on a tenant-only endpoint
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Number-scoped keys cannot call tenant endpoints
                code: NUMBER_SCOPE_NOT_ALLOWED
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Too many requests
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````