# /transaction/receipt

Generates and retrieves the receipt for a completed transaction.
## Purpose
Returns the transaction receipt in HTML or PDF format, including all transaction details, sender/beneficiary information, and fees.
## When to use
Use this endpoint after a transaction has been confirmed to:
- Retrieve the receipt for display or printing at the branch
- Generate a PDF version for email or download
- Obtain the hosted receipt URL for sharing with the sender

## What happens next
1. Validates the transaction exists and has been confirmed
2. Generates the receipt file (PDF or HTML) via the receipt template engine
3. Fetches the POS HTML receipt from ViaOne for printing
4. Caches both results in DynamoDB for subsequent requests
5. Returns the receipt URL and HTML content

## Authentication
Requires `x-client-id` and `x-secret-key` headers.
## Notes
- The `format` query parameter controls the output format: `html` (default) or `pdf`.
- The legacy `type` parameter is deprecated but still supported for backward compatibility.
- Receipt templates are partner-specific and configured per chain_id.
- The receipt URL is a publicly accessible S3 link.
- Subsequent calls return cached results without regeneration.

## Common errors
- `400` Missing or invalid UUID, invalid format value
- `401` Invalid credentials
- `404` Transaction not found
- `422` Transaction has not been confirmed yet
- `500` Internal error (template not found, S3 upload failure)

Endpoint: GET /transaction/receipt
Version: 1.0.0

## Query parameters:

  - `uuid` (string, required)
    Unique identifier (UUID) of the transaction for which to generate the receipt.

Error codes: required=400001, type=400002, minLength=400003, maxLength=400004

  - `type` (string)
    Deprecated. Use `format` instead.

Error codes: type=400002, minLength=400003, maxLength=400004

  - `format` (string)
    Output format for the receipt. Supported values: `html` (default) or `pdf`.

Error codes: type=400002, minLength=400003, maxLength=400004, allowedValues=400010

## Header parameters:

  - `x-client-id` (string, required)
    Unique identifier assigned to the integrating client. It determines the validation rules, allowed values, compliance policies, and operational limits applied to the request.

Error codes: required=400001, type=400002, minLength=400003, maxLength=400004

  - `x-secret-key` (string, required)
    Secret authentication key associated with the client. It is used to authorize the request and must be kept strictly confidential.

Error codes: required=400001, type=400002, minLength=400003, maxLength=400004

## Response 200 fields (application/json):

  - `status` (string)
    Request status (success, error, etc.).

  - `message` (string)
    Process message

  - `receipt_url` (string)
    Publicly accessible URL where the generated receipt is hosted (S3).

  - `receipt_html` (string)
    Full HTML content of the generated receipt, ready for rendering or printing.

## Response 400 fields (application/json):

  - `errors` (array)
    List of object errorsError catalog for 400 (click to expand)CodeDescription400000The body of the request is required. Invalid JSON format of the request body.400001client_id is required400005secret_key is required

  - `errors.status` (string)

  - `errors.code` (number)

  - `errors.message` (string)

  - `errors.details` (string)

## Response 401 fields (application/json):

  - `errors` (array)
    List of object errorsError catalog for 401 (click to expand)CodeDescription401000Invalid credentials

  - `errors.status` (string)

  - `errors.code` (number)

  - `errors.message` (string)

  - `errors.details` (string)

## Response 404 fields (application/json):

  - `errors` (array)
    List of object errorsError catalog for 404 (click to expand)CodeDescription404000Transaction not found.

  - `errors.status` (string)

  - `errors.code` (number)

  - `errors.message` (string)

  - `errors.details` (string)

## Response 422 fields (application/json):

  - `errors` (array)
    List of object errorsError catalog for 422 (click to expand)CodeDescription422000The receipt cannot be generated. The transaction has not been confirmed.

  - `errors.status` (string)

  - `errors.code` (number)

  - `errors.message` (string)

## Response 500 fields (application/json):

  - `errors` (array)
    List of object errorsError catalog for 500 (click to expand)CodeDescription500000Internal Error

  - `errors.status` (string)

  - `errors.code` (number)

  - `errors.message` (string)

  - `errors.details` (string)

