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

# Create an affiliate invitation

> Invite someone to your affiliate program by email. They receive an invitation email and become an active affiliate once they accept. If `program_id` is omitted, the invitation is created for your store's affiliate program.



## OpenAPI

````yaml post /v1/affiliates/invites
openapi: 3.0.0
info:
  title: Creem API
  description: >-
    Creem is an all-in-one platform for managing subscriptions and recurring
    revenue, tailored specifically for today's SaaS companies. It enables you to
    boost revenue, enhance customer retention, and scale your operations
    seamlessly.
  version: v1
  contact:
    name: Creem Support
    url: https://creem.io
    email: support@creem.io
  license:
    name: Commercial
    url: https://creem.io/terms
  termsOfService: https://creem.io/terms
servers:
  - url: https://api.creem.io
    description: Production — live API for processing real transactions and data.
    x-speakeasy-server-id: prod
  - url: https://test-api.creem.io
    description: Test — sandbox API for development and testing with no real charges.
    x-speakeasy-server-id: test
security: []
tags: []
externalDocs:
  description: Creem Documentation
  url: https://docs.creem.io
paths:
  /v1/affiliates/invites:
    post:
      tags:
        - Affiliates
      summary: Create an affiliate invitation
      description: >-
        Invite someone to your affiliate program by email. They receive an
        invitation email and become an active affiliate once they accept. If
        `program_id` is omitted, the invitation is created for your store's
        affiliate program.
      operationId: createAffiliateInvite
      parameters: []
      requestBody:
        required: true
        description: Affiliate invitation payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAffiliateInviteRequestEntity'
      responses:
        '200':
          description: Successfully created the affiliate invitation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateInviteEntity'
        '400':
          description: Bad Request - Invalid input parameters
        '401':
          description: Unauthorized - Invalid or missing API key
        '404':
          description: Not Found - Resource does not exist
        '409':
          description: Conflict - an invitation has already been sent to this email address
      security:
        - ApiKey: []
components:
  schemas:
    CreateAffiliateInviteRequestEntity:
      type: object
      properties:
        email:
          type: string
          description: The email address to send the affiliate invitation to.
          example: partner@example.com
        name:
          type: string
          description: The display name of the affiliate being invited.
          example: Jane Partner
        program_id:
          type: string
          description: >-
            The ID of the affiliate program to invite into. Optional: when
            omitted, the invitation falls back to the store's affiliate program.
            Provide this only if your store runs more than one program.
          example: prog_1234567890
          nullable: true
      required:
        - email
        - name
    AffiliateInviteEntity:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object.
        mode:
          $ref: '#/components/schemas/EnvironmentMode'
        object:
          type: string
          description: >-
            String representing the object's type. Objects of the same type
            share the same value.
          example: affiliate-invite
        email:
          type: string
          description: The email address the affiliate was invited with.
          example: partner@example.com
        name:
          type: string
          description: The display name the affiliate was invited with.
          example: Jane Partner
          nullable: true
        status:
          type: string
          description: >-
            The lifecycle status of the invitation: `pending` while the invitee
            has not yet accepted, `accepted` once they have joined the program.
          example: pending
        created_at:
          type: number
          description: Creation date of the invitation as a timestamp.
      required:
        - id
        - mode
        - object
        - email
        - status
        - created_at
    EnvironmentMode:
      type: string
      description: String representing the environment.
      enum:
        - test
        - prod
        - sandbox
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. You can find your API key in the Creem
        dashboard under Settings > API Keys.

````