Scout RFP (Workday Strategic Sourcing) spend_categories API

Use the Spend Categories API to create, update, and query the Spend Categories in Workday Strategic Sourcing. Spend Categories are used in both the project and contract resources. On POST and PATCH related endpoints for those resources a spend_category_id can be added to attach a spend category. The spend_category_id is a foreign key for the spend_categories resource's id. ## Spend Category Object

OpenAPI Specification

scoutrfp-spend-categories-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Workday Strategic Sourcing attachments spend_categories API
  version: '1.0'
  description: '<span id="section/Authentication/api_key" data-section-id="section/Authentication/api_key"></span>

    <span id="section/Authentication/user_token" data-section-id="section/Authentication/user_token"></span>

    <span id="section/Authentication/user_email" data-section-id="section/Authentication/user_email"></span>

    '
servers:
- url: https://api.us.workdayspend.com/services/attachments/v1
  description: Production Server
- url: https://api.sandbox.us.workdayspend.com/services/attachments/v1
  description: Sandbox Server
security:
- api_key: []
  user_token: []
  user_email: []
tags:
- name: spend_categories
  x-displayName: Spend Categories
  description: 'Use the Spend Categories API to create, update, and query the Spend Categories in Workday Strategic Sourcing.


    Spend Categories are used in both the project and contract resources. On POST and PATCH related endpoints for those resources a spend_category_id can be added to attach a spend category. The spend_category_id is a foreign key for the spend_categories resource''s id.


    ## Spend Category Object


    <SchemaDefinition schemaRef="#/components/schemas/SpendCategory" showReadOnly={true} showWriteOnly={true} />

    '
