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

# Download Receipt

> Download a receipt for a completed transaction

Returns a receipt for any completed transaction. Pass `pdf` as the `type` parameter to receive a base64-encoded PDF, or `json` for a structured data response.

```
GET https://api.yativo.com/api/v1/business/transaction/{transactionId}/{type}/receipt
```

## Path parameters

<ParamField path="transactionId" type="string" required>
  The UUID of the transaction.
</ParamField>

<ParamField path="type" type="string" required>
  Receipt format. Use `"pdf"` to receive a base64-encoded PDF document.
</ParamField>

<RequestExample>
  ```bash cURL — PDF receipt theme={null}
  curl -X GET 'https://api.yativo.com/api/v1/business/transaction/a0e9e50e-81be-4bd0-9941-0151e68b9e97/pdf/receipt' \
    -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
  ```

  ```javascript Node.js theme={null}
  const transactionId = 'a0e9e50e-81be-4bd0-9941-0151e68b9e97';
  const type = 'pdf';

  const response = await fetch(
    `https://api.yativo.com/api/v1/business/transaction/${transactionId}/${type}/receipt`,
    { headers: { 'Authorization': `Bearer ${token}` } }
  );

  const data = await response.json();

  // Decode and save the PDF
  import fs from 'fs';
  const pdfBuffer = Buffer.from(data.data, 'base64');
  fs.writeFileSync('receipt.pdf', pdfBuffer);
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "status": "success",
    "status_code": 200,
    "message": "Request successful",
    "data": "JVBERi0xLjQKJeLjz9MKMiAwIG9iago8PC9MZW5ndGggMTM4Ni9GaWx0ZXIvRmxhdGVEZWNvZGU+Pg..."
  }
  ```

  ```json Not found theme={null}
  {
    "status": "error",
    "status_code": 404,
    "message": "Transaction not found"
  }
  ```
</ResponseExample>

<Note>
  The `data` field contains the PDF as a base64-encoded string. Decode it before writing to disk or serving to a client.
</Note>
