---
title: "api_reports_generation_post"
method: POST
path: "/accounts/{aid}/reports/generation"
tags: ["reports"]
---

# api_reports_generation_post

`POST /accounts/{aid}/reports/generation`

Using this endpoint with the query parameter **save** set to true, will result in an **201**
response, otherwise, the response will be **200**.

#### Generate PDF report for transaction:

First, fetch the transaction from [Get transaction](/api-reference/transactions/transactions_id_get).

Store the transaction in the `transaction` variable and send this payload:

    [
      {
        "key": "transaction",
        "path": "/checkout/v1/transactions/{transaction.id}",
        "data": transaction
      }
    ]

with these query parameters set:

- template_id=checkout_transaction_order
- template_data_path=/checkout/v1/transactions/{transaction.id}
- template_accept=application/pdf
- template_accept_language=en

**scopes**:
  - admin:reports
  - write:reports
  - read:reports

## Path parameters

- `aid` string, ^[PT]{1}\d{8}$, required

## Query parameters

- `template_id` string, required
- `template_data_path` string, required
- `template_accept` string, required
- `template_accept_language` string, required
- `template_accept_timezone` string, iana-timezone
- `data_from` string, date-time
- `data_to` string, date-time
- `schedule` 'monthly' | 'weekly' | 'daily' | 'custom' | 'none'
- `save` boolean

## Request body

- object[]
  - `key` string, required
  - `path` string, required
  - `data` object, required

## Response `200`

Report file

- string

## Other responses

- `201` — SignedUrl
- `400` — Bad / Invalid request
- `401` — Unauthorized
- `403` — Forbidden
- `500` — Unexpected Error

---

[API](https://skmtc.net/dintero/apis/account-management-api.md) · [All operations](https://skmtc.net/dintero/apis/account-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dintero/account-management-api/revisions/9b83a4199008/schema)
