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

# List Affiliate Orders

> Retrieves a paginated list of orders attributed to a specific affiliate (by customerId) in the store.
Requires the `stores.affiliates.view` permission.



## OpenAPI

````yaml GET /stores/{storeId}/affiliates/{customerId}/orders/{page}
openapi: 3.0.4
info:
  title: Komerza API
  description: >-
    The base Komerza API for interfacing with the Komerza platform through a
    REST interface.
  termsOfService: https://komerza.com/terms
  contact:
    name: Support
    url: https://help.komerza.com
    email: support@komerza.com
  version: vUnknown-Development
servers:
  - url: https://api.komerza.com
    description: The production Komerza API
security:
  - bearer: []
tags:
  - name: Affiliate
    description: Manage store affiliates.
  - name: Analytics
    description: >-
      Analytics endpoints for a store: store dashboard, visitor dashboard and
      daily stats.
  - name: Application
    description: Manages OAuth2 applications owned by users for third-party integrations.
  - name: Billing
    description: Provides billing-related endpoints for user accounts.
  - name: Blacklist
    description: Manages blacklist rules and customer blocking for a store.
  - name: BlogCategory
    description: Manages blog categories for a store.
  - name: BlogPost
    description: Manages blog posts for a store.
  - name: Category
    description: >-
      Handles the management of categories, which are used to organize products
      within a store.
  - name: Coupon
    description: >-
      Handles the management of coupons, which are used to give customers a
      percentage discount off any products in your

      store
  - name: Customer
    description: Controller that handles customer-related actions.
  - name: CustomField
    description: Controller for managing custom fields on a product variant.
  - name: CustomPaymentMethod
    description: >-
      Manages custom payment methods for a store (Instructions and Redirect
      types).
  - name: Discord
    description: >-
      Manages Discord integration settings, variant roles, product overrides,
      and grants.
  - name: DiscountDialog
    description: >-
      Handles the management of discount dialogs, which are promotional popups
      displayed on storefronts

      to encourage customer engagement through discount offers.
  - name: Domain
    description: >-
      Controller that handles all store domain-related concerns, like URLs and
      custom domains.
  - name: EmailMarketing
    description: Manages email marketing setup and status for a store
  - name: EmailMarketingCampaign
    description: Manages email campaigns (create, schedule, send, cancel)
  - name: EmailMarketingCredit
    description: Manages email marketing credit packages and purchases
  - name: EmailMarketingDomain
    description: Manages email sending domains for a store (add, verify, delete)
  - name: EmailMarketingRecipient
    description: Manages email recipient lists and their entries
  - name: EmailMarketingSuppression
    description: Manages email suppressions (unsubscribes, bounces, complaints) for a store
  - name: EmailMarketingTemplate
    description: Manages email templates (GrapeJS editor JSON + compiled HTML)
  - name: EmailUnsubscribe
    description: Public endpoint for email unsubscribe (no authentication required)
  - name: FlaggedUsers
    description: Controller for managing flagged users in the administration panel.
  - name: LicenseKey
    description: >-
      Controller that handles license key/item operations including search and
      inventory management.
  - name: OAuth
    description: Controller responsible for handling OAuth2 operations.
  - name: Onboarding
    description: >-
      Manages the merchant onboarding setup guide, including progress tracking,
      step completion, and dismissal.
  - name: Order
    description: Controller that handles order-related concerns.
  - name: Passkey
    description: Manages FIDO2/WebAuthn passkeys for two-factor authentication.
  - name: Product
    description: >-
      Handles creation, retrieval, updating, and deletion of products within a
      store.
  - name: Review
    description: ''
  - name: Store
    description: >-
      Manages actions related to stores in the system, such as creating,
      updating, and retrieving store information.
  - name: StoreBranding
    description: >-
      Provides functionalities for managing store branding and related
      configurations.
  - name: Subscription
    description: Controller for merchant management of customer subscriptions.
  - name: Tax
    description: Manages tax/VAT settings and rules for a store.
  - name: Temp
  - name: Ticket
    description: Handles ticket replies and closure
  - name: User
    description: Manages user-related functionalities and actions for the platform.
  - name: Variant
    description: >-
      Controller which handles management of product variants, including
      creation, updates, deletion,

      file and image uploads, and delivery settings.
  - name: VolumeDiscount
    description: Controller for managing volume discount tiers on a product variant.
  - name: Webhook
    description: Controller for managing webhook operations within the system.
