Slash Card Group API

The Card Group API from Slash — 4 operation(s) for card group.

OpenAPI Specification

slash-card-group-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Slash Public Account Card Group API
  description: API description
  version: 0.0.1
  contact: {}
servers:
- url: https://api.slash.com
  description: production
security:
- api_key: []
- partner_api_key: []
- bearer: []
- developer_application: []
tags:
- name: Card Group
paths:
  /card-group:
    x-reference-path: paths/card-group/route.yaml
    get:
      description: Retrieve the list of card groups that the user owns.
      parameters:
      - name: cursor
        required: false
        in: query
        schema:
          type: string
        description: A cursor string to fetch the next page of results
        x-reference-path: schemas/Pagination/CursorParameter.yaml
      - name: filter:name
        description: Pass in a name to filter for card groups with a matching name.
        in: query
        schema:
          type: string
        required: false
      - name: filter:virtualAccountId
        description: Pass in a virtual account ID to filter for card groups under a specific virtual account.
        in: query
        schema:
          type: string
        required: false
      - name: filter:status
        description: Filter card groups by status. Defaults to 'active' if not provided.
        in: query
        schema:
          type: string
          enum:
          - active
          - archived
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/CardGroup'
                      x-entrypoint:
                        virtualPath: schemas/CardGroup
                        sourcePath: schemas/CardGroup.yaml
                        title: CardGroup
                        origin: ./src/publicApi
                  metadata:
                    $ref: '#/components/schemas/Pagination.PaginationResponse'
                    x-entrypoint:
                      virtualPath: schemas/Pagination/PaginationResponse
                      sourcePath: schemas/Pagination/PaginationResponse.yaml
                      title: PaginationResponse
                      origin: ./src/publicApi
                required:
                - items
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - api_key: []
      - bearer: []
      tags:
      - Card Group
    post:
      description: Create a card group.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                virtualAccountId:
                  type: string
                  description: The ID of the virtual account to associate with the card group. If not provided, the primary virtual account will be used.
                spendingConstraint:
                  $ref: '#/components/schemas/SpendingConstraint'
                  x-entrypoint:
                    virtualPath: schemas/SpendingConstraint
                    sourcePath: schemas/SpendingConstraint.yaml
                    title: SpendingConstraint
                    origin: ./src/publicApi
              required:
              - name
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardGroup'
                x-entrypoint:
                  virtualPath: schemas/CardGroup
                  sourcePath: schemas/CardGroup.yaml
                  title: CardGroup
                  origin: ./src/publicApi
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - api_key: []
      - bearer: []
      tags:
      - Card Group
  /card-group/{cardGroupId}:
    parameters:
    - name: cardGroupId
      in: path
      schema:
        type: string
      required: true
    x-reference-path: paths/card-group/{cardGroupId}/route.yaml
    patch:
      description: Update a card group
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                spendingConstraint:
                  $ref: '#/components/schemas/SpendingConstraint'
                  nullable: true
                  description: Explicitly set this value to null to remove all card group level spending constraints.
                  x-entrypoint:
                    virtualPath: schemas/SpendingConstraint
                    sourcePath: schemas/SpendingConstraint.yaml
                    title: SpendingConstraint
                    origin: ./src/publicApi
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardGroup'
                x-entrypoint:
                  virtualPath: schemas/CardGroup
                  sourcePath: schemas/CardGroup.yaml
                  title: CardGroup
                  origin: ./src/publicApi
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - api_key: []
      - bearer: []
      tags:
      - Card Group
    get:
      description: Fetch details for a single card group by card group ID
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardGroup'
                x-entrypoint:
                  virtualPath: schemas/CardGroup
                  sourcePath: schemas/CardGroup.yaml
                  title: CardGroup
                  origin: ./src/publicApi
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - api_key: []
      - bearer: []
      tags:
      - Card Group
  /card-group/{cardGroupId}/utilization:
    parameters:
    - name: cardGroupId
      in: path
      schema:
        type: string
      required: true
    x-reference-path: paths/card-group/{cardGroupId}/utilization/route.yaml
    get:
      description: Get a card group's current utilization
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardGroupUtilization'
                x-entrypoint:
                  virtualPath: schemas/CardGroupUtilization
                  sourcePath: schemas/CardGroupUtilization.yaml
                  title: CardGroupUtilization
                  origin: ./src/publicApi
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - api_key: []
      - bearer: []
      tags:
      - Card Group
  /card-group/{cardGroupId}/spending-constraint:
    parameters:
    - name: cardGroupId
      in: path
      schema:
        type: string
      required: true
    x-reference-path: paths/card-group/{cardGroupId}/spending-constraint/route.yaml
    patch:
      description: Apply a partial update to a card group's spending constraint while preserving current properties applied. Properties set to "null" will be removed from the spending constraint.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartialSpendingConstraint'
              x-entrypoint:
                virtualPath: schemas/PartialSpendingConstraint
                sourcePath: schemas/PartialSpendingConstraint.yaml
                title: PartialSpendingConstraint
                origin: ./src/publicApi
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendingConstraint'
                x-entrypoint:
                  virtualPath: schemas/SpendingConstraint
                  sourcePath: schemas/SpendingConstraint.yaml
                  title: SpendingConstraint
                  origin: ./src/publicApi
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - api_key: []
      - bearer: []
      tags:
      - Card Group
    put:
      description: Fully replace a card group's spending constraint.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpendingConstraint'
              x-entrypoint:
                virtualPath: schemas/SpendingConstraint
                sourcePath: schemas/SpendingConstraint.yaml
                title: SpendingConstraint
                origin: ./src/publicApi
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendingConstraint'
                x-entrypoint:
                  virtualPath: schemas/SpendingConstraint
                  sourcePath: schemas/SpendingConstraint.yaml
                  title: SpendingConstraint
                  origin: ./src/publicApi
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - api_key: []
      - bearer: []
      tags:
      - Card Group
