Classic Affiliate API

The Affiliate API from Classic — 5 operation(s) for affiliate.

Operations 6

POST /v1/affiliate Create affiliate #
GET /v1/affiliate/{address} Get affiliate config #
PATCH /v1/affiliate/{address} Update affiliate #
GET /v1/affiliate/stats Get affiliate statistics #
GET /v1/affiliate/swaps Get affiliate swaps #
GET /v1/partner/{code} Resolve a partner referral code #

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/classic-affiliate-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

classic-affiliate-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.0.0
  title: ShapeShift Public Affiliate API
  description: The ShapeShift Public API lets you integrate multi-chain swap functionality into your application.
servers:
- url: https://api.shapeshift.com
- url: http://localhost:3001
tags:
- name: Affiliate
paths:
  /v1/affiliate:
    post:
      operationId: createAffiliate
      summary: Create affiliate
      description: Register a new affiliate. Requires a valid SIWE JWT in the Authorization header.
      tags:
      - Affiliate
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                walletAddress:
                  type: string
                  pattern: ^0x[0-9a-fA-F]{40}$
                  example: '0x1234567890123456789012345678901234567890'
                receiveAddress:
                  type: string
                  pattern: ^0x[0-9a-fA-F]{40}$
                  example: '0x1234567890123456789012345678901234567890'
                partnerCode:
                  type: string
                  minLength: 3
                  maxLength: 32
                  pattern: ^[a-z0-9]+$
                bps:
                  type: integer
                  minimum: 0
                  maximum: 1000
              required:
              - walletAddress
              - partnerCode
              - bps
      responses:
        '201':
          description: Affiliate created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateConfig'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '409':
          description: Affiliate already exists
        '429':
          description: Rate limit exceeded. Includes Retry-After header with seconds until reset.
          headers:
            Retry-After:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
            RateLimit-Limit:
              description: Maximum requests allowed per window
              schema:
                type: integer
                example: 60
            RateLimit-Remaining:
              description: Requests remaining in the current window
              schema:
                type: integer
                example: 0
            RateLimit-Reset:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
        '503':
          description: Swap service unavailable
        '504':
          description: Swap service timed out
  /v1/affiliate/{address}:
    get:
      operationId: getAffiliate
      summary: Get affiliate config
      description: Retrieve affiliate configuration for a given wallet address.
      tags:
      - Affiliate
      parameters:
      - schema:
          type: string
          pattern: ^0x[0-9a-fA-F]{40}$
          example: '0x1234567890123456789012345678901234567890'
        required: true
        name: address
        in: path
      responses:
        '200':
          description: Affiliate configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateConfig'
        '400':
          description: Invalid request parameters
        '404':
          description: Affiliate not found
        '429':
          description: Rate limit exceeded. Includes Retry-After header with seconds until reset.
          headers:
            Retry-After:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
            RateLimit-Limit:
              description: Maximum requests allowed per window
              schema:
                type: integer
                example: 60
            RateLimit-Remaining:
              description: Requests remaining in the current window
              schema:
                type: integer
                example: 0
            RateLimit-Reset:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
        '503':
          description: Swap service unavailable
        '504':
          description: Swap service timed out
    patch:
      operationId: updateAffiliate
      summary: Update affiliate
      description: Update an existing affiliate configuration. Requires a valid SIWE JWT in the Authorization header.
      tags:
      - Affiliate
      parameters:
      - schema:
          type: string
          pattern: ^0x[0-9a-fA-F]{40}$
          example: '0x1234567890123456789012345678901234567890'
        required: true
        name: address
        in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                receiveAddress:
                  type: string
                  pattern: ^0x[0-9a-fA-F]{40}$
                  example: '0x1234567890123456789012345678901234567890'
                bps:
                  type: integer
                  minimum: 0
                  maximum: 1000
      responses:
        '200':
          description: Updated affiliate configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateConfig'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Affiliate not found
        '429':
          description: Rate limit exceeded. Includes Retry-After header with seconds until reset.
          headers:
            Retry-After:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
            RateLimit-Limit:
              description: Maximum requests allowed per window
              schema:
                type: integer
                example: 60
            RateLimit-Remaining:
              description: Requests remaining in the current window
              schema:
                type: integer
                example: 0
            RateLimit-Reset:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
        '503':
          description: Swap service unavailable
        '504':
          description: Swap service timed out
  /v1/affiliate/stats:
    get:
      operationId: getAffiliateStats
      summary: Get affiliate statistics
      description: Retrieve aggregated swap statistics for an affiliate by partnerCode. Returns total swaps, volume, and fees earned. Supports optional date range filtering.
      tags:
      - Affiliate
      parameters:
      - schema:
          type: string
          minLength: 3
          maxLength: 32
          pattern: ^[a-z0-9]+$
        required: true
        name: partnerCode
        in: query
      - schema:
          type: string
          format: date-time
        required: false
        name: startDate
        in: query
      - schema:
          type: string
          format: date-time
        required: false
        name: endDate
        in: query
      responses:
        '200':
          description: Affiliate statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateStatsResponse'
        '400':
          description: Invalid request parameters
        '429':
          description: Rate limit exceeded. Includes Retry-After header with seconds until reset.
          headers:
            Retry-After:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
            RateLimit-Limit:
              description: Maximum requests allowed per window
              schema:
                type: integer
                example: 60
            RateLimit-Remaining:
              description: Requests remaining in the current window
              schema:
                type: integer
                example: 0
            RateLimit-Reset:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
        '503':
          description: Swap service unavailable
        '504':
          description: Swap service timed out
  /v1/affiliate/swaps:
    get:
      operationId: getAffiliateSwaps
      summary: Get affiliate swaps
      description: Retrieve paginated swap history for an affiliate by partnerCode. Supports optional date range filtering.
      tags:
      - Affiliate
      parameters:
      - schema:
          type: string
          minLength: 3
          maxLength: 32
          pattern: ^[a-z0-9]+$
        required: true
        name: partnerCode
        in: query
      - schema:
          type: string
          format: date-time
        required: false
        name: startDate
        in: query
      - schema:
          type: string
          format: date-time
        required: false
        name: endDate
        in: query
      - schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 50
        required: false
        name: limit
        in: query
      - schema:
          type: string
          minLength: 1
        required: false
        name: cursor
        in: query
      responses:
        '200':
          description: Affiliate swaps
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateSwapsResponse'
        '400':
          description: Invalid query parameters
        '429':
          description: Rate limit exceeded. Includes Retry-After header with seconds until reset.
          headers:
            Retry-After:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
            RateLimit-Limit:
              description: Maximum requests allowed per window
              schema:
                type: integer
                example: 60
            RateLimit-Remaining:
              description: Requests remaining in the current window
              schema:
                type: integer
                example: 0
            RateLimit-Reset:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
        '503':
          description: Swap service unavailable
        '504':
          description: Swap service timed out
  /v1/partner/{code}:
    get:
      operationId: resolvePartner
      summary: Resolve a partner referral code
      description: Resolve a partner referral code to its attribution details (partner address and bps split).
      tags:
      - Affiliate
      parameters:
      - schema:
          type: string
          minLength: 1
        required: true
        name: code
        in: path
      responses:
        '200':
          description: Partner attribution
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerResolution'
        '400':
          description: Invalid request parameters
        '404':
          description: Partner code not found
        '429':
          description: Rate limit exceeded. Includes Retry-After header with seconds until reset.
          headers:
            Retry-After:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
            RateLimit-Limit:
              description: Maximum requests allowed per window
              schema:
                type: integer
                example: 60
            RateLimit-Remaining:
              description: Requests remaining in the current window
              schema:
                type: integer
                example: 0
            RateLimit-Reset:
              description: Seconds until the rate limit window resets
              schema:
                type: integer
                example: 30
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
        '503':
          description: Swap service unavailable
        '504':
          description: Swap service timed out
