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

# Reject Referral

> Rejects a referral so it no longer counts towards the affiliate's results, and rejects any `pending` commissions earned from it. Use this when a referral turns out to be invalid, for example a self-referral or a fraudulent signup. A `reject_reason` is required; it is stored on the referral and returned in the `reject_reason` attribute while the referral is rejected. Only `converted`, `paid` and `churned` referrals can be rejected. Commissions that were already paid out are left untouched. A rejected referral can be restored with the unreject endpoint.



## OpenAPI

````yaml POST /v1/referrals/{id}/reject
openapi: 3.1.0
info:
  title: Reditus API - Referrals
  description: API specification for managing referrals in Reditus affiliate programs.
  version: 1.0.0
servers:
  - url: https://api.getreditus.com/api
security: []
paths:
  /v1/referrals/{id}/reject:
    post:
      summary: Reject Referral
      description: >-
        Rejects a referral so it no longer counts towards the affiliate's
        results, and rejects any `pending` commissions earned from it. Use this
        when a referral turns out to be invalid, for example a self-referral or
        a fraudulent signup. A `reject_reason` is required; it is stored on the
        referral and returned in the `reject_reason` attribute while the
        referral is rejected. Only `converted`, `paid` and `churned` referrals
        can be rejected. Commissions that were already paid out are left
        untouched. A rejected referral can be restored with the unreject
        endpoint.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Reditus id of the referral
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RejectReferralRequest'
      responses:
        '200':
          description: Referral was rejected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralResponse'
        '400':
          description: Bad Request - No reject_reason provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBadRequest'
        '404':
          description: Not Found - Referral not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseNotFound'
        '422':
          description: >-
            Unprocessable - Referral cannot be rejected from its current state
            (it never converted, or is already rejected)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseUnprocessable'
      security:
        - BearerAuth: []
components:
  schemas:
    RejectReferralRequest:
      type: object
      required:
        - reject_reason
      properties:
        reject_reason:
          type: string
          description: >-
            **required** - Free-text reason for rejecting the referral. Shown to
            your team in the Reditus dashboard and returned in the referral's
            `reject_reason` attribute.
          example: Self referral
    ReferralResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Referral'
    ErrorResponseBadRequest:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
                example: Bad Request
              details:
                type: string
                example: >-
                  Validation failed: one of referral_uid, referral_id or
                  referral_email is required
    ErrorResponseNotFound:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
                example: Not Found
              details:
                type: string
                example: Referral not found
    ErrorResponseUnprocessable:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
                example: Unprocessable entity
              details:
                type: string
                example: Referral in state 'clicked' cannot be churned
    Referral:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            email:
              type: string
            state:
              type: string
              description: >-
                Referral state: new, clicked, converted, paid, churned or
                rejected
            reject_reason:
              type: string
              description: >-
                Reason the referral was rejected. Only present when state is
                rejected
            state_set_at:
              type: integer
            created_at:
              type: integer
            updated_at:
              type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.