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

# Get Advanced Order



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/ordering.yml get /advanced_orders/{order_id}
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:
  /advanced_orders/{order_id}:
    get:
      tags:
        - Advanced Number Orders
      summary: Get Advanced Order
      operationId: get_advanced_order_v2
      parameters:
        - name: order_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Order Id
      responses:
        '200':
          $ref: '#/components/responses/AdvancedOrderResponse'
        '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 advancedOrder = await
            client.advancedOrders.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(advancedOrder.id);
        - 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
            )
            advanced_order = client.advanced_orders.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(advanced_order.id)
        - 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\tadvancedOrder, err := client.AdvancedOrders.Get(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", advancedOrder.ID)\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.advancedorders.AdvancedOrderRetrieveParams;

            import
            com.telnyx.sdk.models.advancedorders.AdvancedOrderRetrieveResponse;


            public final class Main {
                private Main() {}

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

                    AdvancedOrderRetrieveResponse advancedOrder = client.advancedOrders().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            advanced_order =
            telnyx.advanced_orders.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")


            puts(advanced_order)
        - 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 {
              $advancedOrder = $client->advancedOrders->retrieve(
                '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'
              );

              var_dump($advancedOrder);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx advanced-orders retrieve \
              --api-key 'My API Key' \
              --order-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
components:
  responses:
    AdvancedOrderResponse:
      description: An Advanced Order Response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AdvancedOrder'
    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:
    AdvancedOrder:
      type: object
      title: Advanced Order
      properties:
        country_code:
          type: string
          maxLength: 2
          minLength: 2
          title: Country Code
          default: US
        comments:
          type: string
          maxLength: 255
          title: Comments
          default: ''
        quantity:
          type: integer
          maximum: 10000
          minimum: 1
          title: Quantity
          default: 1
        area_code:
          type: string
          maxLength: 3
          title: Area Code
          default: ''
        phone_number_type:
          items:
            enum:
              - local
              - mobile
              - toll_free
              - shared_cost
              - national
              - landline
          default: ''
        features:
          items:
            enum:
              - sms
              - mms
              - voice
              - fax
              - emergency
          type: array
          uniqueItems: true
          title: Features
        customer_reference:
          type: string
          title: Customer Reference
          default: ''
        id:
          type: string
          format: uuid
          title: Id
        status:
          items:
            type: string
            enum:
              - pending
              - processing
              - ordered
        orders:
          items:
            type: string
            format: uuid
          type: array
          uniqueItems: true
          title: Orders
        requirement_group_id:
          type: string
          format: uuid
          title: Requirement Group ID
          description: The ID of the requirement group associated with this advanced order
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
    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
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````