ServiceTitan Purchase Orders API

The Purchase Orders API from ServiceTitan — 2 operation(s) for purchase orders.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

servicetitan-purchase-orders-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: ServiceTitan Accounting Adjustments Purchase Orders API
  description: 'The Accounting API manages invoices, invoice items, AP credits, payments, payment terms,

    payment types, journal entries, journal entry details, tax zones, and GL accounts.

    Tenant-scoped; OAuth 2.0 + App Key. Integrates with QuickBooks, Sage Intacct, and Acumatica.

    '
  version: 2.0.0
  contact:
    name: ServiceTitan Developer Support
    url: https://developer.servicetitan.io/
    email: integrations@servicetitan.com
  license:
    name: ServiceTitan Terms of Service
    url: https://www.servicetitan.com/legal/terms-of-service
servers:
- url: https://api.servicetitan.io/accounting/v2/{tenant}
  description: Production
  variables:
    tenant:
      default: '0000000'
- url: https://api-integration.servicetitan.io/accounting/v2/{tenant}
  description: Integration (Sandbox)
  variables:
    tenant:
      default: '0000000'
security:
- OAuth2: []
  AppKey: []
tags:
- name: Purchase Orders
paths:
  /purchase-orders:
    get:
      summary: List Purchase Orders
      operationId: listPurchaseOrders
      tags:
      - Purchase Orders
      parameters:
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/PageSize'
      - $ref: '#/components/parameters/ModifiedOnOrAfter'
      - name: vendorId
        in: query
        schema:
          type: integer
      - name: status
        in: query
        schema:
          type: string
          enum:
          - Pending
          - Sent
          - Received
          - Canceled
          - PartiallyReceived
      responses:
        '200':
          description: Purchase orders
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrderPagedResponse'
    post:
      summary: Create Purchase Order
      operationId: createPurchaseOrder
      tags:
      - Purchase Orders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseOrderCreateRequest'
      responses:
        '200':
          description: Created purchase order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrder'
  /purchase-orders/{id}:
    get:
      summary: Get Purchase Order
      operationId: getPurchaseOrder
      tags:
      - Purchase Orders
      parameters:
      - $ref: '#/components/parameters/Id'
      responses:
        '200':
          description: Purchase order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrder'
components:
  schemas:
    PurchaseOrderCreateRequest:
      type: object
      required:
      - typeId
      - vendorId
      - items
      properties:
        typeId:
          type: integer
        vendorId:
          type: integer
        warehouseId:
          type: integer
        jobId:
          type: integer
        projectId:
          type: integer
        technicianId:
          type: integer
        memo:
          type: string
        date:
          type: string
          format: date-time
        requiredOn:
          type: string
          format: date-time
        items:
          type: array
          items:
            type: object
            required:
            - skuId
            - quantity
            - cost
            properties:
              skuId:
                type: integer
              quantity:
                type: number
              cost:
                type: number
    PurchaseOrder:
      type: object
      properties:
        id:
          type: integer
          format: int64
        active:
          type: boolean
        number:
          type: string
        typeId:
          type: integer
        status:
          type: string
        date:
          type: string
          format: date-time
        requiredOn:
          type: string
          format: date-time
          nullable: true
        sentOn:
          type: string
          format: date-time
          nullable: true
        receivedOn:
          type: string
          format: date-time
          nullable: true
        memo:
          type: string
          nullable: true
        jobId:
          type: integer
          nullable: true
        projectId:
          type: integer
          nullable: true
        technicianId:
          type: integer
          nullable: true
        vendor:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
        warehouse:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
        items:
          type: array
          items:
            type: object
            properties:
              skuId:
                type: integer
              skuName:
                type: string
              quantity:
                type: number
              cost:
                type: number
              total:
                type: number
        total:
          type: number
        tax:
          type: number
        shipping:
          type: number
        modifiedOn:
          type: string
          format: date-time
    PurchaseOrderPagedResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseOrder'
  parameters:
    Id:
      name: id
      in: path
      required: true
      schema:
        type: integer
        format: int64
    PageSize:
      name: pageSize
      in: query
      schema:
        type: integer
        default: 50
        maximum: 500
    Page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
    ModifiedOnOrAfter:
      name: modifiedOnOrAfter
      in: query
      schema:
        type: string
        format: date-time
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://auth.servicetitan.io/connect/token
          scopes: {}
    AppKey:
      type: apiKey
      in: header
      name: ST-App-Key