On this page

    1. Home
    2. API
    3. API Reference
    4. Account
    5. Validate Referral Code

    Validate Referral Code

    This endpoint allows you to verify the validity of a referral code before using it during network creation or registration. It checks if the code exists and if it has reached its usage cap.


    POST /referral-code/validate

    Validate a specific referral code.

    Request

    POST /referral-code/validate

    Headers:

    {
      "Host": "api.bringyour.com",
      "Content-Type": "application/json",
      "Authorization": "Bearer YOUR_JWT_TOKEN"
    }

    Body:

    {
      "referral_code": "string"
    }

    | Field | Type | Description | +| :--- | :--- | :--- | +| referral_code | string | Required. The referral code to validate. |

    Response

    200 Success

    Status: 200 OK

    Content-Type: application/json

    {
      "is_valid": true,
      "is_capped": false,
      "error": {
        "message": "string"
      }
    }

    Fields

    FieldTypeDescription
    is_validbooleanTrue if the referral code exists and is recognized by the system.
    is_cappedbooleanTrue if the referral code has reached its maximum number of allowed uses.
    errorobjectDetails on validation failure.
    error.messagestringHuman-readable explanation of why the code is invalid or capped.

    Example

    HTTP Request

    POST /referral-code/validate HTTP/1.1
    Host: api.bringyour.com
    Content-Type: application/json
    Authorization: Bearer YOUR_JWT_TOKEN
     
    {
      "referral_code": "UR-FRIEND-2025"
    }

    Successful HTTP Response

    {
      "is_valid": true,
      "is_capped": false,
      "error": null
    }


    Powered by Sudoc v2.5.0
    Hide table of contents