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

# Generate Tracking Link

> This endpoint enables the creation of custom tracking links for an affiliate membership. It requires the `membership_id` and `code` in the request body and verifies the ownership of the membership with the store using the `x-store-id` header.



## OpenAPI

````yaml /api-reference/growth-api.json post /affiliates/links
openapi: 3.0.0
info:
  title: Growth API
  description: Comprehensive API documentation for Blink.
  version: 1.0.0
servers:
  - url: https://api.blink.store/v1
security:
  - storeIdHeader: []
paths:
  /affiliates/links:
    post:
      tags:
        - Affiliates
      summary: Generate Tracking Link
      description: >-
        This endpoint enables the creation of custom tracking links for an
        affiliate membership. It requires the `membership_id` and `code` in the
        request body and verifies the ownership of the membership with the store
        using the `x-store-id` header.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateTrackingLinkRequest'
      responses:
        '201':
          description: Tracking link created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackingLink'
      security:
        - storeIdHeader: []
components:
  schemas:
    GenerateTrackingLinkRequest:
      type: object
      properties:
        membership_id:
          type: string
        code:
          type: string
      required:
        - membership_id
        - code
    TrackingLink:
      type: object
      properties:
        membership_id:
          type: string
        code:
          type: string
  securitySchemes:
    storeIdHeader:
      type: apiKey
      in: header
      name: x-store-id

````