> ## 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 porting order

> Creates a new porting order object.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/porting-orders.yml post /porting_orders
openapi: 3.1.0
info:
  title: Telnyx Porting Orders API
  version: 2.0.0
  description: API for managing porting order lifecycle.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /porting_orders:
    post:
      tags:
        - Porting Orders
      summary: Create a porting order
      description: Creates a new porting order object.
      operationId: CreatePortingOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePortingOrder'
      responses:
        '201':
          $ref: '#/components/responses/ListDraftPortingOrdersWithoutPagination'
        '401':
          description: Unauthorized
        '422':
          description: Unprocessable entity. Check message field in response for details.
      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 portingOrder = await client.portingOrders.create({
              phone_numbers: ['+13035550000', '+13035550001', '+13035550002'],
            });

            console.log(portingOrder.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
            )
            porting_order = client.porting_orders.create(
                phone_numbers=["+13035550000", "+13035550001", "+13035550002"],
            )
            print(porting_order.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\tportingOrder, err := client.PortingOrders.New(context.TODO(), telnyx.PortingOrderNewParams{\n\t\tPhoneNumbers: []string{\"+13035550000\", \"+13035550001\", \"+13035550002\"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", portingOrder.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.portingorders.PortingOrderCreateParams;

            import
            com.telnyx.sdk.models.portingorders.PortingOrderCreateResponse;

            import java.util.List;


            public final class Main {
                private Main() {}

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

                    PortingOrderCreateParams params = PortingOrderCreateParams.builder()
                        .phoneNumbers(List.of(
                          "+13035550000",
                          "+13035550001",
                          "+13035550002"
                        ))
                        .build();
                    PortingOrderCreateResponse portingOrder = client.portingOrders().create(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            porting_order = telnyx.porting_orders.create(phone_numbers:
            ["+13035550000", "+13035550001", "+13035550002"])


            puts(porting_order)
        - lang: CLI
          source: |-
            telnyx porting-orders create \
              --api-key 'My API Key' \
              --phone-number "'+13035550000'" \
              --phone-number "'+13035550001'" \
              --phone-number "'+13035550002'"
components:
  schemas:
    CreatePortingOrder:
      type: object
      title: CreatePortingOrder
      required:
        - phone_numbers
      properties:
        phone_numbers:
          type: array
          items:
            type: string
          description: The list of +E.164 formatted phone numbers
          example:
            - '+13035550000'
            - '+13035550001'
            - '+13035550002'
        customer_reference:
          type:
            - string
            - 'null'
          description: >-
            A customer-specified reference number for customer bookkeeping
            purposes
          example: Acct 123abc
        customer_group_reference:
          type: string
          description: >-
            A customer-specified group reference for customer bookkeeping
            purposes
          example: Group-456
    PortingOrder:
      type: object
      properties:
        id:
          description: Uniquely identifies this porting order
          type: string
          format: uuid
          example: f1486bae-f067-460c-ad43-73a92848f902
          readOnly: true
        customer_reference:
          type:
            - string
            - 'null'
          description: >-
            A customer-specified reference number for customer bookkeeping
            purposes
          example: Acct 123abc
        customer_group_reference:
          type:
            - string
            - 'null'
          description: >-
            A customer-specified group reference for customer bookkeeping
            purposes
          example: Group-456
        created_at:
          type: string
          format: date-time
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2021-03-19T10:07:15.527Z'
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2021-03-19T10:07:15.527Z'
          readOnly: true
        status:
          $ref: '#/components/schemas/PortingOrderStatus'
        support_key:
          type:
            - string
            - 'null'
          description: >-
            A key to reference this porting order when contacting Telnyx
            customer support. This information is not available in draft porting
            orders.
          example: sr_123abc
          readOnly: true
        parent_support_key:
          type:
            - string
            - 'null'
          description: >-
            A key to reference for the porting order group when contacting
            Telnyx customer support. This information is not available for
            porting orders in `draft` state
          example: pr_123abc
          readOnly: true
        porting_phone_numbers_count:
          type: integer
          description: Count of phone numbers associated with this porting order
          example: 1
          readOnly: true
        old_service_provider_ocn:
          type: string
          description: Identifies the old service provider
          example: Unreal Communications
          readOnly: true
        phone_numbers:
          type: array
          description: List of phone numbers associated with this porting order
          items:
            $ref: '#/components/schemas/PortingPhoneNumber'
        documents:
          $ref: '#/components/schemas/PortingOrderDocuments'
        misc:
          anyOf:
            - $ref: '#/components/schemas/PortingOrderMisc'
            - type: 'null'
        end_user:
          $ref: '#/components/schemas/PortingOrderEndUser'
        activation_settings:
          $ref: '#/components/schemas/PortingOrderActivationSettings'
        phone_number_configuration:
          $ref: '#/components/schemas/PortingOrderPhoneNumberConfiguration'
        phone_number_type:
          type: string
          description: The type of the phone number
          enum:
            - landline
            - local
            - mobile
            - national
            - shared_cost
            - toll_free
          example: local
        description:
          type: string
          description: A description of the porting order
          example: FP Telnyx
          readOnly: true
        requirements:
          type: array
          description: >-
            List of documentation requirements for porting numbers. Can be set
            directly or via the `requirement_group_id` parameter.
          items:
            $ref: '#/components/schemas/PortingOrderRequirement'
        requirements_met:
          type: boolean
          description: Is true when the required documentation is met
          example: false
        user_feedback:
          $ref: '#/components/schemas/PortingOrderUserFeedback'
        user_id:
          type: string
          format: uuid
          description: >-
            Identifies the user (or organization) who requested the porting
            order
          example: 40d68ba2-0847-4df2-be9c-b0e0cb673e75
        webhook_url:
          type:
            - string
            - 'null'
          format: uri
          example: https://example.com/porting_webhooks
        record_type:
          type: string
          example: porting_order
          description: Identifies the type of the resource.
          readOnly: true
        messaging:
          $ref: '#/components/schemas/PortingOrderMessaging'
        additional_steps:
          type: array
          description: >-
            For specific porting orders, we may require additional steps to be
            taken before submitting the porting order.
          items:
            type: string
            enum:
              - associated_phone_numbers
              - phone_number_verification_codes
    PortingOrderStatus:
      type: object
      description: Porting order status
      properties:
        details:
          type: array
          items:
            $ref: '#/components/schemas/PortingOrdersExceptionType'
          description: A list of 0 or more details about this porting order's status
        value:
          type: string
          description: The current status of the porting order
          example: ported
          enum:
            - draft
            - in-process
            - submitted
            - exception
            - foc-date-confirmed
            - ported
            - cancelled
            - cancel-pending
    PortingPhoneNumber:
      type: object
      properties:
        porting_order_status:
          type: string
          description: The current status of the porting order
          enum:
            - draft
            - in-process
            - submitted
            - exception
            - foc-date-confirmed
            - cancel-pending
            - ported
            - cancelled
          example: in-process
        phone_number_type:
          type: string
          description: The type of the phone number
          enum:
            - landline
            - local
            - mobile
            - national
            - shared_cost
            - toll_free
          example: local
        phone_number:
          type: string
          description: E164 formatted phone number
          example: '13035550987'
        porting_order_id:
          type: string
          format: uuid
          description: Identifies the associated port request
          example: f1486bae-f067-460c-ad43-73a92848f902
        support_key:
          type: string
          description: >-
            A key to reference this porting order when contacting Telnyx
            customer support
          example: sr_a12345
        activation_status:
          $ref: '#/components/schemas/PortingOrderActivationStatus'
        portability_status:
          $ref: '#/components/schemas/PortabilityStatus'
        requirements_status:
          type: string
          description: The current status of the requirements in a INTL porting order
          enum:
            - requirement-info-pending
            - requirement-info-under-review
            - requirement-info-exception
            - approved
          example: approved
        record_type:
          type: string
          example: porting_phone_number
          description: Identifies the type of the resource.
          readOnly: true
    PortingOrderDocuments:
      type: object
      description: Can be specified directly or via the `requirement_group_id` parameter.
      properties:
        loa:
          type:
            - string
            - 'null'
          format: uuid
          description: Returned ID of the submitted LOA via the Documents endpoint
          example: 64ffb720-04c7-455b-92d6-20fcca92e935
        invoice:
          type:
            - string
            - 'null'
          format: uuid
          description: Returned ID of the submitted Invoice via the Documents endpoint
          example: ce74b771-d23d-4960-81ec-8741b3862146
    PortingOrderMisc:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/PortingOrderType'
        remaining_numbers_action:
          type:
            - string
            - 'null'
          description: >-
            Remaining numbers can be either kept with their current service
            provider or disconnected. 'new_billing_telephone_number' is required
            when 'remaining_numbers_action' is 'keep'.
          enum:
            - keep
            - disconnect
            - null
          example: disconnect
        new_billing_phone_number:
          type:
            - string
            - 'null'
          description: >-
            New billing phone number for the remaining numbers. Used in case the
            current billing phone number is being ported to Telnyx. This will be
            set on your account with your current service provider and should be
            one of the numbers remaining on that account.
    PortingOrderEndUser:
      type: object
      properties:
        admin:
          $ref: '#/components/schemas/PortingOrderEndUserAdmin'
        location:
          $ref: '#/components/schemas/PortingOrderEndUserLocation'
    PortingOrderActivationSettings:
      type: object
      properties:
        foc_datetime_requested:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 formatted Date/Time requested for the FOC date
          example: '2021-03-19T10:07:15.527Z'
        foc_datetime_actual:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 formatted Date/Time of the FOC date
          example: '2021-03-19T10:07:15.527Z'
        fast_port_eligible:
          type: boolean
          readOnly: true
          description: Indicates whether this porting order is eligible for FastPort
          example: true
        activation_status:
          anyOf:
            - $ref: '#/components/schemas/PortingOrderActivationStatus'
            - type: 'null'
    PortingOrderPhoneNumberConfiguration:
      type: object
      properties:
        billing_group_id:
          type:
            - string
            - 'null'
          description: identifies the billing group to set on the numbers when ported
          example: f1486bae-f067-460c-ad43-73a92848f902
        connection_id:
          type:
            - string
            - 'null'
          description: identifies the connection to set on the numbers when ported
          example: f1486bae-f067-460c-ad43-73a92848f902
        messaging_profile_id:
          type:
            - string
            - 'null'
          description: identifies the messaging profile to set on the numbers when ported
          example: f1486bae-f067-460c-ad43-73a92848f901
        emergency_address_id:
          type:
            - string
            - 'null'
          description: identifies the emergency address to set on the numbers when ported
          example: f1486bae-f067-460c-ad43-73a92848f902
        tags:
          type: array
          items:
            type: string
            description: Tag to set on the numbers when ported
          example:
            - abc
            - '123'
    PortingOrderRequirement:
      type: object
      properties:
        field_type:
          type: string
          description: Type of value expected on field_value field
          enum:
            - document
          example: document
        field_value:
          type: string
          description: identifies the document that satisfies this requirement
          example: 9787fb5f-cbe5-4de4-b765-3303774ee9fe
        requirement_type_id:
          type: string
          description: Identifies the requirement type that meets this requirement
          example: 59b0762a-b274-4f76-ac32-4d5cf0272e66
        record_type:
          type: string
          description: Identifies the type of the resource.
          example: porting_requirement
    PortingOrderUserFeedback:
      type: object
      properties:
        user_rating:
          type:
            - integer
            - 'null'
          description: >-
            Once an order is ported, cancellation is requested or the request is
            cancelled, the user may rate their experience
          example: 5
        user_comment:
          type:
            - string
            - 'null'
          description: A comment related to the customer rating.
          example: I loved my experience porting numbers with Telnyx
    PortingOrderMessaging:
      type: object
      description: Information about messaging porting process.
      properties:
        messaging_capable:
          type: boolean
          description: >-
            Indicates whether the porting order can also port messaging
            capabilities.
          example: true
        enable_messaging:
          type: boolean
          description: >-
            Indicates whether Telnyx will port messaging capabilities from the
            losing carrier. If false, any messaging capabilities will stay with
            their current provider.
          example: true
        messaging_port_status:
          type: string
          description: The current status of the messaging porting.
          enum:
            - not_applicable
            - pending
            - activating
            - exception
            - canceled
            - partial_port_complete
            - ported
          example: pending
        messaging_port_completed:
          type: boolean
          description: Indicates whether the messaging porting has been completed.
          example: false
    PortingOrdersExceptionType:
      type: object
      properties:
        code:
          type: string
          description: Identifier of an exception type
          enum:
            - ACCOUNT_NUMBER_MISMATCH
            - AUTH_PERSON_MISMATCH
            - BTN_ATN_MISMATCH
            - ENTITY_NAME_MISMATCH
            - FOC_EXPIRED
            - FOC_REJECTED
            - LOCATION_MISMATCH
            - LSR_PENDING
            - MAIN_BTN_PORTING
            - OSP_IRRESPONSIVE
            - OTHER
            - PASSCODE_PIN_INVALID
            - PHONE_NUMBER_HAS_SPECIAL_FEATURE
            - PHONE_NUMBER_MISMATCH
            - PHONE_NUMBER_NOT_PORTABLE
            - PORT_TYPE_INCORRECT
            - PORTING_ORDER_SPLIT_REQUIRED
            - POSTAL_CODE_MISMATCH
            - RATE_CENTER_NOT_PORTABLE
            - SV_CONFLICT
            - SV_UNKNOWN_FAILURE
          example: ENTITY_NAME_MISMATCH
        description:
          type: string
          description: Description of an exception type
          example: Entity name does not match that on the CSR
    PortingOrderActivationStatus:
      type: string
      description: Activation status
      enum:
        - New
        - Pending
        - Conflict
        - Cancel Pending
        - Failed
        - Concurred
        - Activate RDY
        - Disconnect Pending
        - Concurrence Sent
        - Old
        - Sending
        - Active
        - Cancelled
      example: Active
    PortabilityStatus:
      type: string
      description: >-
        Specifies whether Telnyx is able to confirm portability this number in
        the United States & Canada. International phone numbers are provisional
        by default.
      enum:
        - pending
        - confirmed
        - provisional
      example: confirmed
    PortingOrderType:
      type: string
      description: >-
        A port can be either 'full' or 'partial'. When type is 'full' the other
        attributes should be omitted.
      enum:
        - full
        - partial
      example: full
    PortingOrderEndUserAdmin:
      type: object
      properties:
        entity_name:
          type:
            - string
            - 'null'
          description: Person Name or Company name requesting the port
          example: Porter McPortersen
        auth_person_name:
          type:
            - string
            - 'null'
          description: Name of person authorizing the porting order
          example: Porter McPortersen II
        billing_phone_number:
          type:
            - string
            - 'null'
          description: Billing phone number associated with these phone numbers
          example: '13035551234'
        account_number:
          type:
            - string
            - 'null'
          description: >-
            The authorized person's account number with the current service
            provider
          example: 123abc
        tax_identifier:
          type:
            - string
            - 'null'
          description: >-
            European tax identification number. Applicable only in the European
            Union
          example: 1234abcd
        pin_passcode:
          type:
            - string
            - 'null'
          description: >-
            PIN/passcode possibly required by the old service provider for extra
            verification
          example: '1234'
        business_identifier:
          type:
            - string
            - 'null'
          description: >-
            European business identification number. Applicable only in the
            European Union
          example: abc123
    PortingOrderEndUserLocation:
      type: object
      properties:
        street_address:
          type:
            - string
            - 'null'
          description: First line of billing address
          example: 600 Congress Avenue
        extended_address:
          type:
            - string
            - 'null'
          description: Second line of billing address
          example: 14th Floor
        locality:
          type:
            - string
            - 'null'
          description: City or municipality of billing address
          example: Austin
        administrative_area:
          type:
            - string
            - 'null'
          description: State, province, or similar of billing address
          example: TX
        postal_code:
          type:
            - string
            - 'null'
          description: Postal Code of billing address
          example: '78701'
        country_code:
          type:
            - string
            - 'null'
          description: ISO3166-1 alpha-2 country code of billing address
          example: US
  responses:
    ListDraftPortingOrdersWithoutPagination:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  $ref: '#/components/schemas/PortingOrder'
            example:
              data:
                - activation_settings:
                    activation_status: null
                    fast_port_eligible: true
                    foc_datetime_actual: null
                    foc_datetime_requested: null
                  created_at: '2022-03-17T18:01:01Z'
                  customer_reference: null
                  customer_group_reference: null
                  description: FP Telnyx
                  documents:
                    loa: null
                    invoice: null
                  end_user:
                    admin:
                      account_number: null
                      auth_person_name: null
                      billing_phone_number: null
                      business_identifier: null
                      entity_name: null
                      pin_passcode: null
                      tax_identifier: null
                    location:
                      administrative_area: null
                      country_code: null
                      extended_address: null
                      locality: null
                      postal_code: null
                      street_address: null
                  id: b0ea6d6f-de31-4079-a536-992e0c98b037
                  misc: null
                  old_service_provider_ocn: Unreal Communications
                  parent_support_key: null
                  phone_number_configuration:
                    billing_group_id: null
                    connection_id: null
                    emergency_address_id: null
                    messaging_profile_id: null
                    tags: []
                  phone_number_type: local
                  phone_numbers:
                    - activation_status: Activate RDY
                      phone_number: '{e.164 TN}'
                      phone_number_type: local
                      portability_status: confirmed
                      porting_order_id: b0ea6d6f-de31-4079-a536-992e0c98b037
                      porting_order_status: draft
                      record_type: porting_phone_number
                      requirements_status: requirement-info-pending
                      support_key: sr_10b316
                  porting_phone_numbers_count: 1
                  record_type: porting_order
                  requirements: []
                  requirements_met: false
                  status:
                    details: []
                    value: draft
                  support_key: null
                  updated_at: '2022-03-17T18:01:01Z'
                  user_feedback:
                    user_comment: null
                    user_rating: null
                  messaging:
                    messaging_capable: true
                    enable_messaging: false
                    messaging_port_status: not_applicable
                    messaging_port_completed: false
                  user_id: 40d68ba2-0847-4df2-be9c-b0e0cb673e75
                  webhook_url: null
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````