Create a stored payment transaction
Create a transaction that charges a stored payment method on the account.
POST
/
v2
/
payment
/
stored_payment_transactions
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.payment.createStoredPaymentTransaction({ amount: '120.00' });
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.payment.create_stored_payment_transaction(
amount="120.00",
)
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.Payment.NewStoredPaymentTransaction(context.TODO(), telnyx.PaymentNewStoredPaymentTransactionParams{
Amount: "120.00",
})
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.payment.PaymentCreateStoredPaymentTransactionParams;
import com.telnyx.sdk.models.payment.PaymentCreateStoredPaymentTransactionResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
PaymentCreateStoredPaymentTransactionParams params = PaymentCreateStoredPaymentTransactionParams.builder()
.amount("120.00")
.build();
PaymentCreateStoredPaymentTransactionResponse response = client.payment().createStoredPaymentTransaction(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.payment.create_stored_payment_transaction(amount: "120.00")
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->payment->createStoredPaymentTransaction(
amount: '120.00'
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx payment create-stored-payment-transaction \
--api-key 'My API Key' \
--amount 120.00curl --request POST \
--url https://api.telnyx.com/v2/payment/stored_payment_transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "120.00"
}
'{
"data": {
"id": "de06811a-2e43-4561-af5a-7d0a26e20aaa",
"record_type": "transaction",
"amount_cents": 12000,
"processor_status": "submitted_for_settlement",
"amount_currency": "USD",
"created_at": "2026-02-25T10:00:00Z",
"auto_recharge": false,
"transaction_processing_type": "stored_payment"
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request."
}
]
}{
"errors": [
{
"code": "10010",
"title": "Authorization failed",
"detail": "You do not have permission to perform the requested action on the specified resource or resources."
}
]
}{
"errors": [
{
"code": "10027",
"title": "Invalid amount format",
"detail": "Amount must include dollars and cents (e.g. \"120.00\").",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10027"
},
"source": {
"pointer": "/"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Amount in dollars and cents, e.g. "120.00"
Example:
"120.00"
Response
Stored payment transaction created successfully
Show child attributes
Show child attributes
Was this page helpful?
⌘I
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.payment.createStoredPaymentTransaction({ amount: '120.00' });
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.payment.create_stored_payment_transaction(
amount="120.00",
)
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.Payment.NewStoredPaymentTransaction(context.TODO(), telnyx.PaymentNewStoredPaymentTransactionParams{
Amount: "120.00",
})
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.payment.PaymentCreateStoredPaymentTransactionParams;
import com.telnyx.sdk.models.payment.PaymentCreateStoredPaymentTransactionResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
PaymentCreateStoredPaymentTransactionParams params = PaymentCreateStoredPaymentTransactionParams.builder()
.amount("120.00")
.build();
PaymentCreateStoredPaymentTransactionResponse response = client.payment().createStoredPaymentTransaction(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.payment.create_stored_payment_transaction(amount: "120.00")
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->payment->createStoredPaymentTransaction(
amount: '120.00'
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx payment create-stored-payment-transaction \
--api-key 'My API Key' \
--amount 120.00curl --request POST \
--url https://api.telnyx.com/v2/payment/stored_payment_transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "120.00"
}
'{
"data": {
"id": "de06811a-2e43-4561-af5a-7d0a26e20aaa",
"record_type": "transaction",
"amount_cents": 12000,
"processor_status": "submitted_for_settlement",
"amount_currency": "USD",
"created_at": "2026-02-25T10:00:00Z",
"auto_recharge": false,
"transaction_processing_type": "stored_payment"
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request."
}
]
}{
"errors": [
{
"code": "10010",
"title": "Authorization failed",
"detail": "You do not have permission to perform the requested action on the specified resource or resources."
}
]
}{
"errors": [
{
"code": "10027",
"title": "Invalid amount format",
"detail": "Amount must include dollars and cents (e.g. \"120.00\").",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10027"
},
"source": {
"pointer": "/"
}
}
]
}