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

# Export Orders

> Export orders as a CSV file.

**Scopes**: `orders:read`



## OpenAPI

````yaml /openapi/2027-01.openapi.json get /v1/orders/export
openapi: 3.1.0
info:
  title: Polar API
  summary: Polar HTTP and Webhooks API
  description: >-
    Read the docs at https://polar.sh/docs/api-reference. See
    https://polar.sh/docs/api-reference/versioning for the API versioning and
    deprecation policy.
  version: 2027-01
servers:
  - url: https://api.polar.sh
    description: Production environment
    x-speakeasy-server-id: production
    x-polar-environment: production
  - url: https://sandbox-api.polar.sh
    description: Sandbox environment
    x-speakeasy-server-id: sandbox
    x-polar-environment: sandbox
security: []
tags:
  - name: public
    description: >-
      Endpoints shown and documented in the Polar API documentation and
      available in our SDKs.
  - name: private
    description: >-
      Endpoints that should appear in the schema only in development to generate
      our internal JS SDK.
  - name: mcp
    description: Endpoints supported by Polar's MCP server.
  - name: cli
    description: Endpoints exposed as commands by Polar's CLI.
externalDocs:
  description: API versioning and deprecation policy
  url: https://polar.sh/docs/api-reference/versioning
paths:
  /v1/orders/export:
    get:
      tags:
        - orders
        - public
      summary: Export Orders
      description: |-
        Export orders as a CSV file.

        **Scopes**: `orders:read`
      operationId: orders:export
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The organization ID.
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The organization ID.
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              - type: 'null'
            title: OrganizationID Filter
            description: Filter by organization ID.
          description: Filter by organization ID.
        - name: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
        - name: external_product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - items:
                  type: string
                type: array
              - type: 'null'
            title: ExternalProductID Filter
            description: Filter by product external ID.
          description: Filter by product external ID.
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/OrderStatus'
              - type: array
                items:
                  $ref: '#/components/schemas/OrderStatus'
              - type: 'null'
            title: Status Filter
            description: Filter by order status.
          description: Filter by order status.
        - name: created_after
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Only include orders created after this date. Must include a UTC
              offset.
            title: Created After
          description: >-
            Only include orders created after this date. Must include a UTC
            offset.
        - name: created_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Only include orders created before this date. Must include a UTC
              offset.
            title: Created Before
          description: >-
            Only include orders created before this date. Must include a UTC
            offset.
        - name: timezone
          in: query
          required: false
          schema:
            type: string
            description: Time zone used to render dates in the CSV.
            default: UTC
            title: Timezone
          description: Time zone used to render dates in the CSV.
        - name: columns
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/OrderExportColumn'
              - type: array
                items:
                  $ref: '#/components/schemas/OrderExportColumn'
              - type: 'null'
            description: >-
              Columns to include in the CSV, in order. Defaults to email,
              created_at, product, net_amount, currency, status and
              invoice_number.
            title: Columns
          description: >-
            Columns to include in the CSV, in order. Defaults to email,
            created_at, product, net_amount, currency, status and
            invoice_number.
      responses:
        '200':
          description: Successful Response
          content:
            text/csv:
              schema:
                type: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - oidc:
            - orders:read
        - pat:
            - orders:read
        - oat:
            - orders:read
      x-codeSamples:
        - lang: python
          source: |
            from polar.v2027_01 import Polar

            polar = Polar("polar_oat_xxx")

            response = polar.orders.export(
                timezone='UTC',
            )
            print(response)
        - lang: typescript
          source: |
            import { createPolar } from "@polar-sh/sdk/2027-01";

            const polar = createPolar({
              accessToken: "polar_oat_xxx",
            });

            const response = await polar.orders.export(
              {
                "timezone": "UTC"
              },
            );
            console.log(response);
components:
  schemas:
    OrderStatus:
      type: string
      enum:
        - draft
        - pending
        - paid
        - refunded
        - partially_refunded
        - void
      title: OrderStatus
    OrderExportColumn:
      type: string
      enum:
        - email
        - created_at
        - product
        - net_amount
        - currency
        - status
        - invoice_number
        - customer_name
        - billing_name
        - billing_country
        - subtotal_amount
        - discount_amount
        - tax_amount
        - total_amount
        - refunded_amount
        - billing_reason
      title: OrderExportColumn
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    oidc:
      type: openIdConnect
      openIdConnectUrl: /.well-known/openid-configuration
    pat:
      type: http
      description: >-
        You can generate a **Personal Access Token** from your
        [settings](https://polar.sh/settings).
      scheme: bearer
    oat:
      type: http
      description: >-
        You can generate an **Organization Access Token** from your
        organization's settings.
      scheme: bearer

````

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