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

# Export orders as CSV

> Exports orders as a CSV file and sends it to the specified email address. This is an asynchronous operation that returns immediately with a 202 status.

<Warning>
  **v1 (legacy).** This page documents the API before the v2 update. The v1
  format is not enabled for new accounts and must be enabled on your account by
  your account manager. New integrations should use the
  [current documentation](/introduction). To update an existing integration,
  follow the [migration guide](/migration).
</Warning>


## OpenAPI

````yaml v1/api-reference/orders-docs.json post /api/orders/export
openapi: 3.0.0
info:
  version: v1.0.0
  title: Orders API (legacy v1)
  description: API for managing orders in the Rio platform
servers:
  - url: https://app.sandbox.rio.trade
security:
  - apiKeyAuth: []
paths:
  /api/orders/export:
    post:
      summary: Export orders as CSV
      description: >-
        Exports orders as a CSV file and sends it to the specified email
        address. This is an asynchronous operation that returns immediately with
        a 202 status.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
                  description: Email address to send the CSV file to
                  example: user@example.com
                id:
                  type: string
                  description: Order id by which you want to filter
                  example: b49f4084b96e4fb76f5a496e
                userId:
                  type: string
                  description: User id by which you want to filter
                  example: b49f4084b96e4fb76f5a496e
                brokerId:
                  type: string
                  description: Broker id by which you want to filter
                  example: b49f4084b96e4fb76f5a496e
                startDate:
                  type: string
                  format: date-time
                  description: Start date for filtering orders
                  example: '2024-01-01T00:00:00.000Z'
                endDate:
                  type: string
                  format: date-time
                  description: End date for filtering orders
                  example: '2024-01-31T23:59:59.999Z'
                fiat:
                  type: string
                  description: Fiat currency by which you want to filter
                  example: MXN
                crypto:
                  type: string
                  description: Crypto currency by which you want to filter
                  example: USDC
                side:
                  type: string
                  enum:
                    - buy
                    - sell
                  description: Order side by which you want to filter
                status:
                  type: string
                  description: Order status by which you want to filter
                  example: complete
                country:
                  type: string
                  description: Country by which you want to filter
                  example: MX
                minOrderSize:
                  type: number
                  minimum: 0
                  description: Minimum order size to filter by
                  example: 100
                maxOrderSize:
                  type: number
                  minimum: 0
                  description: Maximum order size to filter by
                  example: 10000
                orderStatusGroups:
                  type: array
                  items:
                    type: string
                  description: Array of order status groups to filter by
                  example:
                    - completed
                    - processing
      responses:
        '202':
          description: Export request accepted. CSV will be sent to the provided email.
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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