Rillet Vendor Credit Applications API

The Vendor Credit Applications API from Rillet — 1 operation(s) for vendor credit applications.

OpenAPI Specification

rillet-vendor-credit-applications-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Rillet Accounting API Key Vendor Credit Applications API
  version: v4.0
servers:
- url: https://api.rillet.com
  description: Production server url
- url: https://sandbox.api.rillet.com
  description: Test server url
security:
- bearerAuth: []
tags:
- name: Vendor Credit Applications
paths:
  /vendor-credits/{vendor_credit_id}/applications:
    post:
      tags:
      - Vendor Credit Applications
      operationId: apply-vendor-credit
      summary: Applies a vendor credit to bills
      description: 'Allocates an existing vendor credit balance against specific open bills, reducing net amounts payable similar to a targeted vendor payment.

        Use after reviewing retrieve-a-vendor-credit so you apply only the remaining unapplied balance.

        '
      parameters:
      - name: vendor_credit_id
        in: path
        description: UUID of the vendor credit to be used in this operation.
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplyVendorCreditRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorCredit'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ApplyVendorCreditRequest:
      type: object
      required:
      - applications
      properties:
        applications:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/VendorCreditApplicationRequest'
    ExpenseTaxRate:
      allOf:
      - $ref: '#/components/schemas/TaxRate'
      - type: object
        required:
        - coverage
        properties:
          tax_code:
            type: string
            description: Code of a predefined tax rate. When provided, the rate's percentage, country, and description are used instead of the inline values.
          coverage:
            type: string
            enum:
            - INCLUSIVE
            - EXCLUSIVE
    BaseVendorCreditRequest:
      type: object
      required:
      - credit_number
      - date
      - gl_impact_date
      - line_items
      properties:
        credit_number:
          type: string
          example: VC-001
        date:
          type: string
          format: date
        gl_impact_date:
          type: string
          format: date
        memo:
          type: string
        line_items:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/VendorCreditLineItemRequest'
    Error:
      type: object
      required:
      - type
      - title
      properties:
        type:
          type: string
          format: uri
          description: A URI reference that identifies the error type.
          example: https://rillet.io/forbidden
        title:
          type: string
          description: Summary of the problem.
          example: Forbidden
        status:
          type: integer
          description: The HTTP status code generated by the origin server for this occurrence of the error.
          example: 403
        detail:
          type: string
          description: Explanation specific to this occurrence of the error.
          example: User does not have rights to perform this operation.
    TaxRateWithOptionalAmount:
      type: object
      required:
      - country
      - description
      - percentage
      - type
      properties:
        percentage:
          type: number
          minimum: 0
          maximum: 100
          example: 0
        tax_amount:
          $ref: '#/components/schemas/RoundedMonetaryAmount'
        country:
          $ref: '#/components/schemas/CountryCode'
        type:
          type: string
          enum:
          - VAT
          - SALES_TAX
        description:
          type: string
    TaxRate:
      allOf:
      - $ref: '#/components/schemas/TaxRateWithOptionalAmount'
      required:
      - tax_amount
    FieldAssignments:
      type: array
      items:
        type: object
        required:
        - field_id
        - field_value_id
        properties:
          field_id:
            type: string
            format: uuid
          field_value_id:
            type: string
            format: uuid
    VendorCreditApplicationRequest:
      type: object
      required:
      - bill_id
      - amount
      properties:
        bill_id:
          type: string
          format: uuid
        amount:
          $ref: '#/components/schemas/RoundedMonetaryAmount'
    VendorCreditApplication:
      type: object
      required:
      - id
      - vendor_credit_id
      - bill_id
      - amount
      - application_date
      properties:
        id:
          type: string
          format: uuid
        vendor_credit_id:
          type: string
          format: uuid
        bill_id:
          type: string
          format: uuid
        bill_number:
          type: string
        amount:
          $ref: '#/components/schemas/RoundedMonetaryAmount'
        application_date:
          type: string
          format: date
    VendorCredit:
      allOf:
      - $ref: '#/components/schemas/CreateVendorCreditRequest'
      - type: object
        required:
        - id
        - organization_id
        - status
        - applied_amount
        - remaining_amount
        - applications
        - updated_at
        properties:
          id:
            type: string
            format: uuid
          organization_id:
            type: string
            format: uuid
          status:
            $ref: '#/components/schemas/VendorCreditStatus'
          amount:
            $ref: '#/components/schemas/RoundedMonetaryAmount'
          applied_amount:
            $ref: '#/components/schemas/RoundedMonetaryAmount'
          remaining_amount:
            $ref: '#/components/schemas/RoundedMonetaryAmount'
          line_items:
            type: array
            items:
              $ref: '#/components/schemas/VendorCreditLineItem'
          applications:
            type: array
            items:
              $ref: '#/components/schemas/VendorCreditApplication'
          updated_at:
            type: string
            format: date-time
            description: Timestamp when the vendor credit was last modified
    CountryCode:
      type: string
      description: Two-letter country code (ISO 3166-1 alpha-2).
      example: US
    AccountCode:
      type: string
      description: The account code found in the Chart of Accounts
      example: '11112'
    RoundedMonetaryAmount:
      type: object
      description: A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
      x-class-extra-annotation: '@io.rillet.common.infra.validators.IsRoundedAmount'
      required:
      - amount
      - currency
      properties:
        amount:
          type: string
          description: Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
          example: '1.01'
        currency:
          $ref: '#/components/schemas/CurrencyCode'
    CreateVendorCreditRequest:
      allOf:
      - $ref: '#/components/schemas/BaseVendorCreditRequest'
      - type: object
        required:
        - subsidiary_id
        - vendor_id
        properties:
          vendor_id:
            type: string
            format: uuid
          subsidiary_id:
            type: string
            format: uuid
    VendorCreditStatus:
      type: string
      enum:
      - UNAPPLIED
      - PARTIALLY_APPLIED
      - REFUNDED
      - APPLIED
    VendorCreditLineItemRequest:
      type: object
      required:
      - account_code
      - amount
      properties:
        account_code:
          $ref: '#/components/schemas/AccountCode'
        amount:
          $ref: '#/components/schemas/RoundedMonetaryAmount'
        description:
          type: string
        tax_rate:
          $ref: '#/components/schemas/ExpenseTaxRate'
        fields:
          $ref: '#/components/schemas/FieldAssignments'
    VendorCreditLineItem:
      allOf:
      - $ref: '#/components/schemas/VendorCreditLineItemRequest'
      - type: object
        required:
        - id
        properties:
          id:
            type: string
            format: uuid
          net_amount:
            $ref: '#/components/schemas/RoundedMonetaryAmount'
          tax_amount:
            $ref: '#/components/schemas/RoundedMonetaryAmount'
    CurrencyCode:
      type: string
      description: Currency code following ISO-4217
      example: USD
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
x-mcp-ready: true
x-readme:
  headers:
  - key: X-Rillet-API-Version
    value: '4'