> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cedarai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create service type

> Create a service type, for example to mirror a new NetSuite or QuickBooks item. Prices are not part of a service type; they live in rate tables, which this API does not change.

Usage notes:
- `serviceTypeName` must be unique for the carrier and `contextType`. New carriers start with a set of default service types (for example Demurrage and Storage), so list first: a duplicate returns 400.
- A service type deleted in ARMS still holds its name and can't be restored through the API. List with `getDeleted: true` to find it, and restore it in the ARMS service type settings.
- A `serviceTypeGroupId` that does not exist returns 400.
- A missing permission returns 401.



## OpenAPI

````yaml /user-docs/api-reference/external-openapi.json post /rms/service_types/create
openapi: 3.1.0
info:
  title: ARMS External API
  version: 1.0.0
  description: >-
    OpenAPI specification generated from external API schemas. Endpoints require
    query parameter carrierId and headers x-arms-api-key and x-arms-assume-user.
  license:
    name: Proprietary
    url: https://cedarai.com
servers:
  - url: https://api-lg.arms.cedarai.com
    description: Production (US)
  - url: https://api-lg.arms.cedarai.se
    description: Production (EU)
security:
  - ApiKeyAuth: []
    AssumeUser: []
paths:
  /rms/service_types/create:
    post:
      summary: Create service type
      description: >-
        Create a service type, for example to mirror a new NetSuite or
        QuickBooks item. Prices are not part of a service type; they live in
        rate tables, which this API does not change.


        Usage notes:

        - `serviceTypeName` must be unique for the carrier and `contextType`.
        New carriers start with a set of default service types (for example
        Demurrage and Storage), so list first: a duplicate returns 400.

        - A service type deleted in ARMS still holds its name and can't be
        restored through the API. List with `getDeleted: true` to find it, and
        restore it in the ARMS service type settings.

        - A `serviceTypeGroupId` that does not exist returns 400.

        - A missing permission returns 401.
      operationId: createServiceType
      parameters:
        - $ref: '#/components/parameters/CarrierId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateServiceTypeInput'
            examples:
              trackLease:
                summary: Track lease charged over time
                value:
                  item:
                    serviceTypeName: Track Lease
                    serviceTypeCode: LEASE
                    contextType: CYCLE
              hazmatHandling:
                summary: Hazmat handling charged per event
                value:
                  item:
                    serviceTypeName: Hazmat Handling
                    serviceTypeCode: HAZ
                    contextType: INCIDENTAL
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateServiceTypeOutput'
        '400':
          description: >-
            Bad Request (for example a duplicate name or an unknown service type
            group)
        '401':
          description: Unauthorized (bad key, carrier not permitted, or missing permission)
        '500':
          description: Internal Server Error
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    CarrierId:
      name: carrierId
      in: query
      required: true
      schema:
        type: integer
      description: Carrier identifier; required for all endpoints
  schemas:
    CreateServiceTypeInput:
      type: object
      required:
        - item
      properties:
        carrierId:
          type: integer
          description: >-
            Carrier identifier. Defaults to the `carrierId` query parameter; if
            you send it, use the same value.
        item:
          $ref: '#/components/schemas/ServiceTypeItemInput'
    CreateServiceTypeOutput:
      type: object
      properties:
        item:
          $ref: '#/components/schemas/ServiceType'
        contract:
          type: object
          properties:
            effect:
              type: string
              enum:
                - append
            resourceType:
              type: string
              enum:
                - ServiceType
    Error:
      type: object
      properties:
        message:
          type: string
    ServiceTypeItemInput:
      type: object
      required:
        - serviceTypeName
        - contextType
      properties:
        serviceTypeName:
          type: string
          description: >-
            Service type name, for example the name of the matching NetSuite or
            QuickBooks item. Unique per carrier and `contextType`, including
            service types deleted in ARMS. New carriers start with default
            service types such as Demurrage and Storage.
        contextType:
          type: string
          enum:
            - INCIDENTAL
            - CYCLE
            - EXCESS
          description: >-
            How charges of this type are calculated. `INCIDENTAL`: one charge
            per event, such as a switch. `CYCLE`: charged over the time between
            two events, such as storage days. `EXCESS`: charged for time or cars
            beyond an allowance in a billing period.
        serviceTypeCode:
          type: string
          description: >-
            Optional code shown with the service type, for example on invoices
            and exports.
        serviceTypeGroupId:
          type: string
          format: uuid
          description: >-
            Optional ID of one of your service type groups (Service group in
            ARMS), as returned on existing service types.
        defaultTaxIds:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Optional IDs of taxes configured in ARMS that apply by default to
            charges of this service type, as returned on existing service types.
    ServiceType:
      type: object
      description: >-
        A service type: what a charge is for. Fields without a value are left
        out.
      properties:
        serviceTypeId:
          type: string
          format: uuid
        carrierId:
          type: integer
        serviceTypeName:
          type: string
        serviceTypeCode:
          type: string
        contextType:
          type: string
          enum:
            - INCIDENTAL
            - CYCLE
            - EXCESS
        serviceTypeGroupId:
          type: string
          format: uuid
        serviceTypeGroupName:
          type: string
        defaultTaxIds:
          type: array
          items:
            type: string
            format: uuid
        createdAt:
          type: string
          format: date-time
        createdById:
          type: string
          format: uuid
        updatedAt:
          type: string
          format: date-time
        updatedById:
          type: string
          format: uuid
        deletedAt:
          type: string
          format: date-time
        deletedById:
          type: string
          format: uuid
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-arms-api-key
      description: Your ARMS API key
    AssumeUser:
      type: apiKey
      in: header
      name: x-arms-assume-user
      description: Email of a user assigned to the appropriate user group

````

## Related topics

- [API Introduction](/user-docs/api-reference/introduction.md)
- [Update service type](/api-reference/update-service-type.md)
- [List service types](/api-reference/list-service-types.md)
- [Get service type](/api-reference/get-service-type.md)
- [QuickBooks Online](/user-docs/accounting-integrations/quickbooks-online.md)