paths:
  /stores/{storeId}/affiliates/{customerId}/orders/{page}:
    get:
      tags:
        - Affiliate
      summary: List affiliate orders.
      description: >-
        Retrieves a paginated list of orders attributed to a specific affiliate
        (by customerId) in the store.

        Requires the `stores.affiliates.view` permission.
      parameters:
        - name: storeId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: customerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: page
          in: path
          required: true
          schema:
            type: integer
            format: int32
            default: 1
        - name: limit
          in: query
          schema:
            type: integer
            format: int32
            default: 20
      responses:
        '200':
          description: The object was successfully returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicOrderPaginatedResponse'
components:
  schemas:
    PublicOrderPaginatedResponse:
      required:
        - data
        - pages
        - success
      type: object
      properties:
        success:
          type: boolean
          description: Indicates whether the operation was successful
          readOnly: true
        pages:
          type: integer
          description: The total number of pages available in the paginated response.
          format: int32
        data:
          type: array
          items:
            $ref: '#/components/schemas/PublicOrder'
          description: Represents the collection of items within a paginated response
      additionalProperties: false
      description: |-
        Represents a paginated response returned from API endpoints,
        which contains the paginated data and metadata about the pagination.
    PublicOrder:
      required:
        - amount
        - amountPaid
        - currencyCode
        - customer
        - dateCreated
        - deliveredItems
        - gateway
        - gatewayMetadata
        - globalGatewayFeeAmount
        - globalGatewayFeePercentage
        - globalGatewayFixedFee
        - globalGatewayFixedFeeAmount
        - id
        - items
        - source
        - status
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity
          format: uuid
        dateCreated:
          type: string
          description: The date the entity was created
          format: date-time
        items:
          type: array
          items:
            $ref: '#/components/schemas/PublicLineItem'
          description: The product that was purchased
        currencyCode:
          type: string
          description: The fiat currency code used for the order, defaults to USD
        gateway:
          type: string
          description: The gateway used to facilitate the purchase
        customer:
          $ref: '#/components/schemas/PublicCustomerDetails'
        chargeback:
          $ref: '#/components/schemas/PublicChargeback'
        gatewayMetadata:
          $ref: '#/components/schemas/PublicGatewayMetadata'
        status:
          type: string
          description: The current payment status
        amountPaid:
          type: number
          description: The amount that the customer has paid for the invoice
          format: double
        amount:
          type: number
          description: The cost of the order
          format: double
        coupon:
          $ref: '#/components/schemas/PublicOrderCoupon'
        affiliateDiscount:
          $ref: '#/components/schemas/PublicOrderDiscount'
        tax:
          $ref: '#/components/schemas/PublicOrderTax'
        globalGatewayFeePercentage:
          type: number
          description: >-
            The global gateway fee percentage that was configured (e.g., 2.5 for
            2.5%).
          format: double
        globalGatewayFeeAmount:
          type: number
          description: The calculated amount from the global gateway fee percentage.
          format: double
        globalGatewayFixedFee:
          type: number
          description: The global gateway fixed fee that was configured.
          format: double
        globalGatewayFixedFeeAmount:
          type: number
          description: >-
            The global gateway fixed fee amount actually applied (0 if
            product-level overrides exist).
          format: double
        deliveredItems:
          type: array
          items:
            $ref: '#/components/schemas/PublicDeliveredItem'
          description: The list of delivered items
        customFieldAnswers:
          type: object
          additionalProperties:
            type: string
          description: The answers to the custom fields for the order
          nullable: true
        returnUrl:
          type: string
          description: The URL to redirect the customer to after payment completion.
          nullable: true
        metadata:
          type: object
          additionalProperties:
            type: string
          description: >-
            Custom key-value metadata attached to the order for merchant
            tracking purposes.
          nullable: true
        source:
          type: string
          description: >-
            The source of the order: "store" (marketplace), "embed" (embeds),
            "api" (dashboard/API).
        discordAccount:
          $ref: '#/components/schemas/PublicOrderDiscordAccount'
        marketingOptIn:
          type: boolean
          description: >-
            Whether the customer has opted in to receive marketing emails from
            this store.

            Null means no explicit choice has been recorded (pre-existing
            customer, treated as opted-in).
          nullable: true
      additionalProperties: false
      description: An order made by a customer to a merchant for a product they are selling
    PublicLineItem:
      required:
        - additionalFeeAmount
        - additionalFeePercentage
        - additionalFixedFeeAmount
        - amount
        - dateCreated
        - id
        - lineTotal
        - productId
        - productName
        - quantity
        - variantId
        - variantName
        - volumeDiscountAmount
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity
          format: uuid
        dateCreated:
          type: string
          description: The date the entity was created
          format: date-time
        productName:
          type: string
          description: The name of the product
        productId:
          type: string
          description: The ID of the product
          format: uuid
        variantId:
          type: string
          description: The ID of the variant they purchased
          format: uuid
        variantName:
          type: string
          description: The name of the variant they purchased
        amount:
          type: number
          description: The unit cost, how much one unit of the product costs
          format: double
        lineTotal:
          type: number
          description: The total cost for the line item (Amount * Quantity)
          format: double
        additionalFeePercentage:
          type: number
          description: An additional fee percentage applied to the line item, if any.
          format: double
        additionalFeeAmount:
          type: number
          description: >-
            The total amount of any additional percentage fees applied to the
            line item.
          format: double
        additionalFixedFeeAmount:
          type: number
          description: >-
            The total amount of any additional fixed fees applied to the line
            item.
          format: double
        volumeDiscountAmount:
          type: number
          description: The volume discount amount applied to this line item.
          format: double
        volumeDiscountType:
          $ref: '#/components/schemas/PublicVolumeDiscountType'
        volumeDiscountValue:
          type: number
          description: The discount value from the applied tier (e.g., 10 for 10% or $10).
          format: double
          nullable: true
        volumeDiscountTierQuantity:
          type: integer
          description: >-
            The quantity threshold of the tier that was applied (e.g., 10 for
            "Buy 10+").
          format: int32
          nullable: true
        quantity:
          type: integer
          description: The amount of product that was purchased
          format: int32
        billingInterval:
          $ref: '#/components/schemas/BillingInterval'
        customIntervalDays:
          type: integer
          description: >-
            Custom interval in days when
            Komerza.Common.Models.Orders.PublicLineItem.BillingInterval is
            Komerza.Common.Models.Products.BillingInterval.Custom.
          format: int32
          nullable: true
      additionalProperties: false
      description: Represents an item purchased by a customer within an order
    PublicCustomerDetails:
      required:
        - countryCode
        - customerId
        - dateCreated
        - emailAddress
        - id
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity
          format: uuid
        dateCreated:
          type: string
          description: The date the entity was created
          format: date-time
        countryCode:
          type: string
          description: The country code of the customer
        emailAddress:
          type: string
          description: The email address of the customer
        customerId:
          type: string
          description: The ID of the customer profile in the database
          format: uuid
      additionalProperties: false
      description: The customer details on the order
    PublicChargeback:
      required:
        - dateCreated
        - id
        - reason
        - status
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity
          format: uuid
        dateCreated:
          type: string
          description: The date the entity was created
          format: date-time
        status:
          type: string
          description: Represents the current state of the dispute.
        reason:
          type: string
          description: Represents the reason associated with a dispute.
      additionalProperties: false
      description: Represents a cardholder chargeback/dispute on an order
    PublicGatewayMetadata:
      required:
        - dateCreated
        - id
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity
          format: uuid
        dateCreated:
          type: string
          description: The date the entity was created
          format: date-time
        transactionId:
          type: string
          description: The transaction ID associated with the gateway
          nullable: true
        clientSecret:
          type: string
          description: >-
            The client secret used by card gateways to facilitate payments down
            to the browser
          nullable: true
        note:
          type: string
          description: The note for PayPal Friends and Family or Cash App payments
          nullable: true
        cryptocurrencyAddress:
          type: string
          description: The address for a cryptocurrency payment
          nullable: true
        cryptocurrencyAmount:
          type: number
          description: >-
            The amount of cryptocurrency converted at the time for a
            cryptocurrency payment
          format: double
          nullable: true
        cryptocurrencyExpiration:
          type: string
          description: The date the cryptocurrency payment expires
          format: date-time
          nullable: true
      additionalProperties: false
      description: The gateway-specific metadata for the order
    PublicOrderCoupon:
      required:
        - code
        - couponId
        - dateCreated
        - id
        - netDecrease
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity
          format: uuid
        dateCreated:
          type: string
          description: The date the entity was created
          format: date-time
        percentageDecrease:
          type: number
          description: >-
            The percentage the coupon cut off the order, this is null if the
            coupon was a fixed amount instead which the net

            decrease is below
          format: double
          nullable: true
        netDecrease:
          type: number
          description: The net amount the coupon decreased the order by
          format: double
        code:
          type: string
          description: The code of the coupon
        couponId:
          type: string
          description: The ID of the coupon
          format: uuid
      additionalProperties: false
      description: Represents the usage data of a coupon within an order
    PublicOrderDiscount:
      required:
        - dateCreated
        - id
        - netDecrease
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity
          format: uuid
        dateCreated:
          type: string
          description: The date the entity was created
          format: date-time
        percentageDecrease:
          type: number
          description: >-
            The percentage the coupon cut off the order, this is null if the
            coupon was a fixed amount instead which the net

            decrease is below
          format: double
          nullable: true
        netDecrease:
          type: number
          description: The net amount the coupon decreased the order by
          format: double
      additionalProperties: false
      description: Represents the usage data of a coupon within an order
    PublicOrderTax:
      required:
        - isReverseCharge
        - preTaxAmount
        - taxAmount
        - taxBehavior
        - taxName
        - taxRate
      type: object
      properties:
        taxAmount:
          type: number
          description: The tax amount charged.
          format: double
        taxRate:
          type: number
          description: The tax rate applied as a percentage.
          format: double
        taxName:
          type: string
          description: The display name of the tax (e.g. "VAT", "Sales Tax").
        isReverseCharge:
          type: boolean
          description: Whether reverse charge was applied.
        customerVatId:
          type: string
          description: The customer's VAT ID if provided.
          nullable: true
        preTaxAmount:
          type: number
          description: The order subtotal before tax.
          format: double
        taxBehavior:
          type: string
          description: 'Tax behavior: "exclusive" or "inclusive".'
      additionalProperties: false
      description: Represents the tax applied to an order.
    PublicDeliveredItem:
      required:
        - dateCreated
        - id
        - orderId
        - source
        - storeId
        - type
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity
          format: uuid
        dateCreated:
          type: string
          description: The date the entity was created
          format: date-time
        orderId:
          type: string
          description: >-
            The unique identifier for the order associated with the delivered
            item.
          format: uuid
        storeId:
          type: string
          description: >-
            The unique identifier for the store associated with the delivered
            item.
          format: uuid
        productId:
          type: string
          description: The identifier of the related product, if applicable.
          format: uuid
          nullable: true
        variantId:
          type: string
          description: >-
            The optional identifier for the variant of the delivered item, if
            applicable.
          format: uuid
          nullable: true
        type:
          maxLength: 128
          type: string
          description: The type that categorizes the delivered item.
        source:
          maxLength: 128
          type: string
          description: The source of the delivered item, indicates its origin or context.
        textContent:
          maxLength: 10000
          type: string
          description: >-
            The text content associated with the delivered item. Used for
            LicenseKey, Plaintext, or Dynamic types.
          nullable: true
        file:
          $ref: '#/components/schemas/PublicStoredFile'
      additionalProperties: false
      description: Represents an item that is delivered as part of an order.
    PublicOrderDiscordAccount:
      required:
        - discordUserId
        - username
      type: object
      properties:
        discordUserId:
          type: string
          description: The Discord user ID (snowflake) of the customer.
        username:
          type: string
          description: The Discord username at the time of the order.
        displayName:
          type: string
          description: The Discord display name at the time of the order, if set.
          nullable: true
        avatarUrl:
          type: string
          description: The Discord avatar URL at the time of the order, if available.
          nullable: true
      additionalProperties: false
      description: >-
        Public representation of the Discord account details associated with an
        order.
    PublicVolumeDiscountType:
      enum:
        - 0
        - 1
        - 2
      type: integer
      description: Specifies the type of discount to apply for volume pricing tiers.
      format: int32
    BillingInterval:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
      type: integer
      description: The billing interval for a subscription product
      format: int32
    PublicStoredFile:
      required:
        - dateCreated
        - friendlyName
        - id
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the entity
          format: uuid
        dateCreated:
          type: string
          description: The date the entity was created
          format: date-time
        friendlyName:
          maxLength: 128
          minLength: 1
          type: string
          description: The friendly name representing the stored file.
      additionalProperties: false
      description: Represents a publicly accessible file with additional metadata.
  securitySchemes:
    bearer:
      type: http
      description: Your API key goes here
      scheme: bearer
      bearerFormat: JWT

````