MX Platform Spending_plans API

The Spending_plans API from MX Platform — 8 operation(s) for spending_plans.

OpenAPI Specification

mx-platform-spending-plans-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  contact:
    name: MX Platform API
    url: https://www.mx.com/products/platform-api
  description: '

    The MX Platform API is a powerful, fully-featured API designed to make

    aggregating and enhancing financial data easy and reliable. It can

    seamlessly connect your app or website to tens of thousands of financial

    institutions.'
  title: MX Platform Spending_plans API
  version: 0.1.0
servers:
- url: https://api.mx.com
- url: https://int-api.mx.com
security:
- basicAuth: []
tags:
- name: Spending_plans
paths:
  /users/{user_guid}/spending_plans/{spending_plan_guid}/iterations/current/iteration_items:
    post:
      description: This endpoint creates a new `spending_plan_iteration_item`.
      operationId: createSpendingPlanIterationItem
      parameters:
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpendingPlanIterationItemCreateRequestBody'
        description: Iteration item to be created with required parameter (planned_amount)
        required: true
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlanIterationItemResponse'
          description: OK
      summary: Create spending plan iteration item
      tags:
      - Spending_plans
    get:
      description: Use this endpoint to list all the spending plan `iteration_items` associated with the `iteration`.
      operationId: listSpendingPlanIterationItems
      parameters:
      - description: Specify current page.
        example: 1
        in: query
        name: page
        schema:
          type: integer
      - description: Specify records per page.
        example: 10
        in: query
        name: records_per_page
        schema:
          type: integer
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlanIterationItemsResponseBody'
          description: OK
      summary: List spending plan iteration items
      tags:
      - Spending_plans
  /users/{user_guid}/spending_plans:
    post:
      description: This endpoint creates a new `spending_plan` for the user.
      operationId: createSpendingPlan
      parameters:
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlanResponse'
          description: OK
      summary: Create spending plan
      tags:
      - Spending_plans
    get:
      description: Use this endpoint to list all the spending plans associated with the user.
      operationId: listSpendingPlans
      parameters:
      - description: Specify current page.
        example: 1
        in: query
        name: page
        schema:
          type: integer
      - description: Specify records per page.
        example: 10
        in: query
        name: records_per_page
        schema:
          type: integer
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlansResponseBody'
          description: OK
      summary: List spending plans
      tags:
      - Spending_plans
  /users/{user_guid}/spending_plans/{spending_plan_guid}/spending_plan_accounts/{spending_plan_account_guid}:
    delete:
      description: Use this endpoint to delete a `spending_plan_account`.
      operationId: deleteSpendingPlanAccount
      parameters:
      - description: The unique ID for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the specified account.
        example: ACT-e9f80fee-84da-7s7r-9a5e-0346g4279b4c
        in: path
        name: spending_plan_account_guid
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
      summary: Delete spending plan account
      tags:
      - Spending_plans
    get:
      description: Use this endpoint to read the attributes of a specific spending plan account according to its unique GUID.
      operationId: readSpendingPlanAccount
      parameters:
      - description: Specify current page.
        example: 1
        in: query
        name: page
        schema:
          type: integer
      - description: Specify records per page.
        example: 10
        in: query
        name: records_per_page
        schema:
          type: integer
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the specified account.
        example: ACT-e9f80fee-84da-7s7r-9a5e-0346g4279b4c
        in: path
        name: spending_plan_account_guid
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlanAccountResponse'
          description: OK
      summary: Read spending plan account
      tags:
      - Spending_plans
  /users/{user_guid}/spending_plans/{spending_plan_guid}/iterations/current/iteration_items/{iteration_item_guid}:
    delete:
      description: Use this endpoint to delete a spending plan `iteration_item`.
      operationId: deleteSpendingPlanIterationItem
      parameters:
      - description: The unique ID for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `iteration_item`.
        example: SII-a4dc1549-da28-1245-9c9c-53eee4cdfbe3
        in: path
        name: iteration_item_guid
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
      summary: Delete spending plan iteration item
      tags:
      - Spending_plans
    get:
      description: Use this endpoint to read the attributes of a specific spending plan `iteration_item` according to its unique GUID.
      operationId: readSpendingPlanIterationItem
      parameters:
      - description: Specify current page.
        example: 1
        in: query
        name: page
        schema:
          type: integer
      - description: Specify records per page.
        example: 10
        in: query
        name: records_per_page
        schema:
          type: integer
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `iteration_item`.
        example: SII-a4dc1549-da28-1245-9c9c-53eee4cdfbe3
        in: path
        name: iteration_item_guid
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlanIterationItemResponse'
          description: OK
      summary: Read a spending plan iteration item
      tags:
      - Spending_plans
    put:
      description: Use this endpoint to update an existing `spending_plan_iteration_item`.
      operationId: updateSpendingPlanIterationItem
      parameters:
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `iteration_item`.
        example: SII-a4dc1549-da28-1245-9c9c-53eee4cdfbe3
        in: path
        name: iteration_item_guid
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpendingPlanIterationItemCreateRequestBody'
        description: Iteration item to be updated with required parameter (planned_amount)
        required: true
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlanIterationItemResponse'
          description: OK
      summary: Update a spending plan iteration item
      tags:
      - Spending_plans
  /users/{user_guid}/spending_plans/{spending_plan_guid}:
    delete:
      description: Use this endpoint to delete a user's `spending_plan`.
      operationId: deleteSpendingPlan
      parameters:
      - description: The unique ID for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
      summary: Delete spending plan
      tags:
      - Spending_plans
    get:
      description: Use this endpoint to read the attributes of a specific spending plan according to its unique GUID.
      operationId: readSpendingPlanUser
      parameters:
      - description: Specify current page.
        example: 1
        in: query
        name: page
        schema:
          type: integer
      - description: Specify records per page.
        example: 10
        in: query
        name: records_per_page
        schema:
          type: integer
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlanResponse'
          description: OK
      summary: Read a spending plan for a user
      tags:
      - Spending_plans
  /users/{user_guid}/spending_plans/{spending_plan_guid}/spending_plan_accounts:
    get:
      description: Use this endpoint to list all the spending plan accounts associated with the spending plan.
      operationId: listSpendingPlanAccounts
      parameters:
      - description: Specify current page.
        example: 1
        in: query
        name: page
        schema:
          type: integer
      - description: Specify records per page.
        example: 10
        in: query
        name: records_per_page
        schema:
          type: integer
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlanAccountsResponse'
          description: OK
      summary: List spending plan accounts
      tags:
      - Spending_plans
  /users/{user_guid}/spending_plans/{spending_plan_guid}/iterations:
    get:
      description: Use this endpoint to list all the spending plan `iterations` associated with the `spending_plan`.
      operationId: listSpendingPlanIterations
      parameters:
      - description: Specify current page.
        example: 1
        in: query
        name: page
        schema:
          type: integer
      - description: Specify records per page.
        example: 10
        in: query
        name: records_per_page
        schema:
          type: integer
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlanIterationsResponse'
          description: OK
      summary: List spending plan iterations
      tags:
      - Spending_plans
  /users/{user_guid}/spending_plans/{spending_plan_guid}/iterations/{iteration_number}:
    get:
      description: Use this endpoint to read the attributes of a specific spending plan `iteration` according to its `iteration_number`.
      operationId: readSpendingPlanIteration
      parameters:
      - description: Specify current page.
        example: 1
        in: query
        name: page
        schema:
          type: integer
      - description: Specify records per page.
        example: 10
        in: query
        name: records_per_page
        schema:
          type: integer
      - description: The unique id for a `user`.
        example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
        in: path
        name: user_guid
        required: true
        schema:
          type: string
      - description: The unique ID for the `spending_plan`.
        example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
        in: path
        name: spending_plan_guid
        required: true
        schema:
          type: string
      - description: The current iteration number for the spending plan `iteration``.
        example: 1
        in: path
        name: iteration_number
        required: true
        schema:
          type: integer
      responses:
        '200':
          content:
            application/vnd.mx.api.v1+json:
              schema:
                $ref: '#/components/schemas/SpendingPlanIterationResponse'
          description: OK
      summary: Read a spending plan iteration
      tags:
      - Spending_plans
components:
  schemas:
    SpendingPlanAccountResponse:
      properties:
        account_guid:
          example: ACT-97d3948f-ebe7-434a-9bd0-20b29d67c9d4
          type: string
        client_guid:
          example: CLT-024284fc-a6a7-42ee-b363-dab9343e3f72
          type: string
        created_at:
          example: '2023-04-27T23:14:16.000Z'
          type: string
        guid:
          example: SPA-c76e4a85-b2c4-4335-82b7-8f8b8f28c35a
          type: string
        spending_plan_guid:
          example: SPL-dbfe201d-c341-4bff-93c0-62a918d0b600
          type: string
        updated_at:
          example: '2023-04-27T23:14:16.000Z'
          type: string
        user_guid:
          example: USR-72086f59-6684-4adf-8f29-c4d32db43cd7
          type: string
      type: object
    SpendingPlanIterationsResponse:
      properties:
        iterations:
          items:
            $ref: '#/components/schemas/SpendingPlanIterationResponse'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
      type: object
    SpendingPlanIterationItemsResponseBody:
      properties:
        iteration_items:
          items:
            $ref: '#/components/schemas/SpendingPlanIterationItemResponse'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
      type: object
    SpendingPlanIterationItemCreateRequestBody:
      properties:
        category_guid:
          example: CAT-40faf068-abb4-405c-8f6a-e883ed541fff
          type: string
        item_type:
          example: 1
          type: number
        planned_amount:
          example: 110
          type: number
        scheduled_payment_guid:
          example: SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b
          type: string
        top_level_category_guid:
          example: CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8
          type: string
      required:
      - planned_amount
      type: object
    PaginationResponse:
      properties:
        current_page:
          example: 1
          type: integer
        per_page:
          example: 25
          type: integer
        total_entries:
          example: 1
          type: integer
        total_pages:
          example: 1
          type: integer
      type: object
    SpendingPlansResponseBody:
      properties:
        spending_plans:
          items:
            $ref: '#/components/schemas/SpendingPlanResponse'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
      type: object
    SpendingPlanIterationResponse:
      properties:
        created_at:
          example: '2016-10-13T18:08:00+00:00'
          nullable: true
          type: string
        end_on:
          example: '2023-05-31T00:00:00.000Z'
          nullable: true
          type: string
        guid:
          example: SPI-848e6648-3fa3-4632-ac8f-e65f03167102
          nullable: true
          type: string
        iteration_number:
          example: 1
          nullable: true
          type: integer
        spending_plan_guid:
          example: SPL-dbfe201d-c341-4bff-93c0-62a918d0b600
          nullable: true
          type: string
        start_on:
          example: '2023-05-01T00:00:00.000Z'
          nullable: true
          type: string
        updated_at:
          example: '2016-10-13T18:09:00.000Z'
          nullable: true
          type: string
        user_guid:
          example: USR-72086f59-6684-4adf-8f29-c4d32db43cd7
          nullable: true
          type: string
      type: object
    SpendingPlanIterationItemResponse:
      properties:
        actual_amount:
          example: 345
          nullable: true
          type: number
        category_guid:
          example: CAT-40faf068-abb4-405c-8f6a-e883ed541fff
          nullable: true
          type: string
        created_at:
          example: '2016-10-13T18:08:00+00:00'
          nullable: true
          type: string
        guid:
          example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
          nullable: true
          type: string
        item_type:
          example: '0'
          nullable: true
          type: string
        planned_amount:
          example: 345
          nullable: true
          type: number
        scheduled_payment_guid:
          example: SCP-54bed778-6600-4262-908c-8822f141cc30
          nullable: true
          type: string
        spending_plan_iteration_guid:
          example: SPI-848e6648-3fa3-4632-ac8f-e65f03167102
          nullable: true
          type: string
        top_level_category_guid:
          example: CAT-50af068-abb4-405c-8f6a-e883ed541f4f
          nullable: true
          type: string
        transaction_guids:
          items:
            example: TRN-265abee9-889b-af6a-c69b-25157db2bdd9
            nullable: true
            type: string
          type: array
        updated_at:
          example: '2016-10-13T18:09:00.000Z'
          nullable: true
          type: string
        user_guid:
          example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
          nullable: true
          type: string
      type: object
    SpendingPlanAccountsResponse:
      properties:
        spending_plan_accounts:
          items:
            $ref: '#/components/schemas/SpendingPlanAccountResponse'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
      type: object
    SpendingPlanResponse:
      properties:
        created_at:
          example: '2016-10-13T18:08:00.000Z'
          nullable: true
          type: string
        current_iteration_number:
          example: 1
          nullable: true
          type: integer
        guid:
          example: SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262
          nullable: true
          type: string
        updated_at:
          example: '2016-10-13T18:09:00+00:00'
          nullable: true
          type: string
        user_guid:
          example: USR-fa7537f3-48aa-a683-a02a-b18940482f54
          nullable: true
          type: string
      type: object
  securitySchemes:
    basicAuth:
      scheme: basic
      type: http