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

# Update Advanced Order



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/ordering.yml patch /advanced_orders/{advanced-order-id}/requirement_group
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/{advanced-order-id}/requirement_group:
    patch:
      tags:
        - Advanced Number Orders
      summary: Update Advanced Order
      operationId: update_advanced_order_v2
      parameters:
        - name: advanced-order-id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Order Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdvancedOrderRequest'
      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 response = await client.advancedOrders.updateRequirementGroup(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );

            console.log(response.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
            )
            response = client.advanced_orders.update_requirement_group(
                advanced_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.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\tresponse, err := client.AdvancedOrders.UpdateRequirementGroup(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\ttelnyx.AdvancedOrderUpdateRequirementGroupParams{\n\t\t\tAdvancedOrder: telnyx.AdvancedOrderParam{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.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.AdvancedOrder;

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

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


            public final class Main {
                private Main() {}

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

                    AdvancedOrderUpdateRequirementGroupParams params = AdvancedOrderUpdateRequirementGroupParams.builder()
                        .advancedOrderId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                        .advancedOrder(AdvancedOrder.builder().build())
                        .build();
                    AdvancedOrderUpdateRequirementGroupResponse response = client.advancedOrders().updateRequirementGroup(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


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


            puts(response)
        - 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 {
              $response = $client->advancedOrders->updateRequirementGroup(
                '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
                areaCode: 'xxx',
                comments: 'comments',
                countryCode: 'xx',
                customerReference: 'customer_reference',
                features: ['sms'],
                phoneNumberType: 'local',
                quantity: 1,
                requirementGroupID: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx advanced-orders update-requirement-group \
              --api-key 'My API Key' \
              --advanced-order-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
components:
  schemas:
    AdvancedOrderRequest:
      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:
          type: string
          enum:
            - local
            - mobile
            - toll_free
            - shared_cost
            - national
            - landline
          default: local
        features:
          items:
            enum:
              - sms
              - mms
              - voice
              - fax
              - emergency
          type: array
          uniqueItems: true
          title: Features
        customer_reference:
          type: string
          title: Customer Reference
          default: ''
        requirement_group_id:
          type: string
          format: uuid
          title: Requirement Group ID
          description: >-
            The ID of the requirement group to associate with this advanced
            order
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      type: object
      title: AdvancedOrderRequest
    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
  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'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````