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

# QR Code Payments

> Generate and verify payments using QR codes only. No redirects.

The endpoints defined in the next section require a special API key generated by Flouci upon request. These endpoints allow for the seemless integration of QR code payments within your external system without redirects or embedding of external pages.
These APIs allow you to generate dynamic QR codes that Flouci wallets - or any other wallet licensed by the Central Bank of Tunisia - can scan and pay. You can simply display the QR code string provided to the client in digital or paper form.

Wallet payments are verified and settled instantly, and will appear in your available balance within seconds.

## Generate Custom QR Code

This API allows you to generate a custom QR code with a specified amount.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET '@IP/api/business/generate_custom_qr_code?amount=1000&merchant_id=123' \
    -H 'Authorization: Api-Key <YOUR_API_KEY>'
  ```
</CodeGroup>

### Query Parameters

<ParamField query="amount_in_millimes" type="decimal" required>
  The transaction amount in millimes
</ParamField>

<ParamField query="merchant_id" type="integer" required>
  Your merchant ID.
</ParamField>

<ParamField query="operation_uuid" type="uuid">
  A unique ID for the operation. If not provided, a random UUID will be generated.
</ParamField>

<ParamField query="barcode" type="boolean" default="false">
  Set to `true` to receive a slug representation of the QR code.
</ParamField>

### Headers

<ParamField header="Authorization" type="string" required>
  Your API key. Should be in the format `Api-Key YOUR_API_KEY`.
</ParamField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "code": 200,
    "qr_code": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADIAQAAAACFI5MzAAABaklEQVR42u3aQW7DMAwFUP//p88j...",
    "operation_uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef"
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "code": 400,
    "message": "<parameter> is required"
  }
  ```

  ```json 403 theme={null}
  {
    "success": false,
    "code": 403,
    "message": "Forbidden"
  }
  ```

  ```json 404 theme={null}
  {
    "success": false,
    "code": 404,
    "message": "precondition fails, code 3"
  }
  ```

  ```json 500 theme={null}
  {
    "success": false,
    "code": 500,
    "message": "Unexpected Error"
  }
  ```
</ResponseExample>

***

## Verify Custom Transaction

This API allows you to verify the transaction associated with a dynamically generated QR code.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://@IP/api/business/custom_transaction/status?operation_uuid=a1b2c3d3-e5f6-7890-1234-567890abcdef' \
    -H 'Authorization: Api-Key <YOUR_API_KEY>'
  ```
</CodeGroup>

### Query Parameters

<ParamField query="operation_uuid" type="uuid" required>
  The `operation_uuid` of the dynamic QR code.
</ParamField>

### Headers

<ParamField header="Authorization" type="string" required>
  Your API key. Should be in the format `Api-Key <YOUR_API_KEY>`.
</ParamField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "code": 200,
    "transactions": [
      {
        "transaction_unique_id": "t1u2n3i4q5u6e7i8d9",
        "time": "2025-08-02T12:00:00Z",
        "amount": 1000,
        "channel": "Flouci"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "code": 400,
    "message": "<parameter> is required"
  }
  ```

  ```json 403 theme={null}
  {
    "success": false,
    "code": 403,
    "message": "Forbidden"
  }
  ```

  ```json 500 theme={null}
  {
    "success": false,
    "code": 500,
    "message": "Unexpected Error"
  }
  ```

  ```json 503 theme={null}
  {
    "success": false,
    "code": 503,
    "message": "Service unavailable"
  }
  ```
</ResponseExample>

***

## History of Purchases

This API allows you to fetch the transaction history of a merchant.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET '@IP/api/business/custom_transactions/history?merchant_id=123' \
    -H 'Authorization: Api-Key YOUR_API_KEY'
  ```
</CodeGroup>

### Query Parameters

<ParamField query="merchant_id" type="integer" required>
  Your merchant ID.
</ParamField>

<ParamField query="start_date" type="datetime">
  The start date of the transaction history.
</ParamField>

<ParamField query="end_date" type="datetime">
  The end date of the transaction history.
</ParamField>

<ParamField query="size" type="integer">
  The number of items per page.
</ParamField>

### Headers

<ParamField header="Authorization" type="string" required>
  Your API key. Should be in the format `Api-Key YOUR_API_KEY`.
</ParamField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "code": 200,
    "result": [
      {
        "transaction_unique_id": "t1u2n3i4q5u6e7i8d9",
        "time": "2025-08-02T12:00:00Z",
        "amount": 1000,
        "channel": "Flouci"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "code": 400,
    "message": "<parameter> is required"
  }
  ```

  ```json 403 theme={null}
  {
    "success": false,
    "code": 403,
    "message": "Forbidden"
  }
  ```

  ```json 404 theme={null}
  {
    "success": false,
    "code": 404,
    "message": "precondition fails, code 3"
  }
  ```

  ```json 500 theme={null}
  {
    "success": false,
    "code": 500,
    "message": "Unexpected Error"
  }
  ```
</ResponseExample>
