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

# Get Manual Retry State

> Check whether a failed subscription renewal payment can be retried now, and when the next manual retry becomes available.



## OpenAPI

````yaml get /payments/{payment_id}/retry
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.118.3
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
  - name: Payment Connector Webhooks
  - name: Moderation
paths:
  /payments/{payment_id}/retry:
    get:
      tags:
        - Payments
      operationId: get_manual_retry_state_handler
      parameters:
        - name: payment_id
          in: path
          description: Id of the failed payment
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Whether this payment can be retried now
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManualRetryStateResponse'
        '404':
          description: No such payment for this business
      security:
        - API_KEY: []
        - ACCESS_TOKEN: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import DodoPayments from 'dodopayments';


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


            const manualRetryState = await
            client.payments.retrieveRetryState('payment_id');


            console.log(manualRetryState.can_retry);
        - lang: Python
          source: |-
            import os
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            manual_retry_state = client.payments.retrieve_retry_state(
                "payment_id",
            )
            print(manual_retry_state.can_retry)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tmanualRetryState, err := client.Payments.GetRetryState(context.TODO(), \"payment_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", manualRetryState.CanRetry)\n}\n"
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import com.dodopayments.api.models.payments.ManualRetryState;

            import
            com.dodopayments.api.models.payments.PaymentRetrieveRetryStateParams;


            public final class Main {
                private Main() {}

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

                    ManualRetryState manualRetryState = client.payments().retrieveRetryState("payment_id");
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import com.dodopayments.api.models.payments.ManualRetryState

            import
            com.dodopayments.api.models.payments.PaymentRetrieveRetryStateParams


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val manualRetryState: ManualRetryState = client.payments().retrieveRetryState("payment_id")
            }
        - lang: Ruby
          source: >-
            require "dodopayments"


            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )


            manual_retry_state =
            dodo_payments.payments.retrieve_retry_state("payment_id")


            puts(manual_retry_state)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $manualRetryState = $client->payments->retrieveRetryState('payment_id');

              var_dump($manualRetryState);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: >-
            using System;

            using DodoPayments.Client;

            using DodoPayments.Client.Models.Payments;


            DodoPaymentsClient client = new();


            PaymentRetrieveRetryStateParams parameters = new() { PaymentID =
            "payment_id" };


            var manualRetryState = await
            client.Payments.RetrieveRetryState(parameters);


            Console.WriteLine(manualRetryState);
        - lang: Rust
          source: |-
            use dodopayments::Client;

            #[tokio::main]
            async fn main() -> dodopayments::Result<()> {
                let client = Client::from_env()?;
                let payment_id = "payment_id";
                let result = client
                    .payments()
                    .retrieve_retry_state()
                    .payment_id(payment_id)
                    .await?;
                println!("{result:?}");
                Ok(())
            }
components:
  schemas:
    ManualRetryStateResponse:
      type: object
      required:
        - can_retry
        - sends_used
        - sends_allowed
      properties:
        can_retry:
          type: boolean
        reason:
          type:
            - string
            - 'null'
          description: The code `POST` would fail with. Null when `can_retry` is true.
        retry_available_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the next send becomes available. Null when no send is left, or
            when

            the block has nothing to do with the cooldown.
        sends_allowed:
          type: integer
          format: int64
        sends_used:
          type: integer
          format: int64
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.