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

# List Affiliate Sales

> Retrieves paginated affiliate sales (conversions) for the organization. For website conversions, use store_platform=website. For Shopify, use store_platform=shopify_store with store_id.

Retrieves paginated affiliate sales (conversions) for the organization. These endpoints manage **conversions** (affiliate sales) attributed to your creators and ambassadors.

For **website** conversions, call with `store_platform=website` (no `store_id` required). For **Shopify** conversions, use `store_platform=shopify_store` along with your `store_id`.

The response includes `data` (array of sales), `meta` (pagination info), and `additional_data` (aggregate totals like total GMV, commission breakdown, and order counts).

## Request Parameters

| Parameter            | Type    | Description                                                                                 | Required |
| -------------------- | ------- | ------------------------------------------------------------------------------------------- | -------- |
| `page`               | Integer | Page number for pagination. Default is 1.                                                   | No       |
| `per_page`           | Integer | Number of results per page. Default is 20. Maximum is 100.                                  | No       |
| `start_date`         | String  | Filter sales from this date (MM/DD/YYYY format)                                             | No       |
| `end_date`           | String  | Filter sales until this date (MM/DD/YYYY format)                                            | No       |
| `search`             | String  | Search by customer name or email                                                            | No       |
| `creator_id`         | Integer | Filter by Growi creator/user ID                                                             | No       |
| `creator_email`      | String  | Filter by creator's email address                                                           | No       |
| `campaign_id`        | Integer | Filter by campaign ID                                                                       | No       |
| `order_id`           | String  | Filter by external order ID                                                                 | No       |
| `status`             | String  | Filter by status: `paid`, `due`, `unpaid`, `canceled`, or `refunded`                        | No       |
| `affiliate_tag`      | String  | Filter by affiliate tag (campaign\_affiliate\_id tag)                                       | No       |
| `store_id`           | String  | Store identifier (required for Shopify, not needed for website)                             | No       |
| `store_platform`     | String  | Platform type: `website` or `shopify_store`. Use `website` for website-sourced conversions. | No       |
| `ambassador_program` | Boolean | Filter to only ambassador program sales. Default is false.                                  | No       |

## Request Example

```bash theme={null}
curl -X GET "https://api.growi.io/api/public/v1/affiliate_sales?store_platform=website&page=1&per_page=20" \
     -H "Authorization: Bearer YOUR_PUBLIC_API_KEY"
```

With date range and status filter:

```bash theme={null}
curl -X GET "https://api.growi.io/api/public/v1/affiliate_sales?store_platform=website&start_date=01/01/2025&end_date=01/31/2025&status=unpaid" \
     -H "Authorization: Bearer YOUR_PUBLIC_API_KEY"
```

## Response Example

```json theme={null}
{
  "data": [
    {
      "id": 1947457,
      "external_id": "ORD-12345",
      "platform": "website",
      "status": "unpaid",
      "occurred_at": "2025-09-30T23:55:29.000Z",
      "total": 9999,
      "commission": 500,
      "currency": "usd"
    }
  ],
  "meta": {
    "row_count": 150,
    "page_count": 8,
    "current_page": 1
  },
  "additional_data": {
    "total_gmv": 14245.57,
    "total_commission": 1403.31,
    "paid_commission": 500.00,
    "unpaid_commission": 903.31,
    "total_vat": 0.0,
    "total_orders": 150,
    "total_refunded_amount": 0.0
  }
}
```

## Response Fields

