Marqeta · Capability

Core API — Account Refunds

Core API — Account Refunds. 4 operations. Lead operation: List account refunds. Self-contained Naftiko capability covering one Marqeta business surface.

Run with Naftiko MarqetaAccount Refunds

What You Can Do

GET
Listrefunds — List account refunds
/v1/accounts/{account-token}/refunds
POST
Createrefund — Create refund
/v1/accounts/{account-token}/refunds
GET
Retrieverefund — Retrieve account refund
/v1/accounts/{account-token}/refunds/{refund-token}
POST
Transitionrefund — Transition account refund status
/v1/accounts/{account-token}/refunds/{refund-token}/transitions

MCP Tools

list-account-refunds

List account refunds

read-only idempotent
create-refund

Create refund

retrieve-account-refund

Retrieve account refund

read-only idempotent
transition-account-refund-status

Transition account refund status

Capability Spec

core-account-refunds.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Core API — Account Refunds
  description: 'Core API — Account Refunds. 4 operations. Lead operation: List account refunds. Self-contained Naftiko capability
    covering one Marqeta business surface.'
  tags:
  - Marqeta
  - Account Refunds
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    MARQETA_API_KEY: MARQETA_API_KEY
capability:
  consumes:
  - type: http
    namespace: core-account-refunds
    baseUri: ''
    description: Core API — Account Refunds business capability. Self-contained, no shared references.
    resources:
    - name: accounts-account_token-refunds
      path: /accounts/{account_token}/refunds
      operations:
      - name: listrefunds
        method: GET
        description: List account refunds
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_token
          in: path
          type: string
          description: Unique identifier of the credit account for which to retrieve refunds.
          required: true
        - name: start_date
          in: query
          type: string
          description: Beginning of the date range of the refunds to return.
        - name: end_date
          in: query
          type: string
          description: End of the date range of the refunds to return.
        - name: count
          in: query
          type: integer
          description: Number of account refund resources to retrieve.
        - name: start_index
          in: query
          type: integer
          description: Sort order index of the first resource in the returned array.
        - name: sort_by
          in: query
          type: string
          description: Field on which to sort.
        - name: statuses
          in: query
          type: array
          description: Array of statuses by which to filter refunds.
      - name: createrefund
        method: POST
        description: Create refund
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_token
          in: path
          type: string
          description: Unique identifier of the credit account for which you want to create a balance refund.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: accounts-account_token-refunds-refund_token
      path: /accounts/{account_token}/refunds/{refund_token}
      operations:
      - name: retrieverefund
        method: GET
        description: Retrieve account refund
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_token
          in: path
          type: string
          description: Unique identifier of the credit account for which to retrieve a refund.
          required: true
        - name: refund_token
          in: path
          type: string
          description: Unique identifier of the refund to retrieve.
          required: true
    - name: accounts-account_token-refunds-refund_token-transitions
      path: /accounts/{account_token}/refunds/{refund_token}/transitions
      operations:
      - name: transitionrefund
        method: POST
        description: Transition account refund status
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_token
          in: path
          type: string
          description: Unique identifier of the credit account for which you want to transition a refund status.
          required: true
        - name: refund_token
          in: path
          type: string
          description: Unique identifier of the refund whose status you want to transition.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: basic
      username: '{{env.MARQETA_USER}}'
      password: '{{env.MARQETA_PASS}}'
  exposes:
  - type: rest
    namespace: core-account-refunds-rest
    port: 8080
    description: REST adapter for Core API — Account Refunds. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/accounts/{account-token}/refunds
      name: accounts-account-token-refunds
      description: REST surface for accounts-account_token-refunds.
      operations:
      - method: GET
        name: listrefunds
        description: List account refunds
        call: core-account-refunds.listrefunds
        with:
          account_token: rest.account_token
          start_date: rest.start_date
          end_date: rest.end_date
          count: rest.count
          start_index: rest.start_index
          sort_by: rest.sort_by
          statuses: rest.statuses
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createrefund
        description: Create refund
        call: core-account-refunds.createrefund
        with:
          account_token: rest.account_token
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/accounts/{account-token}/refunds/{refund-token}
      name: accounts-account-token-refunds-refund-token
      description: REST surface for accounts-account_token-refunds-refund_token.
      operations:
      - method: GET
        name: retrieverefund
        description: Retrieve account refund
        call: core-account-refunds.retrieverefund
        with:
          account_token: rest.account_token
          refund_token: rest.refund_token
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/accounts/{account-token}/refunds/{refund-token}/transitions
      name: accounts-account-token-refunds-refund-token-transitions
      description: REST surface for accounts-account_token-refunds-refund_token-transitions.
      operations:
      - method: POST
        name: transitionrefund
        description: Transition account refund status
        call: core-account-refunds.transitionrefund
        with:
          account_token: rest.account_token
          refund_token: rest.refund_token
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: core-account-refunds-mcp
    port: 9090
    transport: http
    description: MCP adapter for Core API — Account Refunds. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-account-refunds
      description: List account refunds
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: core-account-refunds.listrefunds
      with:
        account_token: tools.account_token
        start_date: tools.start_date
        end_date: tools.end_date
        count: tools.count
        start_index: tools.start_index
        sort_by: tools.sort_by
        statuses: tools.statuses
      outputParameters:
      - type: object
        mapping: $.
    - name: create-refund
      description: Create refund
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: core-account-refunds.createrefund
      with:
        account_token: tools.account_token
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: retrieve-account-refund
      description: Retrieve account refund
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: core-account-refunds.retrieverefund
      with:
        account_token: tools.account_token
        refund_token: tools.refund_token
      outputParameters:
      - type: object
        mapping: $.
    - name: transition-account-refund-status
      description: Transition account refund status
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: core-account-refunds.transitionrefund
      with:
        account_token: tools.account_token
        refund_token: tools.refund_token
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.