# Deposit/Payin

The **payin** operation involves depositing funds into an account from various sources such as cards or crypto wallets.

#### Supported Payin Methods

* **Card**\
  Deposit funds from a credit or debit card..
* **Crypto Wallet**\
  Deposit funds from a cryptocurrency wallet.

#### Payin Flow

1. **Initiate Payin**: Submit [a deposit request](https://apireference.inqud.com/#tag/operations/operation/user_create-payin) with the chosen method.
2. **Validation**: The system verifies the provided payment details (card number or wallet address).
3. **Redirect User:** User should be redirected to page from **payUrl** field to complete payment.&#x20;
4. **Processing**: The deposit is processed and credited to the user's account.
5. **Notification**: If webhook settings specified, webhook is sent for each [status transition](https://docs.inqud.com/developer/payment-statuses). Webhook body represents [payment model](https://apireference.inqud.com/#tag/payments/operation/user_get-payment). Please refer to [webhook section](https://docs.inqud.com/developer/web-hooks) to get more details.<br>

If no webhook settings specified, you can retrieve payment status via [GET endpoint](https://apireference.inqud.com/#tag/payments/operation/user_get-payment)

#### Example API Request (See the API reference for more examples)

```json
{
    "amount": 100,
    "clientOrderId": "1234567890",
    "currency": "EUR",
    "firstName": "John",
    "lastName": "Doe",
    "method": "CC_VISAMC",
    "returnUrl": "https://example.com/"
}
```

#### Example API Request using prefetched payment method id

1. Fetch payment methods, e.g. to perform crypto BITCOIN/BTC/PAYIN:<br>

   <pre class="language-json"><code class="lang-json"><strong>
   </strong>[
     {
       "blockchain": "BITCOIN",
       "currency": "BTC",
       "fixed": 0.0001,
       "hasNetworkFee": true,
       "id": "PMD-2eb51bd4-6117-437b-b933-502538a9662a",
       "maxLimit": 10,
       "methodKey": "CRYPTOCOIN",
       "minFeeAmount": 1,
       "minFeeCurrency": "EUR",
       "minLimit": 0.0001,
       "name": "bitcoin payin",
       "orderType": "PAYIN",
       "percent": 0.1,
       "productType": "PAYMENT",
       "properties": {
         "optional": [
           "email"
         ],
         "required": [
           "firstName",
           "lastName"
         ]
       },
       "scale": 6,
       "verificationLevel": 3
     }
   ]
   </code></pre>
2. Perform proper payout call

   ```json
   {
       "paymentMethodId": "PMD-2eb51bd4-6117-437b-b933-502538a9662a",
       "amount": 0.1,
       "firstName": "John",
       "lastName": "Doe"
   }
   ```

#### Example API Response

```json
{
  "amount": 100,
  "clientOrderId": "1234567890",
  "createdAt": "2022-12-01T12:00:00Z",
  "currency": "EUR",
  "externalId": "c2544dd6e1c53529b877682127d16cff524f2867a57c5cc204e42eb2573e02e0",
  "id": "PMT-b2e2df8c-281a-4cc1-2bcf-61b803358f0e",
  "method": "CC_VISAMC",
  "orderId": "ORD-b40c5710-c419-432b-9814-bac03cb4fe1c",
  "orderType": "PAYIN",
  "payUrl": "https://hpp.inqud.com/PMT-b2e2df8c-281a-4cc1-2bcf-61b803358f0e",
  "status": "NEW",
  "transactionType": "DEBIT"
}
```
