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

# Retry Transfer

> Retry a previously failed transfer within a bulk transfer batch

## Overview

The retry endpoint allows you to reattempt a failed transfer that is marked as retriable within a bulk transfer batch. This is useful when transfers fail due to temporary issues like network problems or bank system downtime.

<Note>
  Only transfers with `retryable: true` in their status can be retried. Non-retriable failures (like invalid account numbers) cannot be retried.
</Note>

## Endpoint

```bash theme={null}
POST /bulk-transfers/{batch_id}/transfers/{id}/retry
```

### Path Parameters

<ParamField path="batch_id" type="string" required>
  The unique identifier of the bulk transfer batch
</ParamField>

<ParamField path="id" type="string" required>
  The unique identifier of the failed transfer to retry
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.spendjuice.com/bulk-transfers/{batch_id}/transfers/{id}/retry" \
  -H "Authorization:  YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    `https://api.spendjuice.com/bulk-transfers/${batchId}/transfers/${transferId}/retry`,
    {
      method: 'POST',
      headers: {
        'Authorization': ` ${apiKey}`
      }
    }
  );
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      f'https://api.spendjuice.com/bulk-transfers/{batch_id}/transfers/{transfer_id}/retry',
      headers={'Authorization': f' {api_key}'}
  )
  ```
</CodeGroup>

## Response

<ResponseField name="202 Accepted">
  Retry request accepted successfully
</ResponseField>

## Error Responses

<AccordionGroup>
  <Accordion title="404 - Transfer Not Found">
    ```json theme={null}
    {
      "error": {
        "code": "transfer_not_found",
        "message": "No transfer found with the provided ID"
      }
    }
    ```
  </Accordion>

  <Accordion title="400 - Not Retriable">
    ```json theme={null}
    {
      "error": {
        "code": "not_retriable",
        "message": "This transfer cannot be retried"
      }
    }
    ```
  </Accordion>

  <Accordion title="409 - Already Being Retried">
    ```json theme={null}
    {
      "error": {
        "code": "retry_in_progress",
        "message": "Transfer is already being retried"
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Retry Limits

<Card>
  * Maximum 3 retry attempts per transfer
  * 5-minute wait period between retries
  * 24-hour maximum retry window from initial failure
  * Retries count towards daily transfer limits
</Card>

## Status Transitions

1. Initial failed status: `failed` with `retryable: true`
2. After retry request: `processing`
3. Final status:
   * Success: `succeeded`
   * Failure: `failed` (may be retriable again)

## Webhook Events

Monitor these events for retry status:

* `bulk.transfer.retry.started` - Retry attempt initiated
* `bulk.transfer.retry.succeeded` - Retry completed successfully
* `bulk.transfer.retry.failed` - Retry attempt failed

## Best Practices

1. **Retry Strategy**
   * Implement exponential backoff between retries
   * Track retry attempt count
   * Consider time of day for retries
   * Monitor success rates by failure reason

2. **Error Handling**
   * Log all retry attempts
   * Track retry outcomes
   * Handle webhook notifications
   * Monitor retry limits

3. **User Communication**
   * Notify users of retry status
   * Provide clear error messages
   * Suggest alternative actions for non-retriable failures
   * Set expectations for processing time

<Card title="Need Help?">
  For retry-related assistance:

  * Check our [Error Handling](/errors) guide
  * Contact [Support](mailto:support@juicyway.com)
  * Review [Webhook Events](/webhooks)
</Card>