paths:
  /spend_categories:
    get:
      tags:
      - spend_categories
      description: Returns a list of spend categories.
      operationId: List Spend Categories
      summary: List Spend Categories
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                allOf:
                - type: object
                  properties:
                    data:
                      type: array
                      items:
                        $ref: '#/components/schemas/SpendCategory'
                - $ref: '#/components/schemas/Pagination'
              examples:
                success:
                  $ref: '#/components/examples/index_response'
        '401':
          description: Unauthorized
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     \"https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories\"\n"
    post:
      tags:
      - spend_categories
      description: 'Create a Spend Category with given parameters.

        '
      operationId: Create a Spend Category
      summary: Create a Spend Category
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/SpendCategoryCreate'
            examples:
              success:
                $ref: '#/components/examples/create_request'
      responses:
        '201':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SpendCategory'
              examples:
                success:
                  $ref: '#/components/examples/create_response'
        '401':
          description: Unauthorized
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     -X POST \\\n     -d '{\"data\":{\"type\":\"spend_categories\",\"attributes\":{\"name\":\"Spend Category\", \"external_id\": \"SP-1\"}}' \\\n     \"https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories\"\n"
  /spend_categories/{id}:
    get:
      tags:
      - spend_categories
      description: 'Retrieves the details of an existing Spend Category.

        '
      operationId: Get a Spend Category
      summary: Get a Spend Category
      parameters:
      - name: id
        in: path
        description: Unique Spend Category identifier.
        required: true
        schema:
          type: integer
        example: 1
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SpendCategory'
              examples:
                success:
                  $ref: '#/components/examples/show_response'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     \"https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/1\"\n"
    patch:
      tags:
      - spend_categories
      description: 'Updates the details of an existing Spend Category. You need to supply the unique

        identifier that was returned upon Spend Category creation.


        Please note, that request body must include an `id` attribute with the value of your Spend Category

        unique identifier (the same one you passed in the URL).

        '
      operationId: Update a Spend Category
      summary: Update a Spend Category
      parameters:
      - name: id
        in: path
        description: Unique Spend Category identifier.
        required: true
        schema:
          type: integer
        example: 1
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/SpendCategoryUpdate'
            examples:
              success:
                $ref: '#/components/examples/update_request'
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SpendCategory'
              examples:
                success:
                  $ref: '#/components/examples/update_response'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '409':
          description: Conflict
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                invalid_type:
                  summary: Missing or invalid 'type' specified, expected 'spend_categories'
                  description: 'Returns error due to invalid `type` parameter.

                    '
                  value:
                    errors:
                    - detail: Missing or invalid 'type' specified, expected 'spend_categories'
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     -X PATCH \\\n     -d '{\"data\":{\"type\":\"spend_categories\",\"id\":\"2\",\"attributes\":{\"name\":\"Updated Spend Category\"}}}' \\\n     \"https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/2\"\n"
    delete:
      tags:
      - spend_categories
      description: 'Deletes a Spend Category. You need to supply the unique Spend Category

        identifier that was returned upon Spend Category creation.

        '
      operationId: Delete a Spend Category
      summary: Delete a Spend Category
      parameters:
      - name: id
        in: path
        description: Unique Spend Category identifier.
        required: true
        schema:
          type: integer
        example: 1
      responses:
        '204':
          description: OK
        '401':
          description: Unauthorized
        '404':
          description: Not Found
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     -X DELETE \\\n     \"https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/1\"\n"
  /spend_categories/{external_id}/external_id:
    get:
      tags:
      - spend_categories
      description: 'Retrieves the details of an existing Spend Category.

        '
      operationId: Get a Spend Category by External ID
      summary: Get a Spend Category by External ID
      parameters:
      - name: external_id
        in: path
        description: Unique Spend Category external identifier.
        required: true
        schema:
          type: string
        example: SP
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SpendCategory'
              examples:
                success:
                  $ref: '#/components/examples/external_show_response'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     \"https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/SP/external_id\"\n"
    patch:
      tags:
      - spend_categories
      description: 'Updates the details of an existing Spend Category. You need to supply the unique

        external identifier assigned to the Spend Category on creation.


        Please note, that request body must include an `id` attribute with the value of your Spend Category

        unique identifier (the same one you passed in the URL).

        '
      operationId: Update a Spend Category by External ID
      summary: Update a Spend Category by External ID
      parameters:
      - name: external_id
        in: path
        description: Unique Spend Category external identifier.
        required: true
        schema:
          type: string
        example: SP
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/SpendCategoryUpdate'
            examples:
              success:
                $ref: '#/components/examples/external_update_request'
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SpendCategory'
              examples:
                success:
                  $ref: '#/components/examples/external_update_response'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     -X PATCH \\\n     -d '{\"data\":{\"type\":\"spend_categories\",\"id\":\"SP\",\"attributes\":{\"name\":\"Updated Spend Category\"}}}' \\\n     \"https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/SP/external_id\"\n"
    delete:
      tags:
      - spend_categories
      description: 'Deletes a Spend Category. You need to supply the unique Spend Category

        external identifier assigned to the Spend Category on creation.

        '
      operationId: Delete a Spend Category by External ID
      summary: Delete a Spend Category by External ID
      parameters:
      - name: external_id
        in: path
        description: Unique Spend Category external identifier.
        required: true
        schema:
          type: string
        example: SP
      responses:
        '204':
          description: OK
        '401':
          description: Unauthorized
        '404':
          description: Not Found
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     -X DELETE \\\n     \"https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/SP/external_id\"\n"
components:
  schemas:
    SpendCategoryBase:
      title: SpendCategory
      type: object
      required:
      - name
      - id
      properties:
        type:
          $ref: '#/components/schemas/SpendCategoryType'
        id:
          $ref: '#/components/schemas/SpendCategoryId'
    SpendCategoryId:
      type: integer
      description: Spend category identifier string.
      example: 1
    PaginationLinks:
      type: object
      description: List of related links.
      allOf:
      - $ref: '#/components/schemas/SelfLink'
      - $ref: '#/components/schemas/NextPageLink'
      - $ref: '#/components/schemas/PrevPageLink'
    PrevPageLink:
      type: object
      properties:
        prev:
          type: string
          format: url
          description: Link to the previous results page.
          nullable: true
          deprecated: true
    SpendCategoryUpdateAttributes:
      type: object
      description: Spend category update attributes.
      properties:
        name:
          $ref: '#/components/schemas/SpendCategoryName'
        external_id:
          $ref: '#/components/schemas/SpendCategoryExternalId'
        usages:
          $ref: '#/components/schemas/SpendCategoryUsages'
    SpendCategoryUsages:
      type: array
      description: Spend category usages. Only spend categories with `procurement` usage can be used for requisitions.
      items:
        type: string
        enum:
        - procurement
        - expense
        - ad_hoc_payment
        - supplier_invoice
    SpendCategoryExternalId:
      type: string
      maxLength: 255
      description: Spend category external identifier string.
    SpendCategoryName:
      type: string
      maxLength: 255
      description: Spend category name.
    SpendCategoryAttributes:
      type: object
      description: Spend category attributes.
      required:
      - name
      properties:
        name:
          $ref: '#/components/schemas/SpendCategoryName'
        external_id:
          $ref: '#/components/schemas/SpendCategoryExternalId'
        usages:
          $ref: '#/components/schemas/SpendCategoryUsages'
    Pagination:
      type: object
      properties:
        meta:
          type: object
          description: Result set metadata.
          properties:
            count:
              type: integer
              description: Number of pages in the result set.
        links:
          $ref: '#/components/schemas/PaginationLinks'
    SpendCategoryType:
      type: string
      description: Object type, should always be `spend_categories`.
      example: spend_categories
    Error:
      type: object
      properties:
        detail:
          type: string
          description: A human-readable explanation specific to this occurrence of the problem.
    SpendCategoryCreate:
      type: object
      required:
      - type
      properties:
        type:
          $ref: '#/components/schemas/SpendCategoryType'
        attributes:
          $ref: '#/components/schemas/SpendCategoryAttributes'
    NextPageLink:
      type: object
      properties:
        next:
          type: string
          format: url
          description: Link to the next results page.
          nullable: true
    SelfLink:
      type: object
      properties:
        self:
          type: string
          format: url
          description: Normalized link to the resource.
    SpendCategory:
      allOf:
      - $ref: '#/components/schemas/SpendCategoryBase'
      - type: object
        properties:
          attributes:
            $ref: '#/components/schemas/SpendCategoryAttributes'
    SpendCategoryUpdate:
      type: object
      required:
      - type
      - id
      properties:
        type:
          $ref: '#/components/schemas/SpendCategoryType'
        id:
          $ref: '#/components/schemas/SpendCategoryId'
        attributes:
          $ref: '#/components/schemas/SpendCategoryUpdateAttributes'
    Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
  examples:
    index_response:
      value:
        meta:
          count: 2
        data:
        - type: spend_categories
          id: '1'
          attributes:
            name: 'Spend Category #1'
            external_id: SP-1
            usages:
            - procurement
          links:
            self: https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/1
        - type: spend_categories
          id: '2'
          attributes:
            name: 'Spend Category #2'
            external_id: SP-2
            usages:
            - procurement
          links:
            self: https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/2
        links:
          self: https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories?page%5Bsize%5D=10
          next: https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories?page%5Bcursor%5D=WzJd&page%5Bdirection%5D=next&page%5Bsize%5D=10
          prev: https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories?page%5Bcursor%5D=WzFd&page%5Bdirection%5D=prev&page%5Bsize%5D=10
    update_request:
      value:
        data:
          type: spend_categories
          id: '1'
          attributes:
            name: Spend Category Updated
            external_id: SP-UPD
            usages:
            - procurement
    external_update_response:
      value:
        data:
          id: '1'
          type: spend_categories
          attributes:
            name: Spend Category Updated
            external_id: SP-UPD
            usages:
            - procurement
          links:
            self: https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/1
    show_response:
      value:
        data:
          id: '1'
          type: spend_categories
          attributes:
            name: Spend Category
            external_id: SP
            usages:
            - procurement
          links:
            self: https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/1
    create_request:
      value:
        data:
          type: spend_categories
          attributes:
            name: 'Spend Category #1'
            external_id: SP-1
            usages:
            - procurement
    external_show_response:
      value:
        data:
          id: '1'
          type: spend_categories
          attributes:
            name: Spend Category
            external_id: SP
            usages:
            - procurement
          links:
            self: https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/1
    external_update_request:
      value:
        data:
          type: spend_categories
          id: SP
          attributes:
            name: Spend Category Updated
            external_id: SP-UPD
            usages:
            - procurement
    create_response:
      value:
        data:
          id: '1'
          type: spend_categories
          attributes:
            name: 'Spend Category #1'
            external_id: SP-1
            usages:
            - procurement
          links:
            self: https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/1
    update_response:
      value:
        data:
          id: '1'
          type: spend_categories
          attributes:
            name: Spend Category Updated
            external_id: SP-UPD
            usages:
            - procurement
          links:
            self: https://api.us.workdayspend.com/services/spend_categories/v1/spend_categories/1
  securitySchemes:
    api_key:
      type: apiKey
      name: X-Api-Key
      in: header
      description: Company API key.
    user_token:
      type: apiKey
      name: X-User-Token
      in: header
      description: User token.
    user_email:
      type: apiKey
      name: X-User-Email
      in: header
      description: User email.
x-tagGroups:
- name: Getting Started
  tags:
  - support
  - servers
  - api_specification
  - authentication
  - rate_limiting
- name: Attachments
  tags:
  - attachments