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

# Retrieve a list of phone numbers associated to orders

> Get a list of phone numbers associated to orders.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/ordering.yml get /number_order_phone_numbers
openapi: 3.1.0
info:
  title: Telnyx Phone Number Ordering API
  version: 2.0.0
  description: API for ordering phone numbers.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /number_order_phone_numbers:
    get:
      tags:
        - Phone Number Orders
      summary: Retrieve a list of phone numbers associated to orders
      description: Get a list of phone numbers associated to orders.
      operationId: RetrieveOrderPhoneNumbers
      parameters:
        - name: filter
          in: query
          style: deepObject
          explode: true
          description: >-
            Consolidated filter parameter (deepObject style). Originally:
            filter[country_code]
          schema:
            type: object
            properties:
              country_code:
                type: string
                example: US
                description: Country code of the order phone number.
      responses:
        '200':
          $ref: '#/components/responses/ListNumberOrderPhoneNumbersResponse'
        '400':
          $ref: '#/components/responses/numbers_BadRequestResponse'
        '401':
          $ref: '#/components/responses/numbers_UnauthorizedResponse'
        '404':
          $ref: '#/components/responses/numbers_NotFoundResponse'
        '422':
          $ref: '#/components/responses/numbers_UnprocessableEntity'
        '500':
          $ref: '#/components/responses/numbers_GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const numberOrderPhoneNumbers = await
            client.numberOrderPhoneNumbers.list();


            console.log(numberOrderPhoneNumbers.data);
        - lang: Python
          source: >-
            import os

            from telnyx import Telnyx


            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )

            number_order_phone_numbers =
            client.number_order_phone_numbers.list()

            print(number_order_phone_numbers.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tnumberOrderPhoneNumbers, err := client.NumberOrderPhoneNumbers.List(context.TODO(), telnyx.NumberOrderPhoneNumberListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", numberOrderPhoneNumbers.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.numberorderphonenumbers.NumberOrderPhoneNumberListParams;

            import
            com.telnyx.sdk.models.numberorderphonenumbers.NumberOrderPhoneNumberListResponse;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    NumberOrderPhoneNumberListResponse numberOrderPhoneNumbers = client.numberOrderPhoneNumbers().list();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            number_order_phone_numbers = telnyx.number_order_phone_numbers.list

            puts(number_order_phone_numbers)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $numberOrderPhoneNumbers = $client->numberOrderPhoneNumbers->list(
                filter: ['countryCode' => 'US']
              );

              var_dump($numberOrderPhoneNumbers);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx number-order-phone-numbers list \
              --api-key 'My API Key'
components:
  responses:
    ListNumberOrderPhoneNumbersResponse:
      description: Successful response with a list of number order phone numbers.
      content:
        application/json:
          schema:
            type: object
            title: List Number Order Phone Numbers Response
            properties:
              data:
                type: array
                items:
                  $ref: '#/components/schemas/NumberOrderPhoneNumber'
              meta:
                $ref: '#/components/schemas/PaginationMeta'
    numbers_BadRequestResponse:
      description: >-
        Bad request, the request was unacceptable, often due to missing a
        required parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_UnauthorizedResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
          examples:
            Authentication Failed:
              value:
                errors:
                  - code: '10009'
                    title: Authentication failed
                    detail: Could not understand the provided credentials.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10009
    numbers_NotFoundResponse:
      description: The requested resource doesn't exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_UnprocessableEntity:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
  schemas:
    NumberOrderPhoneNumber:
      properties:
        id:
          type: string
          format: uuid
          example: dc8e4d67-33a0-4cbb-af74-7b58f05bd494
          readOnly: true
        record_type:
          type: string
          example: number_order_phone_number
          readOnly: true
        phone_number:
          type: string
          example: '+19705555098'
        order_request_id:
          type: string
          format: uuid
          example: dc8e4d67-33a0-4cbb-af74-7b58f05bd495
        sub_number_order_id:
          type: string
          format: uuid
          example: dc8e4d67-33a0-4cbb-af74-7b58f05bd496
        country_code:
          type: string
          example: US
        phone_number_type:
          type: string
          example: local
          enum:
            - local
            - toll_free
            - mobile
            - national
            - shared_cost
            - landline
        regulatory_requirements:
          type: array
          items:
            $ref: '#/components/schemas/SubNumberOrderRegulatoryRequirementWithValue'
        requirements_met:
          type: boolean
          description: >-
            True if all requirements are met for a phone number, false
            otherwise.
          example: true
          readOnly: true
        status:
          type: string
          enum:
            - pending
            - success
            - failure
          description: The status of the phone number in the order.
          readOnly: true
        bundle_id:
          type:
            - string
            - 'null'
          format: uuid
          example: a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
          readOnly: true
        locality:
          type: string
          example: San Francisco
        deadline:
          type: string
          format: date-time
          example: '2024-05-31T11:14:00Z'
        requirements_status:
          type: string
          enum:
            - pending
            - approved
            - cancelled
            - deleted
            - requirement-info-exception
            - requirement-info-pending
            - requirement-info-under-review
          description: Status of requirements (if applicable)
          readOnly: true
        is_block_number:
          type: boolean
          example: false
      type: object
    PaginationMeta:
      type: object
      properties:
        total_pages:
          type: integer
          example: 3
        total_results:
          type: integer
          example: 55
        page_number:
          type: integer
          example: 2
        page_size:
          type: integer
          example: 25
    numbers_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/numbers_Error'
      type: object
    SubNumberOrderRegulatoryRequirementWithValue:
      properties:
        record_type:
          type: string
          example: phone_number_regulatory_requirement
          readOnly: true
        requirement_id:
          type: string
          format: uuid
          description: Unique id for a requirement.
          example: 8ffb3622-7c6b-4ccc-b65f-7a3dc0099576
        field_type:
          type: string
          enum:
            - textual
            - datetime
            - address
            - document
          example: address
          readOnly: true
        field_value:
          type: string
          description: >-
            The value of the requirement, this could be an id to a resource or a
            string value.
          example: 45f45a04-b4be-4592-95b1-9306b9db2b21
      type: object
    numbers_Error:
      properties:
        code:
          type: string
          example: '10007'
        title:
          type: string
          example: Unexpected error
        detail:
          type: string
          example: An unexpected error occured.
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              example: /base
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          properties:
            url:
              type: string
              description: URL with additional information on the error.
              example: https://developers.telnyx.com/docs/overview/errors/10015
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````