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

# Update an affiliate



## OpenAPI

````yaml /openapi.json put /affiliates/{id}
openapi: 3.1.0
info:
  title: Referralful API
  version: 1.0.0
  description: Rewardful-compatible REST API for affiliate programs built on Stripe.
servers:
  - url: https://api.referralful.com/v1
security:
  - basicAuth: []
paths:
  /affiliates/{id}:
    put:
      summary: Update an affiliate
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                last_name:
                  type: string
                email:
                  type: string
                paypal_email:
                  type: string
                wise_email:
                  type: string
                state:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Affiliate'
components:
  schemas:
    Affiliate:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: affiliate
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        email:
          type: string
        paypal_email:
          type: string
          nullable: true
        wise_email:
          type: string
          nullable: true
        state:
          type: string
        stripe_customer_id:
          type: string
          nullable: true
        confirmed_at:
          type: string
          format: date-time
          nullable: true
        visitors:
          type: integer
        leads:
          type: integer
        conversions:
          type: integer
        campaign:
          $ref: '#/components/schemas/Campaign'
        links:
          type: array
          items:
            $ref: '#/components/schemas/AffiliateLink'
        coupon:
          $ref: '#/components/schemas/AffiliateCoupon'
          nullable: true
    Campaign:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: campaign
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        name:
          type: string
        url:
          type: string
        private:
          type: boolean
        reward_type:
          type: string
          enum:
            - percent
            - amount
        commission_percent:
          type: number
          nullable: true
        commission_amount_cents:
          type: integer
          nullable: true
        commission_currency:
          type: string
        minimum_payout_cents:
          type: integer
        days_before_referrals_expire:
          type: integer
        days_before_commissions_are_due:
          type: integer
        max_commissions:
          type: integer
          nullable: true
        max_commission_period_in_months:
          type: integer
          nullable: true
    AffiliateLink:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: affiliate_link
        url:
          type: string
        token:
          type: string
        visitors:
          type: integer
        leads:
          type: integer
        conversions:
          type: integer
        affiliate_id:
          type: string
    AffiliateCoupon:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: affiliate_coupon
        token:
          type: string
          description: The coupon code.
        affiliate_id:
          type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Use your API secret as the username, with an empty password.

````