components:
  schemas:
    PartnerResolution:
      type: object
      properties:
        partnerAddress:
          type: string
          pattern: ^0x[0-9a-fA-F]{40}$
          example: '0x1234567890123456789012345678901234567890'
        partnerBps:
          type: integer
          minimum: 0
          example: 50
        partnerCode:
          type: string
          example: mypartner
        shapeshiftBps:
          type: integer
          minimum: 0
          example: 10
      required:
      - partnerAddress
      - partnerBps
      - partnerCode
      - shapeshiftBps
    Asset:
      type: object
      properties:
        assetId:
          type: string
          example: eip155:1/slip44:60
        chainId:
          type: string
          example: eip155:1
        name:
          type: string
          example: Ethereum
        symbol:
          type: string
          example: ETH
        precision:
          type: number
          example: 18
        color:
          type: string
          example: '#5C6BC0'
        icon:
          type: string
          example: https://assets.coincap.io/assets/icons/eth@2x.png
        networkName:
          type: string
          example: Ethereum
        networkColor:
          type: string
          example: '#5C6BC0'
        networkIcon:
          type: string
          example: https://assets.coincap.io/assets/icons/eth@2x.png
        explorer:
          type: string
          example: https://etherscan.io
        explorerAddressLink:
          type: string
          example: https://etherscan.io/address/
        explorerTxLink:
          type: string
          example: https://etherscan.io/tx/
        relatedAssetKey:
          type:
          - string
          - 'null'
      required:
      - assetId
      - chainId
      - name
      - symbol
      - precision
      - color
      - icon
      - explorer
      - explorerAddressLink
      - explorerTxLink
      - relatedAssetKey
    AffiliateStatsResponse:
      type: object
      properties:
        totalSwaps:
          type: number
          example: 42
        totalVolumeUsd:
          type: string
          example: '12345.67'
        totalFeesEarnedUsd:
          type: string
          example: '44.44'
      required:
      - totalSwaps
      - totalVolumeUsd
      - totalFeesEarnedUsd
    AffiliateSwap:
      type: object
      properties:
        swapId:
          type: string
          example: swap-uuid-1234
        status:
          type: string
          example: completed
        sellAsset:
          $ref: '#/components/schemas/Asset'
        buyAsset:
          $ref: '#/components/schemas/Asset'
        sellAmountCryptoPrecision:
          type: string
          example: '1.0'
        sellAmountUsd:
          type:
          - string
          - 'null'
          example: '1234.56'
        buyAmountCryptoPrecision:
          type:
          - string
          - 'null'
          example: '948.0'
        buyAmountUsd:
          type:
          - string
          - 'null'
          example: '1234.56'
        affiliateFeeAmountUsd:
          type:
          - string
          - 'null'
          example: '3.70'
        affiliateBps:
          type: integer
          minimum: 0
          example: 60
        partnerBps:
          type:
          - integer
          - 'null'
          minimum: 0
          example: 20
        shapeshiftBps:
          type: integer
          minimum: 0
          example: 10
        swapperName:
          type: string
          example: THORChain
        sellTxHash:
          type:
          - string
          - 'null'
          example: '0xabc123'
        buyTxHash:
          type:
          - string
          - 'null'
          example: '0xdef456'
        isAffiliateVerified:
          type:
          - boolean
          - 'null'
          example: true
        createdAt:
          type: string
          example: '2024-01-01T00:00:00.000Z'
      required:
      - swapId
      - status
      - sellAsset
      - buyAsset
      - sellAmountCryptoPrecision
      - sellAmountUsd
      - buyAmountCryptoPrecision
      - buyAmountUsd
      - affiliateFeeAmountUsd
      - affiliateBps
      - partnerBps
      - shapeshiftBps
      - swapperName
      - sellTxHash
      - buyTxHash
      - isAffiliateVerified
      - createdAt
    RateLimitError:
      type: object
      properties:
        error:
          type: string
          example: Too many requests, please try again later
        code:
          type: string
          enum:
          - RATE_LIMIT_EXCEEDED
          example: RATE_LIMIT_EXCEEDED
      required:
      - error
      - code
    AffiliateSwapsResponse:
      type: object
      properties:
        swaps:
          type: array
          items:
            $ref: '#/components/schemas/AffiliateSwap'
        nextCursor:
          type:
          - string
          - 'null'
          example: swap-uuid-1234
      required:
      - swaps
      - nextCursor
    AffiliateConfig:
      type: object
      properties:
        id:
          type: string
          example: abc123
        walletAddress:
          type: string
          pattern: ^0x[0-9a-fA-F]{40}$
          example: '0x1234567890123456789012345678901234567890'
        receiveAddress:
          type:
          - string
          - 'null'
          pattern: ^0x[0-9a-fA-F]{40}$
          example: '0x1234567890123456789012345678901234567890'
        partnerCode:
          type: string
          example: mypartner
        partnerBps:
          type: number
          example: 50
        shapeshiftBps:
          type: number
          example: 10
        isActive:
          type: boolean
          example: true
        createdAt:
          type: string
          format: date-time
          example: '2024-01-01T00:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          example: '2024-01-01T00:00:00.000Z'
      required:
      - id
      - walletAddress
      - receiveAddress
      - partnerCode
      - partnerBps
      - shapeshiftBps
      - isActive
      - createdAt
      - updatedAt