Skip to main content
GET
/
invoices
/
{id}
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const invoice = await client.invoices.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(invoice.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
)
invoice = client.invoices.retrieve(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(invoice.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"),
)
invoice, err := client.Invoices.Get(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.InvoiceGetParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", invoice.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.invoices.InvoiceRetrieveParams;
import com.telnyx.sdk.models.invoices.InvoiceRetrieveResponse;

public final class Main {
private Main() {}

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

InvoiceRetrieveResponse invoice = client.invoices().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
}
}
require "telnyx"

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

invoice = telnyx.invoices.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

puts(invoice)
<?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 {
$invoice = $client->invoices->retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', action: 'json'
);

var_dump($invoice);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx invoices retrieve \
--api-key 'My API Key' \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
curl --request GET \
--url https://api.telnyx.com/v2/invoices/{id} \
--header 'Authorization: Bearer <token>'
{
  "data": {
    "invoice_id": "48eff763-ea80-4345-b688-78249eb165a8",
    "file_id": "454ea3b0-9eaa-4fa9-992e-6d9f31c0a37e",
    "period_start": "2023-11-01",
    "period_end": "2023-11-30",
    "paid": true,
    "url": "https://api.telnyx.com:443/v2/invoices/48eff763-ea80-4345-b688-78249eb165a8",
    "download_url": "https://us-east-1.telnyxstorage.com/porting-documents/telnyx/..."
  }
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}
{
"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.

Path Parameters

id
string<uuid>
required

Invoice UUID

Query Parameters

action
enum<string>

Invoice action

Available options:
json,
link
Example:

"json"

Response

Get invoice details

data
object