Orb

Orb Prices API

The Prices API from Orb — 3 operation(s) for prices.

Documentation

Specifications

Other Resources

OpenAPI Specification

orb-billing-prices-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Orb Alerts Prices API
  description: Orb is a usage-based billing and metering platform. The REST API ingests timestamped usage events, models customers, plans, prices, items, and billable metrics, manages subscriptions, and automates invoicing, credit ledgers, coupons, alerts, and webhooks. All endpoints are served over HTTPS at https://api.withorb.com/v1 and authenticated with a Bearer API key.
  termsOfService: https://www.withorb.com/legal/terms-of-service
  contact:
    name: Orb Support
    url: https://www.withorb.com
    email: team@withorb.com
  version: '1.0'
servers:
- url: https://api.withorb.com/v1
  description: Orb production API
security:
- bearerAuth: []
tags:
- name: Prices
paths:
  /prices:
    get:
      operationId: listPrices
      tags:
      - Prices
      summary: List prices
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: A paginated list of prices.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceList'
    post:
      operationId: createPrice
      tags:
      - Prices
      summary: Create price
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriceCreate'
      responses:
        '201':
          description: The newly created price.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Price'
  /prices/{price_id}:
    parameters:
    - name: price_id
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: fetchPrice
      tags:
      - Prices
      summary: Fetch price
      responses:
        '200':
          description: The requested price.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Price'
  /prices/evaluate:
    post:
      operationId: evaluatePrices
      tags:
      - Prices
      summary: Evaluate multiple prices
      description: Evaluates one or more prices against a set of events over a timeframe.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - timeframe_start
              properties:
                timeframe_start:
                  type: string
                  format: date-time
                timeframe_end:
                  type: string
                  format: date-time
                price_evaluations:
                  type: array
                  items:
                    type: object
                    properties:
                      price_id:
                        type: string
                      external_price_id:
                        type: string
                      filter:
                        type: string
      responses:
        '200':
          description: The evaluated price results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        price_id:
                          type: string
                        amount:
                          type: string
components:
  parameters:
    Limit:
      name: limit
      in: query
      description: The number of items to return per page (default 20, max 100).
      schema:
        type: integer
        default: 20
        maximum: 100
    Cursor:
      name: cursor
      in: query
      description: An opaque cursor for the next page of results.
      schema:
        type: string
  schemas:
    PaginationMetadata:
      type: object
      properties:
        has_more:
          type: boolean
        next_cursor:
          type: string
          nullable: true
    Item:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        external_connections:
          type: array
          items:
            type: object
            properties:
              external_connection_name:
                type: string
              external_entity_id:
                type: string
        created_at:
          type: string
          format: date-time
    PriceCreate:
      type: object
      required:
      - name
      - item_id
      - cadence
      - currency
      - model_type
      properties:
        name:
          type: string
        item_id:
          type: string
        cadence:
          type: string
          enum:
          - one_time
          - monthly
          - quarterly
          - semi_annual
          - annual
        currency:
          type: string
        model_type:
          type: string
          enum:
          - unit
          - tiered
          - package
          - matrix
          - bulk
        billable_metric_id:
          type: string
        unit_config:
          type: object
          properties:
            unit_amount:
              type: string
        external_price_id:
          type: string
    PriceList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Price'
        pagination_metadata:
          $ref: '#/components/schemas/PaginationMetadata'
    Price:
      type: object
      properties:
        id:
          type: string
        external_price_id:
          type: string
          nullable: true
        name:
          type: string
        price_type:
          type: string
          enum:
          - usage_price
          - fixed_price
        model_type:
          type: string
          enum:
          - unit
          - tiered
          - package
          - matrix
          - bulk
          - tiered_package
          - grouped_tiered
          - threshold_total_amount
        cadence:
          type: string
          enum:
          - one_time
          - monthly
          - quarterly
          - semi_annual
          - annual
        currency:
          type: string
        item:
          $ref: '#/components/schemas/Item'
        unit_config:
          type: object
          nullable: true
          properties:
            unit_amount:
              type: string
        created_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Authenticate with an Orb API key sent as a Bearer token in the Authorization header: `Authorization: Bearer <ORB_API_KEY>`.'