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

# Create a Phone Number Order

> Purchase and provision a phone number through the v1 phone number order API.

<Warning>
  **Legacy endpoint - deprecated.** Unversioned endpoints are scheduled for removal on **July 31, 2026**. Use [Buy Phone Number](/docs/api-reference/v1/phone-numbers/buy) for new `/v1` purchase integrations. This endpoint remains available for existing integrations until then.
</Warning>

Creates a phone number order for the selected telephony provider and provisions the resulting number in the workspace. Use this v1 order path for new integrations.

<Note>
  The older `/organization-phone-numbers/purchase` path remains documented for existing integrations during the legacy transition.
</Note>

## Related endpoints

* [Search Available Numbers](/docs/api-reference/phone-numbers/search): find numbers before ordering.
* [Purchase a Number](/docs/api-reference/v1/phone-numbers/buy): legacy purchase path.
* [Link a SIP Trunk](/docs/api-reference/v1/phone-numbers/link-sip-trunk): connect a bring-your-own number.


## OpenAPI

````yaml POST /organization-phone-numbers/orders
openapi: 3.0.0
info:
  title: DialNexa API
  description: >-
    Public REST API for the DialNexa voice AI platform. Versioned endpoints are
    under /v1; unversioned endpoints are legacy and deprecated.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: API Keys
  - name: Agent Functions
  - name: Agents V1
  - name: Agents2
  - name: Batch Calls
  - name: Batch Calls V1
  - name: Call Logs
  - name: Calls
  - name: Calls V1
  - name: Campaign Leads
  - name: Campaigns
  - name: External Webhooks
  - name: Knowledge Base
  - name: Knowledge Base V1
  - name: LLMs
  - name: LLMs V1
  - name: Languages
  - name: Languages V1
  - name: Organization Phone Numbers
  - name: Organization Phone Numbers V1
  - name: Phone Number Pricing
  - name: Phone Number Pricing V1
  - name: Transcribers
  - name: Transcribers V1
  - name: User Webhooks
  - name: User Webhooks V1
  - name: V1
  - name: Voices
  - name: Voices V1
  - name: Webcall
  - name: Workflow Leads
  - name: Workflow Leads V1
  - name: Workflows
  - name: Workflows V1
paths:
  /organization-phone-numbers/orders:
    post:
      tags:
        - Organization Phone Numbers
      summary: Purchase a phone number from the specified provider (V1 alias)
      description: >-
        **Legacy endpoint - deprecated, scheduled for removal on July 31,
        2026.** Use the `/v1` version for new integrations. 
      operationId: OrganizationPhoneNumbersController_purchasePhoneNumberV1
      parameters:
        - name: x-organization-id
          in: header
          description: RSA encrypted organization ID (base64 format)
          required: true
          schema:
            type: string
            example: BASE64_ENCRYPTED_ORG_ID_HERE
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchasePhoneNumberRequestDto'
      responses:
        '200':
          description: Phone number purchase initiated and record created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchasePhoneNumberResponseDto'
        '400':
          description: Invalid request or failed to purchase
      deprecated: true
components:
  schemas:
    PurchasePhoneNumberRequestDto:
      type: object
      properties:
        phoneNumber:
          type: string
          example: '+1234567890'
          description: Phone number to purchase
        telephonyProviderId:
          type: string
          example: plivo_123456
          description: ID of telephony provider (14-char string)
        countryISO:
          type: string
          example: US
          description: Country ISO code (e.g., US, IN)
      required:
        - phoneNumber
        - telephonyProviderId
        - countryISO
    PurchasePhoneNumberResponseDto:
      type: object
      properties:
        phoneNumber:
          type: string
          example: '+1234567890'
          description: Phone number
        status:
          type: string
          enum:
            - active
            - pending
          description: Status of the phone number
        message:
          type: string
          description: Status message
        organizationPhoneNumber:
          description: Organization phone number record
          allOf:
            - $ref: '#/components/schemas/OrganizationPhoneNumber'
      required:
        - phoneNumber
        - status
    OrganizationPhoneNumber:
      type: object
      properties:
        sip_trunk_enabled:
          type: boolean
          default: false
          description: >-
            When true, Speech IO uses SIP trunking (e.g. asterisk) for this
            number.
      required:
        - sip_trunk_enabled
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````