On this page

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

    Set Referral Code

    If you did not provide a referral code during the initial network creation process, you can use this endpoint to set one later. Setting a referral code may grant specific bonuses or benefits to your network based on current promotion rules.


    POST /account/set-referral

    Sets the referral code for the authenticated network. This operation can typically only be performed once if a referral code is not already set.

    Request

    POST /account/set-referral

    Headers:

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

    Body:

    {
      "referral_code": "string"
    }

    Fields

    FieldTypeDescription
    referral_codestringRequired. The referral code of the network that invited you.

    Response

    200 Success

    Status: 200 OK

    Content-Type: application/json

    {
      "error": {
        "message": "string"
      }
    }

    Fields

    FieldTypeDescription
    errorobjectReturned if the code is invalid or if a referral is already set (can be null).
    error.messagestringHuman-readable explanation of why the referral could not be set.

    Example

    HTTP Request

    POST /account/set-referral HTTP/1.1
    Host: api.bringyour.com
    Content-Type: application/json
    Authorization: Bearer YOUR_JWT_TOKEN
     
    {
      "referral_code": "TOP-INVITE-CODE"
    }

    Successful HTTP Response

    {
      "error": null
    }


    Powered by Sudoc v2.5.0
    Hide table of contents