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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Create a Report

> Requests generation of a payment, transaction, or settlement report and returns its ID and status.

This endpoint allows you to request the generation of specific report types. `start_date` must be before `end_date`; otherwise the API answers 400 `REPORT_RANGE_ERROR`. `start_date` must also be before the current time, except for `AGENDA` and `CASHFLOW` reports, which accept future dates. For report types other than `TRANSACTIONS`, `PAYMENTS`, `FRAUD_TRANSACTIONS`, `PAYOUTS`, `AGENDA` and `CASHFLOW`, the range between `start_date` and `end_date` is at most 62 days, and a longer range is rejected with `400`. The response from this endpoint provides an object containing:

* The `status` of the report generation.
* A report `id`.

Use the report id to download the report using the [Download a Report](https://docs.y.uno/reference/download-a-report.md) endpoint after it is generated.


## OpenAPI

````yaml openapi/reports/create-a-report.json POST /reports
openapi: 3.1.0
info:
  title: reports
  version: 1.0.2
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /reports:
    post:
      summary: Create a Report
      operationId: create-a-report
      parameters:
        - name: X-Organization-Code
          in: header
          required: true
          schema:
            type: string
          description: Organization code associated to the request.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - start_date
                - end_date
              properties:
                type:
                  type: string
                  description: >-
                    The type of the report to run (MAX 255; MIN 3).
                    SETTLEMENT_PAYOUTS is available for merchants on Yuno's new
                    reconciliation engine.
                  enum:
                    - PAYOUTS
                    - PAYMENTS
                    - TRANSACTIONS
                    - SETTLEMENTS_FEES
                    - RECONCILIATION_OVERVIEW
                    - COMMUNICATIONS
                    - SETTLEMENT_PAYOUTS
                user_code:
                  type: string
                  description: The user identifier to associate with the report request.
                start_date:
                  type: string
                  description: >-
                    Starting timestamp of data to be included in the report run
                    (MAX 24; MIN 24; [ISO
                    8601](https://en.wikipedia.org/wiki/ISO_8601)). Must be
                    before `end_date`; otherwise the API answers 400
                    REPORT_RANGE_ERROR. Must also be before the current time,
                    except for AGENDA and CASHFLOW reports, which accept future
                    dates. For report types other than TRANSACTIONS, PAYMENTS,
                    FRAUD_TRANSACTIONS, PAYOUTS, AGENDA and CASHFLOW, the range
                    between `start_date` and `end_date` is at most 62 days; a
                    longer range is rejected with 400.
                  format: date-time
                end_date:
                  type: string
                  description: >-
                    Ending timestamp of data to be included in the report run
                    (MAX 24; MIN 24; [ISO
                    8601](https://en.wikipedia.org/wiki/ISO_8601)). Must be
                    after `start_date`; otherwise the API answers 400
                    REPORT_RANGE_ERROR.
                  format: date-time
                merchant_reference_id:
                  type: string
                  description: >-
                    The unique identifier of the report at the merchant side
                    (MAX 255; MIN 3).
                account_id:
                  type: string
                  description: >-
                    Account identifier(s). Omit to include all accounts. For
                    multiple accounts, send a comma-separated list. For the
                    Settlement Payouts report, this is matched against the
                    provider account name and, for merchants on Yuno's new
                    reconciliation engine, also against the Yuno account through
                    the settlement batch. Providers whose payouts arrive through
                    a separate endpoint (for example Pagar.me) return no rows
                    when filtered this way. <br> Example:
                    `19d28762-c714-4fb0-9ef6-4e1953ed334b,
                    91d82267-c714-4fb0-9ef6-4e1953ed334b`
                acquirer:
                  type: string
                  description: >-
                    Filters the Settlements report by acquirer. Accepts a single
                    value (case-insensitive; conventionally uppercase). For the
                    Settlement Payouts report, this filter accepts a
                    comma-separated list of values, in uppercase. <br> Example:
                    `BAC_CREDOMATIC`
                provider_id:
                  type: string
                  description: >-
                    For the Settlement Payouts report, filters the rows by
                    provider. Comma-separated list, values in uppercase. <br>
                    Example: `ADYEN,CIELO`
                payment_status:
                  type: string
                  description: >-
                    The status of the payment (MAX 255; MIN 3; [Payment
                    status](/reference/payment#payments-status)). Don't send
                    this parameter to request the creation of a report for all
                    payment status. Otherwise, indicate all the status you want
                    to include. <br> Example: `CREATED,READY_TO_PAY,DECLINED`
                payment_sub_status:
                  type: string
                  description: >-
                    The substatus of the payment (MAX 255; MIN 3; [Payment
                    substatus](/reference/payment#payments-status)). Don't send
                    this parameter to request the creation of a report for all
                    payment sub status. Otherwise, indicate all the sub status
                    you want to include. <br> Example:
                    `READY_TO_PAY,PENDING_FRAUD_REVIEW,EXPIRED`
                payment_method:
                  type: string
                  description: >-
                    The type of payment method selected by the customer (MAX
                    255; MIN 3; [Payment
                    methods](/reference/payment-type-list)). Don't send this
                    parameter to request the creation of a report for all
                    payment methods. Otherwise, indicate all the methods you
                    want to include. <br> Example: `ADDI,ACUOTAZ,PIX`
                currency:
                  type: string
                  description: >-
                    The currency used to make the payment (MAX 3; MIN 3; [ISO
                    4217](/reference/country-reference)). Don't send this
                    parameter to request the creation of a report for all
                    currencies. Otherwise, indicate all currencies you want to
                    include. For the Settlement Payouts report, filters by
                    settlement currency (comma-separated list). <br> Example:
                    `ARS,BRL,COP`
                country:
                  type: string
                  description: >-
                    The country where the transaction must be processed (MAX 2;
                    MIN 2; [ISO 3166-1](/reference/country-reference)). Don't
                    send this parameter to request the creation of a report for
                    all countries. Otherwise, indicate all countries you want to
                    include. <br> Example: `AR,BR,CO`
                transaction_type:
                  type: string
                  description: >-
                    The transaction type (MAX 255; MIN 3; [Transaction
                    types](/reference/transaction#types-of-transactions)). Don't
                    send this parameter to request the creation of a report for
                    all transaction types. Otherwise, indicate all transaction
                    types you want to include. <br> Example:
                    `PURCHASE,REFUND,VERIFY`
                transaction_status:
                  type: string
                  description: >-
                    The status of the transaction (MAX 255; MIN 3; [Transaction
                    status](/reference/payment#payments-status)). Don't send
                    this parameter to request the creation of a report for all
                    transaction status. Otherwise, indicate all transaction
                    status you want to include. <br> Example:
                    `SUCCEEDED,CREATED,EXPIRED`
                updated_at_start:
                  type: string
                  description: >-
                    Starting timestamp of data to be included in the report run
                    by updated date of operation (MAX 27; MIN 27; [ISO
                    8601](https://en.wikipedia.org/wiki/ISO_8601)).
                  format: date-time
                updated_at_end:
                  type: string
                  description: >-
                    Ending timestamp of data to be included in the report run by
                    updated date of operation (MAX 27; MIN 27; [ISO
                    8601](https://en.wikipedia.org/wiki/ISO_8601)).
                  format: date-time
                columns:
                  type: string
                  description: >-
                    Columns to include (only for Payment, Transaction, or
                    Settlement Payouts reports). See available fields in [Report
                    Fields](/reference/reports-fields). For the Settlement
                    Payouts report, this parameter replaces the default column
                    selection instead of extending it: to add an optional column
                    you must also list every default column you want to keep.
                    <br> Example: `account_id,amount_value,card_category`. A
                    name that is not a column of the chosen report type returns
                    400 INVALID_COLUMNS.
                metadata_fields:
                  type: string
                  description: >-
                    Columns to include (only if the merchant is exporting
                    metadata fields). This option is exclusive to Transaction
                    and Settlement reports.
            examples:
              Create a report:
                value:
                  type: PAYMENTS
                  start_date: '2023-07-28T21:09:03.327Z'
                  end_date: '2023-07-29T21:09:03.327Z'
                  merchant_reference_id: test_id
                  account_id: >-
                    19d28762-c714-4fb0-9ef6-4e1953ed334b,
                    91d82267-c714-4fb0-9ef6-4e1953ed334b
                  payment_status: CREATED,READY_TO_PAY,DECLINED
                  payment_sub_status: READY_TO_PAY,PENDING_FRAUD_REVIEW,EXPIRED
                  payment_method: ADDI,ACUOTAZ,PIX
                  currency: ARS,BRL,COP
                  country: AR,BR,CO
                  transaction_type: PURCHASE,REFUND,VERIFY
                  transaction_status: SUCCEEDED,CREATED,EXPIRED
                  updated_at_start: '2023-07-28T21:09:03.327Z'
                  updated_at_end: '2023-07-28T21:09:03.327Z'
                  columns: account_id,amount_value,card_category
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                Result:
                  value:
                    id: 6d905149-b388-4522-8c0a-759fed1f39da
                    type: PAYMENTS
                    start_date: '2023-07-01T00:00:00.000000Z'
                    end_date: '2023-07-12T00:00:00.000000Z'
                    merchant_reference_id: payments_1
                    created_at: '2023-07-12T20:10:30.311048Z'
                    updated_at: '2023-07-12T20:10:30.311048Z'
                    expires_at: ''
                    status: IN_PROCESS
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: 6d905149-b388-4522-8c0a-759fed1f39da
                  type:
                    type: string
                    example: PAYMENTS
                  start_date:
                    type: string
                    example: 2023-07-01 00:00:00 +0000 UTC
                  end_date:
                    type: string
                    example: 2023-07-12 00:00:00 +0000 UTC
                  merchant_reference_id:
                    type: string
                    example: payments_1
                  created_at:
                    type: string
                    example: 2023-07-12 20:10:30.311048496 +0000 UTC
                  updated_at:
                    type: string
                    example: 2023-07-12 20:10:30.311048496 +0000 UTC
                  expires_at:
                    type: string
                    example: ''
                  status:
                    type: string
                    example: IN_PROCESS
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: INVALID_REQUEST
                    messages:
                      - Invalid request
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INVALID_REQUEST
                  messages:
                    type: array
                    items:
                      type: string
                      example: Invalid request
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: INVALID_CREDENTIALS
                    messages:
                      - Invalid credentials
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INVALID_CREDENTIALS
                  messages:
                    type: array
                    items:
                      type: string
                      example: Invalid credentials
        '403':
          description: '403'
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: AUTHORIZATION_REQUIRED
                    messages:
                      - The merchant has no authorization to use this API.
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: AUTHORIZATION_REQUIRED
                  messages:
                    type: array
                    items:
                      type: string
                      example: The merchant has no authorization to use this API.
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: public-api-key
      x-default: <Your public-api-key>
    sec1:
      type: apiKey
      in: header
      name: private-secret-key
      x-default: <Your private-secret-key>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.