components:
  schemas:
    Restriction:
      type: string
      enum:
      - allowlist
      - blacklist
      x-entrypoint:
        virtualPath: schemas/Restriction
        sourcePath: schemas/Restriction.yaml
        title: Restriction
        origin: ./src/publicApi
      title: Restriction
    Money:
      type: object
      description: Represents a monetary value
      properties:
        amountCents:
          type: integer
          description: The amount in cents
      required:
      - amountCents
      x-entrypoint:
        virtualPath: schemas/Money
        sourcePath: schemas/Money.yaml
        title: Money
        origin: ./src/publicApi
      title: Money
    Pagination.PaginationResponse:
      type: object
      description: Response sent when requesting a list of data
      properties:
        nextCursor:
          type: string
          description: The cursor to use to retrieve the next page of data. If this is not sent, there is no more data to retrieve.
        count:
          type: number
          description: The number of items in the current page of data.
      x-entrypoint:
        virtualPath: schemas/Pagination/PaginationResponse
        sourcePath: schemas/Pagination/PaginationResponse.yaml
        title: PaginationResponse
        origin: ./src/publicApi
      title: PaginationResponse
    Error:
      type: object
      properties:
        message:
          type: string
        name:
          type: string
        identifier:
          type: string
        rawStatus:
          type: number
        meta:
          type: object
          additionalProperties: true
      required:
      - message
      - name
      - identifier
      - rawStatus
      x-entrypoint:
        origin: ./src/publicApi
        sourcePath: ./src/publicApi/main.yaml
        title: Error
        virtualPath: components/Error
      title: Error
    SpendingConstraint:
      type: object
      description: A constraint that can be applied to a CardGroupSpendingRule
      properties:
        merchantCategoryRule:
          type: object
          nullable: true
          properties:
            merchantCategories:
              type: array
              items:
                type: string
            restriction:
              $ref: '#/components/schemas/Restriction'
              x-entrypoint:
                virtualPath: schemas/Restriction
                sourcePath: schemas/Restriction.yaml
                title: Restriction
                origin: ./src/publicApi
          required:
          - merchantCategories
          - restriction
        merchantRule:
          type: object
          nullable: true
          properties:
            merchants:
              type: array
              items:
                type: string
            restriction:
              $ref: '#/components/schemas/Restriction'
              x-entrypoint:
                virtualPath: schemas/Restriction
                sourcePath: schemas/Restriction.yaml
                title: Restriction
                origin: ./src/publicApi
          required:
          - merchants
          - restriction
        spendingRule:
          type: object
          nullable: true
          properties:
            utilizationLimit:
              type: object
              properties:
                timezone:
                  type: string
                  description: IANA timezone string. Limits always reset at midnight of the timezone specified. If no timezone is specified, then UTC time is used.
                limitAmount:
                  $ref: '#/components/schemas/Money'
                  x-entrypoint:
                    virtualPath: schemas/Money
                    sourcePath: schemas/Money.yaml
                    title: Money
                    origin: ./src/publicApi
                preset:
                  type: string
                  enum:
                  - daily
                  - weekly
                  - monthly
                  - yearly
                  - collective
                startDate:
                  type: string
                  description: Format ISO-8601. A day that equals today or the past. This is optional.If the `preset` is "daily", this value is ignored. If the `preset` is "weekly", "monthly" or "yearly", then the this value is used to compute when the limit should start limit.
              required:
              - limitAmount
              - preset
            utilizationLimitV2:
              type: array
              items:
                type: object
                properties:
                  timezone:
                    type: string
                    description: IANA timezone string. Limits always reset at midnight of the timezone specified. If no timezone is specified, then UTC time is used.
                  limitAmount:
                    $ref: '#/components/schemas/Money'
                    x-entrypoint:
                      virtualPath: schemas/Money
                      sourcePath: schemas/Money.yaml
                      title: Money
                      origin: ./src/publicApi
                  preset:
                    type: string
                    enum:
                    - daily
                    - weekly
                    - monthly
                    - yearly
                    - collective
                  startDate:
                    type: string
                    description: Format ISO-8601. A day that equals today or the past. This is optional.If the `preset` is "daily", this value is ignored. If the `preset` is "weekly", "monthly" or "yearly", then the this value is used to compute when the limit should start limit.
                required:
                - limitAmount
                - preset
            transactionSizeLimit:
              type: object
              properties:
                minimum:
                  $ref: '#/components/schemas/Money'
                  x-entrypoint:
                    virtualPath: schemas/Money
                    sourcePath: schemas/Money.yaml
                    title: Money
                    origin: ./src/publicApi
                maximum:
                  $ref: '#/components/schemas/Money'
                  x-entrypoint:
                    virtualPath: schemas/Money
                    sourcePath: schemas/Money.yaml
                    title: Money
                    origin: ./src/publicApi
        countryRule:
          type: object
          nullable: true
          properties:
            countries:
              description: A 2 digit country code
              type: array
              items:
                type: string
            restriction:
              $ref: '#/components/schemas/Restriction'
              x-entrypoint:
                virtualPath: schemas/Restriction
                sourcePath: schemas/Restriction.yaml
                title: Restriction
                origin: ./src/publicApi
          required:
          - countries
          - restriction
        merchantCategoryCodeRule:
          type: object
          nullable: true
          properties:
            merchantCategoryCodes:
              type: array
              items:
                type: string
            restriction:
              $ref: '#/components/schemas/Restriction'
              x-entrypoint:
                virtualPath: schemas/Restriction
                sourcePath: schemas/Restriction.yaml
                title: Restriction
                origin: ./src/publicApi
          required:
          - merchantCategoryCodes
          - restriction
      x-entrypoint:
        virtualPath: schemas/SpendingConstraint
        sourcePath: schemas/SpendingConstraint.yaml
        title: SpendingConstraint
        origin: ./src/publicApi
      title: SpendingConstraint
    CardGroupUtilization:
      type: object
      properties:
        nextResetDate:
          type: string
          format: date-time
          description: The date the next reset will occur, undefined if collective
        spend:
          $ref: '#/components/schemas/Money'
          description: The amount of money spent in the current period
          x-entrypoint:
            virtualPath: schemas/Money
            sourcePath: schemas/Money.yaml
            title: Money
            origin: ./src/publicApi
        availableBalance:
          $ref: '#/components/schemas/Money'
          description: The amount of money available in the current period. Only returned if the card or card group has a spend limit.
          x-entrypoint:
            virtualPath: schemas/Money
            sourcePath: schemas/Money.yaml
            title: Money
            origin: ./src/publicApi
      required:
      - spend
      x-entrypoint:
        virtualPath: schemas/CardGroupUtilization
        sourcePath: schemas/CardGroupUtilization.yaml
        title: CardGroupUtilization
        origin: ./src/publicApi
      title: CardGroupUtilization
    CardGroup:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        virtualAccountId:
          type: string
          description: The ID of the virtual account that the card group is associated with
        spendingConstraint:
          $ref: '#/components/schemas/SpendingConstraint'
          x-entrypoint:
            virtualPath: schemas/SpendingConstraint
            sourcePath: schemas/SpendingConstraint.yaml
            title: SpendingConstraint
            origin: ./src/publicApi
      required:
      - id
      - name
      x-entrypoint:
        virtualPath: schemas/CardGroup
        sourcePath: schemas/CardGroup.yaml
        title: CardGroup
        origin: ./src/publicApi
      title: CardGroup
    PartialSpendingConstraint:
      type: object
      description: A partial spending constraint update that can be applied to a CardGroupSpendingRule
      properties:
        merchantCategoryRule:
          type: object
          nullable: true
          properties:
            merchantCategories:
              type: array
              items:
                type: string
            restriction:
              $ref: '#/components/schemas/Restriction'
              x-entrypoint:
                virtualPath: schemas/Restriction
                sourcePath: schemas/Restriction.yaml
                title: Restriction
                origin: ./src/publicApi
        merchantRule:
          type: object
          nullable: true
          properties:
            merchants:
              type: array
              items:
                type: string
            restriction:
              $ref: '#/components/schemas/Restriction'
              x-entrypoint:
                virtualPath: schemas/Restriction
                sourcePath: schemas/Restriction.yaml
                title: Restriction
                origin: ./src/publicApi
        spendingRule:
          type: object
          nullable: true
          properties:
            utilizationLimit:
              type: object
              properties:
                timezone:
                  type: string
                  description: IANA timezone string. Limits always reset at midnight of the timezone specified. If no timezone is specified, then UTC time is used.
                limitAmount:
                  $ref: '#/components/schemas/Money'
                  x-entrypoint:
                    virtualPath: schemas/Money
                    sourcePath: schemas/Money.yaml
                    title: Money
                    origin: ./src/publicApi
                preset:
                  type: string
                  enum:
                  - daily
                  - weekly
                  - monthly
                  - yearly
                  - collective
                startDate:
                  type: string
                  description: Format ISO-8601. A day that equals today or the past. This is optional.If the `preset` is "daily", this value is ignored. If the `preset` is "weekly", "monthly" or "yearly", then the this value is used to compute when the limit should start limit.
            utilizationLimitV2:
              type: array
              items:
                type: object
                properties:
                  timezone:
                    type: string
                    description: IANA timezone string. Limits always reset at midnight of the timezone specified. If no timezone is specified, then UTC time is used.
                  limitAmount:
                    $ref: '#/components/schemas/Money'
                    x-entrypoint:
                      virtualPath: schemas/Money
                      sourcePath: schemas/Money.yaml
                      title: Money
                      origin: ./src/publicApi
                  preset:
                    type: string
                    enum:
                    - daily
                    - weekly
                    - monthly
                    - yearly
                    - collective
                  startDate:
                    type: string
                    description: Format ISO-8601. A day that equals today or the past. This is optional.If the `preset` is "daily", this value is ignored. If the `preset` is "weekly", "monthly" or "yearly", then the this value is used to compute when the limit should start limit.
            transactionSizeLimit:
              type: object
              properties:
                minimum:
                  $ref: '#/components/schemas/Money'
                  x-entrypoint:
                    virtualPath: schemas/Money
                    sourcePath: schemas/Money.yaml
                    title: Money
                    origin: ./src/publicApi
                maximum:
                  $ref: '#/components/schemas/Money'
                  x-entrypoint:
                    virtualPath: schemas/Money
                    sourcePath: schemas/Money.yaml
                    title: Money
                    origin: ./src/publicApi
        countryRule:
          type: object
          nullable: true
          properties:
            countries:
              description: A 2 digit country code
              type: array
              items:
                type: string
            restriction:
              $ref: '#/components/schemas/Restriction'
              x-entrypoint:
                virtualPath: schemas/Restriction
                sourcePath: schemas/Restriction.yaml
                title: Restriction
                origin: ./src/publicApi
        merchantCategoryCodeRule:
          type: object
          nullable: true
          properties:
            merchantCategoryCodes:
              type: array
              items:
                type: string
            restriction:
              $ref: '#/components/schemas/Restriction'
              x-entrypoint:
                virtualPath: schemas/Restriction
                sourcePath: schemas/Restriction.yaml
                title: Restriction
                origin: ./src/publicApi
      x-entrypoint:
        virtualPath: schemas/PartialSpendingConstraint
        sourcePath: schemas/PartialSpendingConstraint.yaml
        title: PartialSpendingConstraint
        origin: ./src/publicApi
      title: PartialSpendingConstraint
  securitySchemes:
    api_key:
      type: apiKey
      description: "API key authentication for public API requests.\n\nKeys come in two flavors:\n\n- *Legal-entity-scoped keys* are pinned to a single legal entity.\n  Minted via the dashboard under a specific entity; every request\n  acts on that entity.\n- *User-scoped keys* are pinned to a user and span every legal\n  entity that user has access to. Every request made with a\n  user-scoped key (except `GET /legal-entity`, which lists the\n  legal entities the user can access) must include an\n  `x-legal-entity` header naming the legal entity the request is\n  operating on. Requests without the header are rejected with\n  `400`. The authenticated user must have an active permission\n  role on the supplied legal entity, otherwise the request is\n  rejected with `403`.\n"
      name: X-API-Key
      in: header
    partner_api_key:
      type: apiKey
      description: 'Partner-program API key authentication.


        Keys are minted in the partner dashboard (Developers → API Keys),

        are scoped to a single partner program, and are prefixed with

        `sk_partner_`. Partner keys are only accepted by routes that

        declare this scheme; they are rejected by `api_key` routes and

        vice versa.

        '
      name: X-API-Key
      in: header
    bearer:
      type: http
      scheme: bearer
    developer_application:
      type: http
      scheme: basic