Rillet Charges API

The Charges API from Rillet — 2 operation(s) for charges.

OpenAPI Specification

rillet-charges-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Rillet Accounting API Key Charges 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: Charges
paths:
  /charges:
    get:
      tags:
      - Charges
      operationId: list-all-charges
      summary: Lists all charges
      description: 'Pages card or out-of-pocket employee charges awaiting policy review, subsidiary allocation, or conversion into reimbursable payables.

        Filter by subsidiary_id or updated.gt when syncing corporate card feeds into downstream expense automation.

        '
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/cursor'
      - $ref: '#/components/parameters/subsidiary_id'
      - name: updated.gt
        in: query
        required: false
        description: Filter charges updated after this timestamp
        schema:
          type: string
          format: date-time
          example: '2023-01-01T00:00:00Z'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - charges
                - pagination
                properties:
                  charges:
                    type: array
                    items:
                      $ref: '#/components/schemas/Charge'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      tags:
      - Charges
      operationId: create-a-charge
      summary: Create a charge
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChargeRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Charge'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      parameters: []
  /charges/{charge_id}:
    get:
      tags:
      - Charges
      operationId: retrieve-a-charge
      summary: Retrieves a charge
      description: 'Fetches a single charge with merchant metadata, amounts, and workflow state so reviewers can decide coding before reimbursement.

        Use this after list-all-charges surfaces an id that needs manual inspection or attachment to a bill.

        '
      parameters:
      - name: charge_id
        in: path
        description: UUID of the charge to be used in this operation.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Charge'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      tags:
      - Charges
      operationId: delete-a-charge
      summary: Deletes a charge
      description: 'Drops a charge that should not influence spend reporting, for example duplicate imports from a card processor feed.

        Ensure finance agrees the underlying bank activity will not be re-imported before removing the charge permanently.

        '
      parameters:
      - name: charge_id
        in: path
        description: UUID of the charge to be used in this operation.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    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
    ExchangeRate:
      type: object
      required:
      - base
      - date
      - rate
      - target
      properties:
        base:
          $ref: '#/components/schemas/CurrencyCode'
        target:
          $ref: '#/components/schemas/CurrencyCode'
        rate:
          type: string
        date:
          type: string
          format: date
    AccountCode:
      type: string
      description: The account code found in the Chart of Accounts
      example: '11112'
    ChargeItem:
      allOf:
      - $ref: '#/components/schemas/ChargeItemRequest'
      - type: object
        required:
        - id
        properties:
          id:
            type: string
            format: uuid
    ExternalReference:
      type: object
      required:
      - type
      - id
      properties:
        type:
          type: string
          example: xyzSystemId
        id:
          type: string
          example: '234'
        url:
          type: string
          format: uri
          example: https://xyzsystempage.com/ids/234
      description: For requests, only pre-defined custom IDs are accepted. In responses, an object imported through an integration (e.g. Stripe) would return the provider's object ID.
    TaxRate:
      allOf:
      - $ref: '#/components/schemas/TaxRateWithOptionalAmount'
      required:
      - tax_amount
    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.
    ChargeItemRequest:
      type: object
      required:
      - account_code
      - amount
      properties:
        description:
          type: string
          example: API Charge
        account_code:
          $ref: '#/components/schemas/AccountCode'
        amount:
          $ref: '#/components/schemas/RoundedMonetaryAmount'
        tax_rate:
          $ref: '#/components/schemas/ExpenseTaxRate'
        service_period:
          $ref: '#/components/schemas/CalendarPeriod'
        fields:
          $ref: '#/components/schemas/FieldAssignments'
    ChargeStatus:
      type: string
      enum:
      - UNPAID
      - PAID
      - PARTIALLY_PAID
    PageCursor:
      type: string
      description: If defined, a cursor to retrieve the next page.
      example: iLQvkEj3sh3UiweC
    PageLimit:
      type: integer
      minimum: 1
      maximum: 100
      default: 25
    Charge:
      allOf:
      - $ref: '#/components/schemas/ChargeRequest'
      - type: object
        required:
        - id
        - status
        - updated_at
        properties:
          id:
            type: string
            format: uuid
          status:
            $ref: '#/components/schemas/ChargeStatus'
          updated_at:
            type: string
            format: date-time
            description: Timestamp when the charge was last modified
          items:
            type: array
            minItems: 1
            items:
              $ref: '#/components/schemas/ChargeItem'
    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'
    CountryCode:
      type: string
      description: Two-letter country code (ISO 3166-1 alpha-2).
      example: US
    CalendarPeriod:
      type: object
      required:
      - end
      - start
      properties:
        start:
          type: string
          format: date
        end:
          type: string
          format: date
    CurrencyCode:
      type: string
      description: Currency code following ISO-4217
      example: USD
    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
    ChargeRequest:
      type: object
      required:
      - vendor_id
      - items
      - charge_date
      - credit_card_account_code
      properties:
        vendor_id:
          type: string
          format: uuid
        items:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/ChargeItemRequest'
        charge_date:
          type: string
          format: date
        impact_date:
          type: string
          format: date
        credit_card_account_code:
          $ref: '#/components/schemas/AccountCode'
        subsidiary_id:
          type: string
          format: uuid
        external_references:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/ExternalReference'
        exchange_rate:
          $ref: '#/components/schemas/ExchangeRate'
    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
    Pagination:
      type: object
      properties:
        next_cursor:
          $ref: '#/components/schemas/PageCursor'
  parameters:
    limit:
      name: limit
      in: query
      required: false
      description: Maximum number of rows to return in the page.
      schema:
        $ref: '#/components/schemas/PageLimit'
    subsidiary_id:
      name: subsidiary_id
      in: query
      required: false
      description: Subsidiary to be used when filtering data
      schema:
        type: string
        format: uuid
    cursor:
      name: cursor
      in: query
      required: false
      description: Pagination cursor to navigate through the full response.
      schema:
        $ref: '#/components/schemas/PageCursor'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
x-mcp-ready: true
x-readme:
  headers:
  - key: X-Rillet-API-Version
    value: '4'