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

# Create a Crypto Payment — POST /payments

> Create a crypto payment for a fiat amount. Blockra locks the exchange rate, generates a deposit address, and returns deposit details to show your buyer.

Creates a payment for a fiat amount in the crypto asset you specify, locks the live exchange rate, and returns a unique deposit address to show the buyer. The quote is valid for 30 minutes. Requires the `payments:write` scope.

## Request

**`POST https://api.blockra.io/payments`**

### Body parameters

<ParamField body="asset" type="string" required>
  The coin the buyer pays in. One of `BTC`, `LTC`, `ETH`, `USDC`, or `USDT`.
</ParamField>

<ParamField body="fiat_amount" type="number" required>
  The amount to charge, expressed in fiat. Blockra locks the live exchange rate and computes the exact crypto amount. Example: `9.99`.
</ParamField>

<ParamField body="fiat_currency" default="USD" type="string">
  The fiat currency to price in. One of `USD`, `EUR`, or `GBP`. Defaults to `USD`.
</ParamField>

<ParamField body="reference" type="string">
  Your own order or reference ID (max 255 characters). Echoed back on the payment object and in webhook payloads.
</ParamField>

<ParamField body="customer_email" type="string">
  Associates the payment with a customer by email. A customer record is created automatically if one does not already exist.
</ParamField>

<ParamField body="metadata" type="object">
  Arbitrary key/value pairs stored on the payment and returned as-is in all responses.
</ParamField>

## Response

Returns a `201` with the newly created payment object wrapped in the standard `data` envelope.

<ResponseField name="id" type="string">
  The payment ID, prefixed `pay_`.
</ResponseField>

<ResponseField name="status" type="string">
  Lifecycle status: `pending`, `detected`, `completed`, `overpaid`, `underpaid`, `expired`, `failed`, or `cancelled`.
</ResponseField>

<ResponseField name="asset" type="string">
  The crypto asset (e.g. `LTC`).
</ResponseField>

<ResponseField name="network" type="string">
  The blockchain network: `bitcoin`, `litecoin`, or `ethereum`.
</ResponseField>

<ResponseField name="fiat_currency" type="string">
  The fiat currency code.
</ResponseField>

<ResponseField name="fiat_amount" type="number">
  Gross amount the buyer is charged (fiat).
</ResponseField>

<ResponseField name="fee_fiat" type="number">
  The Blockra fee in fiat.
</ResponseField>

<ResponseField name="net_fiat" type="number">
  Amount credited to your balance (`fiat_amount − fee_fiat`).
</ResponseField>

<ResponseField name="confirmations" type="number">
  On-chain confirmations seen so far. Always `0` on a freshly created payment.
</ResponseField>

<ResponseField name="reference" type="string">
  Your reference ID, if provided.
</ResponseField>

<ResponseField name="expires_at" type="string">
  ISO-8601 time the quote expires (30 minutes from creation).
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO-8601 timestamp when the payment was created.
</ResponseField>

<ResponseField name="deposit" type="object">
  Where and how much the buyer should send.

  <Expandable title="deposit fields">
    <ResponseField name="address" type="string">
      The deposit address to send crypto to.
    </ResponseField>

    <ResponseField name="asset" type="string">
      The coin.
    </ResponseField>

    <ResponseField name="network" type="string">
      The chain.
    </ResponseField>

    <ResponseField name="expected_amount" type="string">
      The exact amount to send as a human-readable decimal string, rounded to payable precision. Show this to the buyer.
    </ResponseField>

    <ResponseField name="expected_amount_atoms" type="string">
      The exact amount in the asset's smallest unit (satoshis, wei, etc.) as a string. Use for precise comparisons.
    </ResponseField>

    <ResponseField name="qr_data" type="string">
      A wallet-URI string (e.g. `litecoin:address?amount=0.1183`) to render as a QR code for mobile wallets.
    </ResponseField>

    <ResponseField name="status" type="string">
      Deposit status, mirrors the top-level payment status (e.g. `pending`).
    </ResponseField>

    <ResponseField name="confirmations" type="number">
      On-chain confirmations seen for this deposit so far.
    </ResponseField>

    <ResponseField name="required_confirmations" type="number">
      Number of on-chain confirmations required before the payment is considered complete.
    </ResponseField>

    <ResponseField name="expires_at" type="string">
      ISO-8601 time the quote expires (30 minutes from creation).
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.blockra.io/payments \
    -X POST \
    -H "X-API-Key: bk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -d '{
      "asset": "LTC",
      "fiat_amount": 9.99,
      "fiat_currency": "USD",
      "reference": "order_1234",
      "customer_email": "buyer@example.com"
    }'
  ```

  ```ts Node.js theme={null}
  const res = await fetch("https://api.blockra.io/payments", {
    method: "POST",
    headers: {
      "X-API-Key": process.env.BLOCKRA_API_KEY!,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      asset: "LTC",
      fiat_amount: 9.99,
      fiat_currency: "USD",
      reference: "order_1234",
    }),
  });
  const { data, error } = await res.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "data": {
      "id": "pay_a1b2c3d4e5f6g7h8i9j0k1l2",
      "status": "pending",
      "asset": "LTC",
      "network": "litecoin",
      "fiat_currency": "USD",
      "fiat_amount": 9.99,
      "fee_fiat": 0.22,
      "net_fiat": 9.77,
      "confirmations": 0,
      "reference": "order_1234",
      "expires_at": "2026-07-08T13:09:00.000Z",
      "created_at": "2026-07-08T12:39:00.000Z",
      "deposit": {
        "address": "ltc1q0u0dnysyzuyua7tg2fu05ztgssazx0j5fqfhun",
        "asset": "LTC",
        "network": "litecoin",
        "expected_amount": "0.1183",
        "expected_amount_atoms": "11830000",
        "qr_data": "litecoin:ltc1q0u0dnysyzuyua7tg2fu05ztgssazx0j5fqfhun?amount=0.1183",
        "status": "pending",
        "confirmations": 0,
        "required_confirmations": 4,
        "expires_at": "2026-07-08T13:09:00.000Z"
      }
    },
    "error": null
  }
  ```
</ResponseExample>
