> ## 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.

# Create a stored payment transaction

> Create a transaction that charges a stored payment method on the account.



## OpenAPI

````yaml /openapi/source/external/billing/stored-payment-transactions.json post /v2/payment/stored_payment_transactions
openapi: 3.0.0
info:
  version: 2.0.0
  title: Stored Payment Transactions API
  contact:
    email: mission.control.squad@telnyx.com
servers:
  - url: https://api.telnyx.com
security:
  - bearerAuth: []
tags:
  - name: Stored Payment Transactions
    description: Operations for managing stored payment transactions.
paths:
  /v2/payment/stored_payment_transactions:
    post:
      tags:
        - Stored Payment Transactions
      summary: Create a stored payment transaction
      description: >-
        Create a transaction that charges a stored payment method on the
        account.
      operationId: createStoredPaymentTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoredPaymentTransactionRequest'
            example:
              amount: '120.00'
      responses:
        '200':
          description: Stored payment transaction created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoredPaymentTransactionResponse'
              example:
                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
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errors:
                  - code: '10009'
                    title: Authentication failed
                    detail: >-
                      The required authentication headers were either invalid or
                      not included in the request.
        '403':
          description: Forbidden - insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errors:
                  - code: '10010'
                    title: Authorization failed
                    detail: >-
                      You do not have permission to perform the requested action
                      on the specified resource or resources.
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                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: /
      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.payment.createStoredPaymentTransaction({ amount: '120.00' });


            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.payment.create_stored_payment_transaction(
                amount="120.00",
            )
            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.Payment.NewStoredPaymentTransaction(context.TODO(), telnyx.PaymentNewStoredPaymentTransactionParams{\n\t\tAmount: \"120.00\",\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.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);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            response = telnyx.payment.create_stored_payment_transaction(amount:
            "120.00")


            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->payment->createStoredPaymentTransaction(
                amount: '120.00'
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx payment create-stored-payment-transaction \
              --api-key 'My API Key' \
              --amount 120.00
components:
  schemas:
    StoredPaymentTransactionRequest:
      type: object
      required:
        - amount
      properties:
        amount:
          type: string
          description: Amount in dollars and cents, e.g. "120.00"
          example: '120.00'
    StoredPaymentTransactionResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
            record_type:
              type: string
              enum:
                - transaction
            amount_cents:
              type: integer
            processor_status:
              type: string
            amount_currency:
              type: string
            created_at:
              type: string
              format: date-time
            auto_recharge:
              type: boolean
            transaction_processing_type:
              type: string
              enum:
                - stored_payment
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              detail:
                type: string
              code:
                type: string
              meta:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
              source:
                type: object
                properties:
                  pointer:
                    type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````