> ## 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 payment quote

> Creates a payment quote for the specified USD amount. Returns payment details including the x402 payment requirements, network, and expiration time. The quote must be settled before it expires.



## OpenAPI

````yaml /openapi/source/external/payment/x402-transactions.json post /v2/x402/credit_account/quote
openapi: 3.0.0
info:
  version: 2.0.0
  title: x402 Payment Transactions API
  contact:
    email: mission.control.squad@telnyx.com
servers:
  - url: https://api.telnyx.com
security:
  - bearerAuth: []
tags:
  - name: x402 Payment Transactions
    description: >-
      Operations for x402 cryptocurrency payment transactions. Fund your Telnyx
      account using USDC stablecoin payments via the x402 protocol.
paths:
  /v2/x402/credit_account/quote:
    post:
      tags:
        - x402 Payment Transactions
      summary: Create a payment quote
      description: >-
        Creates a payment quote for the specified USD amount. Returns payment
        details including the x402 payment requirements, network, and expiration
        time. The quote must be settled before it expires.
      operationId: createX402Quote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/X402QuoteRequest'
            example:
              amount_usd: '50.00'
      responses:
        '200':
          description: Quote created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/X402QuoteResponse'
              example:
                data:
                  id: quote_abc123
                  record_type: quote
                  amount_usd: '50.00'
                  amount_crypto: '50000000'
                  network: eip155:8453
                  expires_at: '2026-03-13T15:05:00Z'
                  payment_requirements:
                    x402Version: 2
                    resource:
                      url: https://api.telnyx.com/v2/x402/credit_account
                      description: Payment of $50.00 USD
                      mimeType: application/json
                    accepts:
                      - scheme: exact
                        network: eip155:8453
                        amount: '50000000'
                        asset: '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
                        payTo: '0x1234567890abcdef1234567890abcdef12345678'
                        maxTimeoutSeconds: 900
                        extra:
                          quoteId: quote_abc123
                          facilitatorUrl: https://api.cdp.coinbase.com/platform/v2/x402
                          name: USD Coin
                          version: '2'
        '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 — x402 payments not enabled, account tier ineligible, or
            account suspended
          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 — invalid amount
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errors:
                  - code: unknown
                    title: Invalid request
                    detail: amount_usd must be at least 5.00
        '502':
          description: Bad gateway — upstream payment service failed to create quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errors:
                  - code: '10007'
                    title: Unexpected error
                    detail: An unexpected error occured.
      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.x402.creditAccount.createQuote({
            amount_usd: '50.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.x402.credit_account.create_quote(
                amount_usd="50.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.X402.CreditAccount.NewQuote(context.TODO(), telnyx.X402CreditAccountNewQuoteParams{\n\t\tAmountUsd: \"50.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.x402.creditaccount.CreditAccountCreateQuoteParams;

            import
            com.telnyx.sdk.models.x402.creditaccount.CreditAccountCreateQuoteResponse;


            public final class Main {
                private Main() {}

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

                    CreditAccountCreateQuoteParams params = CreditAccountCreateQuoteParams.builder()
                        .amountUsd("50.00")
                        .build();
                    CreditAccountCreateQuoteResponse response = client.x402().creditAccount().createQuote(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            response = telnyx.x402.credit_account.create_quote(amount_usd:
            "50.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->x402->creditAccount->createQuote(amountUsd: '50.00');

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx x402:credit-account create-quote \
              --api-key 'My API Key' \
              --amount-usd 50.00
components:
  schemas:
    X402QuoteRequest:
      type: object
      required:
        - amount_usd
      properties:
        amount_usd:
          type: string
          description: Amount in USD to fund (minimum 5.00, maximum 10000.00).
          example: '50.00'
    X402QuoteResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              description: Unique quote identifier. Use this to settle the payment.
            record_type:
              type: string
              enum:
                - quote
            amount_usd:
              type: string
              description: The quoted amount in USD.
            amount_crypto:
              type: string
              description: >-
                The equivalent amount in the payment cryptocurrency's smallest
                unit (e.g. USDC has 6 decimals, so $50.00 = "50000000").
            network:
              type: string
              description: >-
                The blockchain network for the payment in CAIP-2 format (e.g.
                eip155:8453 for Base).
            expires_at:
              type: string
              format: date-time
              description: ISO 8601 timestamp when the quote expires.
            payment_requirements:
              $ref: '#/components/schemas/X402PaymentRequirements'
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              title:
                type: string
              detail:
                type: string
              meta:
                type: object
                properties:
                  url:
                    type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
    X402PaymentRequirements:
      type: object
      description: >-
        x402 protocol v2 payment requirements. Contains all information needed
        to construct and sign a payment authorization.
      properties:
        x402Version:
          type: integer
          enum:
            - 2
          description: x402 protocol version. Currently always 2.
        resource:
          type: object
          description: The resource being paid for. Included in the payment signature.
          properties:
            url:
              type: string
              description: Canonical URL of the payment resource.
            description:
              type: string
              description: Human-readable description of the payment.
            mimeType:
              type: string
              description: MIME type of the resource.
        accepts:
          type: array
          description: >-
            Accepted payment schemes. Currently only the `exact` EVM scheme is
            supported.
          items:
            type: object
            properties:
              scheme:
                type: string
                description: Payment scheme (e.g. "exact").
              network:
                type: string
                description: >-
                  Blockchain network identifier in CAIP-2 format (e.g.
                  "eip155:8453" for Base).
              amount:
                type: string
                description: Amount in the token's smallest unit.
              asset:
                type: string
                description: Token contract address (e.g. USDC on Base).
              payTo:
                type: string
                description: Recipient wallet address.
              maxTimeoutSeconds:
                type: integer
                description: >-
                  Maximum time in seconds before the payment authorization
                  expires.
              extra:
                type: object
                description: >-
                  Additional scheme-specific parameters including EIP-712 domain
                  info and the facilitator URL.
                properties:
                  quoteId:
                    type: string
                  facilitatorUrl:
                    type: string
                  name:
                    type: string
                    description: EIP-712 domain name (e.g. "USD Coin").
                  version:
                    type: string
                    description: EIP-712 domain version.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````