openapi: 3.0.3
info:
  title: NetSuite REST Record API
  version: v1
  x-slurry-persona: true
  description: >-
    Community simulation based on Oracle NetSuite's public API documentation. Not affiliated with or endorsed by Oracle NetSuite.
    Covers the SuiteTalk REST web services record service (record/v1) for customers, contacts, vendors, employees,
    inventory items, sales orders, invoices and customer payments, plus SuiteQL, written from the public SuiteTalk
    REST Web Services guide. Collections page with limit and offset and return links, count, hasMore, items,
    offset and totalResults. Create and update return 204 No Content with a Location header. Errors follow the
    documented shape with type, title, status and o:errorDetails.
  license:
    name: CC-BY-4.0
    url: https://creativecommons.org/licenses/by/4.0/
  contact:
    name: Slurry
    url: https://slurry.io
externalDocs:
  description: SuiteTalk REST Web Services (public help centre)
  url: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/book_1559132836.html
servers:
  - url: https://{accountId}.suitetalk.api.netsuite.com
    variables:
      accountId:
        default: "1234567"
security:
  - oauth2: []
paths:
  /services/rest/record/v1/customer:
    get:
      operationId: listCustomer
      tags: [Customer]
      summary: List customers
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Offset"
      responses:
        "200":
          description: A page of customers
          content:
            application/json:
              schema: { $ref: "#/components/schemas/CustomerCollection" }
        "400":
          description: Invalid query
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    post:
      operationId: createCustomer
      tags: [Customer]
      summary: Create a customer
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/Customer" }
      responses:
        "204":
          description: Created. The Location header holds the new record's URL.
          headers:
            Location:
              schema: { type: string, example: "https://1234567.suitetalk.api.netsuite.com/services/rest/record/v1/customer/647" }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/customer/{id}:
    parameters:
      - $ref: "#/components/parameters/Id"
    get:
      operationId: getCustomer
      tags: [Customer]
      summary: Get a customer by internal id
      parameters:
        - $ref: "#/components/parameters/ExpandSubResources"
        - $ref: "#/components/parameters/Fields"
      responses:
        "200":
          description: The record
          content:
            application/json:
              schema: { $ref: "#/components/schemas/Customer" }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    patch:
      operationId: updateCustomer
      tags: [Customer]
      summary: Update fields on a customer
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/Customer" }
      responses:
        "204": { description: Updated }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    delete:
      operationId: deleteCustomer
      tags: [Customer]
      summary: Delete a customer
      responses:
        "204": { description: Deleted }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/contact:
    get:
      operationId: listContact
      tags: [Contact]
      summary: List contacts
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Offset"
      responses:
        "200":
          description: A page of contacts
          content:
            application/json:
              schema: { $ref: "#/components/schemas/ContactCollection" }
        "400":
          description: Invalid query
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    post:
      operationId: createContact
      tags: [Contact]
      summary: Create a contact
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/Contact" }
      responses:
        "204":
          description: Created. The Location header holds the new record's URL.
          headers:
            Location:
              schema: { type: string, example: "https://1234567.suitetalk.api.netsuite.com/services/rest/record/v1/contact/647" }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/contact/{id}:
    parameters:
      - $ref: "#/components/parameters/Id"
    get:
      operationId: getContact
      tags: [Contact]
      summary: Get a contact by internal id
      parameters:
        - $ref: "#/components/parameters/ExpandSubResources"
        - $ref: "#/components/parameters/Fields"
      responses:
        "200":
          description: The record
          content:
            application/json:
              schema: { $ref: "#/components/schemas/Contact" }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    patch:
      operationId: updateContact
      tags: [Contact]
      summary: Update fields on a contact
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/Contact" }
      responses:
        "204": { description: Updated }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    delete:
      operationId: deleteContact
      tags: [Contact]
      summary: Delete a contact
      responses:
        "204": { description: Deleted }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/vendor:
    get:
      operationId: listVendor
      tags: [Vendor]
      summary: List vendors
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Offset"
      responses:
        "200":
          description: A page of vendors
          content:
            application/json:
              schema: { $ref: "#/components/schemas/VendorCollection" }
        "400":
          description: Invalid query
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    post:
      operationId: createVendor
      tags: [Vendor]
      summary: Create a vendor
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/Vendor" }
      responses:
        "204":
          description: Created. The Location header holds the new record's URL.
          headers:
            Location:
              schema: { type: string, example: "https://1234567.suitetalk.api.netsuite.com/services/rest/record/v1/vendor/647" }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/vendor/{id}:
    parameters:
      - $ref: "#/components/parameters/Id"
    get:
      operationId: getVendor
      tags: [Vendor]
      summary: Get a vendor by internal id
      parameters:
        - $ref: "#/components/parameters/ExpandSubResources"
        - $ref: "#/components/parameters/Fields"
      responses:
        "200":
          description: The record
          content:
            application/json:
              schema: { $ref: "#/components/schemas/Vendor" }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    patch:
      operationId: updateVendor
      tags: [Vendor]
      summary: Update fields on a vendor
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/Vendor" }
      responses:
        "204": { description: Updated }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    delete:
      operationId: deleteVendor
      tags: [Vendor]
      summary: Delete a vendor
      responses:
        "204": { description: Deleted }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/employee:
    get:
      operationId: listEmployee
      tags: [Employee]
      summary: List employees
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Offset"
      responses:
        "200":
          description: A page of employees
          content:
            application/json:
              schema: { $ref: "#/components/schemas/EmployeeCollection" }
        "400":
          description: Invalid query
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    post:
      operationId: createEmployee
      tags: [Employee]
      summary: Create a employee
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/Employee" }
      responses:
        "204":
          description: Created. The Location header holds the new record's URL.
          headers:
            Location:
              schema: { type: string, example: "https://1234567.suitetalk.api.netsuite.com/services/rest/record/v1/employee/647" }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/employee/{id}:
    parameters:
      - $ref: "#/components/parameters/Id"
    get:
      operationId: getEmployee
      tags: [Employee]
      summary: Get a employee by internal id
      parameters:
        - $ref: "#/components/parameters/ExpandSubResources"
        - $ref: "#/components/parameters/Fields"
      responses:
        "200":
          description: The record
          content:
            application/json:
              schema: { $ref: "#/components/schemas/Employee" }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    patch:
      operationId: updateEmployee
      tags: [Employee]
      summary: Update fields on a employee
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/Employee" }
      responses:
        "204": { description: Updated }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    delete:
      operationId: deleteEmployee
      tags: [Employee]
      summary: Delete a employee
      responses:
        "204": { description: Deleted }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/inventoryItem:
    get:
      operationId: listInventoryItem
      tags: [InventoryItem]
      summary: List inventory items
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Offset"
      responses:
        "200":
          description: A page of inventory items
          content:
            application/json:
              schema: { $ref: "#/components/schemas/InventoryItemCollection" }
        "400":
          description: Invalid query
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    post:
      operationId: createInventoryItem
      tags: [InventoryItem]
      summary: Create a inventory item
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/InventoryItem" }
      responses:
        "204":
          description: Created. The Location header holds the new record's URL.
          headers:
            Location:
              schema: { type: string, example: "https://1234567.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryItem/647" }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/inventoryItem/{id}:
    parameters:
      - $ref: "#/components/parameters/Id"
    get:
      operationId: getInventoryItem
      tags: [InventoryItem]
      summary: Get a inventory item by internal id
      parameters:
        - $ref: "#/components/parameters/ExpandSubResources"
        - $ref: "#/components/parameters/Fields"
      responses:
        "200":
          description: The record
          content:
            application/json:
              schema: { $ref: "#/components/schemas/InventoryItem" }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    patch:
      operationId: updateInventoryItem
      tags: [InventoryItem]
      summary: Update fields on a inventory item
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/InventoryItem" }
      responses:
        "204": { description: Updated }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    delete:
      operationId: deleteInventoryItem
      tags: [InventoryItem]
      summary: Delete a inventory item
      responses:
        "204": { description: Deleted }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/salesOrder:
    get:
      operationId: listSalesOrder
      tags: [SalesOrder]
      summary: List sales orders
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Offset"
      responses:
        "200":
          description: A page of sales orders
          content:
            application/json:
              schema: { $ref: "#/components/schemas/SalesOrderCollection" }
        "400":
          description: Invalid query
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    post:
      operationId: createSalesOrder
      tags: [SalesOrder]
      summary: Create a sales order
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/SalesOrder" }
      responses:
        "204":
          description: Created. The Location header holds the new record's URL.
          headers:
            Location:
              schema: { type: string, example: "https://1234567.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/647" }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/salesOrder/{id}:
    parameters:
      - $ref: "#/components/parameters/Id"
    get:
      operationId: getSalesOrder
      tags: [SalesOrder]
      summary: Get a sales order by internal id
      parameters:
        - $ref: "#/components/parameters/ExpandSubResources"
        - $ref: "#/components/parameters/Fields"
      responses:
        "200":
          description: The record
          content:
            application/json:
              schema: { $ref: "#/components/schemas/SalesOrder" }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    patch:
      operationId: updateSalesOrder
      tags: [SalesOrder]
      summary: Update fields on a sales order
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/SalesOrder" }
      responses:
        "204": { description: Updated }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    delete:
      operationId: deleteSalesOrder
      tags: [SalesOrder]
      summary: Delete a sales order
      responses:
        "204": { description: Deleted }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/invoice:
    get:
      operationId: listInvoice
      tags: [Invoice]
      summary: List invoices
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Offset"
      responses:
        "200":
          description: A page of invoices
          content:
            application/json:
              schema: { $ref: "#/components/schemas/InvoiceCollection" }
        "400":
          description: Invalid query
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    post:
      operationId: createInvoice
      tags: [Invoice]
      summary: Create a invoice
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/Invoice" }
      responses:
        "204":
          description: Created. The Location header holds the new record's URL.
          headers:
            Location:
              schema: { type: string, example: "https://1234567.suitetalk.api.netsuite.com/services/rest/record/v1/invoice/647" }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/invoice/{id}:
    parameters:
      - $ref: "#/components/parameters/Id"
    get:
      operationId: getInvoice
      tags: [Invoice]
      summary: Get a invoice by internal id
      parameters:
        - $ref: "#/components/parameters/ExpandSubResources"
        - $ref: "#/components/parameters/Fields"
      responses:
        "200":
          description: The record
          content:
            application/json:
              schema: { $ref: "#/components/schemas/Invoice" }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    patch:
      operationId: updateInvoice
      tags: [Invoice]
      summary: Update fields on a invoice
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/Invoice" }
      responses:
        "204": { description: Updated }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    delete:
      operationId: deleteInvoice
      tags: [Invoice]
      summary: Delete a invoice
      responses:
        "204": { description: Deleted }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/customerPayment:
    get:
      operationId: listCustomerPayment
      tags: [CustomerPayment]
      summary: List customer payments
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Offset"
      responses:
        "200":
          description: A page of customer payments
          content:
            application/json:
              schema: { $ref: "#/components/schemas/CustomerPaymentCollection" }
        "400":
          description: Invalid query
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    post:
      operationId: createCustomerPayment
      tags: [CustomerPayment]
      summary: Create a customer payment
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/CustomerPayment" }
      responses:
        "204":
          description: Created. The Location header holds the new record's URL.
          headers:
            Location:
              schema: { type: string, example: "https://1234567.suitetalk.api.netsuite.com/services/rest/record/v1/customerPayment/647" }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/record/v1/customerPayment/{id}:
    parameters:
      - $ref: "#/components/parameters/Id"
    get:
      operationId: getCustomerPayment
      tags: [CustomerPayment]
      summary: Get a customer payment by internal id
      parameters:
        - $ref: "#/components/parameters/ExpandSubResources"
        - $ref: "#/components/parameters/Fields"
      responses:
        "200":
          description: The record
          content:
            application/json:
              schema: { $ref: "#/components/schemas/CustomerPayment" }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    patch:
      operationId: updateCustomerPayment
      tags: [CustomerPayment]
      summary: Update fields on a customer payment
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: "#/components/schemas/CustomerPayment" }
      responses:
        "204": { description: Updated }
        "400":
          description: Validation error
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
    delete:
      operationId: deleteCustomerPayment
      tags: [CustomerPayment]
      summary: Delete a customer payment
      responses:
        "204": { description: Deleted }
        "404":
          description: Record not found
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
  /services/rest/query/v1/suiteql:
    post:
      operationId: suiteql
      tags: [SuiteQL]
      summary: Run a SuiteQL query
      parameters:
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Offset"
        - name: Prefer
          in: header
          required: true
          schema: { type: string, enum: [transient] }
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [q]
              properties:
                q: { type: string, example: "SELECT id, companyname, email FROM customer WHERE isinactive = 'F'" }
      responses:
        "200":
          description: Query results
          content:
            application/json:
              schema:
                type: object
                properties:
                  links: { type: array, items: { $ref: "#/components/schemas/Link" } }
                  count: { type: integer }
                  hasMore: { type: boolean }
                  items: { type: array, items: { type: object, additionalProperties: true } }
                  offset: { type: integer }
                  totalResults: { type: integer }
              example:
                links: [{ rel: self, href: "https://1234567.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=3&offset=0" }]
                count: 3
                hasMore: false
                items:
                  - { links: [], id: "1841", companyname: Harbour Street Coffee Roasters Ltd, email: accounts@harbourstreetcoffee.co.uk }
                  - { links: [], id: "1842", companyname: Pinecrest Dental Group, email: billing@pinecrestdental.com }
                  - { links: [], id: "1847", companyname: Albion Joinery Supplies, email: ap@albionjoinery.co.uk }
                offset: 0
                totalResults: 3
        "400":
          description: Invalid query
          content:
            application/vnd.oracle.resource+json; type=error:
              schema: { $ref: "#/components/schemas/Error" }