| Field                                   | Type    | Description                                                     |
| --------------------------------------- | ------- | --------------------------------------------------------------- |
| `data`                                  | Array   | Array of affiliate sale objects                                 |
| `data[].id`                             | Integer | Unique Growi identifier for the sale                            |
| `data[].external_id`                    | String  | External order ID (your system's order identifier)              |
| `data[].platform`                       | String  | Source platform: `website`, `shopify`, etc.                     |
| `data[].status`                         | String  | Sale status: `paid`, `due`, `unpaid`, `canceled`, or `refunded` |
| `data[].occurred_at`                    | String  | ISO 8601 timestamp when the sale occurred                       |
| `data[].total`                          | Integer | Total order amount in cents                                     |
| `data[].commission`                     | Integer | Commission amount in cents                                      |
| `data[].currency`                       | String  | Currency code (e.g., `usd`, `eur`)                              |
| `meta`                                  | Object  | Pagination metadata                                             |
| `meta.row_count`                        | Integer | Total number of sales matching the query                        |
| `meta.page_count`                       | Integer | Total number of pages available                                 |
| `meta.current_page`                     | Integer | Current page number                                             |
| `additional_data`                       | Object  | Aggregate totals for the query                                  |
| `additional_data.total_gmv`             | Number  | Total Gross Merchandise Value in dollars                        |
| `additional_data.total_commission`      | Number  | Total commission amount in dollars                              |
| `additional_data.paid_commission`       | Number  | Commission already paid out in dollars                          |
| `additional_data.unpaid_commission`     | Number  | Commission not yet paid in dollars                              |
| `additional_data.total_vat`             | Number  | Total VAT amount in dollars                                     |
| `additional_data.total_orders`          | Integer | Total number of orders                                          |
| `additional_data.total_refunded_amount` | Number  | Total refunded amount in dollars                                |

## Use Cases

This endpoint is useful for:

* **Conversions Dashboard**: Build a real-time dashboard showing all affiliate-attributed sales
* **Data Warehouse Sync**: Export conversion data to your analytics or data warehouse
* **Payout Reconciliation**: Verify commission amounts before processing creator payouts
* **Creator Performance**: Filter by `creator_id` or `creator_email` to analyze individual creator performance
* **Campaign Analytics**: Filter by `campaign_id` to measure campaign-specific conversion metrics
* **Financial Reporting**: Use `additional_data` totals for GMV and commission reporting


## OpenAPI

````yaml GET /affiliate_sales
openapi: 3.0.1
info:
  title: Growi API
  description: >-
    API documentation for Growi platform, showcasing the public tracking event
    endpoint
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.growi.io/api/public/v1
security:
  - bearerAuth: []
paths:
  /affiliate_sales:
    get:
      description: >-
        Retrieves paginated affiliate sales (conversions) for the organization.
        For website conversions, use store_platform=website. For Shopify, use
        store_platform=shopify_store with store_id.
      parameters:
        - name: page
          in: query
          required: false
          example: 1
          schema:
            type: integer
            default: 1
          description: Page number for pagination. Default is 1.
        - name: per_page
          in: query
          required: false
          example: 20
          schema:
            type: integer
            default: 20
            maximum: 100
          description: Number of results per page. Default is 20. Maximum is 100.
        - name: start_date
          in: query
          required: false
          example: 01/01/2025
          schema:
            type: string
            format: date
          description: Filter sales from this date (MM/DD/YYYY format)
        - name: end_date
          in: query
          required: false
          example: 01/31/2025
          schema:
            type: string
            format: date
          description: Filter sales until this date (MM/DD/YYYY format)
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: Search by customer name or email
        - name: creator_id
          in: query
          required: false
          schema:
            type: integer
          description: Filter by Growi creator/user ID
        - name: creator_email
          in: query
          required: false
          schema:
            type: string
            format: email
          description: Filter by creator's email address
        - name: campaign_id
          in: query
          required: false
          schema:
            type: integer
          description: Filter by campaign ID
        - name: order_id
          in: query
          required: false
          schema:
            type: string
          description: Filter by external order ID
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - paid
              - due
              - unpaid
              - canceled
              - refunded
          description: Filter by sale status
        - name: affiliate_tag
          in: query
          required: false
          schema:
            type: string
          description: Filter by affiliate tag
        - name: store_id
          in: query
          required: false
          schema:
            type: string
          description: Store identifier (required for Shopify, not needed for website)
        - name: store_platform
          in: query
          required: false
          example: website
          schema:
            type: string
            enum:
              - website
              - shopify_store
          description: 'Platform type: website or shopify_store'
        - name: ambassador_program
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: Filter to only ambassador program sales
      responses:
        '200':
          description: Affiliate sales retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AffiliateSale'
                  meta:
                    type: object
                    properties:
                      row_count:
                        type: integer
                        example: 150
                        description: Total number of sales matching the query
                      page_count:
                        type: integer
                        example: 8
                        description: Total number of pages
                      current_page:
                        type: integer
                        example: 1
                        description: Current page number
                  additional_data:
                    type: object
                    properties:
                      total_gmv:
                        type: number
                        example: 14245.57
                        description: Total GMV in dollars
                      total_commission:
                        type: number
                        example: 1403.31
                        description: Total commission in dollars
                      paid_commission:
                        type: number
                        example: 500
                        description: Paid commission in dollars
                      unpaid_commission:
                        type: number
                        example: 903.31
                        description: Unpaid commission in dollars
                      total_vat:
                        type: number
                        example: 0
                        description: Total VAT amount in dollars
                      total_orders:
                        type: integer
                        example: 150
                        description: Total number of orders
                      total_refunded_amount:
                        type: number
                        example: 0
                        description: Total refunded amount in dollars
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AffiliateSale:
      type: object
      properties:
        id:
          type: integer
          example: 1947457
          description: Unique Growi identifier for the sale
        external_id:
          type: string
          example: ORD-12345
          description: External order ID
        platform:
          type: string
          example: website
          description: Source platform
        status:
          type: string
          example: unpaid
          enum:
            - paid
            - due
            - unpaid
            - canceled
            - refunded
          description: Sale status
        occurred_at:
          type: string
          format: date-time
          example: '2025-09-30T23:55:29.000Z'
          description: When the sale occurred
        total:
          type: integer
          example: 9999
          description: Total amount in cents
        commission:
          type: integer
          example: 500
          description: Commission amount in cents
        currency:
          type: string
          example: usd
          description: Currency code
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````