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

# Quickstart

> Four-step off-ramp flow to sell crypto for fiat: deposit crypto, receive webhook, call the sell API, await bank-transfer confirmation.

Integrate Saber's fiat off-ramp to sell crypto for fiat and deposit it into a user's bank account.

## Prerequisites

1. **Register as a Saber merchant** — reach out to our team if you haven't.
2. **Set up your keys** — every API call needs an authentication signature; see [Configuring Your Keys](/getting-started/auth).
3. **Create a user** — see [Registering Users](/user/registration).
4. **Configure your webhooks** — Saber sends a webhook at each milestone; see [Webhook Configuration](/client/dashboard/webhooks).

## Implementation

![Flowchart of the offramp implementation: fetch a crypto deposit address, deposit crypto, receive a webhook for the deposit, create a sell order, convert crypto to fiat, and deposit fiat in the user's account](https://files.readme.io/83c58f9e26b40eff199b1ed5c1bb3f43f0a1f85fdea2e4d29831e5bdfda5d455-image.png)

### Step 1: Deposit crypto into Saber

Fetch a deposit address for the user (or use an internal transfer instead):

```curl theme={null}
curl --location 'https://api.saber.money/api/v1/wallet/user_deposit_address?symbol=BTC&network=BSC' \
--header 'X-Timestamp: {{timestamp}}' \
--header 'X-Client-Id: {{client_id}}' \
--header 'X-Request-Id;{{request_id}}' \
--header 'X-User-Id;{{user_id}}' \
--header 'X-Secret-Key;{{secret_key}}'
```

**Response**

```json theme={null}
{
  "success": true,
  "data": [
    {
      "network": "BSC",
      "name": "Binance Smart Chain (BEP20)",
      "coin": "BTC",
      "address": "0xc37e9cbe6e1d481d9372585e1b91cb387853d352",
      "tag": "",
      "url": "https://bscscan.com/address/0xc37e9cbe6e1d481d9372585e1b91cb387853d352"
    }
  ]
}
```

Both `symbol` and `network` are required; one address is returned per (symbol, network) pair. [API Reference](https://saber-money.readme.io/reference/getdepositaddress).

### Step 2: Wait for a success callback

Once your crypto deposit hits our systems, we send a webhook to your configured endpoint:

```json theme={null}
{
    "transaction_type": "DEPOSIT",
    "status": "COMPLETED",
    "crypto_symbol": "USDT",
    "network": "BSC",
    "amount": "10.00000000",
    "created_at": 1675171122000,
    "tag": "",
    "updated_at": 1675171203000,
    "usd_value": "10.00",
    "txn_hash": "Internal transfer xyz",
    "id": "91994108-9eff-4999-8e8f-238df8bd4961",
    "event": "deposit",
    "address": "0x123xxxx",
    "user_id": "user1234"
}
```

This also appears on the transaction tab of the Saber dashboard. See [Order Lifecycle and Webhooks](/offramp/operations/lifecycle).

### Step 3: Initiate a sell crypto transaction

* Confirm the user's KYC is complete — see [User KYC](/user/kyc/overview) if not.
* Confirm the user has a valid Indian bank account — see [Add Bank Account](/user/bank-account/api) if not.
* Call the sell API:

```curl theme={null}
curl --location 'https://api.saber.money/api/v1/wallet/conversion/fiat/sell' \
--header 'X-Timestamp: {{timestamp}}' \
--header 'X-Client-Id: {{client_id}}' \
--header 'X-Request-Id;{{request_id}}' \
--header 'X-User-Id;{{user_id}}' \
--header 'X-Secret-Key;{{secret_key}}' \
--data '{
    "source_id": "65d246fc-6a5b-43d7-89bf-944e95ff2279",
    "fiat_symbol": "INR",
    "crypto_symbol": "USDT",
    "crypto_amount": 1.14,
    "payment_method": "bank_transfer"
}'
```

**Response**

```json theme={null}
{
  "success": true,
  "data": {
    "status": "CREATED",
    "fiat_amount": "100",
    "transaction_type": "SELL",
    "fiat_symbol": "INR",
    "failure_code": "",
    "exchange_rate": "0",
    "id": "a892dc4a-aecb-4a22-9de4-2990b4179b77",
    "crypto_symbol": "USDT",
    "created_at": 1664783475000,
    "failure_desc": "",
    "crypto_amount": "1.14"
  }
}
```

[API Reference](https://saber-money.readme.io/reference/createselltransaction).

### Step 4: Wait for a success callback

Once the fiat deposit completes, we send a webhook to your configured endpoint:

```json theme={null}
{
  "event" : "SELL",
  "user_id": "77c4562e-ce47-4054-9d4e-4df69ca11a11", 
  "client_id": "3a309275-5936-4c79-8375-0ebb897502f0",
  "transaction_status": "COMPLETED", 
  "invested_at": "2022-11-16T09:30:13Z", 
  "transaction_id": "4f4d9561-b12f-4cdd-9726-d29333892fc9", 
  "transfer_type": "BANK_TRANSFER", 
  "bank_reference_id": "1176073620125", 
  "usd_amount": 1.21, 
  "fiat_amount": 100
}
```

This also appears on the transaction tab of the Saber dashboard.

For more offramp APIs, see the [API reference](https://saber-money.readme.io/reference/fetchsellquote).


## Related topics

- [Quickstart](/docs/quickstart.md)
- [API Quickstart](/docs/quickstart-3.md)
