SIM Card Orders API

SIM Card Orders operations API

Preview SIM card orders

Preview SIM card order purchases.

SecuritybearerAuth
Request
Request Body schema: application/json
address_id
required
string <int64>

Uniquely identifies the address for the order.

quantity
required
integer >= 1

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

Responses
202

Successful response

Response Schema: application/json
object (SIMCardOrderPreview)
quantity
integer

The amount of SIM cards requested in the SIM card order.

record_type
string

Identifies the type of the resource.

object
object
object
422

Unprocessable entity. Check the 'detail' field in response for details.

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
post/sim_card_order_preview
Request samples
application/json
{
  • "address_id": "1293384261075731499",
  • "quantity": 21
}
Response samples
application/json
{
  • "data": {
    • "quantity": 21,
    • "record_type": "sim_card_order_preview",
    • "shipping_cost": {
      • "amount": "2.32",
      • "currency": "USD"
      },
    • "sim_cards_cost": {
      • "amount": "2.32",
      • "currency": "USD"
      },
    • "total_cost": {
      • "amount": "2.32",
      • "currency": "USD"
      }
    }
}

Get all SIM card orders

Get all SIM card orders according to filters.

SecuritybearerAuth
Request
query Parameters
filter[created_at]
string <datetime>

Filter by ISO 8601 formatted date-time string matching resource creation date-time.

Example: filter[created_at]=2018-02-02T22:25:27.521Z
filter[updated_at]
string <datetime>

Filter by ISO 8601 formatted date-time string matching resource last update date-time.

Example: filter[updated_at]=2018-02-02T22:25:27.521Z
filter[quantity]
integer

Filter orders by how many SIM cards were ordered.

Example: filter[quantity]=21
filter[cost.amount]
string

The total monetary amount of the order.

Example: filter[cost.amount]=2.53
filter[cost.currency]
string

Filter by ISO 4217 currency string.

Example: filter[cost.currency]=USD
filter[address.id]
string <int64>

Uniquely identifies the address for the order.

Example: filter[address.id]=1293384261075731499
filter[address.street_address]
string

Returns entries with matching name of the street where the address is located.

Example: filter[address.street_address]=311 W Superior St
filter[address.extended_address]
string

Returns entries with matching name of the supplemental field for address information.

Example: filter[address.extended_address]=Suite 504
filter[address.locality]
string

Filter by the name of the city where the address is located.

Example: filter[address.locality]=Chicago
filter[address.administrative_area]
string

Filter by state or province where the address is located.

Example: filter[address.administrative_area]=IL
filter[address.country_code]
string

Filter by the mobile operator two-character (ISO 3166-1 alpha-2) origin country code.

Example: filter[address.country_code]=US
filter[address.postal_code]
string

Filter by postal code for the address.

Example: filter[address.postal_code]=60654
page[number]
integer >= 1
Default: 1

The page number to load

page[size]
integer [ 1 .. 250 ]
Default: 20

The size of the page

Responses
200

Successful response

