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

# Match Splits

> **/split/match**

<Note>
  This endpoint requires authentication. Include your Bearer token in the Authorization header.
</Note>

## Description

**/split/match**

**Description:**\
The `/split/match` endpoint finds splits that match the specified criteria. It allows filtering splits by territory, DSP, usage type, and date.

**Method:**\
`POST`

**Request Body:**

The request body should be a JSON object with any of the following properties. At least one property must be provided.

| Parameter          | Type   | Required | Description                                        |
| ------------------ | ------ | -------- | -------------------------------------------------- |
| territory          | string | No       | ISO 3166-1 alpha-2 country code (e.g., 'US', 'NG') |
| dsp                | string | No       | Digital Service Provider identifier                |
| usageType          | string | No       | Type of usage                                      |
| date               | string | No       | Date in ISO 8601 format (e.g., '2023-01-15')       |
| \[customDimension] | string | No       | Any custom dimension key-value pair                |

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.royalti.io/split/match', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      "territory": "NG",
      "dsp": "spotify",
      "usageType": "stream",
      "date": "2023-06-01"
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
    'https://api.royalti.io/split/match',
    headers={
      'Authorization': f'Bearer {token}'
    },
    json={"territory":"NG","dsp":"spotify","usageType":"stream","date":"2023-06-01"}
  )

  data = response.json()
  print(data)
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.royalti.io/split/match \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"territory":"NG","dsp":"spotify","usageType":"stream","date":"2023-06-01"}'

  ```
</CodeGroup>


## OpenAPI

````yaml post /split/match
openapi: 3.0.0
info:
  title: Royalti.io API
  description: "# Royalti API\r\n\r\nThis is the Royalti music royalty management platform API server.\r\n\r\n## Overview\r\n\r\nThe Royalti API provides comprehensive music royalty management services including:\r\n- Music publishing and writer management\r\n- Royalty processing and analytics\r\n- DDEX integration for music industry standards\r\n- File processing and pattern recognition\r\n- Payment processing and distribution\r\n\r\n## Authentication\r\n\r\nThe API uses JWT-based authentication with multiple protection levels:\r\n- Public endpoints for basic operations\r\n- Protected endpoints requiring valid JWT tokens\r\n- Admin endpoints for administrative functions\r\n\r\n## Features\r\n\r\n- Multi-dimensional royalty analytics\r\n- CWR (Collective Works Registration) support\r\n- DDEX integration for music metadata\r\n- Advanced file processing with pattern recognition\r\n- Real-time data processing with queue system"
  version: 2.6.0
  contact:
    name: Royalti.io Support
    email: support@royalti.io
    url: https://royalti.io
  license:
    name: Proprietary
    url: https://royalti.io/terms
servers:
  - url: https://api.royalti.io
    description: Production server
  - url: https://api-dev.royalti.io
    description: Development server
  - url: http://localhost:8084
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Accounting
    description: Accounting and financial transaction operations
  - name: DDEX
    description: DDEX operations (ERN/MEAD, messages, delivery, providers)
  - name: Label
    description: Label management operations
  - name: Internal Webhooks
    description: Internal system webhooks for royalty processing and downloads
  - name: Payment Webhooks
    description: Payment processor webhook endpoints
  - name: Billing Webhooks
    description: Stripe billing and subscription webhooks
  - name: Infrastructure Webhooks
    description: Cloudflare domain and SSL webhooks
  - name: Distribution Webhooks
    description: Digital distribution platform webhooks (FUGA)
paths:
  /split/match:
    post:
      tags:
        - Splits
      summary: Match Splits
      description: >-
        **/split/match**


        **Description:**  

        The `/split/match` endpoint finds splits that match the specified
        criteria. It allows filtering splits by territory, DSP, usage type, and
        date.


        **Method:**  

        `POST`


        **Request Body:**


        The request body should be a JSON object with any of the following
        properties. At least one property must be provided.


        | Parameter | Type | Required | Description |

        | --- | --- | --- | --- |

        | territory | string | No | ISO 3166-1 alpha-2 country code (e.g., 'US',
        'NG') |

        | dsp | string | No | Digital Service Provider identifier |

        | usageType | string | No | Type of usage |

        | date | string | No | Date in ISO 8601 format (e.g., '2023-01-15') |

        | [customDimension] | string | No | Any custom dimension key-value pair
        |
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                territory:
                  type: string
                  description: ISO 3166-1 alpha-2 country code (e.g., 'US', 'NG')
                  example: NG
                dsp:
                  type: string
                  description: Digital Service Provider identifier
                  example: spotify
                usageType:
                  type: string
                  description: Type of usage
                  example: stream
                date:
                  type: string
                  format: date
                  description: Date to check for active splits (ISO 8601 format)
                  example: '2023-06-01'
              anyOf:
                - required:
                    - territory
                - required:
                    - dsp
                - required:
                    - usageType
                - required:
                    - date
                - additionalProperties:
                    type: string
                  minProperties: 1
            example:
              territory: NG
              dsp: spotify
              date: '2023-06-01'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: Number of matching splits found
                  splits:
                    type: array
                    items:
                      $ref: '#/components/schemas/Split'
                    description: Array of matching splits
              example:
                count: 1
                splits:
                  - id: 550e8400-e29b-41d4-a716-446655440000
                    name: Nigerian Split
                    type: Publishing
                    startDate: '2023-01-01T00:00:00.000Z'
                    endDate: '2023-12-31T23:59:59.999Z'
                    conditions:
                      - mode: include
                        territories:
                          - NG
                          - GH
                          - KE
                        dsps:
                          - spotify
                          - apple
                    SplitShares:
                      - TenantUserId: 550e8400-e29b-41d4-a716-446655440001
                        Share: 60
                        TenantUser:
                          firstName: John
                          lastName: Doe
                          ipi: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Split:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the split configuration
        AssetId:
          type: string
          format: uuid
          description: The unique identifier of the asset
        ProductId:
          type: string
          format: uuid
          description: The unique identifier of the product
        name:
          type: string
          description: The name or description of the revenue split
        type:
          type: string
          nullable: true
          enum:
            - ' '
            - Publishing
            - YouTube
            - Live
          description: The type of revenue (e.g., Publishing, YouTube, Live)
        startDate:
          type: string
          format: date
          nullable: true
          description: The start date of the split period (inclusive)
        endDate:
          type: string
          format: date
          nullable: true
          description: The end date of the split period (exclusive)
        SplitShares:
          type: array
          items:
            type: object
            properties:
              TenantUserId:
                type: string
                format: uuid
              Share:
                type: number
              TenantUser:
                type: object
                properties:
                  firstName:
                    type: string
                  lastName:
                    type: string
                  ipi:
                    type: string
                    nullable: true
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/SplitCondition'
        contract:
          type: string
          nullable: true
        ContractId:
          type: string
          format: uuid
          nullable: true
        memo:
          type: string
          nullable: true
        Asset:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            displayArtist:
              type: string
            isrc:
              type: string
            title:
              type: string
            version:
              type: string
              nullable: true
        Product:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            displayArtist:
              type: string
            upc:
              type: string
            title:
              type: string
        coverage:
          $ref: '#/components/schemas/CoverageInfo'
          description: Temporal coverage analysis (included when includeCoverage=true)
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                type: string
    SplitCondition:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the condition
        mode:
          type: string
          enum:
            - include
            - exclude
          description: Whether to include or exclude the specified criteria
        memo:
          type: string
          nullable: true
          description: Additional notes about the condition
        territories:
          type: array
          items:
            type: string
          nullable: true
          description: Array of ISO country codes
        dsps:
          type: array
          items:
            type: string
          nullable: true
          description: Array of DSP identifiers
        usageTypes:
          type: array
          items:
            type: string
          nullable: true
          description: Array of usage type identifiers
        customDimension:
          type: string
          nullable: true
          description: Custom dimension key
        customValues:
          type: array
          items:
            type: string
          nullable: true
          description: Custom dimension values
    CoverageInfo:
      type: object
      properties:
        overlapping:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              name:
                type: string
              type:
                type: string
                nullable: true
              startDate:
                type: string
                format: date
                nullable: true
              endDate:
                type: string
                format: date
                nullable: true
          description: Splits that overlap with the current split
        adjacent:
          type: object
          properties:
            predecessor:
              type: object
              nullable: true
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
                type:
                  type: string
                  nullable: true
                endDate:
                  type: string
                  format: date
            successor:
              type: object
              nullable: true
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
                type:
                  type: string
                  nullable: true
                startDate:
                  type: string
                  format: date
          description: >-
            Adjacent splits (predecessor ends when current starts, successor
            starts when current ends)
        gaps:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - before
                  - after
                  - between
                  - infinite
              description:
                type: string
              startDate:
                type: string
                format: date
                nullable: true
              endDate:
                type: string
                format: date
                nullable: true
          description: Gaps in temporal coverage
        defaultSplits:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              name:
                type: string
              type:
                type: string
                nullable: true
          description: Default splits that provide fallback coverage
        summary:
          type: object
          properties:
            hasOverlaps:
              type: boolean
            hasPredecessor:
              type: boolean
            hasSuccessor:
              type: boolean
            hasGaps:
              type: boolean
            isOpenEnded:
              type: boolean
            hasDefaultSplit:
              type: boolean
          description: Summary flags for quick coverage analysis
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Format: "Bearer
        {token}"

````