Tapfiliate Affiliates API

Manage affiliates, their groups, notes, and payout methods

Business capability
Channel Sales Management BC-410.60

Operations 24

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /affiliates/{affiliate_id}/ Retrieve an affiliate · Retrieve an affiliate #
Ask an LLM
“Can I pull up one affiliate's profile by their ID?”
“What details does Tapfiliate keep on a single affiliate?”
Tell an agent
Get affiliate {affiliate_id}.
Show me the profile of affiliate {affiliate_id}.
DELETE /affiliates/{affiliate_id}/ Delete an affiliate · Delete an affiliate #
Ask an LLM
“How do I permanently delete an affiliate from my account?”
“Can I remove an affiliate record entirely?”
Tell an agent destructive · confirm first
Delete affiliate {affiliate_id}.
Remove affiliate {affiliate_id} and their record.
GET /affiliates/ List affiliates · List all affiliates #
Ask an LLM
“Which affiliates belong to a particular affiliate group?”
“Can I find an affiliate by their email address?”
Tell an agent
List all my affiliates.
Find the affiliate with email {email}.
POST /affiliates/ Create an affiliate · Create an affiliate #
Ask an LLM
“How do I sign up a new affiliate directly through the API?”
“What do I need to provide to create an affiliate?”
Tell an agent
Create an affiliate named {firstname} {lastname} with email {email}.
Add {email} as a new affiliate, {firstname} {lastname}, with metadata {meta_data}.
PUT /affiliates/{affiliate_id}/group/ Assign an affiliate to a group · Set affiliate group #
Ask an LLM
“Can I move an affiliate into one of my affiliate groups?”
“What's the way to put an affiliate in a group?”
Tell an agent
Put affiliate {affiliate_id} in group {group}.
Assign affiliate {affiliate_id} to affiliate group {group}.
DELETE /affiliates/{affiliate_id}/group/ Remove an affiliate from their group · Remove affiliate group #
Ask an LLM
“Can I take an affiliate out of their group without deleting them?”
“What happens to an affiliate's group assignment if I clear it?”
Tell an agent destructive · confirm first
Remove affiliate {affiliate_id} from their group.
Clear the group assignment for affiliate {affiliate_id}.
PATCH /affiliates/{affiliate_id}/notes/{id}/ Edit a note on an affiliate · Update note #
Ask an LLM
“Can I edit the text of a note I already added to an affiliate?”
“Is it possible to correct an existing affiliate note?”
Tell an agent
Change note {id} on affiliate {affiliate_id} to say {note}.
Update existing note {id} for affiliate {affiliate_id}.
DELETE /affiliates/{affiliate_id}/notes/{id}/ Delete a note on an affiliate · Delete note #
Ask an LLM
“Can I delete a note I left on an affiliate?”
“How do I get rid of an outdated affiliate note?”
Tell an agent destructive · confirm first
Delete note {id} from affiliate {affiliate_id}.
Remove note {id} on affiliate {affiliate_id}.
GET /affiliates/{affiliate_id}/notes/ List notes on an affiliate · List notes #
Ask an LLM
“What notes have been written about a given affiliate?”
“Can I read every internal note kept on one affiliate?”
Tell an agent
List notes for affiliate {affiliate_id}.
Show all the notes on affiliate {affiliate_id}.
POST /affiliates/{affiliate_id}/notes/ Add a note to an affiliate · Create note #
Ask an LLM
“How do I leave an internal note on an affiliate's record?”
“Can I attach a new comment to an affiliate?”
Tell an agent
Add a note to affiliate {affiliate_id}: {note}.
Write a new note {note} on affiliate {affiliate_id}.
GET /affiliates/{affiliate_id}/meta-data/ Get all metadata for an affiliate · Retrieve meta data for an Affiliate #
Ask an LLM
“What custom metadata is stored on an affiliate?”
“Can I fetch every metadata key and value for one affiliate at once?”
Tell an agent
Get all metadata for affiliate {affiliate_id}.
Show the full metadata set on affiliate {affiliate_id}.
PUT /affiliates/{affiliate_id}/meta-data/ Replace an affiliate's metadata · Update (replace) meta data for an Affiliate #
Ask an LLM
“Can I overwrite an affiliate's entire metadata object in one call?”
“What happens to existing affiliate metadata keys when I replace it all?”
Tell an agent
Replace all metadata on affiliate {affiliate_id}.
Overwrite the whole metadata set for affiliate {affiliate_id}.
GET /affiliates/{affiliate_id}/meta-data/{key}/ Get one metadata key for an affiliate · Retrieve meta data by key for an Affiliate #
Ask an LLM
“Can I read a single metadata value on an affiliate by its key?”
“What value does an affiliate have for a specific metadata key?”
Tell an agent
Get metadata key {key} for affiliate {affiliate_id}.
Show affiliate {affiliate_id}'s {key} metadata value.
PUT /affiliates/{affiliate_id}/meta-data/{key}/ Set one metadata key on an affiliate · Set meta data by key for an Affiliate #
Ask an LLM
“Can I set just one metadata key on an affiliate without touching the others?”
“Is there a way to update a single affiliate metadata field?”
Tell an agent
Set metadata key {key} on affiliate {affiliate_id}.
Update only the {key} metadata field for affiliate {affiliate_id}.
DELETE /affiliates/{affiliate_id}/meta-data/{key}/ Delete one metadata key from an affiliate · Delete meta data by key for an Affiliate #
Ask an LLM
“Can I remove a single metadata key from an affiliate?”
“How do I drop one custom metadata field from an affiliate?”
Tell an agent destructive · confirm first
Delete metadata key {key} from affiliate {affiliate_id}.
Remove the {key} metadata entry on affiliate {affiliate_id}.
GET /affiliates/{affiliate_id}/payout-methods/{payout_method_id}/ Get an affiliate's payout method · Get payout method #
Ask an LLM
“Can I see the details of one specific payout method an affiliate has?”
“Which payout account details are stored for a given method?”
Tell an agent
Get payout method {payout_method_id} for affiliate {affiliate_id}.
Show affiliate {affiliate_id}'s payout method {payout_method_id}.
PUT /affiliates/{affiliate_id}/payout-methods/{payout_method_id}/ Set an affiliate's payout method · Set payout method #
Ask an LLM
“Can I set an affiliate to be paid by PayPal or wire transfer?”
“How do I update the payout details for an affiliate?”
Tell an agent
Set payout method {payout_method_id} for affiliate {affiliate_id} to type {type}.
Update payout method {payout_method_id} on affiliate {affiliate_id} with details {details}.
GET /affiliates/{affiliate_id}/payout-methods/ List an affiliate's payout methods · List payout methods #
Ask an LLM
“Which payout methods has an affiliate configured?”
“Does this affiliate have any way set up to receive payouts?”
Tell an agent
List payout methods for affiliate {affiliate_id}.
Show every payout option affiliate {affiliate_id} has.
PUT /affiliates/{child_affiliate_id}/parent/ Set an affiliate's parent (MLM) · Set parent #
Ask an LLM
“How do I put an affiliate under another affiliate in a multi-level setup?”
“Can I make one affiliate the recruiter or upline of another?”
Tell an agent
Make {parent} the parent of affiliate {child_affiliate_id}.
Set the MLM parent of affiliate {child_affiliate_id} to {parent}.
DELETE /affiliates/{child_affiliate_id}/parent/ Remove an affiliate's MLM parent · Remove parent #
Ask an LLM
“Can I detach an affiliate from their upline parent?”
“What do I do to take an affiliate out of a multi-level hierarchy?”
Tell an agent destructive · confirm first
Remove the parent from affiliate {child_affiliate_id}.
Detach affiliate {child_affiliate_id} from their MLM parent.
GET /affiliates/{affiliate_id}/balances/ Get an affiliate's balances · Retrieve affiliate's balances #
Ask an LLM
“How much is owed to one particular affiliate right now?”
“Can I see an affiliate's balance in each currency?”
Tell an agent
Get the balances for affiliate {affiliate_id}.
Show what we owe affiliate {affiliate_id} per currency.
GET /affiliates/{affiliate_id}/payments/ List payments made to an affiliate · List affiliate's payments #
Ask an LLM
“What payouts has a specific affiliate received?”
“Can I page through one affiliate's payment history?”
Tell an agent
List payments made to affiliate {affiliate_id}.
Show page {page} of payouts for affiliate {affiliate_id}, {limit} per page.
GET /affiliates/{id}/programs/ List programs an affiliate is in · Get affiliations #
Ask an LLM
“Which affiliate programs is a given affiliate enrolled in?”
“Is this affiliate part of more than one program?”
Tell an agent
List the programs affiliate {id} belongs to.
Show every program enrollment for affiliate {id}.
GET /affiliates/custom-fields/ Get affiliate custom field definitions · Get custom fields #
Ask an LLM
“What custom fields have I defined for affiliate signups?”
“Which extra profile fields do my affiliates fill in?”
Tell an agent
Get the affiliate custom field definitions.
Show me the custom fields configured for affiliates.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/tapfiliate:tapfiliate-affiliates-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

