Skip to main content
POST
/
sim_card_order_preview
JavaScript
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);
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)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.SimCardOrderPreview.Preview(context.TODO(), telnyx.SimCardOrderPreviewPreviewParams{
AddressID: "1293384261075731499",
Quantity: 21,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
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);
}
}
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)
<?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();
}
telnyx sim-card-order-preview preview \
--api-key 'My API Key' \
--address-id 1293384261075731499 \
--quantity 21
curl --request POST \
--url https://api.telnyx.com/v2/sim_card_order_preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quantity": 21,
"address_id": "1293384261075731499"
}
'
{
  "data": {
    "total_cost": {
      "amount": "2.32",
      "currency": "USD"
    },
    "shipping_cost": {
      "amount": "2.32",
      "currency": "USD"
    },
    "sim_cards_cost": {
      "amount": "2.32",
      "currency": "USD"
    },
    "record_type": "sim_card_order_preview",
    "quantity": 21
  }
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
quantity
integer
required

The amount of SIM cards that the user would like to purchase in the SIM card order.

Required range: x >= 1
Example:

21

address_id
string
required

Uniquely identifies the address for the order.

Example:

"1293384261075731499"

Response

Successful Response

data
SIMCardOrderPreview · object