Soldo Expense Policies API

The Expense Policies API from Soldo — 4 operation(s) for expense policies.

OpenAPI Specification

soldo-expense-policies-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Soldo Business API v2.0 Accounting Classification Expense Policies API
  description: Soldo Business API v2.0 OpenAPI specification
  version: 5.56.0
servers:
- url: https://api.soldo.com
  description: Production server (using live data)
- url: https://api-demo.soldocloud.net
  description: Sandbox server (using test data)
tags:
- name: Expense Policies
paths:
  /business/v2/expense-policies/{expensePolicyId}/assignees:
    get:
      tags:
      - Expense Policies
      summary: Get Expense Policy Assignees
      description: Endpoint to get all `User` resources currently assigned to a specific `ExpensePolicy`.
      operationId: expense-policy-assignees-get
      parameters:
      - name: expensePolicyId
        in: path
        required: true
        schema:
          type: string
          description: The `ExpensePolicy` ID.
          example: 7bf79328-a7ae-4222-aa54-091ff7f429a7
      - name: p
        in: query
        description: It indicates the specific page to display (the counter starts from zero).
        schema:
          type: integer
          format: int32
          default: 0
          description: It indicates the specific page to display (the counter starts from zero).
          example: 3
        example: 3
      - name: s
        in: query
        description: It indicates the number of items per page.
        schema:
          type: integer
          format: int32
          default: 0
          description: It indicates the number of items per page.
          example: 25
          maximum: 50
        example: 25
      - name: d
        in: query
        description: It indicates how the pages are ordered.
        schema:
          $ref: '#/components/schemas/Direction'
        example: DESC
      - name: props
        in: query
        description: It indicates the sorting direction applied to the above parameters. To apply a sorting on multiple parameters, set as many times the `props` parameter in the request.
        schema:
          type: array
          description: It indicates the sorting direction applied to the above parameters. To apply a sorting on multiple parameters, set as many times the `props` parameter in the request.
          example: creationTime
          items:
            type: string
            description: It indicates the sorting direction applied to the above parameters. To apply a sorting on multiple parameters, set as many times the `props` parameter in the request.
            example: creationTime
        example: creationTime
      responses:
        '200':
          description: The result is an array of `ExpensePolicyAssignee` resources.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpensePolicyAssignees'
        '404':
          description: One or more resource requested does not exist.
      security:
      - standardAuth:
        - expense_policy_read
    post:
      tags:
      - Expense Policies
      summary: Assign Expense Policy to Users
      description: Endpoint to assign a specific `ExpensePolicy` to one or more `User` resources. Since a `User` can hold at most one `ExpensePolicy`, any existing assignment is replaced.
      operationId: expense-policy-assignees-add
      parameters:
      - name: expensePolicyId
        in: path
        required: true
        schema:
          type: string
          description: The `ExpensePolicy` ID.
          example: 7bf79328-a7ae-4222-aa54-091ff7f429a7
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExpensePolicyAssignment'
      responses:
        '204':
          description: No content as result.
        '400':
          description: Your request has missing arguments or is malformed.
        '404':
          description: One or more resource requested does not exist.
      security:
      - standardAuth:
        - expense_policy_write
    delete:
      tags:
      - Expense Policies
      summary: Unassign Expense Policy from Users
      description: Endpoint to unassign a specific `ExpensePolicy` from one or more `User` resources.
      operationId: expense-policy-assignees-remove
      parameters:
      - name: expensePolicyId
        in: path
        required: true
        schema:
          type: string
          description: The `ExpensePolicy` ID.
          example: 7bf79328-a7ae-4222-aa54-091ff7f429a7
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExpensePolicyUnassignment'
      responses:
        '204':
          description: No content as result.
        '400':
          description: Your request has missing arguments or is malformed.
        '404':
          description: One or more resource requested does not exist.
      security:
      - standardAuth:
        - expense_policy_write
  /business/v2/expense-policies/{expensePolicyId}:
    get:
      tags:
      - Expense Policies
      summary: Get Expense Policy
      description: Endpoint to get a specific `ExpensePolicy` by ID.
      operationId: expense-policy-get
      parameters:
      - name: expensePolicyId
        in: path
        required: true
        schema:
          type: string
          description: The `ExpensePolicy` ID.
          example: 7bf79328-a7ae-4222-aa54-091ff7f429a7
      responses:
        '200':
          description: The result is a single `ExpensePolicy`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpensePolicy'
        '404':
          description: One or more resource requested does not exist.
      security:
      - standardAuth:
        - expense_policy_read
  /business/v2/expense-policies/assignees:
    delete:
      tags:
      - Expense Policies
      summary: Unassign any Expense Policy from Users
      description: Endpoint to unassign the currently assigned `ExpensePolicy` from one or more `User` resources. No-op silently for a `User` with no `ExpensePolicy` assigned.
      operationId: expense-policy-assignees-remove-any
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExpensePolicyUnassignment'
      responses:
        '204':
          description: No content as result.
        '400':
          description: Your request has missing arguments or is malformed.
      security:
      - standardAuth:
        - expense_policy_write
  /business/v2/expense-policies:
    get:
      tags:
      - Expense Policies
      summary: Search Expense Policies
      description: Endpoint to search `ExpensePolicy` resources using filtering parameters.
      operationId: expense-policy-search
      parameters:
      - name: text
        in: query
        description: A simple text to search in the `ExpensePolicy` (`name` or `description`).
        schema:
          type: string
          description: A simple text to search in the `ExpensePolicy` (`name` or `description`).
          example: travel
      - name: statuses
        in: query
        description: The list of `ExpensePolicy` statuses to search by.
        schema:
          type: array
          description: The list of `ExpensePolicy` statuses to search by.
          example: ACTIVE
          items:
            $ref: '#/components/schemas/ExpensePolicyStatus'
      - name: p
        in: query
        description: It indicates the specific page to display (the counter starts from zero).
        schema:
          type: integer
          format: int32
          default: 0
          description: It indicates the specific page to display (the counter starts from zero).
          example: 3
        example: 3
      - name: s
        in: query
        description: It indicates the number of items per page.
        schema:
          type: integer
          format: int32
          default: 0
          description: It indicates the number of items per page.
          example: 25
          maximum: 50
        example: 25
      - name: d
        in: query
        description: It indicates how the pages are ordered.
        schema:
          $ref: '#/components/schemas/Direction'
        example: DESC
      - name: props
        in: query
        description: It indicates the sorting direction applied to the above parameters. To apply a sorting on multiple parameters, set as many times the `props` parameter in the request.
        schema:
          type: array
          description: It indicates the sorting direction applied to the above parameters. To apply a sorting on multiple parameters, set as many times the `props` parameter in the request.
          example: creationTime
          items:
            type: string
            description: It indicates the sorting direction applied to the above parameters. To apply a sorting on multiple parameters, set as many times the `props` parameter in the request.
            example: creationTime
        example: creationTime
      responses:
        '200':
          description: The result is an array of `ExpensePolicy` resources.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpensePolicies'
      security:
      - standardAuth:
        - expense_policy_read
