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

# Create statement file for an account

Generate a statement asynchronously in `PDF`, `CSV` or `MT940` format for a given account.

It is not possible to generate statements for periods longer than 31 days.

In order to retrieve the generated statement go to `Retrieve a statement for an account`

<Warning>Technical note: the input dates (and output file names) will be understood as of `Europe/London` timezone.
This timezone can be GMT/WET (UTC+00:00), *or* BST/WEST (UTC+01:00) when DST is applied.
This occasional shift from UTC, during DST, prevents us to label these dates as being UTC.
If you are not sure if this warning applies to your scenario, ignore it.</Warning>


## OpenAPI

````yaml /openapi.json post /accounts/{account_id}/statements/file
openapi: 3.0.0
info:
  description: |
    Ebury API allows customers:
      to retrieve accounts, balances, beneficiaries, and transactions;
      to get buy/sell estimates and quotes, book trades and retrieve trade history;
      to allocate payments to a trade and beneficiary, and to submit payments in bulk;
      to download documents such as trade receipt, payment instruction and payment receipt;
      to manage the authorised persons on their account.
    The Metadata API allows applications to clarify some parts of the Ebury API
      that are impractical to express schematically.
  termsOfService: https://docs.ebury.io/#terms-of-use
  title: Ebury API
  version: '0.1'
servers:
  - url: https://{environment}.ebury.io
    variables:
      environment:
        default: api
        enum:
          - api
          - sandbox
security:
  - api_key: []
paths:
  /accounts/{account_id}/statements/file:
    post:
      tags:
        - Statements Create
      summary: Create statement file for an account
      description: >-
        Generate a statement asynchronously in PDF, CSV, MT940 or XLS format for
        a given account.
      parameters:
        - description: Account UUID
          in: path
          name: account_id
          required: true
          schema:
            type: string
        - description: The ID of the client
          in: query
          name: client_id
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access token
          required: true
          schema:
            type: string
        - description: The ID of the contact
          in: header
          name: X-Contact-ID
          required: false
          schema:
            type: string
        - description: The format of the statement to generate
          in: query
          name: format
          required: false
          schema:
            type: string
            default: pdf
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewStatement'
        description: Request Payload
        required: true
      responses:
        '202':
          description: Statement processing started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatementFileData'
        '400':
          description: >-
            Formatting, parameter or schema validation error. See error message
            for further details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Access denied due to authentication failure
        '403':
          description: >-
            Could not complete action due to data constraints. Refer to error
            message for additional details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Client ID not found
        '409':
          description: >-
            Could not update contact due to data constraint or conflict with
            contact status. Refer to error message for additional details
        '502':
          description: Internal integration error. Contact support
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    NewStatement:
      properties:
        from_value_datetime:
          description: >-
            Only return transactions with value date after this date. Time
            ignored, considered always to be the start of the day.
            YYYY-MM-DDThh:mm format
          type: string
        to_value_datetime:
          description: >-
            Only return transactions with value date before this date. Time
            ignored, considered always to be the end of the day.
            YYYY-MM-DDThh:mm format
          type: string
      required:
        - from_value_datetime
      type: object
    StatementFileData:
      properties:
        url:
          description: >-
            The url needed to retrieve the statement. It contains two UUID
            values, the first one (from the left) is the account id and the
            second one is the statement id.
          type: string
      required:
        - url
      type: object
    ErrorMessage:
      description: An error message.
      properties:
        code:
          type: string
          description: The code for the error.
        details:
          description: Error details
          type: string
        message:
          type: string
          description: A short description of the cause of the error.
      required:
        - code
        - message
        - details
      type: object
  securitySchemes:
    api_key:
      description: An API Key.
      in: header
      name: x-api-key
      type: apiKey

````