> ## Documentation Index
> Fetch the complete documentation index at: https://developers.circle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accelerate a stuck transaction

> - Accelerate a transaction based on the payment ID. It should be used when a transaction associated with the payment is broadcasted but not confirmed for a long period of time (i.e 10 minutes). This is usually due to gas fees being too low and not picked up by any miner/validator.

- The /accelerate endpoint essentially creates another transaction with the same params as the broadcasted transaction. If multiple broadcasted transactions exist, it will use the newest created one. Afterwards, OFI can sign with a higher gas fee and submit via /submit endpoint to accelerate blockchain confirmation.

- Requirements for using this endpoint:

  - No COMPLETED transaction exist for the payment (otherwise onchain transaction has completed)

  - No CREATED transaction exist for the payment, otherwise OFI should sign that transaction and submit

  - No PENDING transaction exist for the payment, otherwise OFI should wait for transaction to be broadcasted

- In another word, all existing transaction for the payment should either be FAILED (which is no longer effective) or BROADCASTED (which means they are stuck onchain and not confirmed)




## OpenAPI

````yaml openapi/cpn-ofi.yaml post /v1/cpn/payments/{paymentId}/transactions/accelerate
openapi: 3.0.3
info:
  description: CPN OFI REST API
  title: CPN OFI
  version: '1.0'
  license:
    name: Proprietary
    url: https://www.circle.com/legal
servers:
  - url: https://api.circle.com
security:
  - BearerAuth: []
tags:
  - name: Configurations
    description: Manage OFI configurations and settings
  - name: Quotes
    description: Handle quote-related operations
  - name: Payments
    description: Create and manage payment operations
  - name: Transactions
    description: Handle transaction-related operations
  - name: Requests for Information
    description: Manage Requests for Information (RFIs)
  - name: Support Tickets
    description: Manage support ticket operations
paths:
  /v1/cpn/payments/{paymentId}/transactions/accelerate:
    post:
      tags:
        - Transactions
      summary: Accelerate a stuck transaction
      description: >
        - Accelerate a transaction based on the payment ID. It should be used
        when a transaction associated with the payment is broadcasted but not
        confirmed for a long period of time (i.e 10 minutes). This is usually
        due to gas fees being too low and not picked up by any miner/validator.


        - The /accelerate endpoint essentially creates another transaction with
        the same params as the broadcasted transaction. If multiple broadcasted
        transactions exist, it will use the newest created one. Afterwards, OFI
        can sign with a higher gas fee and submit via /submit endpoint to
        accelerate blockchain confirmation.


        - Requirements for using this endpoint:

          - No COMPLETED transaction exist for the payment (otherwise onchain transaction has completed)

          - No CREATED transaction exist for the payment, otherwise OFI should sign that transaction and submit

          - No PENDING transaction exist for the payment, otherwise OFI should wait for transaction to be broadcasted

        - In another word, all existing transaction for the payment should
        either be FAILED (which is no longer effective) or BROADCASTED (which
        means they are stuck onchain and not confirmed)
      operationId: accelerateTransaction
      parameters:
        - $ref: '#/components/parameters/PaymentId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccelerateTransaction'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponse'
          description: Transaction accelerated successfully.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/NotAuthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
      security:
        - BearerAuth: []
