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

# Payment retries

> Retry an invoice payment or share a payment link with your customer.

Retry collection when an invoice payment fails. You can also generate a payment link so your customer can pay the invoice themselves.

## Retry an invoice payment

> [!WARNING]
>
> A retry starts another collection attempt. Check the invoice and selected payment method before continuing.

> [tab] Dashboard
>
> 1. Open **Invoices**.
> 2. Open the **Outstanding** tab.
> 3. Click the **ellipsis icon** on the invoice.
> 4. Select **Resend for collection**.

> [tab] API
>
> `POST /invoices/{lago_id}/retry_payment` retries collection using the selected or default payment method. The body is optional:
>
> | Field | Meaning |
> | - | - |
> | `payment_method.payment_method_type` | `provider` or `manual`. |
> | `payment_method.payment_method_id` | `lago_id` of a payment method that belongs to the customer. |
>
> Omit `payment_method` to use the configured default. See [Payment methods](https://getlago.com/docs/v2/guide/payments/payment-methods.md).
>
> ```bash Retry with the default payment method theme={"dark"}
> LAGO_URL="https://api.getlago.com"
> API_KEY="__YOUR_API_KEY__"
> INVOICE_ID="__YOUR_INVOICE_ID__"
>
> curl --location --request POST "$LAGO_URL/api/v2/invoices/$INVOICE_ID/retry_payment" \
>   --header "Authorization: Bearer $API_KEY"
> ```
>
> ```bash Retry with a specific payment method theme={"dark"}
> LAGO_URL="https://api.getlago.com"
> API_KEY="__YOUR_API_KEY__"
> INVOICE_ID="__YOUR_INVOICE_ID__"
>
> curl --location --request POST "$LAGO_URL/api/v2/invoices/$INVOICE_ID/retry_payment" \
>   --header "Authorization: Bearer $API_KEY" \
>   --header 'Content-Type: application/json' \
>   --data-raw '{
>     "payment_method": {
>       "payment_method_type": "provider",
>       "payment_method_id": "__YOUR_PAYMENT_METHOD_ID__"
>     }
>   }'
> ```

A successful request does not confirm payment. Follow the result on the invoice `payment_status` (`pending`, `succeeded`, `failed`) or in `GET /payments?invoice_id=...`.

## Create a payment URL

`POST /invoices/{lago_id}/payment_url` returns a URL where the customer can pay the invoice through the payment provider. It requires a customer [connected to a provider](https://getlago.com/docs/v2/guide/payments/payment-providers.md). See the [API reference](https://getlago.com/docs/v2/api-reference/invoices/payment-url.md) for error responses.

```bash Create a payment URL theme={"dark"}
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
INVOICE_ID="__YOUR_INVOICE_ID__"

curl --location --request POST "$LAGO_URL/api/v2/invoices/$INVOICE_ID/payment_url" \
  --header "Authorization: Bearer $API_KEY"
```

Share `payment_url.payment_url` from the response with your customer.

## Next steps

> [card] [Payment requests](https://getlago.com/docs/v2/guide/payments/payment-requests.md)
>
> Collect several overdue invoices at once.

> [card] [Record manual payments](https://getlago.com/docs/v2/guide/payments/record-manual-payments.md)
>
> Record a payment collected outside Lago.

> [card] [Retry an invoice payment (API)](https://getlago.com/docs/v2/api-reference/invoices/retry-payment.md)
>
> Request and response schema.

> [card] [Create a payment URL (API)](https://getlago.com/docs/v2/api-reference/invoices/payment-url.md)
>
> Request and response schema.


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