> ## 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 https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/wireless/sim-cards-provisioning.yml post /sim_card_order_preview
openapi: 3.1.0
info:
  title: SIM Cards Provisioning API
  version: 2.0.0
  description: >-
    SIM card ordering, registration, and provisioning actions including enable,
    disable, and standby.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
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':
          $ref: '#/components/responses/SIMCardOrdersPreviewResponse'
        '422':
          $ref: '#/components/responses/wireless_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:
  responses:
    SIMCardOrdersPreviewResponse:
      description: Successful Response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/SIMCardOrderPreview'
    wireless_UnprocessableEntity:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/wireless_Errors'
  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
    wireless_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/wireless_Error'
      type: object
    wireless_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
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````