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

# Transactions, Refunds, and Retries

> Inspect provider-neutral payment attempts, refund successful charges, and retry failed renewals safely.

A transaction is one payment attempt. It records the provider, amount, customer, invoice, status, and lifecycle events without exposing provider credentials.

## Inspect payment attempts

Open **Transactions** to investigate a payment from the dashboard, or list them from your application:

```typescript TypeScript theme={null}
import { Commet } from "@commet/node";

const commet = new Commet({ apiKey: "ck_xxx" });

const response = await commet.transactions.list();
```

```python Python theme={null}
from commet import Commet

commet = Commet("ck_xxx")

transactions_list_result = commet.transactions.list()
```

```go Go theme={null}
client, err := commet.New("ck_xxx")
if err != nil {
	log.Fatal(err)
}
ctx := context.Background()

transactionsListResult, err := client.Transactions.List(ctx, nil)
if err != nil {
	log.Fatal(err)
}
```

```java Java theme={null}
import co.commet.Commet;
import co.commet.params.ListTransactionsParams;

var commet = Commet.builder().apiKey("ck_xxx").build();

var transactionsListResult = commet.transactions().list(ListTransactionsParams.builder().build());
```

```php PHP theme={null}
use Commet\Commet;

$commet = new Commet('ck_xxx');

$transactionsListResult = $commet->transactions->list();
```

One invoice can have multiple transactions when a renewal is retried. The original failed transaction remains immutable; a retry creates a new attempt.

`provider` names the processor. `paymentMethod` names the method used for that attempt (`card`, `mercado_pago`, or `oxxo`), or is `null` when unknown. It stays tied to the transaction if the customer changes their saved method later.

`subPaymentMethod` describes how a Mercado Pago charge was funded when dLocal reports it: `credit_card`, `debit_card`, `prepaid_card`, `bank_transfer`, or `account_money`. It is `null` when unavailable or unknown. The dashboard also shows the card brand and last four digits when dLocal provides them for that charge.

## Refund a successful transaction

```typescript TypeScript theme={null}
import { Commet } from "@commet/node";

const commet = new Commet({ apiKey: "ck_xxx" });

const refund = await commet.transactions.refund({ id: "transaction_xxx" });
```

```python Python theme={null}
from commet import Commet

commet = Commet("ck_xxx")

refund = commet.transactions.refund("transaction_xxx")
```

```go Go theme={null}
client, err := commet.New("ck_xxx")
if err != nil {
	log.Fatal(err)
}
ctx := context.Background()

refund, err := client.Transactions.Refund(ctx, "transaction_xxx", nil)
if err != nil {
	log.Fatal(err)
}
```

```java Java theme={null}
import co.commet.Commet;
import co.commet.params.RefundTransactionParams;

var commet = Commet.builder().apiKey("ck_xxx").build();

var refund = commet.transactions().refund(
    "transaction_xxx",
    RefundTransactionParams.builder().build()
);
```

```php PHP theme={null}
use Commet\Commet;

$commet = new Commet('ck_xxx');

$refund = $commet->transactions->refund(id: 'transaction_xxx');
```

The operation requests a full refund and returns its actual provider-neutral status. Do not grant the refund in your product before the result is confirmed. Handle [`payment.refunded`](https://commet.co/docs/webhooks/payment-refunded) idempotently for downstream access or balance changes.

The subscription and its renewal schedule stay as they were, even when the payment is fully refunded. To end the subscription, [cancel it separately](https://commet.co/docs/manage-subscriptions.md).

When Commet processes the payment as [Merchant of Record](https://commet.co/docs/merchant-of-record.md) and the card issuer reports it as fraudulent, Commet automatically refunds what remains of it to avoid a chargeback. The transaction appears as refunded and you receive [`payment.refunded`](https://commet.co/docs/webhooks/payment-refunded). The refunded amount, excluding refunded taxes, is debited from your balance, and Commet's and the processor's fees are not returned.

## Retry a failed renewal

```typescript TypeScript theme={null}
import { Commet } from "@commet/node";

const commet = new Commet({ apiKey: "ck_xxx" });

const transactionRetry = await commet.transactions.retry({ id: "transaction_xxx" });
```

```python Python theme={null}
from commet import Commet

commet = Commet("ck_xxx")

transaction_retry = commet.transactions.retry("transaction_xxx")
```

```go Go theme={null}
client, err := commet.New("ck_xxx")
if err != nil {
	log.Fatal(err)
}
ctx := context.Background()

transactionRetry, err := client.Transactions.Retry(ctx, "transaction_xxx", nil)
if err != nil {
	log.Fatal(err)
}
```

```java Java theme={null}
import co.commet.Commet;
import co.commet.params.RetryTransactionParams;

var commet = Commet.builder().apiKey("ck_xxx").build();

var transactionRetry = commet.transactions().retry(
    "transaction_xxx",
    RetryTransactionParams.builder().build()
);
```

```php PHP theme={null}
use Commet\Commet;

$commet = new Commet('ck_xxx');

$transactionRetry = $commet->transactions->retry(id: 'transaction_xxx');
```

Retry is for failed subscription renewals, not arbitrary one-time charges. It keeps the failed attempt for audit and returns the new attempt honestly.

For a past-due subscription, prefer the lifecycle actions in [Handle Failed Payments](https://commet.co/docs/handle-failed-payments.md) when the customer needs a recovery link or a new payment method.

Provider routing changes do not move a saved payment method. A retry uses the connection already bound to the subscription.


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