> ## 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.

# Get Ambassador Sales

> Retrieves detailed ambassador sales data including order information, commission amounts, and program details within a specified date range

Retrieves detailed ambassador sales data including order information, commission amounts, and program details within a specified date range. This endpoint supports filtering by payment status, creator email, and pagination.

## Request Parameters

| Parameter       | Type    | Description                                                           | Required |
| --------------- | ------- | --------------------------------------------------------------------- | -------- |
| `start_date`    | String  | Start date in MM/DD/YYYY format                                       | Yes      |
| `end_date`      | String  | End date in MM/DD/YYYY format                                         | Yes      |
| `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       |
| `status`        | String  | Filter by status: `paid`, `due`, `pending`, `canceled`, or `refunded` | No       |
| `creator_email` | String  | Filter results by the creator’s (ambassador’s) email address          | No       |
| `affiliate_tag` | String  | Filter by affiliate tag                                               | No       |
| `order_id`      | String  | Filter by a Shopify order id                                          | No       |

## Request Example

```bash theme={null}
curl -X GET "https://api.growi.io/api/public/v1/stats/query_ambassador_sales?start_date=09/01/2025&end_date=09/30/2025&page=1&per_page=20&status=pending&creator_email=example@example.com" \
     -H "Authorization: Bearer YOUR_PUBLIC_API_KEY" \
     -H "Content-Type: application/json"