components:
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.0 (client credentials or authorisation code) or token-based authentication.
      flows:
        clientCredentials:
          tokenUrl: https://1234567.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token
          scopes:
            rest_webservices: REST web services
  parameters:
    Id:
      name: id
      in: path
      required: true
      description: Internal id, or eid:<externalId>
      schema: { type: string }
    Q:
      name: q
      in: query
      description: 'Record collection filter, for example email START_WITH "barbara" or dateCreated ON_OR_AFTER "1/1/2026"'
      schema: { type: string }
    Limit:
      name: limit
      in: query
      schema: { type: integer, default: 1000, maximum: 1000 }
    Offset:
      name: offset
      in: query
      schema: { type: integer, default: 0 }
    ExpandSubResources:
      name: expandSubResources
      in: query
      schema: { type: boolean }
    Fields:
      name: fields
      in: query
      description: Comma-separated field ids to return
      schema: { type: string }
  schemas:
    Link:
      type: object
      properties:
        rel: { type: string, example: self }
        href: { type: string }
    Ref:
      type: object
      description: A reference to another record
      properties:
        id: { type: string }
        refName: { type: string }
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
    Error:
      type: object
      properties:
        type: { type: string, example: "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.1" }
        title: { type: string, example: Bad Request }
        status: { type: integer, example: 400 }
        o:errorDetails:
          type: array
          items:
            type: object
            properties:
              detail: { type: string, example: "Invalid value for the resource or sub-resource field 'subsidiary'." }
              o:errorPath: { type: string, example: subsidiary }
              o:errorCode: { type: string, enum: [INVALID_CONTENT, NONEXISTENT_ID, USER_ERROR, INVALID_LOGIN, FIELD_NOT_FOUND, INVALID_PARAMETER, INSUFFICIENT_PERMISSION, CONCURRENCY_LIMIT_EXCEEDED, RCRD_DSNT_EXIST] }
    Address:
      type: object
      properties:
        addr1: { type: string }
        addr2: { type: string }
        city: { type: string }
        state: { type: string }
        zip: { type: string }
        country: { type: object, properties: { id: { type: string, enum: [GB, US, IE, CA] }, refName: { type: string } } }
        addrText: { type: string }
    Customer:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        id: { type: string, example: "1841", readOnly: true }
        entityId: { type: string, example: "CUST1841 Harbour Street Coffee Roasters Ltd" }
        externalId: { type: string }
        companyName: { type: string }
        isPerson: { type: boolean }
        email: { type: string, format: email }
        phone: { type: string }
        url: { type: string }
        subsidiary: { $ref: "#/components/schemas/Ref" }
        currency: { $ref: "#/components/schemas/Ref" }
        terms: { $ref: "#/components/schemas/Ref" }
        salesRep: { $ref: "#/components/schemas/Ref" }
        category: { $ref: "#/components/schemas/Ref" }
        entityStatus: { type: object, properties: { id: { type: string, enum: ["6", "7", "8", "13", "16"] }, refName: { type: string, enum: [LEAD-Unqualified, PROSPECT-In Discussion, PROSPECT-Proposal, CUSTOMER-Closed Won, CUSTOMER-Renewal] } } }
        creditLimit: { type: number }
        balance: { type: number, readOnly: true }
        overdueBalance: { type: number, readOnly: true }
        unbilledOrders: { type: number, readOnly: true }
        defaultAddress: { type: string }
        isInactive: { type: boolean }
        dateCreated: { type: string, format: date-time, readOnly: true }
        lastModifiedDate: { type: string, format: date-time, readOnly: true }
    Contact:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        id: { type: string, readOnly: true }
        entityId: { type: string }
        firstName: { type: string }
        lastName: { type: string }
        title: { type: string }
        email: { type: string, format: email }
        phone: { type: string }
        company: { $ref: "#/components/schemas/Ref" }
        subsidiary: { $ref: "#/components/schemas/Ref" }
        contactRole: { type: object, properties: { id: { type: string }, refName: { type: string, enum: [Primary Contact, Alternate Contact, Accounts Payable, Decision Maker] } } }
        isInactive: { type: boolean }
        dateCreated: { type: string, format: date-time, readOnly: true }
        lastModifiedDate: { type: string, format: date-time, readOnly: true }
    Vendor:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        id: { type: string, readOnly: true }
        entityId: { type: string }
        companyName: { type: string }
        isPerson: { type: boolean }
        email: { type: string, format: email }
        phone: { type: string }
        subsidiary: { $ref: "#/components/schemas/Ref" }
        currency: { $ref: "#/components/schemas/Ref" }
        terms: { $ref: "#/components/schemas/Ref" }
        category: { type: object, properties: { id: { type: string }, refName: { type: string, enum: [Supplies, Services, Contractor, Utilities, Freight] } } }
        balance: { type: number, readOnly: true }
        taxIdNum: { type: string }
        is1099Eligible: { type: boolean }
        isInactive: { type: boolean }
        dateCreated: { type: string, format: date-time, readOnly: true }
        lastModifiedDate: { type: string, format: date-time, readOnly: true }
    Employee:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        id: { type: string, readOnly: true }
        entityId: { type: string }
        firstName: { type: string }
        lastName: { type: string }
        email: { type: string, format: email }
        title: { type: string }
        department: { $ref: "#/components/schemas/Ref" }
        location: { $ref: "#/components/schemas/Ref" }
        subsidiary: { $ref: "#/components/schemas/Ref" }
        supervisor: { $ref: "#/components/schemas/Ref" }
        employeeStatus: { type: object, properties: { id: { type: string }, refName: { type: string, enum: [Full-Time, Part-Time, Contractor, Intern] } } }
        hireDate: { type: string, format: date }
        isSalesRep: { type: boolean }
        giveAccess: { type: boolean }
        isInactive: { type: boolean }
        dateCreated: { type: string, format: date-time, readOnly: true }
        lastModifiedDate: { type: string, format: date-time, readOnly: true }
    InventoryItem:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        id: { type: string, readOnly: true }
        itemId: { type: string, example: WIDGET-100 }
        displayName: { type: string }
        salesDescription: { type: string }
        upcCode: { type: string }
        itemType: { type: string, enum: [InvtPart] }
        basePrice: { type: number }
        cost: { type: number }
        averageCost: { type: number, readOnly: true }
        quantityOnHand: { type: number, readOnly: true }
        quantityAvailable: { type: number, readOnly: true }
        reorderPoint: { type: number }
        stockUnit: { $ref: "#/components/schemas/Ref" }
        incomeAccount: { $ref: "#/components/schemas/Ref" }
        cogsAccount: { $ref: "#/components/schemas/Ref" }
        assetAccount: { $ref: "#/components/schemas/Ref" }
        subsidiary: { $ref: "#/components/schemas/Ref" }
        isInactive: { type: boolean }
        createdDate: { type: string, format: date-time, readOnly: true }
        lastModifiedDate: { type: string, format: date-time, readOnly: true }
    TransactionLine:
      type: object
      properties:
        line: { type: integer }
        item: { $ref: "#/components/schemas/Ref" }
        description: { type: string }
        quantity: { type: number }
        rate: { type: number }
        amount: { type: number }
        taxCode: { $ref: "#/components/schemas/Ref" }
    SalesOrder:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        id: { type: string, readOnly: true }
        tranId: { type: string, example: SO10482 }
        tranDate: { type: string, format: date }
        entity: { $ref: "#/components/schemas/Ref" }
        status: { type: string, enum: [Pending Approval, Pending Fulfillment, Partially Fulfilled, Pending Billing/Partially Fulfilled, Pending Billing, Billed, Closed, Cancelled] }
        orderStatus: { type: object, properties: { id: { type: string, enum: [A, B, C, D, E, F, G, H] }, refName: { type: string } } }
        otherRefNum: { type: string, description: Customer PO number }
        memo: { type: string }
        currency: { $ref: "#/components/schemas/Ref" }
        subsidiary: { $ref: "#/components/schemas/Ref" }
        location: { $ref: "#/components/schemas/Ref" }
        salesRep: { $ref: "#/components/schemas/Ref" }
        shipDate: { type: string, format: date }
        subtotal: { type: number, readOnly: true }
        taxTotal: { type: number, readOnly: true }
        total: { type: number, readOnly: true }
        item: { type: object, properties: { items: { type: array, items: { $ref: "#/components/schemas/TransactionLine" } }, totalResults: { type: integer } } }
        createdDate: { type: string, format: date-time, readOnly: true }
        lastModifiedDate: { type: string, format: date-time, readOnly: true }
    Invoice:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        id: { type: string, readOnly: true }
        tranId: { type: string, example: INV10233 }
        tranDate: { type: string, format: date }
        dueDate: { type: string, format: date }
        entity: { $ref: "#/components/schemas/Ref" }
        createdFrom: { $ref: "#/components/schemas/Ref" }
        status: { type: string, enum: [Open, Paid In Full, Pending Approval, Rejected, Voided] }
        terms: { $ref: "#/components/schemas/Ref" }
        currency: { $ref: "#/components/schemas/Ref" }
        subsidiary: { $ref: "#/components/schemas/Ref" }
        account: { $ref: "#/components/schemas/Ref" }
        memo: { type: string }
        subtotal: { type: number, readOnly: true }
        taxTotal: { type: number, readOnly: true }
        total: { type: number, readOnly: true }
        amountPaid: { type: number, readOnly: true }
        amountRemaining: { type: number, readOnly: true }
        item: { type: object, properties: { items: { type: array, items: { $ref: "#/components/schemas/TransactionLine" } }, totalResults: { type: integer } } }
        createdDate: { type: string, format: date-time, readOnly: true }
        lastModifiedDate: { type: string, format: date-time, readOnly: true }
    CustomerPayment:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        id: { type: string, readOnly: true }
        tranId: { type: string, example: PYMT4410 }
        tranDate: { type: string, format: date }
        customer: { $ref: "#/components/schemas/Ref" }
        status: { type: string, enum: [Not Deposited, Deposited, Unapproved Payment] }
        payment: { type: number }
        paymentMethod: { type: object, properties: { id: { type: string }, refName: { type: string, enum: [BACS, Cheque, Card, ACH, Wire] } } }
        currency: { $ref: "#/components/schemas/Ref" }
        subsidiary: { $ref: "#/components/schemas/Ref" }
        account: { $ref: "#/components/schemas/Ref" }
        memo: { type: string }
        applied: { type: number, readOnly: true }
        unapplied: { type: number, readOnly: true }
        createdDate: { type: string, format: date-time, readOnly: true }
        lastModifiedDate: { type: string, format: date-time, readOnly: true }
    CustomerCollection:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        count: { type: integer }
        hasMore: { type: boolean }
        items: { type: array, items: { $ref: "#/components/schemas/Customer" } }
        offset: { type: integer }
        totalResults: { type: integer }
    ContactCollection:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        count: { type: integer }
        hasMore: { type: boolean }
        items: { type: array, items: { $ref: "#/components/schemas/Contact" } }
        offset: { type: integer }
        totalResults: { type: integer }
    VendorCollection:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        count: { type: integer }
        hasMore: { type: boolean }
        items: { type: array, items: { $ref: "#/components/schemas/Vendor" } }
        offset: { type: integer }
        totalResults: { type: integer }
    EmployeeCollection:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        count: { type: integer }
        hasMore: { type: boolean }
        items: { type: array, items: { $ref: "#/components/schemas/Employee" } }
        offset: { type: integer }
        totalResults: { type: integer }
    InventoryItemCollection:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        count: { type: integer }
        hasMore: { type: boolean }
        items: { type: array, items: { $ref: "#/components/schemas/InventoryItem" } }
        offset: { type: integer }
        totalResults: { type: integer }
    SalesOrderCollection:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        count: { type: integer }
        hasMore: { type: boolean }
        items: { type: array, items: { $ref: "#/components/schemas/SalesOrder" } }
        offset: { type: integer }
        totalResults: { type: integer }
    InvoiceCollection:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        count: { type: integer }
        hasMore: { type: boolean }
        items: { type: array, items: { $ref: "#/components/schemas/Invoice" } }
        offset: { type: integer }
        totalResults: { type: integer }
    CustomerPaymentCollection:
      type: object
      properties:
        links: { type: array, items: { $ref: "#/components/schemas/Link" } }
        count: { type: integer }
        hasMore: { type: boolean }
        items: { type: array, items: { $ref: "#/components/schemas/CustomerPayment" } }
        offset: { type: integer }
        totalResults: { type: integer }
