Rapidata Invoice API

The Invoice API from Rapidata — 5 operation(s) for invoice.

OpenAPI Specification

rapidata-invoice-api-openapi.yml Raw ↑
openapi: 3.0.4
info:
  title: Rapidata Asset Invoice API
  description: The API for the Rapidata Asset service
  version: v1
servers:
- url: https://api.rapidata.ai/
tags:
- name: Invoice
  x-displayName: Invoice
paths:
  /billing/invoice:
    post:
      tags:
      - Invoice
      summary: Creates a Stripe draft invoice for a billing period.
      requestBody:
        description: The invoice creation data.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInvoiceEndpoint_Input'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateInvoiceEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /invoice/{invoiceId}/finalize:
    post:
      tags:
      - Invoice
      summary: Finalizes a draft invoice.
      parameters:
      - name: invoiceId
        in: path
        description: The invoice to finalize.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /invoice/{invoiceId}:
    get:
      tags:
      - Invoice
      summary: Gets an invoice by ID.
      parameters:
      - name: invoiceId
        in: path
        description: The invoice ID.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetInvoiceEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /invoices:
    get:
      tags:
      - Invoice
      summary: Queries invoices with filtering, sorting, and pagination.
      parameters:
      - name: page
        in: query
        description: The 1-based page index.
        schema:
          type: integer
        x-parameter-group: page
      - name: page_size
        in: query
        description: The number of items per page.
        schema:
          type: integer
        x-parameter-group: page
      - name: sort
        in: query
        description: Sort fields. Prefix with - for descending order (e.g. -created_at).
        schema:
          type: array
          items:
            enum:
            - created_at
            - -created_at
            - amount_due
            - -amount_due
            - status
            - -status
            type: string
        x-parameter-group: sort
      - name: status
        in: query
        description: Filter by status.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: owner_id
        in: query
        description: Filter by owner_id.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: billing_period_id
        in: query
        description: Filter by billing_period_id.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: created_at
        in: query
        description: Filter by created_at.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: logic
        in: query
        description: 'How to combine the field filters: "and" (default) requires every filter to match, "or" requires any of them to match.'
        schema:
          enum:
          - and
          - or
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryInvoicesEndpoint_PagedResultOfOutput'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /invoice/{invoiceId}/void:
    post:
      tags:
      - Invoice
      summary: Voids an invoice.
      parameters:
      - name: invoiceId
        in: path
        description: The invoice to void.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
