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

# Create a sub number orders report

> Create a CSV report for sub number orders. The report will be generated asynchronously and can be downloaded once complete.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/ordering.yml post /sub_number_orders/report
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/report:
    post:
      tags:
        - Phone Number Orders
      summary: Create a sub number orders report
      description: >-
        Create a CSV report for sub number orders. The report will be generated
        asynchronously and can be downloaded once complete.
      operationId: CreateSubNumberOrdersReport
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubNumberOrdersReportRequest'
      responses:
        '202':
          $ref: '#/components/responses/SubNumberOrdersReportResponse'
        '400':
          $ref: '#/components/responses/numbers_BadRequestResponse'
        '401':
          $ref: '#/components/responses/numbers_UnauthorizedResponse'
        '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 subNumberOrdersReport = await
            client.subNumberOrdersReport.create();


            console.log(subNumberOrdersReport.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_report = client.sub_number_orders_report.create()
            print(sub_number_orders_report.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\tsubNumberOrdersReport, err := client.SubNumberOrdersReport.New(context.TODO(), telnyx.SubNumberOrdersReportNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", subNumberOrdersReport.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.subnumberordersreport.SubNumberOrdersReportCreateParams;

            import
            com.telnyx.sdk.models.subnumberordersreport.SubNumberOrdersReportCreateResponse;


            public final class Main {
                private Main() {}

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

                    SubNumberOrdersReportCreateResponse subNumberOrdersReport = client.subNumberOrdersReport().create();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            sub_number_orders_report = telnyx.sub_number_orders_report.create

            puts(sub_number_orders_report)
        - 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 {
              $subNumberOrdersReport = $client->subNumberOrdersReport->create(
                countryCode: 'US',
                createdAtGt: new \DateTimeImmutable('2023-04-05T10:22:08.230549Z'),
                createdAtLt: new \DateTimeImmutable('2025-06-05T10:22:08.230549Z'),
                customerReference: 'STRING',
                orderRequestID: '12ade33a-21c0-473b-b055-b3c836e1c293',
                status: 'success',
              );

              var_dump($subNumberOrdersReport);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx sub-number-orders-report create \
              --api-key 'My API Key'
components:
  schemas:
    CreateSubNumberOrdersReportRequest:
      type: object
      properties:
        status:
          type: string
          description: Filter by order status
          enum:
            - pending
            - success
            - failure
          example: success
        country_code:
          type: string
          description: Filter by country code
          example: US
        created_at_gt:
          type: string
          format: date-time
          description: Filter for orders created after this date
          example: '2023-04-05T10:22:08.230549Z'
        created_at_lt:
          type: string
          format: date-time
          description: Filter for orders created before this date
          example: '2025-06-05T10:22:08.230549Z'
        order_request_id:
          type: string
          format: uuid
          description: Filter by specific order request ID
          example: 12ade33a-21c0-473b-b055-b3c836e1c293
        customer_reference:
          type: string
          description: Filter by customer reference
          example: STRING
      example:
        status: success
        country_code: US
        created_at_gt: '2023-04-05T10:22:08.230549Z'
        created_at_lt: '2025-06-05T10:22:08.230549Z'
        order_request_id: 12ade33a-21c0-473b-b055-b3c836e1c293
        customer_reference: STRING
    SubNumberOrdersReport:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: cada7e84-122b-4b47-bc66-58c7c3becd40
          description: Identifies the resource.
          readOnly: true
        order_type:
          type: string
          example: sub_number_order
          description: The type of order report.
          readOnly: true
        filters:
          type: object
          description: The filters that were applied to generate this report
          properties:
            status:
              type: string
              example: success
            country_code:
              type: string
              example: US
            created_at_gt:
              type: string
              format: date-time
              example: '2023-04-05T10:22:08.230549Z'
            created_at_lt:
              type: string
              format: date-time
              example: '2025-06-05T10:22:08.230549Z'
            order_request_id:
              type: string
              format: uuid
              example: 991b8ff5-4daf-4826-9a22-e3991b444a9c
            customer_reference:
              type: string
              example: STRING
        status:
          type: string
          enum:
            - pending
            - success
            - failed
            - expired
          default: pending
          example: pending
          description: >-
            Indicates the completion level of the sub number orders report. The
            report must have a status of 'success' before it can be downloaded.
        user_id:
          type: string
          format: uuid
          example: 0d7ef697-df19-413a-b724-56b0539f5397
          description: The ID of the user who created the report.
          readOnly: true
        created_at:
          type: string
          format: date-time
          example: '2025-06-11T13:21:40.967339+00:00'
          description: ISO 8601 formatted date indicating when the resource was created.
          readOnly: true
        updated_at:
          type: string
          format: date-time
          example: '2025-06-11T13:21:45.753260+00:00'
          description: ISO 8601 formatted date indicating when the resource was updated.
          readOnly: true
      example:
        order_type: sub_number_order
        filters:
          status: success
          country_code: US
          created_at_gt: '2023-04-05T10:22:08.230549Z'
          created_at_lt: '2025-06-05T10:22:08.230549Z'
          order_request_id: 991b8ff5-4daf-4826-9a22-e3991b444a9c
          customer_reference: STRING
        status: pending
        created_at: '2025-06-11T13:21:40.967339+00:00'
        user_id: 0d7ef697-df19-413a-b724-56b0539f5397
        updated_at: '2025-06-11T13:21:45.753260+00:00'
        id: cada7e84-122b-4b47-bc66-58c7c3becd40
    numbers_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/numbers_Error'
      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
  responses:
    SubNumberOrdersReportResponse:
      description: Sub number orders report response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/SubNumberOrdersReport'
    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_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'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````