> ## 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.

# Stablecoins payment

# Stablecoin Payment Capture

This guide covers how to capture stablecoin payments after initialization. The capture process confirms the blockchain address and network for the payment.

## Overview

<Note>
  Ensure you've completed [payment
  initialization](/payments/initialize-payment/stablecoins-transfer) before
  attempting capture.
</Note>

## Endpoint

```bash theme={null}
POST /payment-sessions/{payment_id}
```

## Supported Tokens and Networks

<Card>
  **USDC Support Matrix**

  | Network | Status | Confirmation Time |
  | ------- | ------ | ----------------- |
  | ETH     | ✅      | 5-30 minutes      |
  | MATIC   | ✅      | 1-5 minutes       |
  | AVAXC   | ✅      | 1-5 minutes       |

  **USDT Support Matrix**

  | Network | Status | Confirmation Time |
  | ------- | ------ | ----------------- |
  | ETH     | ✅      | 5-30 minutes      |
  | TRX     | ✅      | 1-3 minutes       |
</Card>

<Warning>
  Always verify the network matches the token to avoid lost transactions. For
  example, send USDC only on ETH, MATIC, or AVAXC networks.
</Warning>

## Request Parameters

<ParamField body="crypto_address" type="object" required>
  Crypto payment details

  <Expandable title="Crypto Address Fields">
    <ResponseField name="chain" type="string" required>
      Blockchain network code: \* ETH (Ethereum) \* TRX (Tron) \* MATIC (Polygon) \*
      AVAXC (Avalanche C-Chain)
    </ResponseField>

    <ResponseField name="currency" type="string" required>
      Stablecoin type: \* USDC \* USDT
    </ResponseField>
  </Expandable>
</ParamField>

## Example Requests

<CodeGroup>
  ```json USDT on Tron theme={null}
  {
    "crypto_address": {
      "chain": "TRX",
      "currency": "USDT"
    }
  }
  ```

  ```json USDC on Polygon theme={null}
  {
    "crypto_address": {
      "chain": "MATIC",
      "currency": "USDC"
    }
  }
  ```
</CodeGroup>

## Response Format

<ResponseField name="data" type="object">
  <Expandable title="Response Fields">
    <ResponseField name="status" type="string">
      Payment status: "captured", "failed"
    </ResponseField>

    <ResponseField name="message" type="string">
      Additional status information
    </ResponseField>

    <ResponseField name="payment" type="object">
      <Expandable title="Payment Details">
        <ResponseField name="id" type="string">
          Unique payment identifier
        </ResponseField>

        <ResponseField name="payment_method" type="object">
          <Expandable title="Payment Method Details">
            <ResponseField name="address" type="string">
              Generated blockchain address for payment
            </ResponseField>

            <ResponseField name="chain" type="string">
              Selected blockchain network
            </ResponseField>

            <ResponseField name="currency" type="string">
              Selected stablecoin
            </ResponseField>

            <ResponseField name="type" type="string">
              Will be "crypto\_address"
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="status" type="string">
          Current payment status
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Response

```json theme={null}
{
  "data": {
    "status": "captured",
    "message": "Payment address generated successfully",
    "payment": {
      "id": "pay_123abc456def",
      "currency": "USDT",
      "amount": 100000,
      "description": "Crypto payment",
      "payment_method": {
        "address": "TAd3A1MPNb3xhWrCpmi9x7UdqtwigWcdea",
        "chain": "TRX",
        "currency": "USDT",
        "id": "f1ce6d0f-b30b-4c53-810d-77584f2a36fb",
        "type": "crypto_address"
      },
      "status": "captured",
      "date": "2024-03-15T12:00:00Z",
      "mode": "live",
      "customer": {
        "first_name": "John",
        "last_name": "Doe",
        "email": "john.doe@example.com",
        "billing_address": {
          "line1": "123 Main St",
          "line2": "Apt 4B",
          "city": "New York",
          "state": "NY",
          "zip_code": "10001",
          "country": "US"
        }
      },
      "reference": "crypto_pay_123"
    }
  }
}
```

## Transaction Flow

<Steps>
  <Step title="Generate Address">
    Capture request generates a unique blockchain address
  </Step>

  <Step title="Monitor Transaction">
    Listen for webhook events: \* crypto.payment.pending - Transaction detected \*
    crypto.payment.confirmed - Required confirmations reached \*
    crypto.payment.completed - Funds credited
  </Step>

  <Step title="Verify Amount">
    Ensure received amount matches expected payment
  </Step>
</Steps>

## Best Practices

<AccordionGroup>
  <Accordion title="Network Selection">
    * Use TRX network for lowest fees \* Consider ETH during low gas periods \*
      Use MATIC/AVAXC for faster confirmations
  </Accordion>

  <Accordion title="Error Handling">
    * Validate chain/token compatibility \* Handle network congestion gracefully
    * Monitor transaction timeouts
  </Accordion>

  <Accordion title="User Experience">
    * Display QR code for address \* Show clear network requirements \* Provide
      transaction instructions
  </Accordion>
</AccordionGroup>

<Card title="Need Help?">
  * Check our [Error Handling Guide](/errors) \* Contact
    [support@juicyway.com](mailto:support@juicyway.com) \* Join our [Discord
    community](https://discord.gg/juice)
</Card>