components:
  parameters:
    PaymentId:
      name: paymentId
      description: The payment id created previously.
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Id'
  schemas:
    AccelerateTransaction:
      title: AccelerateTransactionRequest
      type: object
      description: >-
        Accelerate a broadcasted transaction, which is stuck in mempool due to
        low gas fee, by broadcasting the same transaction with high gas fee.
      required:
        - idempotencyKey
      properties:
        idempotencyKey:
          $ref: '#/components/schemas/IdempotencyKey'
    TransactionResponse:
      title: TransactionResponse
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/Transaction'
    Id:
      type: string
      format: uuid
      description: System-generated unique identifier of the resource.
      example: c4d1da72-111e-4d52-bdbf-2e74a2d803d5
    IdempotencyKey:
      type: string
      description: >-
        Universally unique identifier (UUID v4) idempotency key. This key is
        utilized to ensure exactly-once execution of mutating requests. To
        create a UUIDv4 go to
        [uuidgenerator.net](https://www.uuidgenerator.net). If the same key is
        reused, it will be treated as the same request and the original response
        will be returned.
      example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
      format: uuid
    Transaction:
      type: object
      description: >-
        Response schema for a blockchain transaction containing details about
        the transaction amount, addresses, fees, and status
      required:
        - id
        - paymentId
        - status
        - expireDate
        - senderAddress
        - senderAccountType
        - blockchain
        - amount
        - destinationAddress
        - messageType
        - messageToBeSigned
        - type
      properties:
        type:
          type: string
          description: Resource type identifier
          readOnly: true
          enum:
            - transaction
          example: transaction
        id:
          $ref: '#/components/schemas/Id'
        paymentId:
          $ref: '#/components/schemas/Id'
        status:
          $ref: '#/components/schemas/TransactionStatus'
        failureReason:
          $ref: '#/components/schemas/TransactionFailureReason'
        expireDate:
          $ref: '#/components/schemas/ExpireDate'
        senderAddress:
          $ref: '#/components/schemas/BlockchainAddress'
        senderAccountType:
          $ref: '#/components/schemas/BlockchainAddressAccountType'
        blockchain:
          $ref: '#/components/schemas/Blockchain'
        amount:
          $ref: '#/components/schemas/CryptoMoney'
        destinationAddress:
          $ref: '#/components/schemas/BlockchainAddress'
        estimatedFee:
          oneOf:
            - $ref: '#/components/schemas/EIP1559EstimatedFee'
            - $ref: '#/components/schemas/SolEstimatedFee'
          description: >-
            The suggested fee is provided to guide the OFI in constructing and
            signing the transaction object for submission.
        messageType:
          $ref: '#/components/schemas/TransactionMessageType'
        messageToBeSigned:
          type: object
          description: >-
            The message to be signed by OFI on Circle supported EVM chains and
            Solana (A EVM EOA message or a SOL message).
        signedTransaction:
          $ref: '#/components/schemas/SignedTransaction'
        transactionHash:
          $ref: '#/components/schemas/TransactionHash'
    XRequestId:
      type: string
      description: >-
        A unique identifier, which can be helpful for identifying a request when
        communicating with Circle support.
      example: 2adba88e-9d63-44bc-b975-9b6ae3440dde
    ErrorCode:
      title: ErrorCode
      type: integer
      description: Code that corresponds to the error.
      enum:
        - -1
        - 0
        - 1
        - 2
        - 3
        - 290000
        - 290001
        - 290100
        - 290101
        - 290102
        - 290103
        - 290200
        - 290201
        - 290202
        - 290203
        - 290204
        - 290205
        - 290206
        - 290211
        - 290300
        - 290301
        - 290302
        - 290303
        - 290304
        - 290305
        - 290306
        - 290307
        - 290308
        - 290309
        - 290310
        - 290311
        - 290312
        - 290313
        - 290314
        - 290315
        - 290316
        - 290317
        - 290318
        - 290319
        - 290320
        - 290321
        - 290322
        - 290323
        - 290324
        - 290325
        - 290327
        - 290328
        - 290329
        - 290330
        - 290331
        - 290332
        - 290333
        - 290338
        - 290339
        - 290340
        - 290341
        - 290349
        - 290400
        - 290401
        - 290500
        - 290502
        - 290503
        - 290600
        - 290601
        - 290602
        - 290603
        - 290604
        - 290605
        - 290606
      x-enum-descriptions:
        - Unknown error
        - Success
        - API parameter missing
        - API parameter invalid
        - Forbidden
        - >-
          Parameters of request do not match the tenancy environment associated
          with request
        - A request with this idempotency key has already been processed.
        - Amount provided is outside our supported limits
        - No bfis available to create requested quote
        - Parameters of request do not match any supported payment routes
        - Route does not support the requested use case
        - Quote not found with provided id
        - Quote already used by another payment
        - Quote past timestamp at which it expires
        - Blockchain for sender address does not blockchain requested in quote
        - Provided wallet address is on sanctioned lists
        - Pending RFI verification
        - RFI rejected
        - Payment use case does not match the quote.
        - Payment already has an associated active or completed transaction
        - Blockchain is not supported by CPN
        - Blockchain is not supported for V2 transactions
        - Submitting a transaction not in submittable status
        - Payment not in correct status for processing a onchain transfer
        - The payment is not found
        - The transaction is not found
        - A signed transaction for the transaction has already been submitted
        - The payment is expired
        - >-
          The signed transaction is expired. Solana has a concept of recent
          blockhash in a transaction that expires after 150 blocks (~1 min)
        - >-
          The nonce in the signed transaction is lower than the current wallet
          nonce
        - The signed transaction payload does not match the payment
        - The sender's wallet balance is insufficient
        - The fee payer wallet lacks enough gas
        - >-
          The CPN Payment ID provided in the signed data (e.g., in the Solana
          memo or EIP-712 structure) does not match the expected value
        - >-
          The gas price in the signed transaction is below network thresholds.
          The fee must exceed the estimated high fee to ensure prompt
          confirmation
        - >-
          When resubmitting (e.g., for acceleration), the wallet address to sign
          the raw transaction or nonce does not match the original submission
        - >-
          The full node used by CPN is currently unavailable or returns an
          unexpected error during transaction validation
        - The Payment Ref ID has already been used on-chain
        - >-
          For EVM chains, the gas limit in the signed transaction is
          insufficient to cover the execution costs. For Solana, the allocated
          compute budget falls short of the transaction's requirements,
          preventing successful execution
        - >-
          The nonce has already been used with the same sender in another signed
          transaction submission for a CPN payment. The OFI must use a unique
          nonce
        - The signature in the transaction is invalid
        - Provided wallet address is on sanctioned lists
        - The blockchain is not supported by CPN
        - The cross-chain is not supported by CPN yet
        - Completed transaction exist. No need to accelerate
        - The signed transaction cannot be decoded or is invalid
        - The Solana account specified for transaction is not found
        - The targetted transaction for action is expired
        - >-
          Please sign existing transaction or wait for signed transaction to be
          broadcast
        - No broadcasted transaction to be accelerated
        - The Solana account specified for transaction is invalid
        - >-
          Another transaction for the same CPN payment has already been
          submitted and is being broadcasted
        - >-
          A signature for the transaction has already been submitted and
          accepted.
        - >-
          The submitted signature cannot be verified against the typed data to
          be signed. This typically indicates that the signature signed with the
          wrong private key, or the typed data gets manipulated before signing.
        - >-
          The ERC-20 allowance granted to the Permit2 contract is insufficient
          to cover the total required token amount for the payment, including
          both the payment amount and associated fees.
        - >-
          The Permit2 nonce included in the typed data for the sender has
          already been used.
        - >-
          Blockchain is not supported for V1 transactions; use
          transactionVersion=VERSION_2.
        - RFI is past timestamp at which it expires
        - RFI cannot be submitted in current status
        - >-
          The decryption process failed, possibly due to an invalid key or
          corrupted data
        - >-
          The JWE compact payload is not formatted correctly or is missing
          required components
        - >-
          The JWE compact payload was not encrypted with a supported encryption
          algorithm
        - Ticket reference ID is required for escalation tickets
        - Original ticket not found with provided reference ID
        - Issue type is not allowed for this origin
        - Payment not found with provided ID
        - Failed to create Circle Salesforce support ticket
        - Failed to create a BFI support ticket
        - Support ticket not found with provided ID
    DescriptiveError:
      title: DescriptiveError
      type: object
      required:
        - error
        - message
      properties:
        error:
          $ref: '#/components/schemas/DescriptiveErrorType'
        location:
          type: string
          nullable: true
          description: The key or path where the error occurred
        message:
          type: string
          description: Detailed description of the error
    TransactionStatus:
      type: string
      description: Lifecycle status of a transaction
      enum:
        - CREATED
        - PENDING
        - BROADCASTED
        - COMPLETED
        - FAILED
      example: PENDING
    TransactionFailureReason:
      type: string
      description: Possible reasons for transaction failure
      enum:
        - CPN_PAYMENT_EXPIRED
        - SIGNED_TRANSACTION_EXPIRED
        - NONCE_TOO_LOW
        - NONCE_TOO_HIGH
        - INSUFFICIENT_TOKEN_BALANCE
        - INSUFFICIENT_GAS_BALANCE
        - GAS_PRICE_TOO_LOW
        - OUT_OF_GAS
        - TX_REPLACEMENT_FAILED
        - SOL_TX_ALREADY_IN_CACHE
        - TX_ALREADY_CONFIRMED
        - FAILED_ONCHAIN
        - SOL_BLOCKHASH_EXPIRED
        - TRANSACTION_EXPIRED
        - BROADCAST_FAILED
        - RELAY_FAILED
        - UNKNOWN_REASON
      example: FAILED_ONCHAIN
    ExpireDate:
      type: string
      format: date-time
      description: Date and time when the resource expires
      example: '2023-01-01T12:04:05Z'
    BlockchainAddress:
      type: string
      description: >-
        A blockchain address that can be used to send or receive transactions on
        a blockchain network.
      example: '0xe01be9cdd9e744ae6a709794bfe531ec3ec0671c'
    BlockchainAddressAccountType:
      type: string
      description: >-
        The type of blockchain account (currently supports only EOA - Externally
        Owned Account).
      enum:
        - EOA
      example: EOA
    Blockchain:
      type: string
      description: Supported blockchain networks
      enum:
        - SOL
        - MATIC
        - ETH
        - ARC
        - SOL-DEVNET
        - MATIC-AMOY
        - ETH-SEPOLIA
        - ARC-TESTNET
      example: ETH-SEPOLIA
    CryptoMoney:
      type: object
      description: >-
        Represents an amount of cryptocurrency, including both the numerical
        amount and the specific cryptocurrency type.
      properties:
        amount:
          type: string
          example: '110.270000'
        currency:
          $ref: '#/components/schemas/CryptoCurrency'
      example:
        amount: '110.270000'
        currency: USDC
    EIP1559EstimatedFee:
      type: object
      description: Estimated fee params for EIP1559 transaction.
      properties:
        type:
          type: string
          enum:
            - EIP1559
        payload:
          $ref: '#/components/schemas/EIP1559FeePayload'
    SolEstimatedFee:
      type: object
      description: Estimated fee params for Solana transaction.
      properties:
        type:
          type: string
          enum:
            - SOLANA
        payload:
          $ref: '#/components/schemas/SolanaFeePayload'
      required:
        - type
        - payload
    TransactionMessageType:
      type: string
      description: Transaction message type
      enum:
        - EIP3009
        - SOLANA
      example: EIP3009
    SignedTransaction:
      type: string
      description: >-
        Signed transaction. Base64 encoded for NEAR and Solana chains. Hex
        encoded for EVM chains.
      example: >-
        AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpzlAhqqen7eyTe0KQ3w+9NS4E+7sscb+Cr...
    TransactionHash:
      type: string
      description: >-
        Unique identifier assigned to a blockchain transaction when it is
        broadcast to the network
      example: >-
        2vmEDSBThR143WJyJePkpKVQcERVo9KePuCUwYU8fkoJaQjarTMj6sZG7DNnJ4zjhtRz6hDruqEFEkD4wJpGviiW
    DescriptiveErrorType:
      title: DescriptiveErrorType
      type: string
      enum:
        - MISSING_OR_INVALID_FIELD
      description: Type of descriptive error
    CryptoCurrency:
      type: string
      description: Supported cryptocurrencies
      enum:
        - USDC
      example: USDC
    EIP1559FeePayload:
      type: object
      description: >-
        Payload containing EIP-1559 fee configuration parameters for Ethereum
        transactions
      properties:
        gasLimit:
          type: string
          description: Maximum amount of gas units that can be used for the transaction
          example: '21000'
        maxFeePerGas:
          type: string
          description: Maximum total fee per gas (base fee + priority fee) in wei
          example: '5935224468'
        maxPriorityFeePerGas:
          type: string
          description: Maximum priority fee per gas (tip to miners) in wei
          example: '1022783914'
    SolanaFeePayload:
      type: object
      description: Payload containing Solana network fee configuration parameters
      properties:
        computeUnitLimit:
          type: string
          description: Maximum number of compute units allowed for the transaction
          example: '200000'
        computeUnitPrice:
          type: string
          description: Price per compute unit in lamports (1 SOL = 1,000,000,000 lamports)
          example: '20000'
  headers:
    XRequestId:
      description: >
        Circle-generated universally unique identifier (UUID v4). Useful for
        identifying a specific request when communicating with Circle Support.
      schema:
        $ref: '#/components/schemas/XRequestId'
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            type: object
            title: BadRequestResponse
            required:
              - code
              - message
            properties:
              code:
                $ref: '#/components/schemas/ErrorCode'
              message:
                type: string
                description: Human-readable message that describes the error.
                example: Unknown error occurred
              errors:
                type: array
                description: Array of detailed error descriptions
                items:
                  $ref: '#/components/schemas/DescriptiveError'
            example:
              code: 400
              message: Bad request.
      description: Request cannot be processed due to a client error.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
    NotAuthorized:
      content:
        application/json:
          schema:
            type: object
            title: NotAuthorizedResponse
            required:
              - code
              - message
            properties:
              code:
                $ref: '#/components/schemas/ErrorCode'
              message:
                type: string
                description: Human-readable message that describes the error.
                example: Unknown error occurred
              errors:
                type: array
                description: Array of detailed error descriptions
                items:
                  $ref: '#/components/schemas/DescriptiveError'
            example:
              code: 401
              message: Malformed authorization.
      description: >-
        Request has not been applied because it lacks valid authentication
        credentials.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
    Forbidden:
      content:
        application/json:
          schema:
            type: object
            title: ForbiddenResponse
            required:
              - code
              - message
            properties:
              code:
                $ref: '#/components/schemas/ErrorCode'
              message:
                type: string
                description: Human-readable message that describes the error.
                example: Unknown error occurred
              errors:
                type: array
                description: Array of detailed error descriptions
                items:
                  $ref: '#/components/schemas/DescriptiveError'
            example:
              code: 3
              message: Forbidden
      description: >-
        Request provides authentication, but the authenticated user does not
        have permission to access this resource.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
    NotFound:
      content:
        application/json:
          schema:
            type: object
            title: NotFoundResponse
            required:
              - code
              - message
            properties:
              code:
                $ref: '#/components/schemas/ErrorCode'
              message:
                type: string
                description: Human-readable message that describes the error.
                example: Unknown error occurred
              errors:
                type: array
                description: Array of detailed error descriptions
                items:
                  $ref: '#/components/schemas/DescriptiveError'
            example:
              code: 404
              message: Not found.
      description: Specified resource was not found.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
    Conflict:
      content:
        application/json:
          schema:
            type: object
            title: ConflictResponse
            required:
              - code
              - message
            properties:
              code:
                $ref: '#/components/schemas/ErrorCode'
              message:
                type: string
                description: Human-readable message that describes the error.
                example: Unknown error occurred
              errors:
                type: array
                description: Array of detailed error descriptions
                items:
                  $ref: '#/components/schemas/DescriptiveError'
            example:
              code: 290001
              message: A request with this idempotency key has already been processed.
      description: Request cannot be processed due to a conflict error.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: PREFIX:ID:SECRET
      description: >-
        Circle's API Keys are formatted in the following structure
        "PREFIX:ID:SECRET". All three parts are requred to make a successful
        request.

````