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

# Update Affiliate Status

> This endpoint updates the status of an existing affiliate. You can change the status field using the request body. The update is restricted to only allowed fields. It ensures the affiliate membership with the store using the `x-store-id` header.



## OpenAPI

````yaml /api-reference/growth-api.json patch /affiliates/{id}
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/{id}:
    patch:
      tags:
        - Affiliates
      summary: Update Affiliate Status
      description: >-
        This endpoint updates the status of an existing affiliate. You can
        change the status field using the request body. The update is restricted
        to only allowed fields. It ensures the affiliate membership with the
        store using the `x-store-id` header.
      parameters:
        - name: id
          in: path
          required: true
          description: ID of the affiliate.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAffiliateRequest'
      responses:
        '200':
          description: Affiliate status updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateDetails'
      security:
        - storeIdHeader: []
components:
  schemas:
    UpdateAffiliateRequest:
      type: object
      properties:
        status:
          type: string
      required:
        - status
    AffiliateDetails:
      type: object
      properties:
        id:
          type: string
        store_id:
          type: string
        program_id:
          type: string
        status:
          type: string
        created_at:
          type: string
          format: date-time
        affiliate:
          type: object
          properties:
            id:
              type: string
            display_name:
              type: string
            website:
              type: string
            social_links:
              type: string
        stats:
          type: object
          properties:
            conversions:
              type: integer
            total_revenue:
              type: number
            total_commission:
              type: integer
            pending_commission:
              type: integer
  securitySchemes:
    storeIdHeader:
      type: apiKey
      in: header
      name: x-store-id

````