Response Schema: application/json
Array of objects (SIMCardOrder)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/sim_card_orders
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.SimCardOrder.list(filter={"created_at":"2018-02-02T22:25:27.521Z","updated_at":"2018-02-02T22:25:27.521Z"})
Response samples
application/json
{
  • "data": [
    • {
      • "cost": {
        • "amount": "2.52",
        • "currency": "USD"
        },
      • "created_at": "2018-02-02T22:25:27.521Z",
      • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
      • "order_address": {
        • "administrative_area": "IL",
        • "country_code": "US",
        • "extended_address": "Suite 504",
        • "id": "1293384261075731499",
        • "locality": "Chicago",
        • "postal_code": "60654",
        • "street_address": "311 W Superior St"
        },
      • "quantity": 21,
      • "record_type": "sim_card_order",
      • "status": "pending",
      • "tracking_url": "http://www.example.com/",
      • "updated_at": "2018-02-02T22:25:27.521Z"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Create a SIM card order

Creates a new order for SIM cards.

SecuritybearerAuth
Request
Request Body schema: application/json
required
address_id
required
string <int64>

Uniquely identifies the address for the order.

quantity
required
integer >= 1

The amount of SIM cards to order.

Responses
200

Successful Response

Response Schema: application/json
object (SIMCardOrder)
object

An object representing the total cost of the order.

created_at
string

ISO 8601 formatted date-time indicating when the resource was last created.

id
string <uuid>

Identifies the resource.

object

An object representing the address information from when the order was submitted.

quantity
integer >= 1

The amount of SIM cards requested in the SIM card order.

record_type
string

Identifies the type of the resource.

status
string

The current status of the SIM Card order.

  • pending - the order is waiting to be processed.
  • processing - the order is currently being processed.
  • ready_to_ship - the order is ready to be shipped to the specified address.
  • shipped - the order was shipped and is on its way to be delivered to the specified address.
  • delivered - the order was delivered to the specified address.
  • canceled - the order was canceled.

Enum: "pending" "processing" "ready_to_ship" "shipped" "delivered" "canceled"
tracking_url
string <url>

The URL used to get tracking information about the order.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was last updated.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
post/sim_card_orders
Request samples
application/json
{
  • "address_id": "1293384261075731499",
  • "quantity": 23
}
Response samples
application/json
{
  • "data": {
    • "cost": {
      • "amount": "2.52",
      • "currency": "USD"
      },
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "order_address": {
      • "administrative_area": "IL",
      • "country_code": "US",
      • "extended_address": "Suite 504",
      • "id": "1293384261075731499",
      • "locality": "Chicago",
      • "postal_code": "60654",
      • "street_address": "311 W Superior St"
      },
    • "quantity": 21,
    • "record_type": "sim_card_order",
    • "status": "pending",
    • "tracking_url": "http://www.example.com/",
    • "updated_at": "2018-02-02T22:25:27.521Z"
    }
}

Get a single SIM card order

Get a single SIM card order by its ID.

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

Identifies the resource.

Example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
Responses
200

Successful Response

Response Schema: application/json
object (SIMCardOrder)
object

An object representing the total cost of the order.

created_at
string

ISO 8601 formatted date-time indicating when the resource was last created.

id
string <uuid>

Identifies the resource.

object

An object representing the address information from when the order was submitted.

quantity
integer >= 1

The amount of SIM cards requested in the SIM card order.

record_type
string

Identifies the type of the resource.

status
string

The current status of the SIM Card order.

  • pending - the order is waiting to be processed.
  • processing - the order is currently being processed.
  • ready_to_ship - the order is ready to be shipped to the specified address.
  • shipped - the order was shipped and is on its way to be delivered to the specified address.
  • delivered - the order was delivered to the specified address.
  • canceled - the order was canceled.

Enum: "pending" "processing" "ready_to_ship" "shipped" "delivered" "canceled"
tracking_url
string <url>

The URL used to get tracking information about the order.

updated_at
string

ISO 8601 formatted date-time indicating when the resource was last updated.

404

Resource not found

Response Schema: application/json
code
required
string <int>
detail
string
meta
object
object
title
required
string
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/sim_card_orders/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.SimCardOrder.retrieve("id")
Response samples
application/json
{
  • "data": {
    • "cost": {
      • "amount": "2.52",
      • "currency": "USD"
      },
    • "created_at": "2018-02-02T22:25:27.521Z",
    • "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    • "order_address": {
      • "administrative_area": "IL",
      • "country_code": "US",
      • "extended_address": "Suite 504",
      • "id": "1293384261075731499",
      • "locality": "Chicago",
      • "postal_code": "60654",
      • "street_address": "311 W Superior St"
      },
    • "quantity": 21,
    • "record_type": "sim_card_order",
    • "status": "pending",
    • "tracking_url": "http://www.example.com/",
    • "updated_at": "2018-02-02T22:25:27.521Z"
    }
}