> ## 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.

# List sub number orders

> Get a paginated list of sub number orders.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/ordering.yml get /sub_number_orders
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:
  /sub_number_orders:
    get:
      tags:
        - Phone Number Orders
      summary: List sub number orders
      description: Get a paginated list of sub number orders.
      operationId: ListSubNumberOrders
      parameters:
        - name: filter
          in: query
          style: deepObject
          explode: true
          description: >-
            Consolidated filter parameter (deepObject style). Originally:
            filter[status], filter[order_request_id], filter[country_code],
            filter[phone_number_type], filter[phone_numbers_count]
          schema:
            type: object
            properties:
              status:
                type: string
                description: Filter sub number orders by status.
              order_request_id:
                type: string
                format: uuid
                example: 12ade33a-21c0-473b-b055-b3c836e1c293
                description: ID of the number order the sub number order belongs to
              country_code:
                type: string
                example: US
                description: ISO alpha-2 country code.
              phone_number_type:
                type: string
                example: local
                description: Phone Number Type
              phone_numbers_count:
                type: integer
                example: 1
                description: Amount of numbers in the sub number order
      responses:
        '200':
          $ref: '#/components/responses/ListSubNumberOrdersResponse'
        '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 subNumberOrders = await client.subNumberOrders.list();

            console.log(subNumberOrders.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
            )
            sub_number_orders = client.sub_number_orders.list()
            print(sub_number_orders.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\tsubNumberOrders, err := client.SubNumberOrders.List(context.TODO(), telnyx.SubNumberOrderListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", subNumberOrders.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.subnumberorders.SubNumberOrderListParams;

            import
            com.telnyx.sdk.models.subnumberorders.SubNumberOrderListResponse;


            public final class Main {
                private Main() {}

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

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

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

            sub_number_orders = telnyx.sub_number_orders.list

            puts(sub_number_orders)
        - 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 {
              $subNumberOrders = $client->subNumberOrders->list(
                filter: [
                  'countryCode' => 'US',
                  'orderRequestID' => '12ade33a-21c0-473b-b055-b3c836e1c293',
                  'phoneNumberType' => 'local',
                  'phoneNumbersCount' => 1,
                  'status' => 'status',
                ],
              );

              var_dump($subNumberOrders);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx sub-number-orders list \
              --api-key 'My API Key'
components:
  responses:
    ListSubNumberOrdersResponse:
      description: Successful response with a list of sub number orders.
      content:
        application/json:
          schema:
            type: object
            title: List Sub Number Orders Response
            properties:
              data:
                type: array
                items:
                  $ref: '#/components/schemas/SubNumberOrder'
              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:
    SubNumberOrder:
      properties:
        id:
          type: string
          format: uuid
          example: 12ade33a-21c0-473b-b055-b3c836e1c292
          readOnly: true
        order_request_id:
          type: string
          format: uuid
          example: 12ade33a-21c0-473b-b055-b3c836e1c293
          readOnly: true
        country_code:
          type: string
          example: US
          readOnly: true
        phone_number_type:
          type: string
          example: local
          enum:
            - local
            - toll_free
            - mobile
            - national
            - shared_cost
            - landline
        user_id:
          type: string
          format: uuid
          example: d70873cd-7c98-401a-81b6-b1ae08246995
        regulatory_requirements:
          type: array
          items:
            $ref: '#/components/schemas/SubNumberOrderRegulatoryRequirement'
        record_type:
          type: string
          example: sub_number_order
          readOnly: true
        phone_numbers_count:
          type: integer
          description: The count of phone numbers in the number order.
          example: 1
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: >-
            An ISO 8901 datetime string denoting when the number order was
            created.
          example: '2018-01-01T00:00:00.000000Z'
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: An ISO 8901 datetime string for when the number order was updated.
          example: '2018-01-01T00:00:00.000000Z'
          readOnly: true
        requirements_met:
          type: boolean
          description: >-
            True if all requirements are met for every phone number, false
            otherwise.
          example: true
          readOnly: true
        status:
          type: string
          enum:
            - pending
            - success
            - failure
          description: The status of the order.
          readOnly: true
        customer_reference:
          type: string
          description: A customer reference string for customer look ups.
          example: MY REF 001
        is_block_sub_number_order:
          type: boolean
          description: True if the sub number order is a block sub number order
          example: false
          readOnly: true
      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
    SubNumberOrderRegulatoryRequirement:
      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
      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

````