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

# Preview SIM card orders

> Preview SIM card order purchases.



## OpenAPI

````yaml /openapi/source/external/wireless/wireless.json post /sim_card_order_preview
openapi: 3.1.0
info:
  version: 2.0.0
  title: Telnyx API
  x-latency-category: responsive
  x-endpoint-cost: light
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API.
security:
  - bearerAuth: []
tags:
  - name: Wireless
    description: Wireless operations
  - name: SIM Cards
    description: SIM Cards operations
  - name: SIM Card Actions
    description: >-
      View SIM card actions, their progress and timestamps using the SIM Card
      Actions API
  - name: SIM Card Groups
    description: SIM Card Groups operations
  - name: SIM Card Group Actions
    description: SIM Card Group actions operations
  - name: SIM Card Orders
    description: SIM Card Orders operations
  - name: Reporting
    description: Wireless reporting operations
  - name: Wireless Regions
    description: Regions for wireless services
  - name: OTA updates
    description: OTA updates operations
  - name: Mobile Network Operators
    description: Mobile network operators operations
  - name: Private Wireless Gateways
    description: Private Wireless Gateways operations
  - name: Wireless Blocklists
    description: Wireless Blocklists operations
  - name: Traffic Policy Profiles
    description: Traffic Policy Profiles operations
paths:
  /sim_card_order_preview:
    post:
      tags:
        - SIM Card Orders
      summary: Preview SIM card orders
      description: Preview SIM card order purchases.
      operationId: PreviewSimCardOrders
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - quantity
                - address_id
              properties:
                quantity:
                  type: integer
                  minimum: 1
                  description: >-
                    The amount of SIM cards that the user would like to purchase
                    in the SIM card order.
                  example: 21
                address_id:
                  type: string
                  description: Uniquely identifies the address for the order.
                  example: '1293384261075731499'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SIMCardOrderPreview'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
      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.simCardOrderPreview.preview({
              address_id: '1293384261075731499',
              quantity: 21,
            });

            console.log(response.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
            )
            response = client.sim_card_order_preview.preview(
                address_id="1293384261075731499",
                quantity=21,
            )
            print(response.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\tresponse, err := client.SimCardOrderPreview.Preview(context.TODO(), telnyx.SimCardOrderPreviewPreviewParams{\n\t\tAddressID: \"1293384261075731499\",\n\t\tQuantity:  21,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.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.simcardorderpreview.SimCardOrderPreviewPreviewParams;

            import
            com.telnyx.sdk.models.simcardorderpreview.SimCardOrderPreviewPreviewResponse;


            public final class Main {
                private Main() {}

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

                    SimCardOrderPreviewPreviewParams params = SimCardOrderPreviewPreviewParams.builder()
                        .addressId("1293384261075731499")
                        .quantity(21L)
                        .build();
                    SimCardOrderPreviewPreviewResponse response = client.simCardOrderPreview().preview(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            response = telnyx.sim_card_order_preview.preview(address_id:
            "1293384261075731499", quantity: 21)


            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->simCardOrderPreview->preview(
                addressID: '1293384261075731499', quantity: 21
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx sim-card-order-preview preview \
              --api-key 'My API Key' \
              --address-id 1293384261075731499 \
              --quantity 21
components:
  schemas:
    SIMCardOrderPreview:
      title: SIMCardOrderPreview
      type: object
      properties:
        total_cost:
          type: object
          properties:
            amount:
              type: string
              description: A string representing the cost amount.
              example: '2.32'
            currency:
              type: string
              description: ISO 4217 currency string.
              example: USD
        shipping_cost:
          type: object
          properties:
            amount:
              type: string
              description: A string representing the cost amount.
              example: '2.32'
            currency:
              type: string
              description: ISO 4217 currency string.
              example: USD
        sim_cards_cost:
          type: object
          properties:
            amount:
              type: string
              description: A string representing the cost amount.
              example: '2.32'
            currency:
              type: string
              description: ISO 4217 currency string.
              example: USD
        record_type:
          type: string
          description: Identifies the type of the resource.
          example: sim_card_order_preview
          readOnly: true
        quantity:
          type: integer
          description: The amount of SIM cards requested in the SIM card order.
          example: 21
    Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      type: object
    Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
  responses:
    UnprocessableEntity:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
          examples:
            unprocessableEntity:
              summary: Request could not be processed
              value:
                errors:
                  - code: '10027'
                    title: Unprocessable Entity
                    detail: >-
                      The server understood the syntax of the request but was
                      unable to process the instructions.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````