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

# Create QR Code Payin

> Generates a QR code and creates a payin associated with that QR.

### Body

<ParamField body="externalId" type="string">
  Client reference id (must be unique per company). If omitted, defaults to <code>orderId</code>.
</ParamField>

<ParamField body="orderId" type="string" required>
  Client order identifier.
</ParamField>

<ParamField body="amount" type="number" required>
  Amount to be paid.
</ParamField>

<ParamField body="taxAmount" type="number">
  Tax portion (if applicable).
</ParamField>

<ParamField body="currency" type="string">
  Currency code (default <code>USD</code>).
</ParamField>

<ParamField body="expireAt" type="string">
  QR expiration timestamp (ISO-8601).
</ParamField>

<ParamField body="onBehalfOf" type="string">
  User/customer reference.
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates whether the QR code payin was created successfully.
</ResponseField>

<ResponseField name="paymentId" type="string">
  The unique payment identifier generated by our system.
</ResponseField>

<ResponseField name="qrCode" type="string">
  The QR code image (base64-encoded data URL).
</ResponseField>

<ResponseField name="expireAt" type="string">
  The ISO 8601 timestamp when the QR code expires.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://stablecoin-api.sandbox.getmeru.com/v1/payins/qr-code' \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data-raw '{
      "externalId": "EXT-10001",
      "orderId": "ORD-12345",
      "amount": 99.99,
      "taxAmount": 8.99,
      "currency": "USD",
      "expireAt": "2026-04-17T12:46:44.310Z",
      "onBehalfOf": "cus_123"
  }'
  ```

  ```js Javascript theme={null}
  const response = await fetch('https://stablecoin-api.sandbox.getmeru.com/v1/payins/qr-code', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'api-key': '<api-key>'
    },
    body: JSON.stringify({
      externalId: 'EXT-10001',
      orderId: 'ORD-12345',
      amount: 99.99,
      taxAmount: 8.99,
      currency: 'USD',
      expireAt: '2026-04-17T12:46:44.310Z',
      onBehalfOf: 'cus_123'
    })
  });

  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "paymentId": "pay_3ddd0e5b-6276-4b48-b756-c1fcc9a2efd1",
    "qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "expireAt": "2026-04-17T12:46:44.310Z"
  }
  ```
</ResponseExample>

### Error Responses

<ResponseExample>
  ```json 409 theme={null}
  {
    "success": false,
    "error": "externalId was already used"
  }
  ```
</ResponseExample>