```

## Response Example

```json theme={null}
{
  "data": [
    {
      "id": 0,
      "ambassador": {
        "id": 0,
        "name": "0",
        "email": "example@example.com",
        "avatar_url": null
      },
      "program": {
        "id": 0,
        "name": "Test Program",
        "affiliate_status": "active"
      },
      "order": {
        "id": 0,
        "total": "$1.70",
        "subtotal": "$1.50",
        "logs": []
      },
      "sale_amount": {
        "formatted": "$1.70",
        "cents": 170
      },
      "commission": {
        "amount": 1.75,
        "formatted": "$1.75",
        "original_amount": 1.75,
        "original_formatted": "$1.75",
        "override": 0.0,
        "has_override": false
      },
      "occurred_at": "2025-09-30T23:55:29.000Z",
      "due_in_days": 50,
      "invoice": null,
      "status": "pending",
      "refunded": false,
      "disable_attribution": false,
      "self_referral": false
    }
  ],
  "meta": {
    "row_count": 0,
    "page_count": 0,
    "current_page": 1
  },
  "additional_data": {
    "total_gmv": 0,
    "total_commission": 0,
    "paid_commission": 0.0,
    "unpaid_commission": 0,
    "total_orders": 0,
    "total_quantity": 0,
    "total_refunded_amount": 0,
    "total_returned_amount": 0,
    "total_posts": 0
  },
  "user_contents": []
}
```

## Response Fields

| Field                                   | Type    | Description                                                            |
| --------------------------------------- | ------- | ---------------------------------------------------------------------- |
| `data`                                  | Array   | Array of ambassador sale objects                                       |
| `data[].id`                             | Integer | Unique identifier for the sale record                                  |
| `data[].ambassador`                     | Object  | Ambassador information                                                 |
| `data[].ambassador.name`                | String  | Display name of the ambassador                                         |
| `data[].ambassador.email`               | String  | Email address of the ambassador                                        |
| `data[].ambassador.avatar_url`          | String  | URL to the ambassador's avatar image (null if not available)           |
| `data[].program`                        | Object  | Program information                                                    |
| `data[].program.id`                     | Integer | Unique identifier for the program                                      |
| `data[].program.name`                   | String  | Name of the ambassador program                                         |
| `data[].program.affiliate_status`       | String  | Status of the affiliate (e.g., "active")                               |
| `data[].order`                          | Object  | Order details                                                          |
| `data[].order.id`                       | Integer | Unique identifier for the order                                        |
| `data[].order.total`                    | String  | Total order amount in formatted currency                               |
| `data[].order.subtotal`                 | String  | Order subtotal in formatted currency                                   |
| `data[].order.logs`                     | Array   | Order activity logs                                                    |
| `data[].sale_amount`                    | Object  | Sale amount details                                                    |
| `data[].sale_amount.formatted`          | String  | Formatted sale amount with currency symbol                             |
| `data[].sale_amount.cents`              | Integer | Sale amount in cents                                                   |
| `data[].commission`                     | Object  | Commission details                                                     |
| `data[].commission.amount`              | Number  | Commission amount in dollars                                           |
| `data[].commission.formatted`           | String  | Formatted commission amount with currency symbol                       |
| `data[].commission.original_amount`     | Number  | Original commission amount before any overrides                        |
| `data[].commission.original_formatted`  | String  | Formatted original commission amount                                   |
| `data[].commission.override`            | Number  | Override amount applied to commission                                  |
| `data[].commission.has_override`        | Boolean | Whether commission has been manually overridden                        |
| `data[].occurred_at`                    | String  | ISO 8601 timestamp when the sale occurred                              |
| `data[].due_in_days`                    | Integer | Number of days until commission payment is due                         |
| `data[].invoice`                        | String  | Associated invoice (null if none)                                      |
| `data[].status`                         | String  | Sale status: `paid`, `due`, `pending`, `canceled`, or `refunded`       |
| `data[].refunded`                       | Boolean | Whether the sale has been refunded                                     |
| `data[].disable_attribution`            | Boolean | Whether attribution is disabled for this sale                          |
| `data[].self_referral`                  | Boolean | Whether this is a self-referral (ambassador purchased from themselves) |
| `meta`                                  | Object  | Pagination metadata                                                    |
| `meta.row_count`                        | Integer | Total number of records matching the query                             |
| `meta.page_count`                       | Integer | Total number of pages available                                        |
| `meta.current_page`                     | Integer | Current page number                                                    |
| `additional_data`                       | Object  | Summary statistics for the query results                               |
| `additional_data.total_gmv`             | Number  | Total Gross Merchandise Value for all sales in the date range          |
| `additional_data.total_commission`      | Number  | Total commission amount across all sales                               |
| `additional_data.paid_commission`       | Number  | Total commission already paid out                                      |
| `additional_data.unpaid_commission`     | Number  | Total commission not yet paid                                          |
| `additional_data.total_orders`          | Integer | Total number of orders                                                 |
| `additional_data.total_quantity`        | Integer | Total quantity of items sold                                           |
| `additional_data.total_refunded_amount` | Number  | Total amount refunded                                                  |
| `additional_data.total_returned_amount` | Number  | Total amount returned                                                  |
| `additional_data.total_posts`           | Integer | Total number of posts associated with sales                            |

## Status Filter Options

The `status` parameter accepts the following values:

* `all` - Returns all sales regardless of status
* `paid` - Returns only sales where commission has been paid
* `due` - Returns sales where commission payment is due
* `pending` - Returns sales with pending commission payments
* `canceled` - Returns canceled sales
* `refunded` - Returns refunded sales

## Use Cases

This endpoint is useful for:

* **Commission Reports**: Generate detailed commission reports for ambassadors
* **Financial Analytics**: Track GMV, commission, and payment status across date ranges
* **Ambassador Performance**: Monitor individual ambassador sales and earnings
* **Payment Processing**: Identify due and pending commissions for payout processing
* **Self-Referral Detection**: Filter out or identify self-referral transactions
* **Email Filtering**: Filter sales by ambassador’s email for precision reporting
* **Affiliate Tag Filtering**: Find sales by affiliate tags


## OpenAPI

````yaml GET /stats/query_ambassador_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:
  /stats/query_ambassador_sales:
    get:
      description: >-
        Retrieves detailed ambassador sales data including order information,
        commission amounts, and program details within a specified date range
      parameters:
        - name: start_date
          in: query
          required: true
          example: 09/01/2025
          schema:
            type: string
            format: date
            default: 09/01/2025
          description: Start date in MM/DD/YYYY format
        - name: end_date
          in: query
          required: true
          example: 09/30/2025
          schema:
            type: string
            format: date
            default: 09/30/2025
          description: End date in MM/DD/YYYY format
        - 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: status
          in: query
          required: false
          example: all
          schema:
            type: string
            enum:
              - all
              - paid
              - due
              - pending
              - canceled
              - refunded
            default: all
          description: Filter by sale status
        - name: creator_email
          in: query
          required: false
          example: example@gmail.com
          schema:
            type: string
            format: email
          description: Filter results by the creator’s (ambassador’s) email address
        - name: affiliate_tag
          in: query
          required: false
          example: SUMMER2025
          schema:
            type: string
          description: Filter by affiliate tag
        - name: order_id
          in: query
          required: false
          example: '1234567890'
          schema:
            type: string
          description: Filter by a Shopify order ID
      responses:
        '200':
          description: Ambassador sales retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1947457
                          description: Unique identifier for the sale record
                        ambassador:
                          type: object
                          properties:
                            name:
                              type: string
                              example: Amanda Paradis
                              description: Display name of the ambassador
                            email:
                              type: string
                              example: amanda@example.com
                              description: Email address of the ambassador
                            avatar_url:
                              type: string
                              nullable: true
                              description: URL to the ambassador's avatar image
                        program:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 123
                              description: Unique identifier for the program
                            name:
                              type: string
                              example: Ambassador Program
                              description: Name of the ambassador program
                            affiliate_status:
                              type: string
                              example: active
                              description: Status of the affiliate
                        order:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1024995
                              description: Unique identifier for the order
                            total:
                              type: string
                              example: $291.70
                              description: Total order amount
                            subtotal:
                              type: string
                              example: $276.50
                              description: Order subtotal
                            log:
                              type: array
                              items:
                                type: object
                              description: Order activity log
                        sale_amount:
                          type: object
                          properties:
                            formatted:
                              type: string
                              example: $291.70
                              description: Formatted sale amount
                            cents:
                              type: integer
                              example: 29170
                              description: Sale amount in cents
                        commission:
                          type: object
                          properties:
                            amount:
                              type: number
                              example: 8.75
                              description: Commission amount
                            formatted:
                              type: string
                              example: $8.75
                              description: Formatted commission amount
                            original_amount:
                              type: number
                              example: 8.75
                              description: Original commission amount
                            original_formatted:
                              type: string
                              example: $8.75
                              description: Formatted original commission amount
                            override:
                              type: number
                              example: 0
                              description: Override amount
                            has_override:
                              type: boolean
                              example: false
                              description: Whether commission has been overridden
                        occurred_at:
                          type: string
                          example: '2025-09-30T23:55:29.000Z'
                          description: ISO 8601 timestamp when the sale occurred
                        due_in_days:
                          type: integer
                          example: 50
                          description: Number of days until commission is due
                        invoice:
                          type: string
                          nullable: true
                          description: Associated invoice
                        status:
                          type: string
                          example: pending
                          enum:
                            - paid
                            - due
                            - pending
                            - canceled
                            - refunded
                          description: Sale status
                        refunded:
                          type: boolean
                          example: false
                          description: Whether the sale has been refunded
                        disable_attribution:
                          type: boolean
                          example: false
                          description: Whether attribution is disabled
                        self_referral:
                          type: boolean
                          example: false
                          description: Whether this is a self-referral
                  meta:
                    type: object
                    properties:
                      row_count:
                        type: integer
                        example: 12588
                        description: Total number of records
                      page_count:
                        type: integer
                        example: 630
                        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: 1424557.53
                        description: Total Gross Merchandise Value
                      total_commission:
                        type: number
                        example: 140331.24
                        description: Total commission amount
                      paid_commission:
                        type: number
                        example: 0
                        description: Total paid commission
                      unpaid_commission:
                        type: number
                        example: 140331.24
                        description: Total unpaid commission
                      total_orders:
                        type: integer
                        example: 12588
                        description: Total number of orders
                      total_quantity:
                        type: integer
                        example: 31386
                        description: Total quantity sold
                      total_refunded_amount:
                        type: number
                        example: 0
                        description: Total refunded amount
                      total_returned_amount:
                        type: number
                        example: 0
                        description: Total returned amount
                      total_posts:
                        type: integer
                        example: 0
                        description: Total number of posts
                  user_contents:
                    type: array
                    items:
                      type: object
                    description: User-generated content associated with sales
        '400':
          description: Bad Request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````