Ordway Payments API

Manage payments and payment methods

OpenAPI Specification

ordway-payments-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Ordway REST Billing Runs Payments API
  description: RESTful API for bidirectional integration with the Ordway billing and revenue automation platform. Enables managing customers, subscriptions, invoices, payments, usage data, and revenue recognition schedules. Supports usage-based billing, ASC 606 compliant revenue recognition, accounts receivable automation, and SaaS metrics reporting.
  version: v1
  contact:
    name: Ordway Support
    url: https://support.ordwaylabs.com
  termsOfService: https://ordwaylabs.com/
servers:
- url: https://api.ordwaylabs.com/api/v1
  description: Production
- url: https://staging.ordwaylabs.com/api/v1
  description: Staging
security:
- ApiKeyAuth: []
  UserTokenAuth: []
  UserEmailAuth: []
  CompanyAuth: []
tags:
- name: Payments
  description: Manage payments and payment methods
paths:
  /customers/{id}/payment_methods:
    get:
      summary: List payment methods for a customer
      operationId: listCustomerPaymentMethods
      tags:
      - Payments
      parameters:
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: List of payment methods
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaymentMethod'
        '404':
          $ref: '#/components/responses/NotFound'
  /payments:
    get:
      summary: List payments
      operationId: listPayments
      tags:
      - Payments
      parameters:
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/size'
      - $ref: '#/components/parameters/sort'
      - name: updated_date>
        in: query
        description: Filter payments updated after this date-time (ISO 8601)
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: List of payments
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Payment'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      summary: Create a payment
      operationId: createPayment
      tags:
      - Payments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentInput'
      responses:
        '201':
          description: Payment created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
  /payments/{id}:
    get:
      summary: Retrieve a payment
      operationId: getPayment
      tags:
      - Payments
      parameters:
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Payment details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Payment:
      type: object
      required:
      - company_id
      - payment_id
      properties:
        company_id:
          type: string
        payment_id:
          type: string
        customer_id:
          type: string
        payment_date:
          type: string
          format: date
          nullable: true
        notes:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        payment_amount:
          type: number
          nullable: true
        fee_amount:
          type: number
          nullable: true
        applied_amount:
          type: number
          nullable: true
        unapplied_amount:
          type: number
          nullable: true
        refunded_amount:
          type: number
          nullable: true
        payment_type:
          type: string
          nullable: true
        payment_method:
          type: string
          nullable: true
        currency:
          type: string
          nullable: true
        reference_number:
          type: string
          nullable: true
        auto_apply:
          type: boolean
          nullable: true
        gl_account:
          type: string
          nullable: true
        custom_fields:
          type: object
          nullable: true
          additionalProperties: true
        created_by:
          type: string
          nullable: true
        updated_by:
          type: string
          nullable: true
        created_date:
          type: string
          format: date-time
          nullable: true
        updated_date:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
        errors:
          type: object
          additionalProperties: true
    PaymentInput:
      type: object
      properties:
        customer_id:
          type: string
        payment_date:
          type: string
          format: date
        payment_amount:
          type: number
        payment_type:
          type: string
        payment_method:
          type: string
        currency:
          type: string
        reference_number:
          type: string
        auto_apply:
          type: boolean
        gl_account:
          type: string
        custom_fields:
          type: object
          additionalProperties: true
    PaymentMethod:
      type: object
      required:
      - company_id
      - payment_method_id
      - customer_id
      - payment_type
      - account_number
      properties:
        payment_method_id:
          type: string
        company_id:
          type: string
        customer_id:
          type: string
        payment_type:
          type: string
        account_number:
          type: string
        routing_number:
          type: string
          nullable: true
        account_holder_name:
          type: string
          nullable: true
        account_holder_type:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        expiry:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          nullable: true
        default:
          type: boolean
          nullable: true
  parameters:
    id:
      name: id
      in: path
      required: true
      description: Resource identifier
      schema:
        type: string
    size:
      name: size
      in: query
      description: Number of records per page
      schema:
        type: integer
        minimum: 1
        maximum: 500
        default: 50
    page:
      name: page
      in: query
      description: Page number for pagination (1-based)
      schema:
        type: integer
        minimum: 1
        default: 1
    sort:
      name: sort
      in: query
      description: Comma-separated list of fields to sort by (prefix with - for descending)
      schema:
        type: string
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication credentials missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Ordway API key
    UserTokenAuth:
      type: apiKey
      in: header
      name: X-User-Token
      description: Ordway user authentication token
    UserEmailAuth:
      type: apiKey
      in: header
      name: X-User-Email
      description: Ordway user email address
    CompanyAuth:
      type: apiKey
      in: header
      name: X-User-Company
      description: Ordway company identifier
externalDocs:
  description: Ordway API Documentation
  url: https://ordwaylabs.stoplight.io/docs/ordway/ZG9jOjQ4OTgxNg-overview