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

# Create Pay-in

> Initiate a fiat or stablecoin deposit.

## Create Pay-in

Initiate a deposit to your account. Pay-ins accept fiat transfers (via bank transfer) or stablecoin deposits (on-chain). All pay-ins must reference a valid quote.

### Endpoint

```
POST /v1/payins
```

### Request Headers

| Header            | Required | Description                              |
| ----------------- | -------- | ---------------------------------------- |
| `X-API-Key`       | Yes      | Your API key                             |
| `Content-Type`    | Yes      | `application/json`                       |
| `Idempotency-Key` | No       | Unique identifier for idempotent retries |

### Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.thiqwave.com/v1/payins \
    -H "X-API-Key: your_api_key" \
    -H "Content-Type: application/json" \
    -H "Idempotency-Key: unique_request_id" \
    -d '{
      "quote_id": "quote_1234567890",
      "source_currency": "AED",
      "destination_currency": "USDT",
      "destination_network": "ethereum",
      "destination_address": "0x742d35Cc6634C0532925a3b844Bc123e5fA42f9c",
      "amount": 50000,
      "metadata": {
        "customer_id": "cust_123"
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.thiqwave.com/v1/payins', {
    method: 'POST',
    headers: {
      'X-API-Key': 'your_api_key',
      'Content-Type': 'application/json',
      'Idempotency-Key': 'unique_request_id',
    },
    body: JSON.stringify({
      quote_id: 'quote_1234567890',
      source_currency: 'AED',
      destination_currency: 'USDT',
      destination_network: 'ethereum',
      destination_address: '0x742d35Cc6634C0532925a3b844Bc123e5fA42f9c',
      amount: 50000,
      metadata: {
        customer_id: 'cust_123',
      },
    }),
  });

  const payin = await response.json();
  console.log(payin);
  ```

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

  response = requests.post(
      'https://api.thiqwave.com/v1/payins',
      headers={
          'X-API-Key': 'your_api_key',
          'Idempotency-Key': 'unique_request_id',
      },
      json={
          'quote_id': 'quote_1234567890',
          'source_currency': 'AED',
          'destination_currency': 'USDT',
          'destination_network': 'ethereum',
          'destination_address': '0x742d35Cc6634C0532925a3b844Bc123e5fA42f9c',
          'amount': 50000,
          'metadata': {
              'customer_id': 'cust_123',
          },
      }
  )

  payin = response.json()
  print(payin)
  ```
</CodeGroup>

### Request Body

| Field                  | Type    | Required | Description                                                                                                                         |
| ---------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `quote_id`             | string  | No       | Quote ID to lock in rates. If omitted, a new quote is created internally.                                                           |
| `source_currency`      | string  | Yes      | Fiat currency code (AED, USD, EUR, GBP).                                                                                            |
| `destination_currency` | string  | Yes      | Stablecoin (USDT, USDC).                                                                                                            |
| `destination_network`  | string  | Yes      | Blockchain network: `ethereum`, `avalanche`, `arbitrum`, `base`, `polygon`, `tron`, `stellar`, `solana`, `xrpl`, `algorand`, `sui`. |
| `destination_address`  | string  | Yes      | Wallet address to receive stablecoins.                                                                                              |
| `amount`               | integer | Yes      | Amount in smallest fiat unit (e.g., 50000 AED fils).                                                                                |
| `metadata`             | object  | No       | Key-value pairs for your reference.                                                                                                 |

### Response

```json theme={null}
{
  "payin_id": "payin_1234567890",
  "quote_id": "quote_1234567890",
  "status": "awaiting_deposit",
  "source_currency": "AED",
  "destination_currency": "USDT",
  "destination_network": "ethereum",
  "destination_address": "0x742d35Cc6634C0532925a3b844Bc123e5fA42f9c",
  "source_amount": 50000,
  "estimated_stablecoin_amount": "479.50",
  "payment_instructions": {
    "beneficiary_account": "1234567890",
    "beneficiary_name": "Thiqwave Limited",
    "bank_code": "ABUAAE3D",
    "country": "AE",
    "reference": "payin_1234567890"
  },
  "expires_at": "2026-04-09T14:45:00Z",
  "created_at": "2026-04-09T14:30:00Z"
}
```

### Response Fields

| Field                         | Type    | Description                                                                       |
| ----------------------------- | ------- | --------------------------------------------------------------------------------- |
| `payin_id`                    | string  | Unique pay-in identifier.                                                         |
| `quote_id`                    | string  | Associated quote ID.                                                              |
| `status`                      | string  | Current status: `awaiting_deposit`, `processing`, `completed`, `failed`.          |
| `source_currency`             | string  | Source fiat currency.                                                             |
| `destination_currency`        | string  | Destination stablecoin.                                                           |
| `destination_network`         | string  | Destination blockchain.                                                           |
| `destination_address`         | string  | Wallet address for stablecoin delivery.                                           |
| `source_amount`               | integer | Amount in smallest fiat unit.                                                     |
| `estimated_stablecoin_amount` | string  | Expected stablecoin amount in human-readable format.                              |
| `payment_instructions`        | object  | Bank transfer details (beneficiary account, name, bank code, country, reference). |
| `expires_at`                  | string  | ISO 8601 timestamp when pay-in window closes.                                     |
| `created_at`                  | string  | ISO 8601 timestamp of creation.                                                   |

## Pay-in States

| Status             | Description                                                             |
| ------------------ | ----------------------------------------------------------------------- |
| `awaiting_deposit` | Waiting for fiat deposit. Use `payment_instructions` to transfer funds. |
| `processing`       | Fiat received and being converted.                                      |
| `completed`        | Stablecoins delivered to destination address.                           |
| `failed`           | Transaction failed. Check details for reason.                           |

## Notes

* Pay-in windows typically remain open for 15 minutes. Complete the bank transfer within this timeframe.
* Use the `reference` field from `payment_instructions` in your bank transfer to match deposits.
* Monitor pay-in status via the [Get Pay-in](/api/payins/get) endpoint or webhooks.