components:
  schemas:
    ExpensePolicy:
      properties:
        id:
          type: string
          description: The `ExpensePolicy` ID.
          example: 7bf79328-a7ae-4222-aa54-091ff7f429a7
        name:
          type: string
          description: The name of the `ExpensePolicy`.
          example: Company Travel Policy
        description:
          type: string
          description: A custom description of the `ExpensePolicy`.
          example: A policy for company travel expenses
        policy_url:
          type: string
          description: A URL pointing to the `ExpensePolicy` document.
          example: https://www.policy.pdf
        status:
          $ref: '#/components/schemas/ExpensePolicyStatus'
          description: The status of the `ExpensePolicy`.
          example: ACTIVE
        creation_time:
          type: string
          description: The date and time when the `ExpensePolicy` was created.
          example: '2017-06-01T12:48:40Z'
        last_update:
          type: string
          description: The date and time when the `ExpensePolicy` was last updated.
          example: '2017-06-01T12:48:40Z'
    ExpensePolicyAssignee:
      properties:
        assignee_id:
          type: string
          description: The ID one `User` assigned to the `ExpensePolicy`.
          example: XMPL1234-000001
    ExpensePolicyAssignees:
      properties:
        total:
          type: integer
          format: int32
          description: It represents the total number of available items in the list.
          example: 168
        pages:
          type: integer
          format: int32
          description: It represents the total number of available pages.
          example: 7
        page_size:
          type: integer
          format: int32
          description: It represents the number of items per page.
          example: 25
        current_page:
          type: integer
          format: int32
          description: It indicates the current page (the counter starts from zero).
          example: 0
        results_size:
          type: integer
          format: int32
          description: It indicates the size of the array results.
          example: 25
        results:
          type: array
          items:
            $ref: '#/components/schemas/ExpensePolicyAssignee'
    ExpensePolicyAssignment:
      description: Add `ExpensePolicy` assignees JSON parameters.
      properties:
        assignee_ids:
          type: array
          description: List of `User` IDs to assign to the `ExpensePolicy`.
          example:
          - XMPL1234-000001
          - XMPL1234-000002
          - XMPL1234-000003
          items:
            type: string
      required:
      - assignee_ids
    Direction:
      type: string
      description: It indicates how the pages are ordered.
      enum:
      - ASC
      - DESC
      example: DESC
    ExpensePolicies:
      properties:
        total:
          type: integer
          format: int32
          description: It represents the total number of available items in the list.
          example: 168
        pages:
          type: integer
          format: int32
          description: It represents the total number of available pages.
          example: 7
        page_size:
          type: integer
          format: int32
          description: It represents the number of items per page.
          example: 25
        current_page:
          type: integer
          format: int32
          description: It indicates the current page (the counter starts from zero).
          example: 0
        results_size:
          type: integer
          format: int32
          description: It indicates the size of the array results.
          example: 25
        results:
          type: array
          items:
            $ref: '#/components/schemas/ExpensePolicy'
    ExpensePolicyStatus:
      type: string
      description: The list of `ExpensePolicy` statuses to search by.
      enum:
      - ACTIVE
      - DELETED
      example: ACTIVE
    ExpensePolicyUnassignment:
      description: '`ExpensePolicy` unassignment JSON parameters.'
      properties:
        assignee_ids:
          type: array
          description: List of `User` IDs to remove from their current `ExpensePolicy`.
          example:
          - XMPL1234-000001
          - XMPL1234-000002
          - XMPL1234-000003
          items:
            type: string
      required:
      - assignee_ids
  securitySchemes:
    standardAuth:
      type: oauth2
      description: This API uses OAuth 2 with the "Client Credentials" grant flow.
      flows:
        clientCredentials:
          tokenUrl: https://api.soldo.com/oauth/authorize
          refreshUrl: https://api.soldo.com/oauth/refresh
          scopes:
            address_read: Can read address details.
            address_write: Can update address details.
            card_read: Can read card details.
            card_write: Can change card details.
            company_read: Can read company details.
            company_write: Can change company details.
            contact_read: Can read contact details.
            contact_write: Can change contact details.
            employee_read: Can read employee details.
            employee_write: Can change employee details.
            expense_category_read: Can read expense category details.
            expense_category_write: Can change expense category details.
            expense_report_read: Can read expense report details.
            expense_report_write: Can change expense report details.
            expense_review_read: Can read expense review status.
            expense_review_write: Can change expense review status.
            group_read: Can read group details.
            group_write: Can change groups details.
            online_ads_read: Can read online ads details.
            online_ads_write: Can change online ads details.
            payment_read: Can read payment details.
            payment_write: Can change payment details.
            purchase_read: Can read purchase details.
            purchase_write: Can change purchase details.
            refueling_read: Can read refueling details.
            refueling_write: Can change refueling details.
            resource_set_read: Can read resource set details.
            resource_set_write: Can change resource set details.
            role_read: Can read role details.
            statement_read: Can read statement details.
            subscription_read: Can read subscription details.
            subscription_write: Can change subscription details.
            tag_read: Can read tags.
            tag_write: can change tags.
            tax_rate_read: Can read vat rate details.
            tax_rate_write: Can change vat rate details.
            transaction_read: Can read transaction details.
            transaction_write: Can change transaction details.
            vehicle_read: Can read vehicle details.
            vehicle_write: Can change vehicle details.
            wallet_read: Can read wallet details.
            wallet_write: Can change wallet details.
            webhook_subscription_read: Can read webhook subscription details.
            webhook_subscription_write: Can change webhook subscription details.
x-readme:
  hidden: false