> ## 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.

# Approve Payment Request

> **Approve Payment Request**

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

## Description

**Approve Payment Request**

**Description:**\
The `/payment-request/{id}/approve` endpoint approves a specific payment request.

**Method:**\
`PATCH`

**Path Parameter:**

| Parameter | Type   | Description                                  |
| --------- | ------ | -------------------------------------------- |
| id        | string | The unique identifier of the payment request |

**Request Body**

| Parameter                    | Type   | Description                                                                 |
| ---------------------------- | ------ | --------------------------------------------------------------------------- |
| title *(Optional)*           | string | Title for the payment (defaults to "Payment for \[original request title]") |
| transactionDate *(Optional)* | string | Transaction date (defaults to current date)                                 |
| currency *(Optional)*        | string | Currency code (defaults to request currency)                                |
| amount *(Optional)*          | number | Payment amount (defaults to request amount)                                 |
| amountUSD *(Optional)*       | number | Payment amount in USD (defaults to request amountUSD)                       |
| conversionRate *(Optional)*  | number | Conversion rate if different from default                                   |
| memo *(Optional)*            | string | Additional notes about the payment                                          |
| method *(Optional)*          | string | Payment method (only 'vertofx' requires additional fields)                  |
| walletId *(Optional)*        | string | Required if method is 'vertofx' - Wallet ID for VertoFX                     |
| purposeCode *(Optional)*     | string | Required if method is 'vertofx' - Purpose code for VertoFX                  |
| files *(Optional)*           | array  | Optional receipt or supporting documents (multipart/form-data)              |

**Note:** When uploading files, use `multipart/form-data` content type. PDF receipt is automatically generated upon approval.

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.royalti.io/payment-request/example-id/approve', {
    method: 'PATCH',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      "title": "sample-title",
      "transactionDate": "2024-01-21T12:00:00Z",
      "currency": "sample-currency",
      "amount": 1,
      "amountUSD": 1,
      "conversionRate": 1,
      "memo": "sample-memo",
      "method": "sample-method",
      "walletId": "sample-walletId",
      "purposeCode": "sample-purposeCode",
      "files": [
        {}
      ]
    })
  });

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

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

  response = requests.patch(
    'https://api.royalti.io/payment-request/example-id/approve',
    headers={
      'Authorization': f'Bearer {token}'
    },
    json={"title":"sample-title","transactionDate":"2024-01-21T12:00:00Z","currency":"sample-currency","amount":1,"amountUSD":1,"conversionRate":1,"memo":"sample-memo","method":"sample-method","walletId":"sample-walletId","purposeCode":"sample-purposeCode","files":[{}]}
  )

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

  ```bash cURL theme={null}
  curl -X PATCH https://api.royalti.io/payment-request/example-id/approve \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"title":"sample-title","transactionDate":"2024-01-21T12:00:00Z","currency":"sample-currency","amount":1,"amountUSD":1,"conversionRate":1,"memo":"sample-memo","method":"sample-method","walletId":"sample-walletId","purposeCode":"sample-purposeCode","files":[{}]}'

  ```
</CodeGroup>


## OpenAPI

````yaml patch /payment-request/{id}/approve
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:
  /payment-request/{id}/approve:
    patch:
      tags:
        - Payment Requests
      summary: Approve Payment Request
      description: >-
        **Approve Payment Request**


        **Description:**  

        The `/payment-request/{id}/approve` endpoint approves a specific payment
        request.


        **Method:**  

        `PATCH`


        **Path Parameter:**


        | Parameter | Type | Description |

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

        | id | string | The unique identifier of the payment request |


        **Request Body**

        | Parameter | Type | Description |

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

        | title _(Optional)_ | string | Title for the payment (defaults to
        "Payment for [original request title]") |

        | transactionDate _(Optional)_ | string | Transaction date (defaults to
        current date) |

        | currency _(Optional)_ | string | Currency code (defaults to request
        currency) |

        | amount _(Optional)_ | number | Payment amount (defaults to request
        amount) |

        | amountUSD _(Optional)_ | number | Payment amount in USD (defaults to
        request amountUSD) |

        | conversionRate _(Optional)_ | number | Conversion rate if different
        from default |

        | memo _(Optional)_ | string | Additional notes about the payment |

        | method _(Optional)_ | string | Payment method (only 'vertofx' requires
        additional fields) |

        | walletId _(Optional)_ | string | Required if method is 'vertofx' -
        Wallet ID for VertoFX |

        | purposeCode _(Optional)_ | string | Required if method is 'vertofx' -
        Purpose code for VertoFX |

        | files _(Optional)_ | array | Optional receipt or supporting documents
        (multipart/form-data) |


        **Note:** When uploading files, use `multipart/form-data` content type.
        PDF receipt is automatically generated upon approval.
      parameters:
        - name: id
          in: path
          required: true
          description: Payment Request ID
          schema:
            type: string
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: >-
                    Title for the payment (defaults to "Payment for [original
                    request title]")
                transactionDate:
                  type: string
                  format: date-time
                  description: Transaction date (defaults to current date)
                currency:
                  type: string
                  description: Currency code (defaults to request currency)
                amount:
                  type: number
                  description: Payment amount (defaults to request amount)
                amountUSD:
                  type: number
                  description: Payment amount in USD (defaults to request amountUSD)
                conversionRate:
                  type: number
                  description: Conversion rate if different from default
                memo:
                  type: string
                  description: Additional notes about the payment
                method:
                  type: string
                  enum:
                    - vertofx
                  description: Payment method (only 'vertofx' requires additional fields)
                walletId:
                  type: string
                  description: Required if method is 'vertofx' - Wallet ID for VertoFX
                purposeCode:
                  type: string
                  description: Required if method is 'vertofx' - Purpose code for VertoFX
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: Receipt files (PDF, images, etc.)
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: >-
                    Title for the payment (defaults to "Payment for [original
                    request title]")
                transactionDate:
                  type: string
                  format: date-time
                  description: Transaction date (defaults to current date)
                currency:
                  type: string
                  description: Currency code (defaults to request currency)
                amount:
                  type: number
                  description: Payment amount (defaults to request amount)
                amountUSD:
                  type: number
                  description: Payment amount in USD (defaults to request amountUSD)
                conversionRate:
                  type: number
                  description: Conversion rate if different from default
                memo:
                  type: string
                  description: Additional notes about the payment
                method:
                  type: string
                  enum:
                    - vertofx
                  description: Payment method (only 'vertofx' requires additional fields)
                walletId:
                  type: string
                  description: Required if method is 'vertofx' - Wallet ID for VertoFX
                purposeCode:
                  type: string
                  description: Required if method is 'vertofx' - Purpose code for VertoFX
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: Optional receipt or supporting documents
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  paymentRequest:
                    type: object
              example:
                message: Payment request approved successfully
                paymentRequest:
                  id: 0654cd19-cea3-4fad-b92e-4033c4252c79
                  status: approved
        '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:
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Format: "Bearer
        {token}"

````