ServiceTitan Locations API

Customer service locations and addresses

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

servicetitan-locations-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: ServiceTitan Accounting Adjustments Locations 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: Locations
  description: Customer service locations and addresses
paths:
  /locations:
    get:
      summary: List Locations
      operationId: listLocations
      tags:
      - Locations
      parameters:
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/PageSize'
      - $ref: '#/components/parameters/CustomerId'
      - $ref: '#/components/parameters/ModifiedOnOrAfter'
      responses:
        '200':
          description: Paginated list of locations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationPagedResponse'
    post:
      summary: Create Location
      operationId: createLocation
      tags:
      - Locations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationCreateRequest'
      responses:
        '200':
          description: Created location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Location'
  /locations/{id}:
    get:
      summary: Get Location
      operationId: getLocation
      tags:
      - Locations
      parameters:
      - $ref: '#/components/parameters/Id'
      responses:
        '200':
          description: Location record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Location'
    patch:
      summary: Update Location
      operationId: updateLocation
      tags:
      - Locations
      parameters:
      - $ref: '#/components/parameters/Id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationUpdateRequest'
      responses:
        '200':
          description: Updated location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Location'
components:
  schemas:
    Location:
      type: object
      properties:
        id:
          type: integer
          format: int64
        customerId:
          type: integer
          format: int64
        active:
          type: boolean
        name:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        zoneId:
          type: integer
          format: int64
        taxZoneId:
          type: integer
          format: int64
          nullable: true
        createdOn:
          type: string
          format: date-time
        modifiedOn:
          type: string
          format: date-time
    LocationPagedResponse:
      type: object
      properties:
        page:
          type: integer
        pageSize:
          type: integer
        hasMore:
          type: boolean
        data:
          type: array
          items:
            $ref: '#/components/schemas/Location'
    Address:
      type: object
      properties:
        street:
          type: string
        unit:
          type: string
          nullable: true
        city:
          type: string
        state:
          type: string
        zip:
          type: string
        country:
          type: string
        latitude:
          type: number
          nullable: true
        longitude:
          type: number
          nullable: true
    LocationUpdateRequest:
      type: object
      properties:
        name:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        zoneId:
          type: integer
    LocationCreateRequest:
      type: object
      required:
      - address
      properties:
        name:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        zoneId:
          type: integer
  parameters:
    Id:
      name: id
      in: path
      required: true
      schema:
        type: integer
        format: int64
    CustomerId:
      name: customerId
      in: query
      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
        minimum: 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