components:
  schemas:
    QueryInvoicesEndpoint_PagedResultOfOutput:
      required:
      - total
      - page
      - pageSize
      - items
      type: object
      properties:
        total:
          type: integer
          format: int64
        page:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        items:
          type: array
          items:
            $ref: '#/components/schemas/QueryInvoicesEndpoint_Output'
        totalPages:
          type: integer
          format: int32
    CreateInvoiceEndpoint_Output:
      required:
      - invoiceId
      type: object
      properties:
        invoiceId:
          type: string
          description: The created invoice ID.
    CreateInvoiceEndpoint_Input:
      required:
      - billingPeriodId
      type: object
      properties:
        billingPeriodId:
          type: string
          description: The billing period to create an invoice for.
    ValidationProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    QueryInvoicesEndpoint_Output:
      required:
      - id
      - billingPeriodId
      - billingPeriodStart
      - billingPeriodEnd
      - status
      - amountDue
      - ownerId
      - createdAt
      type: object
      properties:
        id:
          type: string
          description: The invoice ID.
        billingPeriodId:
          type: string
          description: The billing period this invoice belongs to.
        billingPeriodStart:
          type: string
          description: The start date of the billing period.
          format: date-time
        billingPeriodEnd:
          type: string
          description: The end date of the billing period.
          format: date-time
        stripeInvoiceId:
          type: string
          description: The Stripe invoice ID.
          nullable: true
        status:
          allOf:
          - $ref: '#/components/schemas/InvoiceStatus'
          description: The current invoice status.
        amountDue:
          type: integer
          description: The total amount due in cents.
          format: int64
        currency:
          type: string
          description: The invoice currency.
          nullable: true
        ownerId:
          type: string
          description: The owner customer ID.
          format: uuid
        createdAt:
          type: string
          description: When the invoice was created.
          format: date-time
        finalizedAt:
          type: string
          description: When the invoice was finalized.
          format: date-time
          nullable: true
        paidAt:
          type: string
          description: When the invoice was paid.
          format: date-time
          nullable: true
        voidedAt:
          type: string
          description: When the invoice was voided.
          format: date-time
          nullable: true
    InvoiceStatus:
      enum:
      - Generating
      - Draft
      - Open
      - Paid
      - Void
      - Uncollectible
      - Failed
    GetInvoiceEndpoint_Output:
      required:
      - id
      - billingPeriodId
      - billingPeriodStart
      - billingPeriodEnd
      - status
      - amountDue
      - createdAt
      type: object
      properties:
        id:
          type: string
          description: The invoice ID.
        billingPeriodId:
          type: string
          description: The billing period this invoice belongs to.
        billingPeriodStart:
          type: string
          description: The start date of the billing period.
          format: date-time
        billingPeriodEnd:
          type: string
          description: The end date of the billing period.
          format: date-time
        stripeInvoiceId:
          type: string
          description: The Stripe invoice ID.
          nullable: true
        status:
          allOf:
          - $ref: '#/components/schemas/InvoiceStatus'
          description: The current invoice status.
        amountDue:
          type: integer
          description: The total amount due in cents.
          format: int64
        currency:
          type: string
          description: The invoice currency.
          nullable: true
        createdAt:
          type: string
          description: When the invoice was created.
          format: date-time
        finalizedAt:
          type: string
          description: When the invoice was finalized.
          format: date-time
          nullable: true
        paidAt:
          type: string
          description: When the invoice was paid.
          format: date-time
          nullable: true
  securitySchemes:
    OpenIdConnect:
      type: openIdConnect
      description: OpenID Connect connection flow
      openIdConnectUrl: https://auth.rapidata.ai/.well-known/openid-configuration
x-tagGroups:
- name: Rapidata Asset API
  tags:
  - Asset
  - BatchUpload
- name: Rapidata Audience API
  tags:
  - Audience
  - Examples
- name: Rapidata Campaign API
  tags:
  - Cache
  - Campaign
  - ExternalAudience
- name: Rapidata Dataset API
  tags:
  - ContextShortening
  - Datapoints
  - Dataset
  - DatasetGroup
- name: Rapidata Flow API
  tags:
  - Flow
  - FlowItem
  - RankingFlow
  - RankingFlowItem
- name: Rapidata Identity API
  tags:
  - Rapidata.Identity.API
  - Client
  - Customer
  - Identity
  - Newsletter
  - Organization
  - Survey
- name: Rapidata Leaderboard API
  tags:
  - Benchmark
  - SampleGeneration
  - Faucet
  - Replicate
  - Leaderboard
  - Participant
  - Prompt
  - Sample
- name: Rapidata Order API
  tags:
  - Feedback
  - Job
  - Order
- name: Rapidata Payment API
  tags:
  - Billing
  - ExternalServicePrices
  - Reconciliation
  - Settings
  - VolumeDiscount
  - BillingAccount
  - Invoice
  - Payment
- name: Rapidata Pipeline API
  tags:
  - Pipeline
- name: Rapidata Rapid API
  tags:
  - CustomerRapid
  - GlobalText
  - Rapid
  - UserRapid
  - ValidationFeedback
- name: Rapidata Signal API
  tags:
  - Signal
- name: Rapidata Translation API
  tags:
  - Translation
- name: Rapidata Validation API
  tags:
  - ValidationSet
- name: Rapidata Workflow API
  tags:
  - Evaluation
  - GroupedRanking
  - Ranking
  - SimpleWorkflow
  - Workflow