tapfiliate-affiliates-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Tapfiliate REST Affiliates API
  description: Tapfiliate is an affiliate tracking and management platform. This REST API allows you to create and manage affiliate programs, track conversions, manage affiliates, handle commission payouts, and record clicks. The API is versioned at V1.6 and uses API key authentication via the X-Api-Key header.
  version: '1.6'
  contact:
    name: Tapfiliate Support
    url: https://tapfiliate.com/docs/rest/
  termsOfService: https://tapfiliate.com/terms/
servers:
- url: https://api.tapfiliate.com/1.6
  description: Tapfiliate REST API v1.6
security:
- ApiKeyAuth: []
tags:
- name: Affiliates
  description: Manage affiliates, their groups, notes, and payout methods
paths:
  /affiliates/{affiliate_id}/:
    get:
      operationId: getAffiliate
      summary: Retrieve an affiliate
      description: Retrieve a single affiliate by their ID.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      responses:
        '200':
          description: Affiliate retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Affiliate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteAffiliate
      summary: Delete an affiliate
      description: Delete an affiliate record.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      responses:
        '204':
          description: Affiliate deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/:
    get:
      operationId: listAffiliates
      summary: List all affiliates
      description: Retrieve a paginated list of all affiliates.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/limit'
      - name: email
        in: query
        schema:
          type: string
        description: Filter by affiliate email
      - name: affiliate_group_id
        in: query
        schema:
          type: string
        description: Filter by affiliate group
      responses:
        '200':
          description: List of affiliates
          headers:
            Link:
              $ref: '#/components/headers/PaginationLink'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Affiliate'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createAffiliate
      summary: Create an affiliate
      description: Create a new affiliate.
      tags:
      - Affiliates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - email
              - firstname
              - lastname
              properties:
                email:
                  type: string
                  format: email
                firstname:
                  type: string
                lastname:
                  type: string
                meta_data:
                  type: object
                  additionalProperties: true
      responses:
        '201':
          description: Affiliate created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Affiliate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
  /affiliates/{affiliate_id}/group/:
    put:
      operationId: setAffiliateGroup
      summary: Set affiliate group
      description: Assign an affiliate to a group.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - group
              properties:
                group:
                  type: object
                  required:
                  - id
                  properties:
                    id:
                      type: string
      responses:
        '200':
          description: Affiliate group set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Affiliate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: removeAffiliateGroup
      summary: Remove affiliate group
      description: Remove the group assignment from an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      responses:
        '200':
          description: Affiliate group removed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Affiliate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/{affiliate_id}/notes/{id}/:
    patch:
      operationId: updateAffiliateNote
      summary: Update note
      description: Update an existing note for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Note ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                note:
                  type: string
      responses:
        '200':
          description: Note updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Note'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteAffiliateNote
      summary: Delete note
      description: Delete a note from an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Note ID
      responses:
        '204':
          description: Note deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/{affiliate_id}/notes/:
    get:
      operationId: listAffiliateNotes
      summary: List notes
      description: List all notes for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      responses:
        '200':
          description: List of notes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Note'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    post:
      operationId: createAffiliateNote
      summary: Create note
      description: Create a new note for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - note
              properties:
                note:
                  type: string
      responses:
        '201':
          description: Note created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Note'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/{affiliate_id}/meta-data/:
    get:
      operationId: getAffiliateMetaData
      summary: Retrieve meta data for an Affiliate
      description: Retrieve all metadata for a given affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      responses:
        '200':
          description: Affiliate metadata
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    put:
      operationId: replaceAffiliateMetaData
      summary: Update (replace) meta data for an Affiliate
      description: Replace all metadata for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
      responses:
        '200':
          description: Metadata replaced
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/{affiliate_id}/meta-data/{key}/:
    get:
      operationId: getAffiliateMetaDataByKey
      summary: Retrieve meta data by key for an Affiliate
      description: Retrieve a specific metadata key for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      - $ref: '#/components/parameters/metaDataKey'
      responses:
        '200':
          description: Metadata value
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    put:
      operationId: setAffiliateMetaDataByKey
      summary: Set meta data by key for an Affiliate
      description: Set a specific metadata key for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      - $ref: '#/components/parameters/metaDataKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Metadata set
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteAffiliateMetaDataByKey
      summary: Delete meta data by key for an Affiliate
      description: Delete a specific metadata key for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      - $ref: '#/components/parameters/metaDataKey'
      responses:
        '204':
          description: Metadata deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/{affiliate_id}/payout-methods/{payout_method_id}/:
    get:
      operationId: getPayoutMethod
      summary: Get payout method
      description: Retrieve a specific payout method for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      - name: payout_method_id
        in: path
        required: true
        schema:
          type: string
        description: Payout method ID
      responses:
        '200':
          description: Payout method retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayoutMethod'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    put:
      operationId: setPayoutMethod
      summary: Set payout method
      description: Set or update a payout method for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      - name: payout_method_id
        in: path
        required: true
        schema:
          type: string
        description: Payout method ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: Payout method type (e.g. paypal, wire)
                details:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: Payout method set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayoutMethod'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/{affiliate_id}/payout-methods/:
    get:
      operationId: listPayoutMethods
      summary: List payout methods
      description: List all payout methods for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      responses:
        '200':
          description: List of payout methods
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PayoutMethod'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/{child_affiliate_id}/parent/:
    put:
      operationId: setAffiliateParent
      summary: Set parent
      description: Set the parent affiliate for a child affiliate (MLM).
      tags:
      - Affiliates
      parameters:
      - name: child_affiliate_id
        in: path
        required: true
        schema:
          type: string
        description: Child affiliate ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - parent
              properties:
                parent:
                  type: object
                  required:
                  - id
                  properties:
                    id:
                      type: string
      responses:
        '200':
          description: Parent affiliate set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Affiliate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: removeAffiliateParent
      summary: Remove parent
      description: Remove the parent affiliate from a child affiliate.
      tags:
      - Affiliates
      parameters:
      - name: child_affiliate_id
        in: path
        required: true
        schema:
          type: string
        description: Child affiliate ID
      responses:
        '200':
          description: Parent affiliate removed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Affiliate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/{affiliate_id}/balances/:
    get:
      operationId: getAffiliateBalances
      summary: Retrieve affiliate's balances
      description: Get all currency balances for an affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      responses:
        '200':
          description: Affiliate balances
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Balance'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/{affiliate_id}/payments/:
    get:
      operationId: listAffiliatePayments
      summary: List affiliate's payments
      description: List all payments made to a specific affiliate.
      tags:
      - Affiliates
      parameters:
      - $ref: '#/components/parameters/affiliateId'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: List of payments for the affiliate
          headers:
            Link:
              $ref: '#/components/headers/PaginationLink'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Payment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/{id}/programs/:
    get:
      operationId: getAffiliations
      summary: Get affiliations
      description: Get all programs an affiliate is enrolled in.
      tags:
      - Affiliates
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Affiliate ID
      responses:
        '200':
          description: List of affiliations
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Affiliation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /affiliates/custom-fields/:
    get:
      operationId: getCustomFields
      summary: Get custom fields
      description: Retrieve custom field definitions for affiliates.
      tags:
      - Affiliates
      responses:
        '200':
          description: Custom fields
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    Unauthorized:
      description: Authentication failed — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: Validation error — request body is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    metaDataKey:
      name: key
      in: path
      required: true
      schema:
        type: string
      description: Metadata key
    limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 50
        minimum: 1
        maximum: 100
      description: Number of results per page
    page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
        minimum: 1
      description: Page number for pagination
    affiliateId:
      name: affiliate_id
      in: path
      required: true
      schema:
        type: string
      description: Affiliate ID
  schemas:
    CustomField:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
        required:
          type: boolean
    Affiliate:
      type: object
      properties:
        id:
          type: string
          description: Affiliate ID
        email:
          type: string
          format: email
        firstname:
          type: string
        lastname:
          type: string
        created_at:
          type: string
          format: date-time
        group:
          allOf:
          - $ref: '#/components/schemas/AffiliateGroup'
        meta_data:
          type: object
          additionalProperties: true
        referral_link:
          type: string
          format: uri
        coupon:
          type:
          - string
          - 'null'
        parent:
          allOf:
          - $ref: '#/components/schemas/AffiliateRef'
    AffiliateRef:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
          format: email
        firstname:
          type: string
        lastname:
          type: string
    PayoutMethod:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          description: Payout method type (e.g. paypal, wire)
        details:
          type: object
          additionalProperties: true
    Error:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message
    AffiliateGroup:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
    Balance:
      type: object
      properties:
        affiliate:
          $ref: '#/components/schemas/AffiliateRef'
        currency:
          type: string
          description: ISO 4217 currency code
        balance:
          type: number
          format: float
    Payment:
      type: object
      properties:
        id:
          type: string
        affiliate:
          $ref: '#/components/schemas/AffiliateRef'
        amount:
          type: number
          format: float
        currency:
          type: string
          description: ISO 4217 currency code
        paid_at:
          type:
          - string
          - 'null'
          format: date-time
        status:
          type: string
          enum:
          - pending
          - paid
          - cancelled
    Note:
      type: object
      properties:
        id:
          type: string
        note:
          type: string
        created_at:
          type: string
          format: date-time
    Affiliation:
      type: object
      description: An affiliate's enrollment in a program
      properties:
        affiliate:
          $ref: '#/components/schemas/AffiliateRef'
        program:
          type: object
          properties:
            id:
              type: string
            title:
              type: string
        approved:
          type: boolean
        coupon:
          type:
          - string
          - 'null'
        referral_link:
          type: string
          format: uri
        created_at:
          type: string
          format: date-time
  headers:
    PaginationLink:
      description: Links to navigate between pages. Contains rel="next", rel="prev", rel="first", and rel="last" links as per RFC 5988.
      schema:
        type: string
      example: <https://api.tapfiliate.com/1.6/conversions/?page=3>; rel="next", <https://api.tapfiliate.com/1.6/conversions/?page=51>; rel="last"
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
x-provenance:
  method: harvested
  publisher: Tapfiliate
  source: https://developers.tapfiliate.com/api-reference/openapi.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)